From 115bd9b51f5d8eade4658f844de37516486c60e7 Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期六, 18 十一月 2023 17:25:25 +0800 Subject: [PATCH] crm获取aps项目模块信息 --- api/v1/plan.go | 51 +++++++++++++++++++++++++++------------------------ 1 files changed, 27 insertions(+), 24 deletions(-) diff --git a/api/v1/plan.go b/api/v1/plan.go index 28fff5a..2b59b8a 100644 --- a/api/v1/plan.go +++ b/api/v1/plan.go @@ -98,30 +98,6 @@ ctx.Ok() } -// List -// -// @Tags Plan -// @Summary 鑾峰彇璁″垝鍒楄〃 -// @Produce application/json -// @Success 200 {object} contextx.Response{data=response.PlanResponse} -// @Router /api/plan/list [get] -func (s *PlanApi) List(c *gin.Context) { - ctx, ok := contextx.NewContext(c, nil) - if !ok { - return - } - - list, errCode := planService.GetPlanList() - if errCode != ecode.OK { - ctx.Fail(errCode) - return - } - - ctx.OkWithDetailed(response.PlanResponse{ - List: list, - }) -} - func checkPlanParams(plan request.Plan) (errCode int, p model.Plan) { //if plan.Number == "" { // return ecode.InvalidParams, p @@ -155,3 +131,30 @@ return ecode.OK, p } + +// List +// +// @Tags Plan +// @Summary 鐢熸垚璁″垝鍒楄〃 +// @Produce application/json +// @Param object body request.GetPlanList true "鍙傛暟" +// @Success 200 {object} contextx.Response{data=response.PlanResponse} +// @Router /api/plan/list [post] +func (con *PlanApi) List(c *gin.Context) { + var params request.GetPlanList + ctx, ok := contextx.NewContext(c, ¶ms) + if !ok { + return + } + + plans, total, errCode := planService.GetPlanList(params.Page, params.PageSize, params.Keyword) + if errCode != ecode.OK { + ctx.Fail(errCode) + return + } + + ctx.OkWithDetailed(response.PlanResponse{ + List: plans, + Count: int(total), + }) +} -- Gitblit v1.8.0