| | |
| | | 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() |
| | |
| | | |
| | | 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 |
| | | } |