From d533225faddf7b77497b479e8c3fe6458ffe7c40 Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期四, 20 六月 2024 19:52:31 +0800
Subject: [PATCH] 成本单价-销售单价业务修正

---
 controllers/attribute.go |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/controllers/attribute.go b/controllers/attribute.go
index 926a09f..a2cc273 100644
--- a/controllers/attribute.go
+++ b/controllers/attribute.go
@@ -24,7 +24,7 @@
 // @Param     Authorization	header string true "token"
 // @Success   200 {object} util.Response "鎴愬姛"
 // @Router    /api-wms/v1/attribute/attribute [post]
-func (slf *AttributeController) Add(c *gin.Context) {
+func (slf AttributeController) Add(c *gin.Context) {
 	var reqParams request.AddAttribute
 	var params models.Attribute
 	if err := c.BindJSON(&reqParams); err != nil {
@@ -142,21 +142,20 @@
 	util.ResponseFormat(c, code.UpdateSuccess, "鍒犻櫎鎴愬姛")
 }
 
-// List
-// @Tags      灞炴��
-// @Summary   鏌ヨ灞炴�у垪琛�
+// ListAttribute
+// @Tags      灞炴�у�煎拰瀵硅薄
+// @Summary   鏌ヨ灞炴�у�煎拰瀵硅薄
 // @Produce   application/json
-// @Param     object  query    request.GetAttributeList true  "鏌ヨ鍙傛暟"
-// @Param     Authorization	header string true "token"
-// @Success   200   {object}  util.ResponseList{data=[]models.Attribute}  "鎴愬姛"
-// @Router    /api-wms/v1/attribute/attribute [get]
-func (slf AttributeController) List(c *gin.Context) {
+// object  body  request.GetAttributeList true  "鏌ヨ鍙傛暟"
+// @Success   200 {object} util.Response "鎴愬姛"
+// @Router    /api-wms/v1/attribute/list [post]
+func (slf AttributeController) ListAttribute(c *gin.Context) {
 	var params request.GetAttributeList
 	if err := c.ShouldBindQuery(&params); err != nil {
 		util.ResponseFormat(c, code.RequestParamError, err.Error())
 		return
 	}
-	list, count, err := models.NewAttributeSearch().SetPage(params.Page, params.PageSize).SetOrder("id desc").Find()
+	list, count, err := models.NewAttributeSearch().SetEntityType(params.EntityType).SetPage(params.Page, params.PageSize).SetOrder("id desc").Find()
 	if err != nil {
 		util.ResponseFormat(c, code.RequestParamError, "鏌ヨ澶辫触")
 		return
@@ -192,7 +191,7 @@
 // object  body  request.OperationList true  "鏌ヨ鍙傛暟"
 // @Success   200 {object} util.Response "鎴愬姛"
 // @Router    /api-wms/v1/attribute/primary/{id}  [get]
-func (slf *AttributeValueController) PrimaryAttribute(c *gin.Context) {
+func (slf AttributeController) PrimaryAttribute(c *gin.Context) {
 	id, _ := strconv.ParseUint(c.Param("id"), 10, 64)
 	if id == 0 {
 		util.ResponseFormat(c, code.RequestParamError, "鏃犳晥id")

--
Gitblit v1.8.0