feat: 优化发货交付页面与凭据生成,支持一键复制结果图片及官方商品图片本地缓存

- 交付界面重构:隐藏内部订单号、流水号与发货渠道,展示聚焦于买家游戏UID、角色名与交付时间
- 发货结果凭据生成:采用 Canvas 生成高清发货存证图,优化存证说明文案与自适应排版
- 一键复制图片:支持直接将结果凭证图片写入系统剪贴板,方便客服在聊天窗口快捷粘贴
- 官方图片本地化缓存:全量下载乐玩商品官方主图并建立本地持久化路由,规避外部源站跨域及破损问题
- 修复乐玩渠道角色UID提取与履约状态幂等回填逻辑
This commit is contained in:
yml2213
2026-09-14 17:19:12 +08:00
parent f7f48d0feb
commit 5f642eb7a6
34 changed files with 1428 additions and 66 deletions
@@ -118,3 +118,38 @@ func (h *PlatformLewanHandler) SyncLewanProduct(c *gin.Context) {
}
response.WithStatus(c, http.StatusCreated, item)
}
type batchSyncLewanReq struct {
Products []syncLewanProductReq `json:"products" binding:"required,min=1"`
}
// BatchSyncLewanProducts POST /api/platform/lewan/batch-sync-catalog
// 批量同步/添加乐玩商品到自营商品目录
func (h *PlatformLewanHandler) BatchSyncLewanProducts(c *gin.Context) {
var req batchSyncLewanReq
if err := c.ShouldBindJSON(&req); err != nil {
response.BadRequest(c, "参数错误:products 列表不能为空")
return
}
actorUserID := middleware.GetUserID(c)
inputs := make([]service.SyncLewanProductInput, len(req.Products))
for i, p := range req.Products {
inputs[i] = service.SyncLewanProductInput{
LewanProductID: p.LewanProductID,
Name: p.Name,
Category: p.Category,
SKU: p.SKU,
Price: p.Price,
DeliveryType: p.DeliveryType,
}
}
count, err := h.merchantSvc.BatchSyncLewanProductsToCatalog(inputs, actorUserID)
if err != nil {
response.BadRequest(c, err.Error())
return
}
response.OK(c, gin.H{"synced_count": count})
}