| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- package daytask
- import (
- "time"
- )
- // DtAdmin 管理员表
- type DtAdmin struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:管理员ID"`
- Username string `json:"username" gorm:"column:username;type:varchar(64);not null;uniqueIndex:uk_username;comment:用户名"`
- Password string `json:"-" gorm:"column:password;type:varchar(128);not null;comment:密码"`
- Nickname string `json:"nickname" gorm:"column:nickname;type:varchar(64);comment:昵称"`
- Avatar string `json:"avatar" gorm:"column:avatar;type:varchar(255);comment:头像"`
- Email string `json:"email" gorm:"column:email;type:varchar(128);comment:邮箱"`
- Phone string `json:"phone" gorm:"column:phone;type:varchar(32);comment:手机号"`
- RoleId int64 `json:"roleId" gorm:"column:role_id;type:bigint;default:0;index:idx_role_id;comment:角色ID"`
- Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 0=禁用 1=启用"`
- LastLoginTime int64 `json:"lastLoginTime" gorm:"column:last_login_time;type:bigint;comment:最后登录时间"`
- LastLoginIp string `json:"lastLoginIp" gorm:"column:last_login_ip;type:varchar(64);comment:最后登录IP"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
- UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
- DeletedAt *time.Time `json:"deletedAt,omitempty" gorm:"column:deleted_at;type:datetime;index;comment:删除时间"`
- }
- func (*DtAdmin) TableName() string {
- return "dt_admin"
- }
- func NewDtAdmin() *DtAdmin {
- return &DtAdmin{}
- }
- // DtRole 角色表
- type DtRole struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:角色ID"`
- Name string `json:"name" gorm:"column:name;type:varchar(64);not null;comment:角色名称"`
- Code string `json:"code" gorm:"column:code;type:varchar(64);not null;uniqueIndex:uk_code;comment:角色编码"`
- Description string `json:"description" gorm:"column:description;type:varchar(255);comment:角色描述"`
- MenuIds string `json:"menuIds" gorm:"column:menu_ids;type:json;comment:菜单权限ID列表"`
- Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 0=禁用 1=启用"`
- Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
- UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
- DeletedAt *time.Time `json:"deletedAt,omitempty" gorm:"column:deleted_at;type:datetime;index;comment:删除时间"`
- }
- func (*DtRole) TableName() string {
- return "dt_role"
- }
- func NewDtRole() *DtRole {
- return &DtRole{}
- }
- // DtMenu 菜单表
- type DtMenu struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:菜单ID"`
- ParentId int64 `json:"parentId" gorm:"column:parent_id;type:bigint;default:0;index:idx_parent_id;comment:父级ID"`
- Name string `json:"name" gorm:"column:name;type:varchar(64);not null;comment:菜单名称"`
- Path string `json:"path" gorm:"column:path;type:varchar(255);comment:路由路径"`
- Component string `json:"component" gorm:"column:component;type:varchar(255);comment:组件路径"`
- Icon string `json:"icon" gorm:"column:icon;type:varchar(64);comment:图标"`
- Type int8 `json:"type" gorm:"column:type;type:tinyint;default:1;comment:类型: 1=目录 2=菜单 3=按钮"`
- Permission string `json:"permission" gorm:"column:permission;type:varchar(128);comment:权限标识"`
- Visible int8 `json:"visible" gorm:"column:visible;type:tinyint;default:1;comment:是否可见: 0=隐藏 1=显示"`
- Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 0=禁用 1=启用"`
- Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
- UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
- }
- func (*DtMenu) TableName() string {
- return "dt_menu"
- }
- func NewDtMenu() *DtMenu {
- return &DtMenu{}
- }
- // DtConfig 系统配置表
- type DtConfig struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:配置ID"`
- Group string `json:"group" gorm:"column:group;type:varchar(64);not null;uniqueIndex:uk_group_key,priority:1;comment:配置分组"`
- Key string `json:"key" gorm:"column:key;type:varchar(128);not null;uniqueIndex:uk_group_key,priority:2;comment:配置键"`
- Value string `json:"value" gorm:"column:value;type:text;comment:配置值"`
- Type string `json:"type" gorm:"column:type;type:varchar(32);default:string;comment:类型: string/number/boolean/json"`
- Name string `json:"name" gorm:"column:name;type:varchar(128);comment:配置名称"`
- Description string `json:"description" gorm:"column:description;type:varchar(255);comment:配置描述"`
- Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 0=禁用 1=启用"`
- Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
- UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
- }
- func (*DtConfig) TableName() string {
- return "dt_config"
- }
- func NewDtConfig() *DtConfig {
- return &DtConfig{}
- }
- // DtOperationLog 操作日志表
- type DtOperationLog struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:日志ID"`
- AdminId int64 `json:"adminId" gorm:"column:admin_id;type:bigint;default:0;index:idx_admin_id;comment:管理员ID"`
- AdminName string `json:"adminName" gorm:"column:admin_name;type:varchar(64);comment:管理员名称"`
- Module string `json:"module" gorm:"column:module;type:varchar(64);comment:操作模块"`
- Action string `json:"action" gorm:"column:action;type:varchar(64);comment:操作动作"`
- Method string `json:"method" gorm:"column:method;type:varchar(16);comment:请求方法"`
- Path string `json:"path" gorm:"column:path;type:varchar(255);comment:请求路径"`
- Params string `json:"params" gorm:"column:params;type:text;comment:请求参数"`
- Result string `json:"result" gorm:"column:result;type:text;comment:响应结果"`
- Ip string `json:"ip" gorm:"column:ip;type:varchar(64);comment:操作IP"`
- UserAgent string `json:"userAgent" gorm:"column:user_agent;type:varchar(512);comment:UserAgent"`
- Duration int `json:"duration" gorm:"column:duration;type:int;default:0;comment:耗时(ms)"`
- Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 0=失败 1=成功"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;index:idx_created_at;comment:创建时间"`
- }
- func (*DtOperationLog) TableName() string {
- return "dt_operation_log"
- }
- func NewDtOperationLog() *DtOperationLog {
- return &DtOperationLog{}
- }
- // DtDailyStats 每日统计表
- type DtDailyStats struct {
- Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:ID"`
- Date string `json:"date" gorm:"column:date;type:date;not null;uniqueIndex:uk_date;comment:统计日期"`
- NewUserCount int `json:"newUserCount" gorm:"column:new_user_count;type:int;default:0;comment:新增用户数"`
- ActiveUserCount int `json:"activeUserCount" gorm:"column:active_user_count;type:int;default:0;comment:活跃用户数"`
- TaskPublishCount int `json:"taskPublishCount" gorm:"column:task_publish_count;type:int;default:0;comment:发布任务数"`
- TaskCompleteCount int `json:"taskCompleteCount" gorm:"column:task_complete_count;type:int;default:0;comment:完成任务数"`
- WithdrawCount int `json:"withdrawCount" gorm:"column:withdraw_count;type:int;default:0;comment:提现笔数"`
- WithdrawAmount float64 `json:"withdrawAmount" gorm:"column:withdraw_amount;type:decimal(18,2);default:0.00;comment:提现金额"`
- TaskRewardAmount float64 `json:"taskRewardAmount" gorm:"column:task_reward_amount;type:decimal(18,2);default:0.00;comment:任务奖励金额"`
- InviteRewardAmount float64 `json:"inviteRewardAmount" gorm:"column:invite_reward_amount;type:decimal(18,2);default:0.00;comment:推广奖励金额"`
- LevelPurchaseAmount float64 `json:"levelPurchaseAmount" gorm:"column:level_purchase_amount;type:decimal(18,2);default:0.00;comment:等级购买金额"`
- CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
- }
- func (*DtDailyStats) TableName() string {
- return "dt_daily_stats"
- }
- func NewDtDailyStats() *DtDailyStats {
- return &DtDailyStats{}
- }
|