48 lines
1.8 KiB
Go
48 lines
1.8 KiB
Go
|
|
// 盘点明细控制器
|
|||
|
|
// 职责:盘点明细CRUD、相似商品查询
|
|||
|
|
// 调用服务:service.InventoryCountDetail
|
|||
|
|
// 注意: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 inventoryCountDetail struct{}
|
|||
|
|
|
|||
|
|
var InventoryCountDetail = new(inventoryCountDetail)
|
|||
|
|
|
|||
|
|
func init() {
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (c *inventoryCountDetail) CreateInventoryCountDetail(ctx context.Context, req *dto.CreateInventoryCountDetailReq) (res *dto.CreateInventoryCountDetailRes, err error) {
|
|||
|
|
return service.InventoryCountDetail.Create(ctx, req)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (c *inventoryCountDetail) UpdateInventoryCountDetail(ctx context.Context, req *dto.UpdateInventoryCountDetailReq) (res *beans.ResponseEmpty, err error) {
|
|||
|
|
err = service.InventoryCountDetail.Update(ctx, req)
|
|||
|
|
return
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (c *inventoryCountDetail) DeleteInventoryCountDetail(ctx context.Context, req *dto.DeleteInventoryCountDetailReq) (res *beans.ResponseEmpty, err error) {
|
|||
|
|
err = service.InventoryCountDetail.Delete(ctx, req)
|
|||
|
|
return
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (c *inventoryCountDetail) GetInventoryCountDetail(ctx context.Context, req *dto.GetInventoryCountDetailReq) (res *dto.GetInventoryCountDetailRes, err error) {
|
|||
|
|
return service.InventoryCountDetail.GetOne(ctx, req)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (c *inventoryCountDetail) ListInventoryCountDetails(ctx context.Context, req *dto.ListInventoryCountDetailReq) (res *dto.ListInventoryCountDetailRes, err error) {
|
|||
|
|
return service.InventoryCountDetail.List(ctx, req)
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// SearchSimilarAssets 查询相似商品
|
|||
|
|
func (c *inventoryCountDetail) SearchSimilarAssets(ctx context.Context, req *dto.SearchSimilarAssetsReq) (res *dto.SearchSimilarAssetsRes, err error) {
|
|||
|
|
return service.InventoryCountDetail.SearchSimilarAssets(ctx, req)
|
|||
|
|
}
|