lishihai
2024-06-20 e6a52fd2432f4773ec791053ffc5e28b9ca9a382
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(&params); 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")