Files
cpdaily_xiaozhushou/backed/internal/model/agent_user.go
T
becomer 2e2c161770 feat: init cpdaily-xiaozhushou with blue-green deploy
- 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
2026-07-03 15:37:55 +08:00

22 lines
959 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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"
}