| | |
| | | "wms/models" |
| | | "wms/pkg/logx" |
| | | "wms/request" |
| | | "wms/utils" |
| | | ) |
| | | |
| | | type ProductController struct { |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | return |
| | | } |
| | | if params.ID == "" { |
| | | util.ResponseFormat(c, code.RequestParamError, "产品编码不能为空") |
| | | return |
| | | } |
| | | if params.Name == "" { |
| | | util.ResponseFormat(c, code.RequestParamError, "产品名称不能为空") |
| | | return |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "单位不能为空") |
| | | return |
| | | } |
| | | params.ID = utils.GetUUID() |
| | | //params.ID = utils.GetUUID() |
| | | err := models.NewMaterialSearch().Create(¶ms) |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "产品信息保存失败") |