package config import ( "app.yhyue.com/moapp/jybase/common" qrpc "app.yhyue.com/moapp/message/model" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/os/gcfg" ) type config struct { Nsq struct { Address string } Redis struct { Address string } Mongodb struct { Address string Size int DbName string ReplSet string UserName string Password string } Etcd struct { Hosts []string Key string } DocPoints struct { AppId string Open struct { Max int64 Jyweb_article_open int64 Jydocs_doc_open int64 } Jywx_subscribe_new int64 Jywx_subscribe_invite int64 Jywx_subscribe_invited int64 } } type msgConf struct { Title string Content string MsgType int64 Appid string PcUrl string MobileUrl string } var ( PushConfig *pushConfig TaskConf *taskConf ) type LotteryReceiveReq struct { UserName string `json:"userName"` UserId string `json:"userId"` LotteryIdArr string `json:"lotteryIdArr"` } type pushConfig struct { Webdomain string `json:"webdomain"` Weixinrpc string `json:"weixinrpc"` PushPoolSize int `json:"pushPoolSize"` WxMsg struct { Id string First *qrpc.TmplItem Keyword1 *qrpc.TmplItem Keyword2 *qrpc.TmplItem Keyword3 *qrpc.TmplItem Keyword4 *qrpc.TmplItem Remark *qrpc.TmplItem } `json:"wxTplMsg"` TestId string `json:"testId"` DelayedTime int `json:"delayedTime"` Subvip string `json:"subvip"` Points string `json:"points"` FullReduce string `json:"fullReduce"` Messages struct { NewUser *msgConf ConfirmChallenge *msgConf } } type OrderMonitorConfig struct { DateSpecial string // 特别奖品活动日期 OpenCron string // 每天开启订单查询的任务 SelectCron string // 每5分钟查询一次 WinNumberDaily int // 每天第xx个付款获得奖品 WinNumbersSpecial int // 第xxx个付款获得特殊奖品 Switch bool // 是否开启定时任务 ActivityMode int // # 1. 每天第多少名 2. 活动期间内一共第多少名(双十二) Rules []struct { // 双十二活动规则 WinNum []int // 获奖的下单顺序 Mold int // 奖品 3 免单 Products []string // # 参加活动的产品 PriceLimit bool // 是否有实付金额限制 PriceStart int // 实付金额最低 单位(分) PriceEnd int // 实付金额最高 单位(分) } } type taskConf struct { TaskStartTime int64 `json:"taskStartTime"` //限时活动开始时间 NewTask []*TaskStruct `json:"newTask"` //新手任务 OldTask []*TaskStruct `json:"oldTask"` //老用户限时任务 TaskDayTime int64 `json:"taskDayTime"` //活动时间 } type TaskStruct struct { Name string `json:"name"` Desc string `json:"desc"` PcHref string `json:"pcHref"` AppHref string `json:"appHref"` WxHref string `json:"wxHref"` Point int `json:"point"` Icon string `json:"icon"` Type string `json:"type"` Distinguish int `json:"distinguish"` // 0不用区分身份 1区分身份 } //var Config *config func init() { //推送配置文件 common.ReadConfig("./etc/push.json", &PushConfig) //系统配置文件 //common.ReadConfig(&Config) g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("./etc/config.yaml") //任务配置文件 common.ReadConfig("./etc/task.json", &TaskConf) }