history.proto 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. syntax = "proto3";
  2. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  3. option go_package = "model";
  4. // History model
  5. message History {
  6. // ctime
  7. int64 ctime = 1 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
  8. // mtime
  9. int64 mtime = 2 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
  10. // mid
  11. int64 mid = 3 [(gogoproto.jsontag) = "mid", (gogoproto.moretags) = 'form:"mid" validate:"required,min=1"'];
  12. // business_id
  13. int64 business_id = 4[(gogoproto.jsontag) = "business_id", (gogoproto.customname) = "BusinessID"];
  14. // business 业务
  15. string business = 5 [(gogoproto.jsontag) = "business", (gogoproto.moretags) = 'form:"business" validate:"required"'];
  16. // kid 业务中唯一id
  17. int64 kid = 6 [(gogoproto.jsontag) = "kid", (gogoproto.moretags) = 'form:"kid"'];
  18. // aid
  19. int64 aid = 7 [(gogoproto.moretags) = 'form:"aid"'];
  20. // sid
  21. int64 sid = 8 [(gogoproto.moretags) = 'form:"sid"'];
  22. // epid
  23. int64 epid = 9 [(gogoproto.moretags) = 'form:"epid"'];
  24. // cid
  25. int64 cid = 10 [(gogoproto.moretags) = 'form:"cid"'];
  26. // sub_type 子类型
  27. int32 sub_type = 11 [(gogoproto.moretags) = 'form:"sub_type"'];
  28. // device 设备类型
  29. int32 device = 12 [(gogoproto.jsontag) = "device", (gogoproto.moretags) = 'form:"device"'];
  30. // progress 进度
  31. int32 progress = 13 [(gogoproto.jsontag) = "progress", (gogoproto.moretags) = 'form:"progress"'];
  32. // 观看时间
  33. int64 view_at = 14 [(gogoproto.jsontag) = "view_at", (gogoproto.moretags) = 'form:"view_at"'];
  34. }
  35. // Business model
  36. message Business {
  37. // id
  38. int64 id = 1[(gogoproto.jsontag) = "id", (gogoproto.customname) = "ID"];
  39. // name
  40. string name = 2 [(gogoproto.jsontag) = "name"];
  41. // ttl
  42. int64 ttl = 3[(gogoproto.customname) = "TTL"];
  43. }
  44. // Merge model
  45. message Merge {
  46. // mid
  47. int64 mid = 1 [(gogoproto.moretags) = "validate:\"required\""];
  48. // bid
  49. int64 bid = 2 [(gogoproto.jsontag) = "bid", (gogoproto.customname) = "Bid", (gogoproto.moretags) = 'validate:"required"'];
  50. // business 业务
  51. string business = 3 [(gogoproto.jsontag) = "-"];
  52. // time
  53. int64 time = 4 [(gogoproto.moretags) = 'validate:"required"'];
  54. // kid
  55. int64 kid = 5 [(gogoproto.moretags) = 'validate:"required"'];
  56. }