1.go
1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package confdemo
import (
"apigame/configs/confbase"
"apigame/service-common/svconst"
"fmt"
)
// DemoConfig 房间排行活动配置 分析后数据
type DemoConfig struct {
Raw *DemoConfigRaw `json:"-"`
Id int64 // ID
OpenLevel int // 开启等级
}
func (c *DemoConfig) ConfInfo(suffix string) *confbase.ConfInfo {
tableName := "s_demo"
return &confbase.ConfInfo{
DbMysql: svconst.DbConfig,
TableName: tableName + suffix,
KeyName: "id",
CacheKey: fmt.Sprintf("%s:%s:%s", svconst.REDIS_CACHEP_REFIX, tableName, suffix),
CacheTime: 300,
}
}
// DemoConfigRaw 房间排行活动配置 原始数据
type DemoConfigRaw struct {
Id int64 `gorm:"column:id;primaryKey"` // ID
OpenLevel int // 开启等级
PreviewTime int64 // 预告时间
StartTime int64 // 开始时间
EndTime int64 // 结束时间
Robot string // 机器人配置
Room string // 房间配置
Ver string // 版本号
Status int // 状态 0=关闭 1=开启
UpdateTime int64 // 修改时间戳
}