fix: 修复授权详情API返回格式,重构授权管理页面表格和批量操作
This commit is contained in:
@@ -568,9 +568,11 @@ func handleGetAgentAppDetail(c *gin.Context) {
|
||||
}
|
||||
|
||||
type CardTypeResponse struct {
|
||||
ID uint `json:"id"`
|
||||
CardTypeID uint `json:"card_type_id"`
|
||||
Name string `json:"name"`
|
||||
BillingType string `json:"billing_type"`
|
||||
Price float64 `json:"price"`
|
||||
OriginPrice float64 `json:"origin_price"`
|
||||
CanGenerate bool `json:"can_generate"`
|
||||
}
|
||||
|
||||
@@ -583,6 +585,7 @@ func handleGetAgentAppDetail(c *gin.Context) {
|
||||
AppName string `json:"app_name"`
|
||||
Discount float64 `json:"discount"`
|
||||
Status string `json:"status"`
|
||||
Balance float64 `json:"balance"`
|
||||
CardTypes []CardTypeResponse `json:"card_types"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
}
|
||||
@@ -590,9 +593,11 @@ func handleGetAgentAppDetail(c *gin.Context) {
|
||||
var cardTypes []CardTypeResponse
|
||||
for _, ct := range agentApp.CardTypes {
|
||||
cardTypes = append(cardTypes, CardTypeResponse{
|
||||
ID: ct.CardTypeID,
|
||||
CardTypeID: ct.CardTypeID,
|
||||
Name: ct.CardType.Name,
|
||||
Price: ct.CardType.Price,
|
||||
BillingType: ct.CardType.RechargeType,
|
||||
Price: ct.Price,
|
||||
OriginPrice: ct.CardType.Price,
|
||||
CanGenerate: ct.CanGenerate,
|
||||
})
|
||||
}
|
||||
@@ -605,6 +610,7 @@ func handleGetAgentAppDetail(c *gin.Context) {
|
||||
AppName: application.Name,
|
||||
Discount: agentApp.Discount,
|
||||
Status: agentApp.Status,
|
||||
Balance: agent.Balance,
|
||||
CardTypes: cardTypes,
|
||||
CreatedAt: agentApp.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
@@ -613,7 +619,9 @@ func handleGetAgentAppDetail(c *gin.Context) {
|
||||
result.AgentEmail = *agent.Email
|
||||
}
|
||||
|
||||
response.Success(c, result)
|
||||
response.Success(c, gin.H{
|
||||
"agent_app": result,
|
||||
})
|
||||
}
|
||||
|
||||
func handleUpdateAgentApp(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user