|
@@ -3,6 +3,8 @@ package report
|
|
|
import (
|
|
|
"github.com/gin-gonic/gin"
|
|
|
"hongze/hongze_yb/controller/response"
|
|
|
+ "hongze/hongze_yb/models/request"
|
|
|
+ "hongze/hongze_yb/models/tables/rddp/classify_menu"
|
|
|
reportService "hongze/hongze_yb/services/report"
|
|
|
userService "hongze/hongze_yb/services/user"
|
|
|
"hongze/hongze_yb/utils"
|
|
@@ -10,7 +12,7 @@ import (
|
|
|
)
|
|
|
|
|
|
// ClassifyList 专栏列表
|
|
|
-func ClassifyList(c *gin.Context) {
|
|
|
+func ClassifyList(c *gin.Context) {
|
|
|
reqClassifyIdFirst := c.DefaultQuery("classify_id_first", "")
|
|
|
if reqClassifyIdFirst == "" {
|
|
|
response.Fail("请输入二级分类标识", c)
|
|
@@ -29,12 +31,12 @@ func ClassifyList(c *gin.Context) {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", classList, c )
|
|
|
+ response.OkData("查询成功", classList, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// ClassifyDetail 专栏详情
|
|
|
-func ClassifyDetail(c *gin.Context) {
|
|
|
+func ClassifyDetail(c *gin.Context) {
|
|
|
reqClassifyIdSecond := c.DefaultQuery("classify_id_second", "")
|
|
|
if reqClassifyIdSecond == "" {
|
|
|
response.Fail("请输入二级分类标识", c)
|
|
@@ -53,12 +55,12 @@ func ClassifyDetail(c *gin.Context) {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", detail, c )
|
|
|
+ response.OkData("查询成功", detail, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// ClassifyDetailReports 专栏目录列表
|
|
|
-func ClassifyDetailReports(c *gin.Context) {
|
|
|
+func ClassifyDetailReports(c *gin.Context) {
|
|
|
reqClassifyIdSecond := c.DefaultQuery("classify_id_second", "")
|
|
|
reqPageIndex := c.DefaultQuery("current_index", "1")
|
|
|
reqPageSize := c.DefaultQuery("page_size", strconv.Itoa(utils.PageSize20))
|
|
@@ -93,14 +95,14 @@ func ClassifyDetailReports(c *gin.Context) {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", detail, c )
|
|
|
+ response.OkData("查询成功", detail, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// ClassifySimpleList 简单查询二级分类名称列表
|
|
|
-func ClassifySimpleList(c *gin.Context) {
|
|
|
+func ClassifySimpleList(c *gin.Context) {
|
|
|
reqClassifyIdFirst := c.DefaultQuery("classify_id_first", "")
|
|
|
- if reqClassifyIdFirst == ""{
|
|
|
+ if reqClassifyIdFirst == "" {
|
|
|
response.Fail("请输入分类ID", c)
|
|
|
return
|
|
|
}
|
|
@@ -116,12 +118,12 @@ func ClassifySimpleList(c *gin.Context) {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", classList, c )
|
|
|
+ response.OkData("查询成功", classList, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// ClassifyFirstList Ficc 菜单
|
|
|
-func ClassifyFirstList(c *gin.Context) {
|
|
|
+func ClassifyFirstList(c *gin.Context) {
|
|
|
userinfo := userService.GetInfoByClaims(c)
|
|
|
|
|
|
classList, err := reportService.GetClassifyFirstList(userinfo)
|
|
@@ -129,6 +131,26 @@ func ClassifyFirstList(c *gin.Context) {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", classList, c )
|
|
|
+ response.OkData("查询成功", classList, c)
|
|
|
return
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+// ClassifyMenuList 一级分类-子目录列表
|
|
|
+func ClassifyMenuList(c *gin.Context) {
|
|
|
+ var req request.ClassifyMenuReq
|
|
|
+ if err := c.Bind(&req); err != nil {
|
|
|
+ response.Fail("参数有误", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if req.ClassifyId <= 0 {
|
|
|
+ response.Fail("参数有误", c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ list, e := classify_menu.GetMenuListByClassifyId(req.ClassifyId)
|
|
|
+ if e != nil {
|
|
|
+ response.FailMsg("获取失败", "获取一级分类子目录列表失败, Err: "+e.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.OkData("获取成功", list, c)
|
|
|
+}
|