From d20acf38c36c11ee4428c3e74a17f5870dc61b51 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期四, 16 十一月 2023 09:51:00 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/SRM

---
 api/v1/test/supplier.go |   46 +++++++++++++++++++++++++++++++---------------
 1 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/api/v1/test/supplier.go b/api/v1/test/supplier.go
index 5b9df26..197b10f 100644
--- a/api/v1/test/supplier.go
+++ b/api/v1/test/supplier.go
@@ -1,15 +1,15 @@
 package test
 
 import (
-	"github.com/flipped-aurora/gin-vue-admin/server/global"
-	"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
-	"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
-	"github.com/flipped-aurora/gin-vue-admin/server/model/test"
-	testReq "github.com/flipped-aurora/gin-vue-admin/server/model/test/request"
-	"github.com/flipped-aurora/gin-vue-admin/server/service"
-	"github.com/flipped-aurora/gin-vue-admin/server/utils"
 	"github.com/gin-gonic/gin"
 	"go.uber.org/zap"
+	"srm/global"
+	"srm/model/common/request"
+	"srm/model/common/response"
+	"srm/model/test"
+	testReq "srm/model/test/request"
+	"srm/service"
+	"srm/utils"
 )
 
 type SupplierApi struct {
@@ -30,14 +30,6 @@
 	var s test.Supplier
 	err := c.ShouldBindJSON(&s)
 	if err != nil {
-		response.FailWithMessage(err.Error(), c)
-		return
-	}
-	verify := utils.Rules{
-		"Name":                {utils.NotEmpty()},
-		"ResponsiblePersonId": {utils.NotEmpty()},
-	}
-	if err := utils.Verify(s, verify); err != nil {
 		response.FailWithMessage(err.Error(), c)
 		return
 	}
@@ -181,3 +173,27 @@
 		}, "鑾峰彇鎴愬姛", c)
 	}
 }
+
+// ChangeSupplierStatus 淇敼Supplier鐘舵��
+// @Tags Supplier
+// @Summary 淇敼Supplier鐘舵��
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data body testReq.SupplierStatus true "淇敼Supplier鐘舵��"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"淇敼鎴愬姛"}"
+// @Router /s/changeSupplierStatus [post]
+func (sApi *SupplierApi) ChangeSupplierStatus(c *gin.Context) {
+	var params testReq.SupplierStatus
+	err := c.ShouldBindJSON(&params)
+	if err != nil {
+		response.FailWithMessage(err.Error(), c)
+		return
+	}
+	if err := sService.ChangeStatus(params.Id, params.Status); err != nil {
+		global.GVA_LOG.Error("淇敼澶辫触!", zap.Error(err))
+		response.FailWithMessage("淇敼澶辫触", c)
+	} else {
+		response.OkWithMessage("淇敼鎴愬姛", c)
+	}
+}

--
Gitblit v1.8.0