milk_afimilk.go 504 B

123456789101112131415161718192021222324252627
  1. package backend
  2. import (
  3. "context"
  4. "encoding/json"
  5. "kpt-pasture/model"
  6. "gitee.com/xuyiping_admin/pkg/xerr"
  7. )
  8. // AFIMILK 阿菲金品牌实现
  9. type AFIMILK struct {
  10. store *StoreEntry
  11. }
  12. func (a *AFIMILK) SaveData(ctx context.Context, body *model.MilkHallBody) error {
  13. content := body.Content
  14. if len(content) <= 0 {
  15. return nil
  16. }
  17. afiMilkList := make([]*model.AFIMilkHallOriginal, 0)
  18. if err := json.Unmarshal(content, &afiMilkList); err != nil {
  19. return xerr.WithStack(err)
  20. }
  21. return nil
  22. }