From fbb3b8c3eb3b48772dc1123561e68741d05dfffa Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 30 八月 2023 13:31:35 +0800
Subject: [PATCH] 统一记录编号
---
service/contract.go | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/service/contract.go b/service/contract.go
index b966dce..2072299 100644
--- a/service/contract.go
+++ b/service/contract.go
@@ -16,19 +16,6 @@
return ecode.OK
}
-func (ContractService) DeleteContract(id int) int {
- _, err := model.NewContractSearch().SetId(id).Find()
- if err != nil {
- return ecode.ContractNotExist
- }
-
- err = model.NewContractSearch().SetId(id).Delete()
- if err != nil {
- return ecode.ContractNotExist
- }
- return ecode.OK
-}
-
func (ContractService) UpdateContract(contract *model.Contract) int {
// check contract exist
_, err := model.NewContractSearch().SetId(contract.Id).Find()
@@ -52,3 +39,12 @@
}
return contacts, total, ecode.OK
}
+
+func (ContractService) DeleteContract(ids []int) int {
+ // delete client
+ err := model.NewContractSearch().SetIds(ids).Delete()
+ if err != nil {
+ return ecode.ContractDeleteErr
+ }
+ return ecode.OK
+}
--
Gitblit v1.8.0