asset.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package http
  2. import (
  3. "go-common/app/service/main/ugcpay/model"
  4. )
  5. // ArgAssetRegister .
  6. type ArgAssetRegister struct {
  7. MID int64 `form:"mid" validate:"required"`
  8. OID int64 `form:"oid" validate:"required"`
  9. OType string `form:"otype" validate:"required"`
  10. Price int64 `form:"price" validate:"required"`
  11. Currency string `form:"currency" validate:"required"`
  12. }
  13. // ArgAssetQuery .
  14. type ArgAssetQuery struct {
  15. OID int64 `form:"oid" validate:"required"`
  16. OType string `form:"otype" validate:"required"`
  17. Currency string `form:"currency" validate:"required"`
  18. }
  19. // RespAssetQuery .
  20. type RespAssetQuery struct {
  21. Price int64 `json:"price"`
  22. PlatformPrice map[string]int64 `json:"platform_price"`
  23. }
  24. // Parse .
  25. func (r *RespAssetQuery) Parse(as *model.Asset, pp map[string]int64) {
  26. if as == nil {
  27. return
  28. }
  29. r.Price = as.Price
  30. r.PlatformPrice = pp
  31. }
  32. // ArgAssetRelation .
  33. type ArgAssetRelation struct {
  34. MID int64 `form:"mid" validate:"required"`
  35. OID int64 `form:"oid" validate:"required"`
  36. OType string `form:"otype" validate:"required"`
  37. }
  38. // RespAssetRelation .
  39. type RespAssetRelation struct {
  40. State string `json:"state"`
  41. }
  42. // ArgAssetRelationDetail .
  43. type ArgAssetRelationDetail struct {
  44. ArgAssetRelation
  45. Currency string `form:"currency" validate:"required"`
  46. }
  47. // RespAssetRelationDetail .
  48. type RespAssetRelationDetail struct {
  49. RelationState string `json:"relation_state"`
  50. AssetPrice int64 `json:"asset_price"`
  51. AssetPlatformPrice map[string]int64 `json:"asset_platform_price"`
  52. }