associate_banner.go 874 B

12345678910111213141516171819202122232425262728293031
  1. package model
  2. // associate_platform
  3. const (
  4. AssociatePlatformNone int8 = iota
  5. AssociatePlatformAndroidPink
  6. AssociatePlatformIphonePink
  7. AssociatePlatformIpadPink
  8. )
  9. // AssociatePlatform get platfrom.
  10. func AssociatePlatform(platfrom, device, mobiApp string) int8 {
  11. switch {
  12. case platfrom == "ios" && device == "phone" && mobiApp == "iphone":
  13. return AssociatePlatformIphonePink
  14. case platfrom == "ios" && device == "pad" && mobiApp == "iphone":
  15. return AssociatePlatformIpadPink
  16. case platfrom == "android" && mobiApp == "android":
  17. return AssociatePlatformAndroidPink
  18. default:
  19. return AssociatePlatformNone
  20. }
  21. }
  22. // AssociateVipResp associate vip resp
  23. type AssociateVipResp struct {
  24. Title string `json:"title"`
  25. Remark string `json:"remark"`
  26. Link string `json:"link"`
  27. AssociatePlatform int8 `json:"associate_platform"`
  28. }