From 108a50410388eb75f4865d9129b4b82846d7941b Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Sat, 9 May 2020 17:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=90=8E=E5=8F=B0=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=A0=A1=E9=AA=8C=E5=B7=A5=E5=85=B7=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/v1/exa_customer.go | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/server/api/v1/exa_customer.go b/server/api/v1/exa_customer.go index a98824a0..38998156 100644 --- a/server/api/v1/exa_customer.go +++ b/server/api/v1/exa_customer.go @@ -24,12 +24,10 @@ func CreateExaCustomer(c *gin.Context) { _ = c.ShouldBindJSON(&cu) CustomerVerify := utils.Rules{ "CustomerName": {utils.NotEmpty()}, - "CustomerPhoneData": {utils.NotEmpty()}, - "SysUserID": {utils.NotEmpty()}, - "SysUserAuthorityID": {utils.NotEmpty()}, + "CustomerPhoneData": {utils.NotEmpty()}, } CustomerVerifyErr := utils.Verify(cu, CustomerVerify) - if CustomerVerifyErr!=nil { + if CustomerVerifyErr != nil { response.FailWithMessage(CustomerVerifyErr.Error(), c) return } @@ -57,10 +55,10 @@ func DeleteExaCustomer(c *gin.Context) { var cu model.ExaCustomer _ = c.ShouldBindJSON(&cu) CustomerVerify := utils.Rules{ - "ID": {utils.NotEmpty()}, + "ID": {utils.NotEmpty()}, } CustomerVerifyErr := utils.Verify(cu.Model, CustomerVerify) - if CustomerVerifyErr!=nil { + if CustomerVerifyErr != nil { response.FailWithMessage(CustomerVerifyErr.Error(), c) return } @@ -84,21 +82,19 @@ func UpdateExaCustomer(c *gin.Context) { var cu model.ExaCustomer _ = c.ShouldBindJSON(&cu) IdCustomerVerify := utils.Rules{ - "ID": {utils.NotEmpty()}, + "ID": {utils.NotEmpty()}, } IdCustomerVerifyErr := utils.Verify(cu.Model, IdCustomerVerify) - if IdCustomerVerifyErr!=nil { + if IdCustomerVerifyErr != nil { response.FailWithMessage(IdCustomerVerifyErr.Error(), c) return } CustomerVerify := utils.Rules{ "CustomerName": {utils.NotEmpty()}, - "CustomerPhoneData": {utils.NotEmpty()}, - "SysUserID": {utils.NotEmpty()}, - "SysUserAuthorityID": {utils.NotEmpty()}, + "CustomerPhoneData": {utils.NotEmpty()}, } CustomerVerifyErr := utils.Verify(cu, CustomerVerify) - if CustomerVerifyErr!=nil { + if CustomerVerifyErr != nil { response.FailWithMessage(CustomerVerifyErr.Error(), c) return } @@ -122,10 +118,10 @@ func GetExaCustomer(c *gin.Context) { var cu model.ExaCustomer _ = c.ShouldBindQuery(&cu) IdCustomerVerify := utils.Rules{ - "ID": {utils.NotEmpty()}, + "ID": {utils.NotEmpty()}, } IdCustomerVerifyErr := utils.Verify(cu.Model, IdCustomerVerify) - if IdCustomerVerifyErr!=nil { + if IdCustomerVerifyErr != nil { response.FailWithMessage(IdCustomerVerifyErr.Error(), c) return } @@ -151,11 +147,11 @@ func GetExaCustomerList(c *gin.Context) { var pageInfo request.PageInfo _ = c.ShouldBindQuery(&pageInfo) CustomerVerify := utils.Rules{ - "Page": {utils.NotEmpty()}, + "Page": {utils.NotEmpty()}, "PageSize": {utils.NotEmpty()}, } CustomerVerifyErr := utils.Verify(pageInfo, CustomerVerify) - if CustomerVerifyErr!=nil { + if CustomerVerifyErr != nil { response.FailWithMessage(CustomerVerifyErr.Error(), c) return }