From de4bcd1dead50b05f716bc5718be5540bdb96783 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期日, 28 四月 2024 17:23:29 +0800
Subject: [PATCH] fix
---
api/v1/test/supplier.go | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/api/v1/test/supplier.go b/api/v1/test/supplier.go
index f7e30b5..6a2b489 100644
--- a/api/v1/test/supplier.go
+++ b/api/v1/test/supplier.go
@@ -151,6 +151,29 @@
}
}
+// GetSupplierByNumber 鐢ㄧ紪鐮佹煡璇upplier
+// @Tags Supplier
+// @Summary 鐢ㄧ紪鐮佹煡璇upplier
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param number path string true "渚涘簲鍟嗙紪鐮�"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"鏌ヨ鎴愬姛"}"
+// @Router /s/getSupplierByNumber/{number} [get]
+func (sApi *SupplierApi) GetSupplierByNumber(c *gin.Context) {
+ number := c.Param("number")
+ if number == "" {
+ response.FailWithMessage("缂栫爜鍙傛暟涓嶈兘涓虹┖", c)
+ return
+ }
+ if res, err := sService.GetSupplierByNumber(number); err != nil {
+ global.GVA_LOG.Error("鏌ヨ澶辫触!", zap.Error(err))
+ response.FailWithMessage("鏌ヨ澶辫触", c)
+ } else {
+ response.OkWithData(gin.H{"res": res}, c)
+ }
+}
+
// GetSupplierList 鍒嗛〉鑾峰彇Supplier鍒楄〃
// @Tags Supplier
// @Summary 鍒嗛〉鑾峰彇Supplier鍒楄〃
@@ -203,3 +226,34 @@
response.OkWithMessage("淇敼鎴愬姛", c)
}
}
+
+// GetSupplierProductList 鑾峰彇渚涘簲鍟嗘彁渚涗骇鍝佸垪琛�
+// @Tags Supplier
+// @Summary 鑾峰彇渚涘簲鍟嗘彁渚涗骇鍝佸垪琛�
+// @Security ApiKeyAuth
+// @accept application/json
+// @Produce application/json
+// @Param data query testReq.SupplierProduct true "鑾峰彇渚涘簲鍟嗘彁渚涗骇鍝佸垪琛�"
+// @Param Authorization header string true "token"
+// @Success 200 {string} string "{"success":true,"data":{},"msg":"鑾峰彇鎴愬姛"}"
+// @Router /s/getSupplierProductList [get]
+func (sApi *SupplierApi) GetSupplierProductList(c *gin.Context) {
+ var params testReq.SupplierProduct
+ err := c.ShouldBindQuery(¶ms)
+ if err != nil {
+ response.FailWithMessage(err.Error(), c)
+ return
+ }
+ list, total, err := sService.GetSupplierProduct(params)
+ if err != nil {
+ global.GVA_LOG.Error("鑾峰彇澶辫触!", zap.Error(err))
+ response.FailWithMessage("鑾峰彇澶辫触", c)
+ return
+ }
+ response.OkWithDetailed(response.PageResult{
+ List: list,
+ Total: total,
+ Page: params.Page,
+ PageSize: params.PageSize,
+ }, "鑾峰彇鎴愬姛", c)
+}
--
Gitblit v1.8.0