Dockerfile
This commit is contained in:
42
controller/stock/stock_batch_controller.go
Normal file
42
controller/stock/stock_batch_controller.go
Normal file
@@ -0,0 +1,42 @@
|
||||
// 批次库存控制器(逻辑库存)
|
||||
// 职责:批次CRUD接口
|
||||
// 调用服务:service.StockBatch
|
||||
// 注意:Update/Delete返回*beans.ResponseEmpty,直接return
|
||||
package controller
|
||||
|
||||
import (
|
||||
dto "assets/model/dto/stock"
|
||||
service "assets/service/stock"
|
||||
"context"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
type stockBatchController struct{}
|
||||
|
||||
var StockBatch = new(stockBatchController)
|
||||
|
||||
func init() {
|
||||
}
|
||||
|
||||
func (c *stockBatchController) CreateBatch(ctx context.Context, req *dto.CreateBatchReq) (res *dto.CreateBatchRes, err error) {
|
||||
return service.StockBatch.Create(ctx, req)
|
||||
}
|
||||
|
||||
func (c *stockBatchController) UpdateBatch(ctx context.Context, req *dto.UpdateBatchReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.StockBatch.Update(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *stockBatchController) DeleteBatch(ctx context.Context, req *dto.DeleteBatchReq) (res *beans.ResponseEmpty, err error) {
|
||||
err = service.StockBatch.Delete(ctx, req)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *stockBatchController) GetBatch(ctx context.Context, req *dto.GetBatchReq) (res *dto.GetBatchRes, err error) {
|
||||
return service.StockBatch.GetOne(ctx, req)
|
||||
}
|
||||
|
||||
func (c *stockBatchController) ListBatches(ctx context.Context, req *dto.ListBatchReq) (res *dto.ListBatchRes, err error) {
|
||||
return service.StockBatch.List(ctx, req)
|
||||
}
|
||||
Reference in New Issue
Block a user