credit.go 913 B

12345678910111213141516171819202122
  1. package model
  2. type CreditRecord struct {
  3. Id int64 `json:"-"` // 唯一标识符,主键,自增
  4. PlayerId int64 `xorm:"BIGINT index 'playerid'" json:"-"`
  5. ChangeValue int64 `xorm:"INT 'changevalue'" json:"change"` // 变化值
  6. NewScore int64 `xorm:"INT 'newscore'" json:"newScore"` // 变化后信誉积分
  7. Reason int `xorm:"INT 'reason'" json:"reason"`
  8. CreatedTime int64 `xorm:"created" json:"createdTime"` // 变化时间
  9. }
  10. type PlayerCreditRecords struct {
  11. PlayerId int64 `json:"playerId"` // 玩家ID
  12. CreditRecords []*CreditRecord `json:"creditRecords"` // 10条信用记录
  13. LastLoadTs2 int64
  14. // LastCreatedTs int64 //最后一条记录的穿件时间,只能加载协程使用
  15. // NewLoads []*CreditRecord // 辅助加载函数;业务功能不要使用
  16. }
  17. func (p *PlayerCreditRecords) IsDirty() bool {
  18. return (p.LastLoadTs2 == -1)
  19. }