Browse Source

fix:分享的右侧列表调整,新增用户id筛选

Roc 3 months ago
parent
commit
f732f516be

+ 9 - 0
controllers/data_manage/chart_info_share.go

@@ -276,6 +276,8 @@ func (c *ChartInfoShareController) Tree() {
 // @Param   CurrentIndex   query   int  true       "当前页页码,从1开始"
 // @Param   ClassifyId   query   int  true       "分类id"
 // @Param   FilterSource   query   int  false       "共享图表的列表数据来源,0:我共享的;1:别人共享给我的"
+// @Param   ClassifyId   query   int  false       "分类id"
+// @Param   UserId   query   int  false       "所属用户id"
 // @Success 200 {object} response.ChartInfoChartListResp
 // @router /chart_info/share/list [get]
 func (c *ChartInfoShareController) List() {
@@ -317,6 +319,13 @@ func (c *ChartInfoShareController) List() {
 	condition += ` AND source = ? `
 	pars = append(pars, utils.CHART_TYPE_CURVE)
 
+	// 用户筛选
+	userId, _ := c.GetInt("UserId")
+	if userId > 0 {
+		condition += ` AND b.sys_user_id = ?  `
+		pars = append(pars, userId)
+	}
+
 	// 分类筛选
 	classifyId, _ := c.GetInt("ClassifyId")
 	if classifyId > 0 {

+ 7 - 0
controllers/data_manage/edb_info_share.go

@@ -315,6 +315,13 @@ func (c *EdbInfoShareController) List() {
 		pars = append(pars, edbType)
 	}
 
+	// 用户筛选
+	userId, _ := c.GetInt("UserId")
+	if userId > 0 {
+		condition += ` AND b.sys_user_id = ?  `
+		pars = append(pars, userId)
+	}
+
 	// 分类筛选
 	classifyId, _ := c.GetInt("ClassifyId")
 	if classifyId > 0 {

+ 2 - 2
models/data_manage/response/chart_info_share.go

@@ -12,6 +12,6 @@ type ChartInfoShareUserResp struct {
 // ChartShareListResp
 // @Description: 共享列表
 type ChartShareListResp struct {
-	Send     []*data_manage.UserShareChartClassifyItem
-	Received []*data_manage.UserShareChartClassifyItem `description:"收到的共享"`
+	Send     data_manage.UserShareChartClassifyItemList
+	Received data_manage.UserShareChartClassifyItemList `description:"收到的共享"`
 }