refactor(plan):移除套餐相关的所有修改
This commit is contained in:
1 parent
8480d06d21
commit
5d48dbcdc2
73 files changed
+958
-2306
No files matched your search
@@ -144,7 +144,6 @@ type IAdminV1 interface {
|
||||
OrderList(ctx context.Context, req *v1.OrderListReq) (res *v1.OrderListRes, err error)
|
||||
OrderDetail(ctx context.Context, req *v1.OrderDetailReq) (res *v1.OrderDetailRes, err error)
|
||||
OrderRefund(ctx context.Context, req *v1.OrderRefundReq) (res *v1.OrderRefundRes, err error)
|
||||
OrderRefundPreview(ctx context.Context, req *v1.OrderRefundPreviewReq) (res *v1.OrderRefundPreviewRes, err error)
|
||||
OrderComplete(ctx context.Context, req *v1.OrderCompleteReq) (res *v1.OrderCompleteRes, err error)
|
||||
OrderExport(ctx context.Context, req *v1.OrderExportReq) (res *v1.OrderExportRes, err error)
|
||||
AdminMemberCreate(ctx context.Context, req *v1.AdminMemberCreateReq) (res *v1.AdminMemberCreateRes, err error)
|
||||
|
||||
@@ -62,23 +62,7 @@ type OrderRefundReq struct {
|
||||
Reason string `json:"reason"`
|
||||
}
|
||||
|
||||
type OrderRefundRes struct {
|
||||
RefundAmount float64 `json:"refund_amount"`
|
||||
}
|
||||
|
||||
// OrderRefundPreviewReq 退款预览(计算可退金额)
|
||||
type OrderRefundPreviewReq struct {
|
||||
g.Meta `path:"/orders/{id}/refund-preview" method:"get" mime:"json" tags:"管理后台-订单" summary:"退款预览"`
|
||||
Id int64 `json:"id" in:"path" v:"required|min:1"`
|
||||
}
|
||||
|
||||
type OrderRefundPreviewRes struct {
|
||||
CanRefund bool `json:"can_refund"`
|
||||
RefundAmount float64 `json:"refund_amount"`
|
||||
OrderType string `json:"order_type"`
|
||||
OrderStatus string `json:"order_status"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
type OrderRefundRes struct{}
|
||||
|
||||
type OrderCompleteReq struct {
|
||||
g.Meta `path:"/orders/{id}/complete" method:"post" mime:"json" tags:"管理后台-订单" summary:"手动完成订单"`
|
||||
|
||||
+23
-32
@@ -15,24 +15,19 @@ type PlanListReq struct {
|
||||
}
|
||||
|
||||
type PlanItem struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Identifier string `json:"identifier"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price"`
|
||||
Status string `json:"status"`
|
||||
CreditAmount float64 `json:"credit_amount"`
|
||||
BonusAmount float64 `json:"bonus_amount"`
|
||||
ValidityDays int `json:"validity_days"`
|
||||
AllowedModels []string `json:"allowed_models"`
|
||||
PurchaseLimit int `json:"purchase_limit"`
|
||||
PurchaseLimitPeriod string `json:"purchase_limit_period"`
|
||||
Stock int `json:"stock"`
|
||||
TotalPurchased int `json:"total_purchased"`
|
||||
IsRecommended bool `json:"is_recommended"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
CreatedAt *gtime.Time `json:"created_at"`
|
||||
UpdatedAt *gtime.Time `json:"updated_at"`
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Identifier string `json:"identifier"`
|
||||
Description string `json:"description"`
|
||||
MonthlyPrice float64 `json:"monthly_price"`
|
||||
YearlyPrice float64 `json:"yearly_price"`
|
||||
Status string `json:"status"`
|
||||
MonthlyQuotaTokens int64 `json:"monthly_quota_tokens"`
|
||||
AllowedModels []string `json:"allowed_models"`
|
||||
IsRecommended bool `json:"is_recommended"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
CreatedAt *gtime.Time `json:"created_at"`
|
||||
UpdatedAt *gtime.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type PlanListRes struct {
|
||||
@@ -43,20 +38,16 @@ type PlanListRes struct {
|
||||
}
|
||||
|
||||
type PlanCreateReq struct {
|
||||
g.Meta `path:"/plans" method:"post" mime:"json" tags:"管理后台-套餐" summary:"创建套餐"`
|
||||
Name string `json:"name" v:"required#请输入名称"`
|
||||
Identifier string `json:"identifier" v:"required#请输入标识符"`
|
||||
Description string `json:"description"`
|
||||
Price float64 `json:"price" v:"min:0.01#价格必须大于0.01"`
|
||||
CreditAmount float64 `json:"credit_amount" v:"min:0.01#额度必须大于0.01"`
|
||||
BonusAmount float64 `json:"bonus_amount"`
|
||||
ValidityDays int `json:"validity_days" v:"min:1#有效天数至少为1"`
|
||||
AllowedModels []string `json:"allowed_models"`
|
||||
PurchaseLimit int `json:"purchase_limit"`
|
||||
PurchaseLimitPeriod string `json:"purchase_limit_period" v:"in:lifetime,monthly,yearly#限购周期无效"`
|
||||
Stock int `json:"stock"`
|
||||
IsRecommended bool `json:"is_recommended"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
g.Meta `path:"/plans" method:"post" mime:"json" tags:"管理后台-套餐" summary:"创建套餐"`
|
||||
Name string `json:"name" v:"required#请输入名称"`
|
||||
Identifier string `json:"identifier" v:"required#请输入标识符"`
|
||||
Description string `json:"description"`
|
||||
MonthlyPrice float64 `json:"monthly_price"`
|
||||
YearlyPrice float64 `json:"yearly_price"`
|
||||
MonthlyQuotaTokens int64 `json:"monthly_quota_tokens"`
|
||||
AllowedModels []string `json:"allowed_models"`
|
||||
IsRecommended bool `json:"is_recommended"`
|
||||
SortOrder int `json:"sort_order"`
|
||||
}
|
||||
|
||||
type PlanCreateRes struct {
|
||||
|
||||
Reference in new issue
Block a user