config.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. Registedate int64
  28. }
  29. type mysqlConfig struct {
  30. DbName string
  31. Address string
  32. UserName string
  33. PassWord string
  34. MaxOpenConns int
  35. MaxIdleConns int
  36. }
  37. type mgoConf struct {
  38. Address string
  39. Size int
  40. DbName string
  41. ReplSet string
  42. UserName string
  43. Password string
  44. Collection string
  45. Collection_back string
  46. }
  47. var ConfigJson Config
  48. type WxTmplMsg struct {
  49. RpcAddr string `json:"rpcAddr"`
  50. CloseNotice string `json:"closeNotice"`
  51. Limit struct {
  52. Total int64 `json:"total"`
  53. OneDayLimit int64 `json:"oneDayLimit"`
  54. DuringMine int `json:"duringMine"`
  55. Alert struct {
  56. Nums []int64 `json:"nums"`
  57. ToMail []string `json:"toMail"`
  58. CcMail []string `json:"ccMail"`
  59. } `json:"alert"`
  60. } `json:"limit"`
  61. }