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/contract.go |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/service/contract.go b/service/contract.go
index 58cb8e0..a1e56e5 100644
--- a/service/contract.go
+++ b/service/contract.go
@@ -29,15 +29,6 @@
 	return ecode.OK
 }
 
-func (ContractService) GetContractList() ([]*model.Contract, int) {
-	list, err := model.NewContractSearch().FindAll()
-	if err != nil {
-		return nil, ecode.ContractListErr
-	}
-
-	return list, ecode.OK
-}
-
 func (ContractService) UpdateContract(contract *model.Contract) int {
 	// check contract exist
 	_, err := model.NewContractSearch().SetId(contract.Id).Find()
@@ -52,3 +43,12 @@
 
 	return ecode.OK
 }
+
+func (ContractService) GetContractList(page, pageSize int, keyword string) ([]*model.Contract, int) {
+	// get contact list
+	contacts, err := model.NewContractSearch().SetKeyword(keyword).SetPage(page, pageSize).FindAll()
+	if err != nil {
+		return nil, ecode.ContractListErr
+	}
+	return contacts, ecode.OK
+}

--
Gitblit v1.8.0