diff --git a/docs/docs.go b/docs/docs.go index 6feaed1..6664198 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -623,6 +623,12 @@ const docTemplate = `{ "name": "app_id", "in": "query" }, + { + "type": "integer", + "description": "客服编号", + "name": "admin_id", + "in": "query" + }, { "type": "integer", "default": 1, diff --git a/docs/swagger.json b/docs/swagger.json index d385a74..65cce33 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -615,6 +615,12 @@ "name": "app_id", "in": "query" }, + { + "type": "integer", + "description": "客服编号", + "name": "admin_id", + "in": "query" + }, { "type": "integer", "default": 1, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 228a26f..f0805b4 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1043,6 +1043,10 @@ paths: in: query name: app_id type: string + - description: 客服编号 + in: query + name: admin_id + type: integer - default: 1 description: 当前页码 in: query diff --git a/internal/api/app/app_list.go b/internal/api/app/app_list.go index 282e284..2e8965d 100755 --- a/internal/api/app/app_list.go +++ b/internal/api/app/app_list.go @@ -14,6 +14,7 @@ import ( type listRequest struct { AppID string `form:"app_id"` // 小程序ID + AdminID int32 `form:"admin_id"` // 客服编号 Name string `form:"name"` // 小程序名称 Page int `form:"page"` // 当前页码,默认为第一页 PageSize int `form:"page_size"` // 每页返回的数据量 @@ -44,6 +45,7 @@ type listResponse struct { // @Produce json // @Param name query string false "小程序名称" // @Param app_id query string false "小程序ID" +// @Param admin_id query int false "客服编号" // @Param page query int true "当前页码" default(1) // @Param page_size query int true "每页返回的数据量,最多 100 条" default(20) // @Success 200 {object} listResponse @@ -85,6 +87,10 @@ func (h *handler) PageList() core.HandlerFunc { if ctx.SessionUserInfo().IsSuper != 1 { query = query.Where(h.readDB.MiniProgram.AdminID.Eq(ctx.SessionUserInfo().Id)) + } else { + if req.AdminID != 0 { + query = query.Where(h.readDB.MiniProgram.AdminID.Eq(req.AdminID)) + } } if req.AppID != "" {