config.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. SurvivalTime int
  14. SaveConcurrency int // 消息保存并发数
  15. WxWebdomain string `json:"WxWebdomain"`
  16. WxTmplConfig WxTmplMsg `json:"WxTmplConfig"`
  17. PushGrpcServer string `json:"PushGrpcServer"`
  18. Mail []struct {
  19. Addr string `json:"addr"`
  20. Port int `json:"port"`
  21. Pwd string `json:"pwd"`
  22. User string `json:"user"`
  23. } `json:"mail"`
  24. TidbEng string `json:"Tidb"`
  25. ClassSearchList []int64 `json:"ClassSearchList"` // 需要按照messageclass 查询的groupId
  26. EquityInfoMsgType int64 `json:"EquityInfoMsgType"` // 营销权益消息需要特殊处理的消息类型
  27. }
  28. type mysqlConfig struct {
  29. DbName string
  30. Address string
  31. UserName string
  32. PassWord string
  33. MaxOpenConns int
  34. MaxIdleConns int
  35. }
  36. type mgoConf struct {
  37. Address string
  38. Size int
  39. DbName string
  40. ReplSet string
  41. UserName string
  42. Password string
  43. Collection string
  44. Collection_back string
  45. }
  46. var ConfigJson Config
  47. type WxTmplMsg struct {
  48. RpcAddr string `json:"rpcAddr"`
  49. CloseNotice string `json:"closeNotice"`
  50. Limit struct {
  51. Total int64 `json:"total"`
  52. OneDayLimit int64 `json:"oneDayLimit"`
  53. DuringMine int `json:"duringMine"`
  54. Alert struct {
  55. Nums []int64 `json:"nums"`
  56. ToMail []string `json:"toMail"`
  57. CcMail []string `json:"ccMail"`
  58. } `json:"alert"`
  59. } `json:"limit"`
  60. }