From 3f9be2937eabc2dda6ec5cb4be3b0f5d1f8ee424 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Thu, 27 Aug 2026 16:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6:=20server?= =?UTF-8?q?=5Ftb=5FLinkedMall/internal/entities/response.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/entities/response.go | 346 ++++++++++++++++++ 1 file changed, 346 insertions(+) create mode 100644 server_tb_LinkedMall/internal/entities/response.go diff --git a/server_tb_LinkedMall/internal/entities/response.go b/server_tb_LinkedMall/internal/entities/response.go new file mode 100644 index 0000000..28b9877 --- /dev/null +++ b/server_tb_LinkedMall/internal/entities/response.go @@ -0,0 +1,346 @@ +package entities + +// ============================================================ +// 公共响应结构 +// ============================================================ + +// CommonResponse 阿里云LinkedMall公共响应外层 +type CommonResponse struct { + RequestId string `json:"RequestId"` + Success bool `json:"Success"` + Code string `json:"Code"` + Message string `json:"Message"` + SubCode string `json:"SubCode"` + SubMessage string `json:"SubMessage"` + Data interface{} `json:"Data"` +} + +// APIResponse 服务端统一返回结构 +type APIResponse struct { + Success bool `json:"Success"` + Code string `json:"Code"` + Message string `json:"Message"` + RequestId string `json:"RequestId,omitempty"` + Data interface{} `json:"Data,omitempty"` +} + +// ============================================================ +// 接口 1: ListPurchaserShops +// ============================================================ +type ListPurchaserShopsRespData struct { + Total int64 `json:"Total"` + PageNum int `json:"PageNum"` + PageSize int `json:"PageSize"` + ShopList []PurchaserShopItem `json:"ShopList"` +} + +type PurchaserShopItem struct { + ShopId string `json:"ShopId"` + PurchaserId string `json:"PurchaserId"` + ShopName string `json:"ShopName"` + ShopStatus string `json:"ShopStatus"` +} + +// ============================================================ +// 接口 2: GetPurchaserShop +// ============================================================ +type GetPurchaserShopRespData struct { + ShopId string `json:"ShopId"` + PurchaserId string `json:"PurchaserId"` + ShopName string `json:"ShopName"` + ShopStatus string `json:"ShopStatus"` + ContactInfo string `json:"ContactInfo"` +} + +// ============================================================ +// 接口 3: ListSelectionProducts +// ============================================================ +type ListSelectionProductsRespData struct { + Total int64 `json:"Total"` + PageNum int `json:"PageNum"` + PageSize int `json:"PageSize"` + ProductList []SelectionProductItem `json:"ProductList"` +} + +type SelectionProductItem struct { + ProductId string `json:"ProductId"` + Title string `json:"Title"` + MainImage string `json:"MainImage"` + BrandName string `json:"BrandName"` + CategoryId string `json:"CategoryId"` +} + +// ============================================================ +// 接口 4: GetSelectionProduct +// ============================================================ +type GetSelectionProductRespData struct { + ProductId string `json:"ProductId"` + Title string `json:"Title"` + MainImage string `json:"MainImage"` + Images []string `json:"Images"` + BrandName string `json:"BrandName"` + CategoryId string `json:"CategoryId"` + Desc string `json:"Desc"` + SkuList []SelectionSkuItem `json:"SkuList"` + CanSale bool `json:"CanSale"` + StockQuantity int64 `json:"StockQuantity"` +} + +type SelectionSkuItem struct { + SkuId string `json:"SkuId"` + SkuSpec string `json:"SkuSpec"` + SalePrice int64 `json:"SalePrice"` + MarketPrice int64 `json:"MarketPrice"` + StockQuantity int64 `json:"StockQuantity"` +} + +// ============================================================ +// 接口 5: GetSelectionProductSaleInfo +// ============================================================ +type GetSelectionProductSaleInfoRespData struct { + ProductId string `json:"ProductId"` + Title string `json:"Title"` + CanSale bool `json:"CanSale"` + SalePrice int64 `json:"SalePrice"` + StockQuantity int64 `json:"StockQuantity"` +} + +// ============================================================ +// 接口 6: ListSelectionProductSaleInfos +// ============================================================ +type ListSelectionProductSaleInfosRespData struct { + ProductSaleInfoList []ProductSaleInfoItem `json:"ProductSaleInfoList"` +} + +type ProductSaleInfoItem struct { + ProductId string `json:"ProductId"` + CanSale bool `json:"CanSale"` + SalePrice int64 `json:"SalePrice"` + StockQuantity int64 `json:"StockQuantity"` +} + +// ============================================================ +// 接口 7: ListSelectionSkuSaleInfos +// ============================================================ +type ListSelectionSkuSaleInfosRespData struct { + SkuSaleInfoList []SkuSaleInfoItem `json:"SkuSaleInfoList"` +} + +type SkuSaleInfoItem struct { + SkuId string `json:"SkuId"` + CanSale bool `json:"CanSale"` + SalePrice int64 `json:"SalePrice"` + StockQuantity int64 `json:"StockQuantity"` +} + +// ============================================================ +// 接口 8: ListCategories +// ============================================================ +type ListCategoriesRespData struct { + CategoryList []CategoryItem `json:"CategoryList"` +} + +type CategoryItem struct { + CategoryId string `json:"CategoryId"` + CategoryName string `json:"CategoryName"` + ParentId string `json:"ParentId"` + Level int `json:"Level"` +} + +// ============================================================ +// 接口 9: SearchProducts +// ============================================================ +type SearchProductsRespData struct { + Total int64 `json:"Total"` + PageNum int `json:"PageNum"` + PageSize int `json:"PageSize"` + ProductList []SelectionProductItem `json:"ProductList"` +} + +// ============================================================ +// 接口 10: SelectionGroupAddProduct +// ============================================================ +type SelectionGroupAddProductRespData struct { + SuccessCount int `json:"SuccessCount"` + FailList []string `json:"FailList"` +} + +// ============================================================ +// 接口 11: SelectionGroupRemoveProduct +// ============================================================ +type SelectionGroupRemoveProductRespData struct { + SuccessCount int `json:"SuccessCount"` + FailList []string `json:"FailList"` +} + +// ============================================================ +// 接口 12: RenderPurchaseOrder +// ============================================================ +type RenderPurchaseOrderRespData struct { + TotalFee int64 `json:"TotalFee"` + TotalFreight int64 `json:"TotalFreight"` + ItemList []RenderResultItem `json:"ItemList"` + CanSale bool `json:"CanSale"` + UnSaleReason string `json:"UnSaleReason"` +} + +type RenderResultItem struct { + SkuId string `json:"SkuId"` + SalePrice int64 `json:"SalePrice"` + Quantity int64 `json:"Quantity"` + SubTotalFee int64 `json:"SubTotalFee"` + CanSale bool `json:"CanSale"` + UnSaleReason string `json:"UnSaleReason"` +} + +// ============================================================ +// 接口 13: SplitPurchaseOrder +// ============================================================ +type SplitPurchaseOrderRespData struct { + SubOrderList []SubOrderItem `json:"SubOrderList"` +} + +type SubOrderItem struct { + ShopId string `json:"ShopId"` + ItemList []RenderOrderItem `json:"ItemList"` + TotalFee int64 `json:"TotalFee"` + TotalFreight int64 `json:"TotalFreight"` +} + +// ============================================================ +// 接口 14: CreatePurchaseOrder +// ============================================================ +type CreatePurchaseOrderRespData struct { + PurchaseOrderId string `json:"PurchaseOrderId"` +} + +// ============================================================ +// 接口 15: GetPurchaseOrderStatus +// ============================================================ +type GetPurchaseOrderStatusRespData struct { + PurchaseOrderId string `json:"PurchaseOrderId"` + Status string `json:"Status"` + StatusDesc string `json:"StatusDesc"` +} + +// ============================================================ +// 接口 16: GetOrder +// ============================================================ +type GetOrderRespData struct { + OrderId string `json:"OrderId"` + PurchaseOrderId string `json:"PurchaseOrderId"` + ShopId string `json:"ShopId"` + OrderStatus string `json:"OrderStatus"` + TotalFee int64 `json:"TotalFee"` + FreightFee int64 `json:"FreightFee"` + ActualPayFee int64 `json:"ActualPayFee"` + ReceiverInfo ReceiverInfo `json:"ReceiverInfo"` + OrderItemList []OrderItemDetail `json:"OrderItemList"` + CreateTime string `json:"CreateTime"` +} + +type OrderItemDetail struct { + OrderItemId string `json:"OrderItemId"` + SkuId string `json:"SkuId"` + Title string `json:"Title"` + Quantity int64 `json:"Quantity"` + PayFee int64 `json:"PayFee"` + UnitPrice int64 `json:"UnitPrice"` +} + +// ============================================================ +// 接口 17: QueryOrders +// ============================================================ +type QueryOrdersRespData struct { + Total int64 `json:"Total"` + PageNum int `json:"PageNum"` + PageSize int `json:"PageSize"` + OrderList []GetOrderRespData `json:"OrderList"` +} + +// ============================================================ +// 接口 18: ListLogisticsOrders +// ============================================================ +type ListLogisticsOrdersRespData struct { + LogisticsList []LogisticsItem `json:"LogisticsList"` +} + +type LogisticsItem struct { + LogisticsCompany string `json:"LogisticsCompany"` + TrackingNumber string `json:"TrackingNumber"` + TrajectoryList []LogisticsTrajectory `json:"TrajectoryList"` +} + +type LogisticsTrajectory struct { + Time string `json:"Time"` + Context string `json:"Context"` + Location string `json:"Location"` +} + +// ============================================================ +// 接口 19: ConfirmDisburse +// ============================================================ +type ConfirmDisburseRespData struct { + Success bool `json:"Success"` +} + +// ============================================================ +// 接口 20: RenderRefundOrder +// ============================================================ +type RenderRefundOrderRespData struct { + RefundableAmount int64 `json:"RefundableAmount"` + RefundableQuantity int64 `json:"RefundableQuantity"` + CanRefund bool `json:"CanRefund"` + UnRefundReason string `json:"UnRefundReason"` +} + +// ============================================================ +// 接口 21: CreateRefundOrder +// ============================================================ +type CreateRefundOrderRespData struct { + RefundOrderId string `json:"RefundOrderId"` + Status string `json:"Status"` +} + +// ============================================================ +// 接口 22: CancelRefundOrder +// ============================================================ +type CancelRefundOrderRespData struct { + Success bool `json:"Success"` +} + +// ============================================================ +// 接口 23: GetRefundOrder +// ============================================================ +type GetRefundOrderRespData struct { + RefundOrderId string `json:"RefundOrderId"` + OrderId string `json:"OrderId"` + OrderItemId string `json:"OrderItemId"` + RefundQuantity int64 `json:"RefundQuantity"` + RefundAmount int64 `json:"RefundAmount"` + RefundType string `json:"RefundType"` + RefundStatus string `json:"RefundStatus"` + RefundReason string `json:"RefundReason"` + CreateTime string `json:"CreateTime"` +} + +// ============================================================ +// 接口 24: CreateGoodsShippingNotice +// ============================================================ +type CreateGoodsShippingNoticeRespData struct { + Success bool `json:"Success"` +} + +// ============================================================ +// 接口 25: QueryChildDivisionCode +// ============================================================ +type QueryChildDivisionCodeRespData struct { + DivisionList []DivisionItem `json:"DivisionList"` +} + +type DivisionItem struct { + DivisionCode string `json:"DivisionCode"` + DivisionName string `json:"DivisionName"` + Level int `json:"Level"` + ParentCode string `json:"ParentCode"` +} \ No newline at end of file