config.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package config
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. qrpc "app.yhyue.com/moapp/message/model"
  5. )
  6. type config struct {
  7. Nsq struct {
  8. Address string
  9. }
  10. Redis struct {
  11. Address string
  12. }
  13. Mongodb struct {
  14. Address string
  15. Size int
  16. DbName string
  17. ReplSet string
  18. UserName string
  19. Password string
  20. }
  21. Etcd struct {
  22. Hosts []string
  23. Key string
  24. }
  25. DocPoints struct {
  26. AppId string
  27. Open struct {
  28. Max int64
  29. Jyweb_article_open int64
  30. Jydocs_doc_open int64
  31. }
  32. Jywx_subscribe_new int64
  33. Jywx_subscribe_invite int64
  34. Jywx_subscribe_invited int64
  35. }
  36. }
  37. var PushConfig *pushConfig
  38. type pushConfig struct {
  39. Webdomain string `json:"webdomain"`
  40. Weixinrpc string `json:"weixinrpc"`
  41. PushPoolSize int `json:"pushPoolSize"`
  42. WxMsg struct {
  43. Id string
  44. First *qrpc.TmplItem
  45. Keyword1 *qrpc.TmplItem
  46. Keyword2 *qrpc.TmplItem
  47. Keyword3 *qrpc.TmplItem
  48. Keyword4 *qrpc.TmplItem
  49. Remark *qrpc.TmplItem
  50. } `json:"wxTplMsg"`
  51. TestId string `json:"testId"`
  52. }
  53. var Config *config
  54. func init() {
  55. common.ReadConfig(&Config)
  56. common.ReadConfig("./push.json", &PushConfig)
  57. }