| | |
| | | // @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 { |
| | |
| | | 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} "成功" |
| | | // @Param object body request.AttributeList true "属性值和对象信息" |
| | | // @Success 200 {object} util.Response "成功" |
| | | // @Router /api-wms/v1/attribute/attribute [get] |
| | | func (slf AttributeController) List(c *gin.Context) { |
| | | var params request.GetAttributeList |
| | | if err := c.ShouldBindQuery(¶ms); err != nil { |
| | | func (slf AttributeController) ListAttribute(c *gin.Context) { |
| | | var params request.AttributeList |
| | | if err := c.ShouldBind(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | |
| | | // 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") |