config.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package vars
  2. import (
  3. qutil "app.yhyue.com/moapp/jybase/common"
  4. )
  5. var Config *config
  6. type config struct {
  7. WebPort string `json:"webPort"` //服务端口
  8. Ahead AheadConfig `json:"ahead"` //超前项目配置
  9. Custom CustomConfig `json:"custom"` //定制化报告配置
  10. TestUid []string `json:"testUid"` //测试用户id
  11. ContextOldVipLimit int64 `json:"contextOldVipLimit"` //旧版超级订阅超前订阅时间
  12. ProjectNumLimit int `json:"projectNumLimit"` //自定义报告限制项目个数
  13. }
  14. type AheadConfig struct {
  15. IsEnable bool `json:"isEnable"` //开关
  16. Prop float64 `json:"prop"` //新增用户百分比
  17. DailyTimes int `json:"dailyTimes"` //每日展示次数
  18. SaveClickTimes int `json:"saveClickTimes"` //保留用户的点击量
  19. UpdateCron string `json:"updateCron"` //更新周活用户
  20. Mode int `json:"mode"` // 用户范围: 1-月活 2 周活
  21. }
  22. type CustomConfig struct {
  23. IsEnable bool `json:"isEnable"` //开关
  24. Open bool `json:"open"` //是否运行查询
  25. UpdateCron string `json:"updateCron"` //更新周活用户
  26. SearchLimit struct {
  27. Switch struct {
  28. Stop string `json:"stop"` //搜索停止
  29. Start string `json:"start"` //搜索开始
  30. } `json:"switch"`
  31. TimeOver int `json:"timeOver"` //超时
  32. WaitTime int `json:"waitTime"` //休息
  33. } `json:"searchLimit"`
  34. Mode int `json:"mode"` // 用户范围: 1-月活 2 周活
  35. }
  36. func init() {
  37. //程序配置文件
  38. qutil.ReadConfig(&Config)
  39. }