重构: 手续费改为百分比/固定二选一,清理旧 Skin/Order/ShipLog 演示链路
手续费: - 新增 fee_type 字段(rate/fixed),百分比与固定金额二选一,不再叠加 - calculateServiceFee 按 fee_type 分支计算 - 商户创建/更新校验 fee_type,订单落库快照 fee_type - 前端表单改为下拉选择手续费类型,动态显示对应输入框 - 测试拆为 TestFeeRate + TestFeeFixed 清理旧链路: - 删除旧 Skin/Order/ShipLog 模型及 OrderService/SkinService - Dashboard 迁移到 FulfillmentService - 上游 /api/open/v1 改为基于 FulfillmentOrder 实现,接口契约不变 - 推送留痕改用 AuditLog,不再建 ShipLog 表 - 删除前端 Skins/Orders/ShipLogs/Distributors 页面及路由、菜单、API、类型 - 新增迁移 003: 添加 fee_type 列并 DROP 旧表
This commit is contained in:
@@ -11,13 +11,13 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// OpenHandler 皮肤源头开放接口
|
||||
// OpenHandler 皮肤源头开放接口(上游 SourceOpen),基于 FulfillmentOrder 履约模型。
|
||||
type OpenHandler struct {
|
||||
orderSvc *service.OrderService
|
||||
fulfillmentSvc *service.FulfillmentService
|
||||
}
|
||||
|
||||
func NewOpenHandler(orderSvc *service.OrderService) *OpenHandler {
|
||||
return &OpenHandler{orderSvc: orderSvc}
|
||||
func NewOpenHandler(fulfillmentSvc *service.FulfillmentService) *OpenHandler {
|
||||
return &OpenHandler{fulfillmentSvc: fulfillmentSvc}
|
||||
}
|
||||
|
||||
// QueryOrder GET /api/open/v1/orders/:order_no
|
||||
@@ -29,7 +29,7 @@ func (h *OpenHandler) QueryOrder(c *gin.Context) {
|
||||
}
|
||||
openlog.Info(c, "query_order start order_no=%s", orderNo)
|
||||
|
||||
data, err := h.orderSvc.QueryOpenOrder(orderNo)
|
||||
data, err := h.fulfillmentSvc.QueryOpenOrder(orderNo)
|
||||
if err != nil {
|
||||
openlog.Warn(c, "query_order fail order_no=%s err=%s", orderNo, err.Error())
|
||||
if err.Error() == "订单不存在" {
|
||||
@@ -90,7 +90,7 @@ func (h *OpenHandler) ShipNotify(c *gin.Context) {
|
||||
shippedAt = &t
|
||||
}
|
||||
|
||||
result, err := h.orderSvc.HandleShipNotify(service.ShipNotifyInput{
|
||||
result, err := h.fulfillmentSvc.HandleShipNotify(service.ShipNotifyInput{
|
||||
OrderNo: req.OrderNo,
|
||||
ShipStatus: req.ShipStatus,
|
||||
ProviderOrderNo: req.ProviderOrderNo,
|
||||
|
||||
Reference in New Issue
Block a user