From e0a433e9c31594527a3bf7766c0bfb2cbbceffdb Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期三, 26 七月 2023 10:09:04 +0800 Subject: [PATCH] fix add pageInfo, keyword to all the list --- service/plan.go | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/service/plan.go b/service/plan.go index 9e175fb..1d34051 100644 --- a/service/plan.go +++ b/service/plan.go @@ -29,15 +29,6 @@ return ecode.OK } -func (PlanService) GetPlanList() ([]*model.Plan, int) { - list, err := model.NewPlanSearch().FindAll() - if err != nil { - return nil, ecode.PlanListErr - } - - return list, ecode.OK -} - func (PlanService) UpdatePlan(plan *model.Plan) int { // check plan exist _, err := model.NewPlanSearch().SetId(plan.Id).Find() @@ -52,3 +43,12 @@ return ecode.OK } + +func (PlanService) GetPlanList(page, pageSize int, keyword string) ([]*model.Plan, int) { + // get contact list + contacts, err := model.NewPlanSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, ecode.PlanListErr + } + return contacts, ecode.OK +} -- Gitblit v1.8.0