config.go 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. }
  38. type CHouseConfig struct {
  39. Addr string
  40. UserName string
  41. Password string
  42. DbName string
  43. MaxIdleConns int
  44. MaxOpenConns int
  45. }
  46. type mysqlConfig struct {
  47. DbName string
  48. Address string
  49. UserName string
  50. PassWord string
  51. MaxOpenConns int
  52. MaxIdleConns int
  53. }
  54. type mgoConf struct {
  55. Address string
  56. Size int
  57. DbName string
  58. ReplSet string
  59. UserName string
  60. Password string
  61. Collection string
  62. Collection_back string
  63. }
  64. var ConfigJson Config
  65. type WxTmplMsg struct {
  66. RpcAddr string `json:"rpcAddr"`
  67. CloseNotice string `json:"closeNotice"`
  68. Limit struct {
  69. Total int64 `json:"total"`
  70. OneDayLimit int64 `json:"oneDayLimit"`
  71. DuringMine int `json:"duringMine"`
  72. Alert struct {
  73. Nums []int64 `json:"nums"`
  74. ToMail []string `json:"toMail"`
  75. CcMail []string `json:"ccMail"`
  76. } `json:"alert"`
  77. } `json:"limit"`
  78. }