feat: 补全客户端订单和资产 DTO _name 字段,修复代码格式
This commit is contained in:
@@ -76,6 +76,9 @@ components:
|
|||||||
status:
|
status:
|
||||||
description: 状态 (0:禁用, 1:启用)
|
description: 状态 (0:禁用, 1:启用)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 状态名称(中文)
|
||||||
|
type: string
|
||||||
updated_at:
|
updated_at:
|
||||||
description: 更新时间
|
description: 更新时间
|
||||||
type: string
|
type: string
|
||||||
@@ -604,6 +607,9 @@ components:
|
|||||||
activation_status:
|
activation_status:
|
||||||
description: 激活状态(0:未激活, 1:已激活)
|
description: 激活状态(0:未激活, 1:已激活)
|
||||||
type: integer
|
type: integer
|
||||||
|
activation_status_name:
|
||||||
|
description: 激活状态名称(中文)
|
||||||
|
type: string
|
||||||
asset_id:
|
asset_id:
|
||||||
description: 资产ID
|
description: 资产ID
|
||||||
minimum: 0
|
minimum: 0
|
||||||
@@ -625,6 +631,9 @@ components:
|
|||||||
bound_device_no:
|
bound_device_no:
|
||||||
description: 绑定的设备虚拟号
|
description: 绑定的设备虚拟号
|
||||||
type: string
|
type: string
|
||||||
|
bound_phone:
|
||||||
|
description: 当前登录用户绑定的手机号
|
||||||
|
type: string
|
||||||
card_category:
|
card_category:
|
||||||
description: 卡业务类型(normal:普通卡, industry:行业卡)
|
description: 卡业务类型(normal:普通卡, industry:行业卡)
|
||||||
type: string
|
type: string
|
||||||
@@ -684,6 +693,9 @@ components:
|
|||||||
network_status:
|
network_status:
|
||||||
description: 网络状态(0:停机, 1:开机)
|
description: 网络状态(0:停机, 1:开机)
|
||||||
type: integer
|
type: integer
|
||||||
|
network_status_name:
|
||||||
|
description: 网络状态名称(中文)
|
||||||
|
type: string
|
||||||
package_remain_mb:
|
package_remain_mb:
|
||||||
description: 当前剩余虚流量(MB),已按虚流量比例换算
|
description: 当前剩余虚流量(MB),已按虚流量比例换算
|
||||||
type: number
|
type: number
|
||||||
@@ -696,12 +708,18 @@ components:
|
|||||||
real_name_status:
|
real_name_status:
|
||||||
description: 实名状态(0:未实名, 1:已实名)
|
description: 实名状态(0:未实名, 1:已实名)
|
||||||
type: integer
|
type: integer
|
||||||
|
real_name_status_name:
|
||||||
|
description: 实名状态名称(中文)
|
||||||
|
type: string
|
||||||
sn:
|
sn:
|
||||||
description: 设备序列号
|
description: 设备序列号
|
||||||
type: string
|
type: string
|
||||||
status:
|
status:
|
||||||
description: 状态(1:在库, 2:已分销, 3:已激活, 4:已停用)
|
description: 状态(1:在库, 2:已分销, 3:已激活, 4:已停用)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 状态名称(中文)
|
||||||
|
type: string
|
||||||
virtual_no:
|
virtual_no:
|
||||||
description: 虚拟号
|
description: 虚拟号
|
||||||
type: string
|
type: string
|
||||||
@@ -948,9 +966,6 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
DtoAssetResolveResponse:
|
DtoAssetResolveResponse:
|
||||||
properties:
|
properties:
|
||||||
accumulated_recharge:
|
|
||||||
description: 累计充值金额(分)
|
|
||||||
type: integer
|
|
||||||
activated_at:
|
activated_at:
|
||||||
description: 激活时间
|
description: 激活时间
|
||||||
format: date-time
|
format: date-time
|
||||||
@@ -1023,9 +1038,6 @@ components:
|
|||||||
enable_polling:
|
enable_polling:
|
||||||
description: 是否参与轮询
|
description: 是否参与轮询
|
||||||
type: boolean
|
type: boolean
|
||||||
first_commission_paid:
|
|
||||||
description: 一次性佣金是否已发放
|
|
||||||
type: boolean
|
|
||||||
iccid:
|
iccid:
|
||||||
description: 卡ICCID(asset_type=card时有效)
|
description: 卡ICCID(asset_type=card时有效)
|
||||||
type: string
|
type: string
|
||||||
@@ -1103,8 +1115,11 @@ components:
|
|||||||
description: 固件版本号(设备类型时有效)
|
description: 固件版本号(设备类型时有效)
|
||||||
type: string
|
type: string
|
||||||
status:
|
status:
|
||||||
description: 资产状态
|
description: 资产状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 资产状态名称(中文)
|
||||||
|
type: string
|
||||||
supplier:
|
supplier:
|
||||||
description: 供应商
|
description: 供应商
|
||||||
type: string
|
type: string
|
||||||
@@ -1807,6 +1822,9 @@ components:
|
|||||||
payment_status:
|
payment_status:
|
||||||
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||||
type: integer
|
type: integer
|
||||||
|
payment_status_name:
|
||||||
|
description: 支付状态名称(中文)
|
||||||
|
type: string
|
||||||
total_amount:
|
total_amount:
|
||||||
description: 订单总金额(分)
|
description: 订单总金额(分)
|
||||||
type: integer
|
type: integer
|
||||||
@@ -1826,6 +1844,9 @@ components:
|
|||||||
payment_status:
|
payment_status:
|
||||||
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||||
type: integer
|
type: integer
|
||||||
|
payment_status_name:
|
||||||
|
description: 支付状态名称(中文)
|
||||||
|
type: string
|
||||||
total_amount:
|
total_amount:
|
||||||
description: 订单总金额(分)
|
description: 订单总金额(分)
|
||||||
type: integer
|
type: integer
|
||||||
@@ -1851,6 +1872,9 @@ components:
|
|||||||
payment_status:
|
payment_status:
|
||||||
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
description: 支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)
|
||||||
type: integer
|
type: integer
|
||||||
|
payment_status_name:
|
||||||
|
description: 支付状态名称(中文)
|
||||||
|
type: string
|
||||||
total_amount:
|
total_amount:
|
||||||
description: 订单总金额(分)
|
description: 订单总金额(分)
|
||||||
type: integer
|
type: integer
|
||||||
@@ -2005,6 +2029,9 @@ components:
|
|||||||
status:
|
status:
|
||||||
description: 状态 (0:待支付, 1:已支付, 2:已关闭)
|
description: 状态 (0:待支付, 1:已支付, 2:已关闭)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 状态名称(中文)
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
DtoClientRechargeListItem:
|
DtoClientRechargeListItem:
|
||||||
properties:
|
properties:
|
||||||
@@ -3160,6 +3187,9 @@ components:
|
|||||||
status:
|
status:
|
||||||
description: 卡状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)
|
description: 卡状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 卡状态名称(中文)
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
DtoDeviceCardItem:
|
DtoDeviceCardItem:
|
||||||
properties:
|
properties:
|
||||||
@@ -3656,9 +3686,6 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
DtoDeviceResponse:
|
DtoDeviceResponse:
|
||||||
properties:
|
properties:
|
||||||
accumulated_recharge:
|
|
||||||
description: 累计充值金额(分)
|
|
||||||
type: integer
|
|
||||||
activated_at:
|
activated_at:
|
||||||
description: 激活时间
|
description: 激活时间
|
||||||
format: date-time
|
format: date-time
|
||||||
@@ -3683,9 +3710,6 @@ components:
|
|||||||
device_type:
|
device_type:
|
||||||
description: 设备类型
|
description: 设备类型
|
||||||
type: string
|
type: string
|
||||||
first_commission_paid:
|
|
||||||
description: 一次性佣金是否已发放
|
|
||||||
type: boolean
|
|
||||||
id:
|
id:
|
||||||
description: 设备ID
|
description: 设备ID
|
||||||
minimum: 0
|
minimum: 0
|
||||||
@@ -4911,6 +4935,9 @@ components:
|
|||||||
commission_status:
|
commission_status:
|
||||||
description: 佣金状态 (1:待计算, 2:已计算)
|
description: 佣金状态 (1:待计算, 2:已计算)
|
||||||
type: integer
|
type: integer
|
||||||
|
commission_status_name:
|
||||||
|
description: 佣金状态名称(中文)
|
||||||
|
type: string
|
||||||
created_at:
|
created_at:
|
||||||
description: 创建时间
|
description: 创建时间
|
||||||
format: date-time
|
format: date-time
|
||||||
@@ -5085,9 +5112,15 @@ components:
|
|||||||
shelf_status:
|
shelf_status:
|
||||||
description: 上架状态 (1:上架, 2:下架)
|
description: 上架状态 (1:上架, 2:下架)
|
||||||
type: integer
|
type: integer
|
||||||
|
shelf_status_name:
|
||||||
|
description: 上架状态名称(中文)
|
||||||
|
type: string
|
||||||
status:
|
status:
|
||||||
description: 状态 (0:禁用, 1:启用)
|
description: 状态 (0:禁用, 1:启用)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 状态名称(中文)
|
||||||
|
type: string
|
||||||
suggested_retail_price:
|
suggested_retail_price:
|
||||||
description: 建议售价(分)
|
description: 建议售价(分)
|
||||||
type: integer
|
type: integer
|
||||||
@@ -5965,6 +5998,9 @@ components:
|
|||||||
status:
|
status:
|
||||||
description: 状态 (1:待审批, 2:已通过, 3:已拒绝, 4:已退回)
|
description: 状态 (1:待审批, 2:已通过, 3:已拒绝, 4:已退回)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 状态名称(中文)
|
||||||
|
type: string
|
||||||
updated_at:
|
updated_at:
|
||||||
description: 更新时间
|
description: 更新时间
|
||||||
type: string
|
type: string
|
||||||
@@ -6349,6 +6385,9 @@ components:
|
|||||||
status:
|
status:
|
||||||
description: 状态 (0:禁用, 1:启用)
|
description: 状态 (0:禁用, 1:启用)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 状态名称(中文)
|
||||||
|
type: string
|
||||||
updated_at:
|
updated_at:
|
||||||
description: 更新时间
|
description: 更新时间
|
||||||
type: string
|
type: string
|
||||||
@@ -6648,9 +6687,6 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
DtoStandaloneIotCardResponse:
|
DtoStandaloneIotCardResponse:
|
||||||
properties:
|
properties:
|
||||||
accumulated_recharge:
|
|
||||||
description: 累计充值金额(分)
|
|
||||||
type: integer
|
|
||||||
activated_at:
|
activated_at:
|
||||||
description: 激活时间
|
description: 激活时间
|
||||||
format: date-time
|
format: date-time
|
||||||
@@ -6659,6 +6695,9 @@ components:
|
|||||||
activation_status:
|
activation_status:
|
||||||
description: 激活状态 (0:未激活, 1:已激活)
|
description: 激活状态 (0:未激活, 1:已激活)
|
||||||
type: integer
|
type: integer
|
||||||
|
activation_status_name:
|
||||||
|
description: 激活状态名称(中文)
|
||||||
|
type: string
|
||||||
batch_no:
|
batch_no:
|
||||||
description: 批次号
|
description: 批次号
|
||||||
type: string
|
type: string
|
||||||
@@ -6696,9 +6735,6 @@ components:
|
|||||||
enable_polling:
|
enable_polling:
|
||||||
description: 是否参与轮询
|
description: 是否参与轮询
|
||||||
type: boolean
|
type: boolean
|
||||||
first_commission_paid:
|
|
||||||
description: 一次性佣金是否已发放
|
|
||||||
type: boolean
|
|
||||||
iccid:
|
iccid:
|
||||||
description: ICCID
|
description: ICCID
|
||||||
type: string
|
type: string
|
||||||
@@ -6728,9 +6764,15 @@ components:
|
|||||||
network_status:
|
network_status:
|
||||||
description: 网络状态 (0:停机, 1:开机)
|
description: 网络状态 (0:停机, 1:开机)
|
||||||
type: integer
|
type: integer
|
||||||
|
network_status_name:
|
||||||
|
description: 网络状态名称(中文)
|
||||||
|
type: string
|
||||||
real_name_status:
|
real_name_status:
|
||||||
description: 实名状态 (0:未实名, 1:已实名)
|
description: 实名状态 (0:未实名, 1:已实名)
|
||||||
type: integer
|
type: integer
|
||||||
|
real_name_status_name:
|
||||||
|
description: 实名状态名称(中文)
|
||||||
|
type: string
|
||||||
series_id:
|
series_id:
|
||||||
description: 套餐系列ID
|
description: 套餐系列ID
|
||||||
minimum: 0
|
minimum: 0
|
||||||
@@ -6750,6 +6792,9 @@ components:
|
|||||||
status:
|
status:
|
||||||
description: 状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)
|
description: 状态 (1:在库, 2:已分销, 3:已激活, 4:已停用)
|
||||||
type: integer
|
type: integer
|
||||||
|
status_name:
|
||||||
|
description: 状态名称(中文)
|
||||||
|
type: string
|
||||||
supplier:
|
supplier:
|
||||||
description: 供应商
|
description: 供应商
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -151,41 +151,45 @@ func (h *ClientAssetHandler) GetAssetInfo(c *fiber.Ctx) error {
|
|||||||
phone, _ := middleware.GetCustomerPhone(c)
|
phone, _ := middleware.GetCustomerPhone(c)
|
||||||
|
|
||||||
resp := &dto.AssetInfoResponse{
|
resp := &dto.AssetInfoResponse{
|
||||||
BoundPhone: phone,
|
BoundPhone: phone,
|
||||||
AssetType: resolved.Asset.AssetType,
|
AssetType: resolved.Asset.AssetType,
|
||||||
AssetID: resolved.Asset.AssetID,
|
AssetID: resolved.Asset.AssetID,
|
||||||
Identifier: resolved.Identifier,
|
Identifier: resolved.Identifier,
|
||||||
VirtualNo: resolved.Asset.VirtualNo,
|
VirtualNo: resolved.Asset.VirtualNo,
|
||||||
Status: resolved.Asset.Status,
|
Status: resolved.Asset.Status,
|
||||||
RealNameStatus: resolved.Asset.RealNameStatus,
|
StatusName: resolved.Asset.StatusName,
|
||||||
CarrierName: resolved.Asset.CarrierName,
|
RealNameStatus: resolved.Asset.RealNameStatus,
|
||||||
Generation: strconv.Itoa(resolved.Generation),
|
RealNameStatusName: constants.GetRealNameStatusName(resolved.Asset.RealNameStatus),
|
||||||
WalletBalance: resolved.WalletBalance,
|
CarrierName: resolved.Asset.CarrierName,
|
||||||
ActivatedAt: resolved.Asset.ActivatedAt,
|
Generation: strconv.Itoa(resolved.Generation),
|
||||||
CurrentPackage: resolved.Asset.CurrentPackage,
|
WalletBalance: resolved.WalletBalance,
|
||||||
PackageTotalMB: resolved.Asset.PackageTotalMB,
|
ActivatedAt: resolved.Asset.ActivatedAt,
|
||||||
PackageUsedMB: resolved.Asset.PackageUsedMB,
|
CurrentPackage: resolved.Asset.CurrentPackage,
|
||||||
PackageRemainMB: resolved.Asset.PackageRemainMB,
|
PackageTotalMB: resolved.Asset.PackageTotalMB,
|
||||||
DeviceName: resolved.Asset.DeviceName,
|
PackageUsedMB: resolved.Asset.PackageUsedMB,
|
||||||
IMEI: resolved.Asset.IMEI,
|
PackageRemainMB: resolved.Asset.PackageRemainMB,
|
||||||
SN: resolved.Asset.SN,
|
DeviceName: resolved.Asset.DeviceName,
|
||||||
DeviceModel: resolved.Asset.DeviceModel,
|
IMEI: resolved.Asset.IMEI,
|
||||||
DeviceType: resolved.Asset.DeviceType,
|
SN: resolved.Asset.SN,
|
||||||
Manufacturer: resolved.Asset.Manufacturer,
|
DeviceModel: resolved.Asset.DeviceModel,
|
||||||
MaxSimSlots: resolved.Asset.MaxSimSlots,
|
DeviceType: resolved.Asset.DeviceType,
|
||||||
BoundCardCount: resolved.Asset.BoundCardCount,
|
Manufacturer: resolved.Asset.Manufacturer,
|
||||||
Cards: resolved.Asset.Cards,
|
MaxSimSlots: resolved.Asset.MaxSimSlots,
|
||||||
DeviceProtectStatus: resolved.Asset.DeviceProtectStatus,
|
BoundCardCount: resolved.Asset.BoundCardCount,
|
||||||
ICCID: resolved.Asset.ICCID,
|
Cards: resolved.Asset.Cards,
|
||||||
MSISDN: resolved.Asset.MSISDN,
|
DeviceProtectStatus: resolved.Asset.DeviceProtectStatus,
|
||||||
CarrierID: resolved.Asset.CarrierID,
|
ICCID: resolved.Asset.ICCID,
|
||||||
CarrierType: resolved.Asset.CarrierType,
|
MSISDN: resolved.Asset.MSISDN,
|
||||||
NetworkStatus: resolved.Asset.NetworkStatus,
|
CarrierID: resolved.Asset.CarrierID,
|
||||||
ActivationStatus: resolved.Asset.ActivationStatus,
|
CarrierType: resolved.Asset.CarrierType,
|
||||||
CardCategory: resolved.Asset.CardCategory,
|
NetworkStatus: resolved.Asset.NetworkStatus,
|
||||||
BoundDeviceID: resolved.Asset.BoundDeviceID,
|
NetworkStatusName: constants.GetNetworkStatusName(resolved.Asset.NetworkStatus),
|
||||||
BoundDeviceNo: resolved.Asset.BoundDeviceNo,
|
ActivationStatus: resolved.Asset.ActivationStatus,
|
||||||
BoundDeviceName: resolved.Asset.BoundDeviceName,
|
ActivationStatusName: constants.GetActivationStatusName(resolved.Asset.ActivationStatus),
|
||||||
|
CardCategory: resolved.Asset.CardCategory,
|
||||||
|
BoundDeviceID: resolved.Asset.BoundDeviceID,
|
||||||
|
BoundDeviceNo: resolved.Asset.BoundDeviceNo,
|
||||||
|
BoundDeviceName: resolved.Asset.BoundDeviceName,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 调用服务层获取设备实时 Gateway 数据(per D-11)
|
// 调用服务层获取设备实时 Gateway 数据(per D-11)
|
||||||
|
|||||||
@@ -23,11 +23,12 @@ type ClientCreateOrderResponse struct {
|
|||||||
|
|
||||||
// ClientOrderInfo D1 套餐订单信息
|
// ClientOrderInfo D1 套餐订单信息
|
||||||
type ClientOrderInfo struct {
|
type ClientOrderInfo struct {
|
||||||
OrderID uint `json:"order_id" description:"订单ID"`
|
OrderID uint `json:"order_id" description:"订单ID"`
|
||||||
OrderNo string `json:"order_no" description:"订单号"`
|
OrderNo string `json:"order_no" description:"订单号"`
|
||||||
TotalAmount int64 `json:"total_amount" description:"订单总金额(分)"`
|
TotalAmount int64 `json:"total_amount" description:"订单总金额(分)"`
|
||||||
PaymentStatus int `json:"payment_status" description:"支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)"`
|
PaymentStatus int `json:"payment_status" description:"支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)"`
|
||||||
CreatedAt string `json:"created_at" description:"创建时间"`
|
PaymentStatusName string `json:"payment_status_name" description:"支付状态名称(中文)"`
|
||||||
|
CreatedAt string `json:"created_at" description:"创建时间"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientRechargeInfo D1 充值订单信息
|
// ClientRechargeInfo D1 充值订单信息
|
||||||
@@ -36,6 +37,7 @@ type ClientRechargeInfo struct {
|
|||||||
RechargeNo string `json:"recharge_no" description:"充值单号"`
|
RechargeNo string `json:"recharge_no" description:"充值单号"`
|
||||||
Amount int64 `json:"amount" description:"充值金额(分)"`
|
Amount int64 `json:"amount" description:"充值金额(分)"`
|
||||||
Status int `json:"status" description:"状态 (0:待支付, 1:已支付, 2:已关闭)"`
|
Status int `json:"status" description:"状态 (0:待支付, 1:已支付, 2:已关闭)"`
|
||||||
|
StatusName string `json:"status_name" description:"状态名称(中文)"`
|
||||||
AutoPurchaseStatus string `json:"auto_purchase_status" description:"自动购包状态"`
|
AutoPurchaseStatus string `json:"auto_purchase_status" description:"自动购包状态"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,12 +73,13 @@ type ClientOrderListRequest struct {
|
|||||||
|
|
||||||
// ClientOrderListItem D2 客户端订单列表项
|
// ClientOrderListItem D2 客户端订单列表项
|
||||||
type ClientOrderListItem struct {
|
type ClientOrderListItem struct {
|
||||||
OrderID uint `json:"order_id" description:"订单ID"`
|
OrderID uint `json:"order_id" description:"订单ID"`
|
||||||
OrderNo string `json:"order_no" description:"订单号"`
|
OrderNo string `json:"order_no" description:"订单号"`
|
||||||
TotalAmount int64 `json:"total_amount" description:"订单总金额(分)"`
|
TotalAmount int64 `json:"total_amount" description:"订单总金额(分)"`
|
||||||
PaymentStatus int `json:"payment_status" description:"支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)"`
|
PaymentStatus int `json:"payment_status" description:"支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)"`
|
||||||
CreatedAt string `json:"created_at" description:"创建时间"`
|
PaymentStatusName string `json:"payment_status_name" description:"支付状态名称(中文)"`
|
||||||
PackageNames []string `json:"package_names" description:"套餐名称列表"`
|
CreatedAt string `json:"created_at" description:"创建时间"`
|
||||||
|
PackageNames []string `json:"package_names" description:"套餐名称列表"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientOrderListResponse D2 客户端订单列表响应
|
// ClientOrderListResponse D2 客户端订单列表响应
|
||||||
@@ -93,15 +96,16 @@ type ClientOrderListResponse struct {
|
|||||||
|
|
||||||
// ClientOrderDetailResponse D3 客户端订单详情响应
|
// ClientOrderDetailResponse D3 客户端订单详情响应
|
||||||
type ClientOrderDetailResponse struct {
|
type ClientOrderDetailResponse struct {
|
||||||
OrderID uint `json:"order_id" description:"订单ID"`
|
OrderID uint `json:"order_id" description:"订单ID"`
|
||||||
OrderNo string `json:"order_no" description:"订单号"`
|
OrderNo string `json:"order_no" description:"订单号"`
|
||||||
TotalAmount int64 `json:"total_amount" description:"订单总金额(分)"`
|
TotalAmount int64 `json:"total_amount" description:"订单总金额(分)"`
|
||||||
PaymentStatus int `json:"payment_status" description:"支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)"`
|
PaymentStatus int `json:"payment_status" description:"支付状态 (1:待支付, 2:已支付, 3:已取消, 4:已退款)"`
|
||||||
PaymentMethod string `json:"payment_method" description:"支付方式"`
|
PaymentStatusName string `json:"payment_status_name" description:"支付状态名称(中文)"`
|
||||||
CreatedAt string `json:"created_at" description:"创建时间"`
|
PaymentMethod string `json:"payment_method" description:"支付方式"`
|
||||||
PaidAt *string `json:"paid_at,omitempty" description:"支付时间"`
|
CreatedAt string `json:"created_at" description:"创建时间"`
|
||||||
CompletedAt *string `json:"completed_at,omitempty" description:"完成时间"`
|
PaidAt *string `json:"paid_at,omitempty" description:"支付时间"`
|
||||||
Packages []ClientOrderPackageItem `json:"packages" description:"订单套餐列表"`
|
CompletedAt *string `json:"completed_at,omitempty" description:"完成时间"`
|
||||||
|
Packages []ClientOrderPackageItem `json:"packages" description:"订单套餐列表"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClientOrderPackageItem D3 订单套餐项
|
// ClientOrderPackageItem D3 订单套餐项
|
||||||
|
|||||||
@@ -323,11 +323,12 @@ func (s *Service) createPackageOrder(
|
|||||||
return &dto.ClientCreateOrderResponse{
|
return &dto.ClientCreateOrderResponse{
|
||||||
OrderType: "package",
|
OrderType: "package",
|
||||||
Order: &dto.ClientOrderInfo{
|
Order: &dto.ClientOrderInfo{
|
||||||
OrderID: order.ID,
|
OrderID: order.ID,
|
||||||
OrderNo: order.OrderNo,
|
OrderNo: order.OrderNo,
|
||||||
TotalAmount: order.TotalAmount,
|
TotalAmount: order.TotalAmount,
|
||||||
PaymentStatus: order.PaymentStatus,
|
PaymentStatus: order.PaymentStatus,
|
||||||
CreatedAt: formatClientServiceTime(order.CreatedAt),
|
PaymentStatusName: constants.GetOrderPaymentStatusName(order.PaymentStatus),
|
||||||
|
CreatedAt: formatClientServiceTime(order.CreatedAt),
|
||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
@@ -394,13 +395,15 @@ func (s *Service) createForceRechargeOrder(
|
|||||||
s.markClientPurchaseCreated(ctx, redisKey, recharge.RechargeNo)
|
s.markClientPurchaseCreated(ctx, redisKey, recharge.RechargeNo)
|
||||||
*created = true
|
*created = true
|
||||||
|
|
||||||
|
clientStatus := rechargeStatusToClientStatus(recharge.Status)
|
||||||
return &dto.ClientCreateOrderResponse{
|
return &dto.ClientCreateOrderResponse{
|
||||||
OrderType: "recharge",
|
OrderType: "recharge",
|
||||||
Recharge: &dto.ClientRechargeInfo{
|
Recharge: &dto.ClientRechargeInfo{
|
||||||
RechargeID: recharge.ID,
|
RechargeID: recharge.ID,
|
||||||
RechargeNo: recharge.RechargeNo,
|
RechargeNo: recharge.RechargeNo,
|
||||||
Amount: recharge.Amount,
|
Amount: recharge.Amount,
|
||||||
Status: rechargeStatusToClientStatus(recharge.Status),
|
Status: clientStatus,
|
||||||
|
StatusName: clientRechargeStatusName(clientStatus),
|
||||||
AutoPurchaseStatus: recharge.AutoPurchaseStatus,
|
AutoPurchaseStatus: recharge.AutoPurchaseStatus,
|
||||||
},
|
},
|
||||||
PayConfig: buildClientPayConfigFromResult(paymentResult),
|
PayConfig: buildClientPayConfigFromResult(paymentResult),
|
||||||
@@ -709,6 +712,17 @@ func rechargeStatusToClientStatus(status int) int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func clientRechargeStatusName(clientStatus int) string {
|
||||||
|
switch clientStatus {
|
||||||
|
case 0:
|
||||||
|
return "待支付"
|
||||||
|
case 1:
|
||||||
|
return "已支付"
|
||||||
|
default:
|
||||||
|
return "已关闭"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func formatClientServiceTime(t time.Time) string {
|
func formatClientServiceTime(t time.Time) string {
|
||||||
if t.IsZero() {
|
if t.IsZero() {
|
||||||
return ""
|
return ""
|
||||||
@@ -789,12 +803,13 @@ func (s *Service) ListOrders(ctx context.Context, customerID uint, req *dto.Clie
|
|||||||
}
|
}
|
||||||
|
|
||||||
list = append(list, dto.ClientOrderListItem{
|
list = append(list, dto.ClientOrderListItem{
|
||||||
OrderID: order.ID,
|
OrderID: order.ID,
|
||||||
OrderNo: order.OrderNo,
|
OrderNo: order.OrderNo,
|
||||||
TotalAmount: order.TotalAmount,
|
TotalAmount: order.TotalAmount,
|
||||||
PaymentStatus: order.PaymentStatus,
|
PaymentStatus: order.PaymentStatus,
|
||||||
CreatedAt: formatClientServiceTime(order.CreatedAt),
|
PaymentStatusName: constants.GetOrderPaymentStatusName(order.PaymentStatus),
|
||||||
PackageNames: packageNames,
|
CreatedAt: formatClientServiceTime(order.CreatedAt),
|
||||||
|
PackageNames: packageNames,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -835,15 +850,16 @@ func (s *Service) GetOrderDetail(ctx context.Context, customerID uint, orderID u
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &dto.ClientOrderDetailResponse{
|
return &dto.ClientOrderDetailResponse{
|
||||||
OrderID: order.ID,
|
OrderID: order.ID,
|
||||||
OrderNo: order.OrderNo,
|
OrderNo: order.OrderNo,
|
||||||
TotalAmount: order.TotalAmount,
|
TotalAmount: order.TotalAmount,
|
||||||
PaymentStatus: order.PaymentStatus,
|
PaymentStatus: order.PaymentStatus,
|
||||||
PaymentMethod: order.PaymentMethod,
|
PaymentStatusName: constants.GetOrderPaymentStatusName(order.PaymentStatus),
|
||||||
CreatedAt: formatClientServiceTime(order.CreatedAt),
|
PaymentMethod: order.PaymentMethod,
|
||||||
PaidAt: formatClientServiceTimePtr(order.PaidAt),
|
CreatedAt: formatClientServiceTime(order.CreatedAt),
|
||||||
CompletedAt: nil,
|
PaidAt: formatClientServiceTimePtr(order.PaidAt),
|
||||||
Packages: packages,
|
CompletedAt: nil,
|
||||||
|
Packages: packages,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,6 @@ func (g *Generator) AddOperation(method, path, summary, description string, inpu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// u663eu5f0fu4f20u5165u7684 JSON bodyuff0cu7528u4e8e DELETE u7b49u65b9u6cd5u4e0du81eau52a8u751fu6210 requestBody u7684u573au666f
|
// u663eu5f0fu4f20u5165u7684 JSON bodyuff0cu7528u4e8e DELETE u7b49u65b9u6cd5u4e0du81eau52a8u751fu6210 requestBody u7684u573au666f
|
||||||
if body != nil {
|
if body != nil {
|
||||||
tempOp := openapi3.Operation{}
|
tempOp := openapi3.Operation{}
|
||||||
|
|||||||
@@ -278,4 +278,3 @@ func parseCardRows(rows [][]string) (*CSVParseResult, error) {
|
|||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user