From dac214fa72dc2974954a4d8ee934695f548ad155 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期三, 02 八月 2023 14:14:30 +0800
Subject: [PATCH] fix
---
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