asset.go 573 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package model
  2. import (
  3. "time"
  4. )
  5. // Asset .
  6. type Asset struct {
  7. ID int64
  8. MID int64
  9. OID int64
  10. OType string
  11. Currency string
  12. Price int64
  13. State string
  14. CTime time.Time
  15. MTime time.Time
  16. }
  17. // PickPrice 获得平台相应的价格
  18. func (a Asset) PickPrice(platform string, pp map[string]int64) (price int64) {
  19. var ok bool
  20. if price, ok = pp[platform]; ok {
  21. return
  22. }
  23. return a.Price
  24. }
  25. // AssetRelation .
  26. type AssetRelation struct {
  27. ID int64
  28. OID int64
  29. OType string
  30. MID int64
  31. State string
  32. CTime time.Time
  33. MTime time.Time
  34. }