log.go 503 B

1234567891011121314151617181920212223242526
  1. package model
  2. // Reverse is
  3. func (rl *RelationLog) Reverse() *RelationLog {
  4. content := make(map[string]string, len(rl.Content))
  5. for k, v := range rl.Content {
  6. content[k] = v
  7. }
  8. reversed := &RelationLog{
  9. // reverse
  10. Mid: rl.Fid,
  11. Fid: rl.Mid,
  12. Ts: rl.Ts,
  13. Source: rl.Source,
  14. Ip: rl.Ip,
  15. Buvid: rl.Buvid,
  16. // reverse
  17. FromAttr: rl.FromRevAttr,
  18. ToAttr: rl.ToRevAttr,
  19. FromRevAttr: rl.FromAttr,
  20. ToRevAttr: rl.ToAttr,
  21. Content: content,
  22. }
  23. return reversed
  24. }