config.go 2.8 KB

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