132 lines
3.5 KiB
Go
132 lines
3.5 KiB
Go
package inventorymanage
|
||
|
||
import (
|
||
"errors"
|
||
"github.com/gin-gonic/gin"
|
||
"go-admin/app/admin/models"
|
||
"go-admin/tools/app"
|
||
"net/http"
|
||
)
|
||
|
||
// 库存变动相关代码
|
||
|
||
// InventoryChangeAdd 新增
|
||
// @Summary 新增
|
||
// @Tags 库存变动,V1.4.0
|
||
// @Produce json
|
||
// @Accept json
|
||
// @Param request body models.InventoryChangeAddReq true "新增模型"
|
||
// @Success 200 {object} models.InventoryChangeOrder
|
||
// @Router /api/v1/inventory/change/add [post]
|
||
func InventoryChangeAdd(c *gin.Context) {
|
||
req := &models.ErpStockListReq{}
|
||
if err := c.ShouldBindJSON(&req); err != nil {
|
||
//logger.Error(err)
|
||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
||
return
|
||
}
|
||
|
||
app.OK(c, "", "OK")
|
||
return
|
||
}
|
||
|
||
// InventoryChangeEdit 编辑
|
||
// @Summary 编辑
|
||
// @Tags 库存变动,V1.4.0
|
||
// @Produce json
|
||
// @Accept json
|
||
// @Param request body models.InventoryChangeEditReq true "编辑模型"
|
||
// @Success 200 {object} models.InventoryChangeOrder
|
||
// @Router /api/v1/inventory/change/edit [post]
|
||
func InventoryChangeEdit(c *gin.Context) {
|
||
req := &models.ErpStockListReq{}
|
||
if err := c.ShouldBindJSON(&req); err != nil {
|
||
//logger.Error(err)
|
||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
||
return
|
||
}
|
||
|
||
app.OK(c, "", "OK")
|
||
return
|
||
}
|
||
|
||
// InventoryChangeAudit 审核
|
||
// @Summary 审核
|
||
// @Tags 库存变动,V1.4.0
|
||
// @Produce json
|
||
// @Accept json
|
||
// @Param request body models.InventoryChangeAuditReq true "审核模型"
|
||
// @Success 200 {object} app.Response
|
||
// @Router /api/v1/inventory/change/audit [post]
|
||
func InventoryChangeAudit(c *gin.Context) {
|
||
req := &models.ErpStockListReq{}
|
||
if err := c.ShouldBindJSON(&req); err != nil {
|
||
//logger.Error(err)
|
||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
||
return
|
||
}
|
||
|
||
app.OK(c, "", "OK")
|
||
return
|
||
}
|
||
|
||
// InventoryChangeDelete 删除
|
||
// @Summary 删除
|
||
// @Tags 库存变动,V1.4.0
|
||
// @Produce json
|
||
// @Accept json
|
||
// @Param request body models.InventoryChangeDeleteReq true "删除模型"
|
||
// @Success 200 {object} app.Response
|
||
// @Router /api/v1/inventory/change/delete [post]
|
||
func InventoryChangeDelete(c *gin.Context) {
|
||
req := &models.ErpStockListReq{}
|
||
if err := c.ShouldBindJSON(&req); err != nil {
|
||
//logger.Error(err)
|
||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
||
return
|
||
}
|
||
|
||
app.OK(c, "", "OK")
|
||
return
|
||
}
|
||
|
||
// InventoryChangeList 库存变动列表
|
||
// @Summary 库存变动列表
|
||
// @Tags 库存变动,V1.4.0
|
||
// @Produce json
|
||
// @Accept json
|
||
// @Param request body models.InventoryChangeListReq true "库存变动列表模型"
|
||
// @Success 200 {object} models.InventoryChangeListResp
|
||
// @Router /api/v1/inventory/change/list [post]
|
||
func InventoryChangeList(c *gin.Context) {
|
||
req := &models.ErpStockListReq{}
|
||
if err := c.ShouldBindJSON(&req); err != nil {
|
||
//logger.Error(err)
|
||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
||
return
|
||
}
|
||
|
||
app.OK(c, "", "OK")
|
||
return
|
||
}
|
||
|
||
// InventoryChangeDetail 库存变动详情
|
||
// @Summary 库存变动详情
|
||
// @Tags 库存变动,V1.4.0
|
||
// @Produce json
|
||
// @Accept json
|
||
// @Param request body models.InventoryChangeDetailReq true "库存变动详情模型"
|
||
// @Success 200 {object} models.InventoryChangeOrder
|
||
// @Router /api/v1/inventory/change/detail [post]
|
||
func InventoryChangeDetail(c *gin.Context) {
|
||
req := &models.ErpStockListReq{}
|
||
if err := c.ShouldBindJSON(&req); err != nil {
|
||
//logger.Error(err)
|
||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
||
return
|
||
}
|
||
|
||
app.OK(c, "", "OK")
|
||
return
|
||
}
|