From b0c07ddee23e2d54d03636f08af19f0934857cf4 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 25 八月 2023 10:32:56 +0800
Subject: [PATCH] Merge branch 'hotfix'
---
api/v1/assign.go | 98 ++++++++++++++++++++++++------------------------
1 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/api/v1/assign.go b/api/v1/assign.go
index 4889095..c4218df 100644
--- a/api/v1/assign.go
+++ b/api/v1/assign.go
@@ -1,49 +1,49 @@
-package v1
-
-import (
- "aps_crm/model/request"
- "aps_crm/pkg/contextx"
- "aps_crm/pkg/ecode"
- "github.com/gin-gonic/gin"
-)
-
-type AssignApi struct{}
-
-// Assign
-//
-// @Tags Assign
-// @Summary 瀹℃牳
-// @Produce application/json
-// @Param object body request.Assign true "鏌ヨ鍙傛暟"
-// @Success 200 {object} contextx.Response{}
-// @Router /api/assign/assign [post]
-func (au *AssignApi) Assign(c *gin.Context) {
- var params request.Assign
- ctx, ok := contextx.NewContext(c, ¶ms)
- if !ok {
- return
- }
-
- if params.MemberId == 0 {
- ctx.Fail(ecode.AssignWrongMemberId)
- return
- }
-
- if params.Id == 0 {
- ctx.Fail(ecode.AssignWrongId)
- return
- }
-
- if params.Type == "" {
- ctx.Fail(ecode.AssignWrongModelType)
- return
- }
-
- errCode := assignService.Assign(params.MemberId, params.Id, params.Type)
- if errCode != ecode.OK {
- ctx.Fail(errCode)
- return
- }
-
- ctx.Ok()
-}
+package v1
+
+import (
+ "aps_crm/model/request"
+ "aps_crm/pkg/contextx"
+ "aps_crm/pkg/ecode"
+ "github.com/gin-gonic/gin"
+)
+
+type AssignApi struct{}
+
+// Assign
+//
+// @Tags Assign
+// @Summary 鍒嗛厤
+// @Produce application/json
+// @Param object body request.Assign true "鏌ヨ鍙傛暟"
+// @Success 200 {object} contextx.Response{}
+// @Router /api/assign/assign [post]
+func (au *AssignApi) Assign(c *gin.Context) {
+ var params request.Assign
+ ctx, ok := contextx.NewContext(c, ¶ms)
+ if !ok {
+ return
+ }
+
+ if params.MemberId == 0 {
+ ctx.Fail(ecode.AssignWrongMemberId)
+ return
+ }
+
+ if len(params.Ids) == 0 {
+ ctx.Fail(ecode.AssignWrongId)
+ return
+ }
+
+ if params.Type == "" {
+ ctx.Fail(ecode.AssignWrongModelType)
+ return
+ }
+
+ errCode := assignService.Assign(params.MemberId, params.Ids, params.Type)
+ if errCode != ecode.OK {
+ ctx.Fail(errCode)
+ return
+ }
+
+ ctx.Ok()
+}
--
Gitblit v1.8.0