From b4201a0054369a8cd89e940947fd6f1a89f357c2 Mon Sep 17 00:00:00 2001 From: wangpengfei <274878379@qq.com> Date: 星期三, 02 八月 2023 13:38:24 +0800 Subject: [PATCH] Merge branch 'master' into fly --- service/contact.go | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/service/contact.go b/service/contact.go index c62bc8a..8a3e761 100644 --- a/service/contact.go +++ b/service/contact.go @@ -48,15 +48,6 @@ return ecode.OK } -func (ContactService) GetContactList() ([]*model.ContactDetail, int) { - // get contact list - contacts, err := model.NewContactSearch(nil).FindAll() - if err != nil { - return nil, ecode.ContactListErr - } - return contacts, ecode.OK -} - func (ContactService) UpdateContact(contact *model.Contact) int { // check contact exist _, err := model.NewContactSearch(nil).SetId(contact.Id).First() @@ -125,3 +116,12 @@ return ecode.OK } + +func (ContactService) GetContactList(page, pageSize int, keyword string) ([]*model.ContactDetail, int64, int) { + // get contact list + contacts, total, err := model.NewContactSearch(nil).SetKeyword(keyword).SetPage(page, pageSize).FindAll() + if err != nil { + return nil, 0, ecode.ContactListErr + } + return contacts, total, ecode.OK +} -- Gitblit v1.8.0