建立订单读模型Port与架构依赖门禁
将订单列表筛选条件和展示行提取到 internal/application/orders,Server 适配器负责数据库模型转换。 架构检查器统一模块路径,禁止应用层依赖基础设施,并要求新增 Server 低层依赖登记临时白名单。 验证:make check。
This commit is contained in:
1 parent
0a45fd4a8b
commit
c2503645e0
7 files changed
+249
-16
No files matched your search
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
orderapp "xianyu-go/internal/application/orders"
|
||||
"xianyu-go/internal/db"
|
||||
"xianyu-go/internal/xianyu/cookierefresh"
|
||||
"xianyu-go/internal/xianyu/mtop"
|
||||
@@ -109,7 +110,7 @@ type orderListResult struct {
|
||||
}
|
||||
|
||||
// orderDTOFromRow 把数据库订单列表行转换为稳定的订单响应视图。
|
||||
func orderDTOFromRow(row db.OrderRow) orderDTO {
|
||||
func orderDTOFromRow(row orderapp.OrderRow) orderDTO {
|
||||
// status 保存状态,供当前处理流程使用
|
||||
status := db.NormalizeOrderStatus(row.OrderStatus)
|
||||
return orderDTO{
|
||||
@@ -168,7 +169,7 @@ func (a *orderApplicationService) List(ctx context.Context, query orderListQuery
|
||||
// offset 保存偏移量,供当前处理流程使用
|
||||
offset := (query.Page - 1) * query.PageSize
|
||||
// rows、total、err 保存rows、total、err,供当前处理流程使用
|
||||
rows, total, err := a.repository.ListOrdersForUser(ctx, db.OrderListFilter{
|
||||
rows, total, err := a.repository.ListOrdersForUser(ctx, orderapp.ListFilter{
|
||||
UserID: query.UserID, CookieID: query.CookieID, Status: query.Status,
|
||||
Search: query.Search, Limit: query.PageSize, Offset: offset,
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user