act_discount_icon.go 926 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package service
  2. import (
  3. "crazy-fox-backend-api/model"
  4. "github.com/pkg/errors"
  5. )
  6. const discountIconSkin = "discount_icon"
  7. // GetOtherConf 获取折扣图标资源
  8. func (This *activityService) GetOtherConf() (model.ActOtherConf, error) {
  9. var iconRes model.ActDiscountIconRes
  10. iconRes.ResList = Config.GetSkinOptions(discountIconSkin)
  11. res, err := Config.GetBasicConf(model.ItemTitle{Item: "Game", Title: "discountIconTheme"})
  12. if err != nil {
  13. return model.ActOtherConf{}, errors.WithStack(err)
  14. }
  15. iconRes.Res = res
  16. return model.ActOtherConf{IconResConf: iconRes}, nil
  17. }
  18. func (This *activityService) UpdateIconRes(req model.ReqDiscountIcon) error {
  19. if err := Config.UpdateBasicConf(model.TBasicConfig{
  20. ItemTitle: model.ItemTitle{Item: "Game", Title: "discountIconTheme"},
  21. Content: req.Res,
  22. Memo: "活动礼包折扣图标主题",
  23. }); err != nil {
  24. return errors.WithStack(err)
  25. }
  26. return nil
  27. }