From e6a52fd2432f4773ec791053ffc5e28b9ca9a382 Mon Sep 17 00:00:00 2001 From: lishihai <dslsh@dscom> Date: 星期四, 20 六月 2024 17:44:43 +0800 Subject: [PATCH] 查询属性值和对象 通过主键ID查询 --- controllers/attribute.go | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/controllers/attribute.go b/controllers/attribute.go index 6567cea..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,15 +142,14 @@ 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(¶ms); err != nil { util.ResponseFormat(c, code.RequestParamError, err.Error()) @@ -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