refactor(catalog): 废弃 LEWAN_ 镜像,统一英文 SKU 与积分价,商品图按 SKU 缓存
对外目录只保留英文主 sku;迁移硬删镜像并校准 1元=100积分;发货页/凭证优先使用 local {sku}.webp。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"affiliate_dash/internal/middleware"
|
||||
"affiliate_dash/internal/model"
|
||||
@@ -30,7 +31,7 @@ func (h *OpenV1Handler) ListProducts(c *gin.Context) {
|
||||
page, _ := strconv.Atoi(c.DefaultQuery("page", "1"))
|
||||
size, _ := strconv.Atoi(c.DefaultQuery("size", "20"))
|
||||
openlog.Info(c, "list_products start page=%d size=%d", page, size)
|
||||
list, total, err := h.merchantSvc.ListMerchantProducts(middleware.GetMerchantID(c), page, size, true)
|
||||
list, total, err := h.merchantSvc.ListMerchantProductsForClient(middleware.GetMerchantID(c), page, size)
|
||||
if err != nil {
|
||||
openlog.Warn(c, "list_products fail err=%v", err)
|
||||
response.ServerError(c, err.Error())
|
||||
@@ -71,6 +72,11 @@ func (h *OpenV1Handler) CreateOrder(c *gin.Context) {
|
||||
}
|
||||
data = decoded
|
||||
}
|
||||
if service.IsLegacyLewanMirrorSKU(req.SKU) {
|
||||
openlog.Warn(c, "create_order reject legacy lewan sku=%s", strings.TrimSpace(req.SKU))
|
||||
response.BadRequest(c, "请使用英文主商品 sku 下单,勿使用 LEWAN_ 镜像 sku")
|
||||
return
|
||||
}
|
||||
client := middleware.GetAPIClient(c)
|
||||
openlog.Info(c, "create_order start client_order_no=%s sku=%s quantity=%d buyer=%s",
|
||||
req.ClientOrderNo, req.SKU, req.Quantity, req.BuyerReference)
|
||||
|
||||
Reference in New Issue
Block a user