2e2c161770
- backed/: Go Fiber backend with cpdaily integration - frondend/: Vue 3 + Vite frontend - Dockerfile: multi-stage build (Node → Go → Alpine) - deploy/docker-compose.yml: production compose file - .woodpecker/build.yml: CI/CD with blue-green zero-downtime deploy - /health endpoint for deployment health checks - Port 8884/8885 blue-green swap via 1Panel OpenResty
22 lines
959 B
Go
22 lines
959 B
Go
package model
|
||
|
||
import "time"
|
||
|
||
// AgentUser 代理/管理员
|
||
type AgentUser struct {
|
||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||
Username string `gorm:"type:varchar(255);uniqueIndex;not null" json:"username"`
|
||
Password string `gorm:"type:varchar(255);not null" json:"-"`
|
||
Role string `gorm:"type:varchar(16);not null;default:agent" json:"role"` // admin / agent
|
||
ParentID *uint `gorm:"index" json:"parentId"` // 上级代理ID(admin为null)
|
||
Rate float64 `gorm:"type:decimal(5,2);not null;default:1.00" json:"rate"` // 费率倍率 1.00=100%
|
||
Balance float64 `gorm:"type:decimal(12,2);not null;default:0" json:"balance"`
|
||
Status string `gorm:"type:varchar(16);not null;default:active" json:"status"` // active / disabled
|
||
CreatedAt time.Time `json:"createdAt"`
|
||
UpdatedAt time.Time `json:"updatedAt"`
|
||
}
|
||
|
||
func (AgentUser) TableName() string {
|
||
return "agent_users"
|
||
}
|