config.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package config
  2. import (
  3. "github.com/zeromicro/go-zero/zrpc"
  4. )
  5. type Config struct {
  6. zrpc.RpcServerConf
  7. DataSource *mysqlConfig // 手动代码
  8. BaseSource *mysqlConfig // 手动代码
  9. WebRpcPort int
  10. //Mysql string
  11. RedisAddr string `json:"RedisAddr"`
  12. Mongodb *mgoConf
  13. Bidding *mgoConf
  14. SurvivalTime int
  15. SaveConcurrency int // 消息保存并发数
  16. WxWebdomain string `json:"WxWebdomain"`
  17. WxTmplConfig WxTmplMsg `json:"WxTmplConfig"`
  18. PushGrpcServer string `json:"PushGrpcServer"`
  19. Mail []struct {
  20. Addr string `json:"addr"`
  21. Port int `json:"port"`
  22. Pwd string `json:"pwd"`
  23. User string `json:"user"`
  24. } `json:"mail"`
  25. Registedate int64
  26. TidbEng string `json:"Tidb"`
  27. ClassSearchList []int64 `json:"ClassSearchList"` // 需要按照messageclass 查询的groupId
  28. Clickhouse *CHouseConfig
  29. GlobMsgLoadTime string `json:"GlobMsgLoadTime"`
  30. FreeIntelTime string `json:"FreeIntelTime"`
  31. PayIntelTime string `json:"PayIntelTime"`
  32. FreePushNumber int `json:"FreePushNumber"`
  33. PayPushNumber int `json:"PayPushNumber"`
  34. EquityInfoMsgType int64 `json:"EquityInfoMsgType"` // 营销权益消息需要特殊处理的消息类型
  35. NewUserMsgTitle string `json:"NewUserMsgTitle"`
  36. IsFilterActive bool `json:"IsFilterActive"`
  37. RedisFailureTime int `json:"RedisFailureTime"` //用户消息缓存失效时间
  38. ThreadCount int `json:"ThreadCount"` //线程锁,配置15个,用户hash取锁
  39. MsgLogLimit int `json:"MsgLogLimit"` //加载消息记录条数
  40. MsgTitlePS string `json:"MsgTitlePS"` //商情推荐标题前后缀
  41. }
  42. type CHouseConfig struct {
  43. Addr string
  44. UserName string
  45. Password string
  46. DbName string
  47. MaxIdleConns int
  48. MaxOpenConns int
  49. }
  50. type mysqlConfig struct {
  51. DbName string
  52. Address string
  53. UserName string
  54. PassWord string
  55. MaxOpenConns int
  56. MaxIdleConns int
  57. }
  58. type mgoConf struct {
  59. Address string
  60. Size int
  61. DbName string
  62. ReplSet string
  63. UserName string
  64. Password string
  65. Collection string
  66. Collection_back string
  67. }
  68. var ConfigJson Config
  69. type WxTmplMsg struct {
  70. RpcAddr string `json:"rpcAddr"`
  71. CloseNotice string `json:"closeNotice"`
  72. Limit struct {
  73. Total int64 `json:"total"`
  74. OneDayLimit int64 `json:"oneDayLimit"`
  75. DuringMine int `json:"duringMine"`
  76. Alert struct {
  77. Nums []int64 `json:"nums"`
  78. ToMail []string `json:"toMail"`
  79. CcMail []string `json:"ccMail"`
  80. } `json:"alert"`
  81. } `json:"limit"`
  82. }