6bb47d4b00
- Add full admin REST API: auth, API keys, chains, chain tokens, wallets, orders, RPC nodes, settings, dashboard stats, notifications - Add JWT-based admin authentication and API key auth middleware - Add multi-chain listeners: BSC, ETH, Polygon, Plasma, EVM WebSocket - Add RPC node health check job with automatic failover - Add Telegram notification channel for order events - Add installer for first-run database initialization - Add new DB models: admin_user, api_key, chain, chain_token, rpc_node, settings, notification_channel - Add order statistics aggregation (daily/monthly/by-chain) - Serve built admin SPA from embedded www/ assets - Add comprehensive test coverage for all new features
22 lines
648 B
Go
22 lines
648 B
Go
package mdb
|
|
|
|
import "github.com/dromara/carbon/v2"
|
|
|
|
const (
|
|
AdminUserStatusEnable = 1
|
|
AdminUserStatusDisable = 2
|
|
)
|
|
|
|
type AdminUser struct {
|
|
Username string `gorm:"column:username;uniqueIndex:admin_users_username_uindex;size:64" json:"username" example:"admin"`
|
|
PasswordHash string `gorm:"column:password_hash;size:255" json:"-"`
|
|
// 状态 1=启用 2=禁用
|
|
Status int `gorm:"column:status;default:1" json:"status" enums:"1,2" example:"1"`
|
|
LastLoginAt carbon.Time `gorm:"column:last_login_at" json:"last_login_at" example:"2026-04-16 12:00:00"`
|
|
BaseModel
|
|
}
|
|
|
|
func (a *AdminUser) TableName() string {
|
|
return "admin_users"
|
|
}
|