Files
assets/service/stock/stock_batch_service.go
qhd 829dc07747 refactor: 重构资产实体和DTO结构类型
将gjson.Json类型替换为具体的结构体和map类型,修正DAO层链式调用,启用SKU元数据校验逻辑
2026-03-22 20:08:32 +08:00

52 lines
1.4 KiB
Go
Raw Permalink 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、列表查询
// 紧密耦合dao.StockBatch
// 注意区别于PrivateStock的实物库存批次库存是逻辑概念不记录物理位置
package service
type stockBatch struct{}
// StockBatch 批次服务
var StockBatch = new(stockBatch)
//func (s *stockBatch) Create(ctx context.Context, req *dto.CreateBatchReq) (res *dto.CreateBatchRes, err error) {
// ids, err := dao.StockBatch.Insert(ctx, req)
// if err != nil {
// return
// }
// id := ids[0].(bson.ObjectID)
// res = &dto.CreateBatchRes{
// Id: &id,
// }
// return
//}
//
//func (s *stockBatch) Update(ctx context.Context, req *dto.UpdateBatchReq) error {
// return dao.StockBatch.Update(ctx, req)
//}
//
//func (s *stockBatch) Delete(ctx context.Context, req *dto.DeleteBatchReq) error {
// return dao.StockBatch.Delete(ctx, req)
//}
//
//func (s *stockBatch) GetOne(ctx context.Context, req *dto.GetBatchReq) (res *dto.GetBatchRes, err error) {
// one, err := dao.StockBatch.GetOneById(ctx, req)
// if err != nil {
// return
// }
// err = utils.Struct(one, &res)
// return
//}
//
//func (s *stockBatch) List(ctx context.Context, req *dto.ListBatchReq) (res *dto.ListBatchRes, err error) {
// list, total, err := dao.StockBatch.List(ctx, req)
// if err != nil {
// return
// }
// res = &dto.ListBatchRes{
// Total: total,
// }
// err = utils.Struct(list, &res.List)
// return
//}