zhangqian
2024-07-01 73b6baf6af3d88cdcb0e2df7932a9bd96b0b85c5
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,17 +142,16 @@
   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(&params); err != nil {
func (slf AttributeController) ListAttribute(c *gin.Context) {
   var params request.AttributeList
   if err := c.ShouldBind(&params); err != nil {
      util.ResponseFormat(c, code.RequestParamError, err.Error())
      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")