示例#1
0
文件: mss_rep.go 项目: yonglehou/go2o
// 保存消息设置
func (this *MssRep) SaveConfig(userId int, conf *mss.Config) error {
	filePath := "conf/core/mss_conf"
	if userId != 0 {
		filePath = fmt.Sprintf("conf/mch/%d/mss_conf", userId)
	}
	globFile := util.NewGobFile(filePath)
	return globFile.Save(conf)
}
示例#2
0
文件: mss_rep.go 项目: yonglehou/go2o
// 获取短信配置
func (this *MssRep) GetConfig(userId int) *mss.Config {
	conf := mss.Config{}
	filePath := "conf/core/mss_conf"
	if userId != 0 {
		filePath = fmt.Sprintf("conf/mch/%d/mss_conf", userId)
	}
	globFile := util.NewGobFile(filePath)
	handleError(globFile.Unmarshal(&conf))
	return &conf
}
示例#3
0
func NewValueRep(conn db.Connector) valueobject.IValueRep {
	return &valueRep{
		Connector: conn,
		_rstGob:   util.NewGobFile("conf/core/registry"),
		_wxGob:    util.NewGobFile("conf/core/wx_api"),
		_rpGob:    util.NewGobFile("conf/core/register_perm"),
		_numGob:   util.NewGobFile("conf/core/number_conf"),
		_mchGob:   util.NewGobFile("conf/core/mch_conf"),
		_mscGob:   util.NewGobFile("conf/core/mch_sale_conf"),
		_smsGob:   util.NewGobFile("conf/core/sms_conf"),
	}
}
示例#4
0
func NewNotifyRep(conn db.Connector) notify.INotifyRep {
	return &notifyRepImpl{
		_conn:    conn,
		_itemGob: util.NewGobFile("conf/core/mss_notify"),
	}
}