123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package service
- import (
- "crazy-fox-backend-api/model"
- "github.com/jmoiron/sqlx/types"
- jsoniter "github.com/json-iterator/go"
- "github.com/pkg/errors"
- )
- type actDailyChest struct{}
- // 展示数据处理
- func (This *actDailyChest) handleActShow(confInfo *model.ActConfInfo) (json types.JSONText, err error) {
- var conf model.DailyChestConf
- if err = jsoniter.Unmarshal(confInfo.RewardConf, &conf); err != nil {
- return nil, errors.Wrap(err, "每日宝箱 配置Json解析失败")
- }
- if json, err = jsoniter.Marshal(conf); err != nil {
- return nil, errors.Wrap(err, "每日宝箱 配置序列化失败")
- }
- return
- }
- // 保存数据处理
- func (This *actDailyChest) handleActSave(confInfo *model.ActConfInfo) (err error) {
- var conf model.DailyChestConf
- if err = jsoniter.Unmarshal(confInfo.ActShowConf, &conf); err != nil {
- return errors.Wrap(err, "每日宝箱 配置Json解析失败")
- }
- if confInfo.RewardConf, err = jsoniter.Marshal(conf); err != nil {
- return errors.Wrap(err, "每日宝箱 配置序列化失败")
- }
- return
- }
- // 分层数据处理
- func (This *actDailyChest) handleActRewardSection(*model.ActConfInfo, ...map[string]any) error {
- return nil
- }
- // 导入数据处理
- func (This *actDailyChest) handleActImport(*model.ActDetailInfo, [][][]string) (types.JSONText, error) {
- return nil, errors.New("暂不支持此活动类型导入")
- }
|