config.go 2.6 KB

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