Files
assets/controller/stock/stock_batch_controller.go
2026-03-18 10:18:03 +08:00

43 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 批次库存控制器(逻辑库存)
// 职责批次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)
}