refactor: 移除佣金比例字段,将developer统一为admin
This commit is contained in:
@@ -40,7 +40,6 @@ type AgentTreeNode struct {
|
||||
CreatedAt string `json:"created_at"`
|
||||
LastLoginAt string `json:"last_login_at"`
|
||||
Balance float64 `json:"balance"`
|
||||
Commission float64 `json:"commission"`
|
||||
CanCreateAgent bool `json:"can_create_agent"`
|
||||
CardsCount int `json:"cards_count"`
|
||||
ChildAgentsCount int `json:"child_agents_count"`
|
||||
@@ -69,7 +68,6 @@ func handleGetAgents(c *gin.Context) {
|
||||
CreatedAt string `json:"created_at"`
|
||||
LastLoginAt string `json:"last_login_at"`
|
||||
Balance float64 `json:"balance"`
|
||||
Commission float64 `json:"commission"`
|
||||
CanCreateAgent bool `json:"can_create_agent"`
|
||||
CardsCount int `json:"cards_count"`
|
||||
ChildAgentsCount int `json:"child_agents_count"`
|
||||
@@ -110,7 +108,6 @@ func handleGetAgents(c *gin.Context) {
|
||||
CreatedAt: user.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
LastLoginAt: lastLoginAt,
|
||||
Balance: user.Balance,
|
||||
Commission: user.Commission,
|
||||
CanCreateAgent: user.CanCreateAgent,
|
||||
CardsCount: int(cardsCount),
|
||||
ChildAgentsCount: int(childAgentsCount),
|
||||
@@ -185,7 +182,6 @@ func handleGetAgentsTree(c *gin.Context) {
|
||||
CreatedAt: user.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
LastLoginAt: lastLoginAt,
|
||||
Balance: user.Balance,
|
||||
Commission: user.Commission,
|
||||
CanCreateAgent: user.CanCreateAgent,
|
||||
CardsCount: int(cardsCount),
|
||||
ChildAgentsCount: int(childAgentsCount),
|
||||
@@ -217,7 +213,6 @@ func handleCreateAgent(c *gin.Context) {
|
||||
Email string `json:"email"`
|
||||
Password string `json:"password" binding:"required"`
|
||||
ParentAgentID *uint `json:"parent_agent_id"`
|
||||
Commission float64 `json:"commission"`
|
||||
CanCreateAgent bool `json:"can_create_agent"`
|
||||
Balance float64 `json:"balance"`
|
||||
}
|
||||
@@ -259,7 +254,6 @@ func handleCreateAgent(c *gin.Context) {
|
||||
Role: "agent",
|
||||
Status: "active",
|
||||
ParentAgentID: req.ParentAgentID,
|
||||
Commission: req.Commission,
|
||||
CanCreateAgent: req.CanCreateAgent,
|
||||
Balance: req.Balance,
|
||||
}
|
||||
@@ -365,7 +359,6 @@ func handleGetAgentDetail(c *gin.Context) {
|
||||
"role": user.Role,
|
||||
"parent_agent_id": user.ParentAgentID,
|
||||
"parent_agent_name": parentAgentName,
|
||||
"commission": user.Commission,
|
||||
"can_create_agent": user.CanCreateAgent,
|
||||
"balance": user.Balance,
|
||||
"created_at": user.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
@@ -387,7 +380,6 @@ func handleUpdateAgent(c *gin.Context) {
|
||||
|
||||
var req struct {
|
||||
ParentAgentID *uint `json:"parent_agent_id"`
|
||||
Commission *float64 `json:"commission"`
|
||||
Email *string `json:"email"`
|
||||
Password *string `json:"password"`
|
||||
CanCreateAgent *bool `json:"can_create_agent"`
|
||||
@@ -414,9 +406,6 @@ func handleUpdateAgent(c *gin.Context) {
|
||||
if req.Email != nil {
|
||||
user.Email = req.Email
|
||||
}
|
||||
if req.Commission != nil {
|
||||
user.Commission = *req.Commission
|
||||
}
|
||||
if req.Password != nil && *req.Password != "" {
|
||||
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(*req.Password), bcrypt.DefaultCost)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user