config.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. package config
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. qrpc "app.yhyue.com/moapp/message/model"
  5. "github.com/gogf/gf/v2/frame/g"
  6. "github.com/gogf/gf/v2/os/gcfg"
  7. )
  8. type config struct {
  9. Nsq struct {
  10. Address string
  11. }
  12. Redis struct {
  13. Address string
  14. }
  15. Mongodb struct {
  16. Address string
  17. Size int
  18. DbName string
  19. ReplSet string
  20. UserName string
  21. Password string
  22. }
  23. Etcd struct {
  24. Hosts []string
  25. Key string
  26. }
  27. DocPoints struct {
  28. AppId string
  29. Open struct {
  30. Max int64
  31. Jyweb_article_open int64
  32. Jydocs_doc_open int64
  33. }
  34. Jywx_subscribe_new int64
  35. Jywx_subscribe_invite int64
  36. Jywx_subscribe_invited int64
  37. }
  38. }
  39. var (
  40. PushConfig *pushConfig
  41. )
  42. type LotteryReceiveReq struct {
  43. UserName string `json:"userName"`
  44. UserId string `json:"userId"`
  45. LotteryIdArr string `json:"lotteryIdArr"`
  46. }
  47. type pushConfig struct {
  48. Webdomain string `json:"webdomain"`
  49. Weixinrpc string `json:"weixinrpc"`
  50. PushPoolSize int `json:"pushPoolSize"`
  51. WxMsg struct {
  52. Id string
  53. First *qrpc.TmplItem
  54. Keyword1 *qrpc.TmplItem
  55. Keyword2 *qrpc.TmplItem
  56. Keyword3 *qrpc.TmplItem
  57. Keyword4 *qrpc.TmplItem
  58. Remark *qrpc.TmplItem
  59. } `json:"wxTplMsg"`
  60. TestId string `json:"testId"`
  61. DelayedTime int `json:"delayedTime"`
  62. Subvip string `json:"subvip"`
  63. Points string `json:"points"`
  64. FullReduce string `json:"fullReduce"`
  65. }
  66. //var Config *config
  67. func init() {
  68. //推送配置文件
  69. common.ReadConfig("./etc/push.json", &PushConfig)
  70. //系统配置文件
  71. //common.ReadConfig(&Config)
  72. g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("./etc/config.yaml")
  73. }