model.proto 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. syntax = "proto3";
  2. package article.service;
  3. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  4. option (gogoproto.goproto_enum_prefix_all) = false;
  5. option (gogoproto.goproto_getters_all) = false;
  6. option (gogoproto.unmarshaler_all) = true;
  7. option (gogoproto.marshaler_all) = true;
  8. option (gogoproto.sizer_all) = true;
  9. option go_package = "model";
  10. message Category {
  11. int64 id = 1 [(gogoproto.jsontag) = "id", (gogoproto.customname) = "ID"];
  12. int64 parent_id = 2 [(gogoproto.jsontag) = "parent_id", (gogoproto.customname) = "ParentID"];
  13. string name = 3 [(gogoproto.jsontag) = "name"];
  14. int64 position = 4 [(gogoproto.jsontag) = "-"];
  15. repeated Category children = 5 [(gogoproto.jsontag) = "children,omitempty"];
  16. string banner_url = 6 [(gogoproto.jsontag) = "banner_url,omitempty", (gogoproto.customname) = "BannerURL"];
  17. }
  18. message Stats {
  19. int64 view = 1 [(gogoproto.jsontag) = "view"];
  20. int64 favorite = 2 [(gogoproto.jsontag) = "favorite"];
  21. int64 like= 3 [(gogoproto.jsontag) = "like"];
  22. int64 dislike= 4 [(gogoproto.jsontag) = "dislike"];
  23. int64 reply= 5 [(gogoproto.jsontag) = "reply"];
  24. int64 share= 6 [(gogoproto.jsontag) = "share"];
  25. int64 coin= 7 [(gogoproto.jsontag) = "coin"];
  26. int64 dynamic= 8 [(gogoproto.jsontag) = "dynamic"];
  27. }
  28. message Meta {
  29. int64 id = 1 [(gogoproto.jsontag) = "id", (gogoproto.customname) = "ID"];
  30. Category category = 2 [(gogoproto.jsontag) = "category"];
  31. repeated Category categories = 3 [(gogoproto.jsontag) = "categories"];
  32. string title = 4 [(gogoproto.jsontag) = "title"];
  33. string summary = 5 [(gogoproto.jsontag) = "summary"];
  34. string banner_url = 6 [(gogoproto.jsontag) = "banner_url", (gogoproto.customname) = "BannerURL"];
  35. int32 template_id = 7 [(gogoproto.jsontag) = "template_id", (gogoproto.customname) = "TemplateID"];
  36. int32 state = 8 [(gogoproto.jsontag) = "state"];
  37. Author author = 9 [(gogoproto.jsontag) = "author"];
  38. int32 reprint = 10 [(gogoproto.jsontag) = "reprint"];
  39. repeated string image_urls = 11 [(gogoproto.jsontag) = "image_urls", (gogoproto.customname) = "ImageURLs"];
  40. int64 publish_time = 12 [(gogoproto.jsontag) = "publish_time", (gogoproto.casttype) = "go-common/library/time.Time"];
  41. int64 ctime = 13 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
  42. int64 mtime = 14 [(gogoproto.jsontag) = "mtime,omitempty", (gogoproto.casttype) = "go-common/library/time.Time"];
  43. Stats stats = 15 [(gogoproto.jsontag) = "stats,omitempty"];
  44. repeated Tag tags = 16 [(gogoproto.jsontag) = "tags,omitempty"];
  45. int32 attributes = 17 [(gogoproto.jsontag) = "attributes,omitempty"];
  46. string reason = 18 [(gogoproto.jsontag) = "reason,omitempty"];
  47. int64 words = 19 [(gogoproto.jsontag) = "words"];
  48. string dynamic = 20 [(gogoproto.jsontag) = "dynamic,omitempty"];
  49. repeated string origin_image_urls = 21 [(gogoproto.jsontag) = "origin_image_urls", (gogoproto.customname) = "OriginImageURLs"];
  50. List list = 22 [(gogoproto.jsontag) = "list"];
  51. bool isLike = 23 [(gogoproto.jsontag) = "is_like", (gogoproto.customname) = "IsLike"];
  52. Media media = 24 [(gogoproto.jsontag) = "media", (gogoproto.customname) = "Media"];
  53. string apply_time = 25 [(gogoproto.jsontag) = "apply_time", (gogoproto.customname) = "ApplyTime"];
  54. string check_time = 26 [(gogoproto.jsontag) = "check_time", (gogoproto.customname) = "CheckTime"];
  55. }
  56. message Media {
  57. int32 score = 1 [(gogoproto.jsontag) = "score", (gogoproto.customname) = "Score"];
  58. int64 media_id = 2 [(gogoproto.jsontag) = "media_id", (gogoproto.customname) = "MediaID"];
  59. string title = 3 [(gogoproto.jsontag) = "title", (gogoproto.customname) = "Title"];
  60. string cover = 4 [(gogoproto.jsontag) = "cover", (gogoproto.customname) = "Cover"];
  61. string area = 5 [(gogoproto.jsontag) = "area", (gogoproto.customname) = "Area"];
  62. int32 type_id = 6 [(gogoproto.jsontag) = "type_id", (gogoproto.customname) = "TypeID"];
  63. string type_name = 7 [(gogoproto.jsontag) = "type_name", (gogoproto.customname) = "TypeName"];
  64. int32 spoiler = 8 [(gogoproto.jsontag) = "spoiler", (gogoproto.customname) = "Spoiler"];
  65. }
  66. message OfficialVerify {
  67. int64 type = 1 [(gogoproto.jsontag) = "type"];
  68. string desc = 2 [(gogoproto.jsontag) = "desc"];
  69. }
  70. message Author {
  71. int64 mid = 1 [(gogoproto.jsontag) = "mid"];
  72. string name = 2 [(gogoproto.jsontag) = "name"];
  73. string face = 3 [(gogoproto.jsontag) = "face"];
  74. Pendant pendant = 4 [(gogoproto.jsontag) = "pendant", (gogoproto.nullable) = false];
  75. OfficialVerify official_verify = 5 [(gogoproto.jsontag) = "official_verify", (gogoproto.nullable) = false];
  76. Nameplate nameplate = 6 [(gogoproto.jsontag) = "nameplate", (gogoproto.nullable) = false];
  77. VipInfo vip = 7 [(gogoproto.jsontag) = "vip", (gogoproto.nullable) = false];
  78. }
  79. message VipInfo {
  80. int32 type = 1 [(gogoproto.jsontag) = "type"];
  81. int32 status = 2 [(gogoproto.jsontag) = "status"];
  82. int64 due_date = 3 [(gogoproto.jsontag) = "due_date"];
  83. int32 vip_pay_type = 4 [(gogoproto.jsontag) = "vip_pay_type"];
  84. }
  85. message Nameplate {
  86. int32 nid = 1 [(gogoproto.jsontag) = "nid",(gogoproto.casttype) = "int"];
  87. string name = 2 [(gogoproto.jsontag) = "name"];
  88. string image = 3 [(gogoproto.jsontag) = "image"];
  89. string image_small = 4 [(gogoproto.jsontag) = "image_small"];
  90. string level = 5 [(gogoproto.jsontag) = "level"];
  91. string condition = 6 [(gogoproto.jsontag) = "condition"];
  92. }
  93. message Pendant {
  94. int32 pid = 1 [(gogoproto.jsontag) = "pid"];
  95. string name = 2 [(gogoproto.jsontag) = "name"];
  96. string image = 3 [(gogoproto.jsontag) = "image"];
  97. int32 expire = 4 [(gogoproto.jsontag) = "expire"];
  98. }
  99. message Tag {
  100. int64 tid = 1 [(gogoproto.jsontag) = "tid"];
  101. string name = 2 [(gogoproto.jsontag) = "name"];
  102. }
  103. message Article {
  104. Meta meta = 1 [(gogoproto.jsontag) = "", (gogoproto.embed) = true];
  105. string content = 2 [(gogoproto.jsontag) = "content,omitempty"];
  106. string keywords = 3 [(gogoproto.jsontag) = "keywords", (gogoproto.customname) = "Keywords"];
  107. }
  108. message List {
  109. int64 id = 1 [(gogoproto.jsontag) = "id", (gogoproto.customname) = "ID"];
  110. int64 mid = 2[(gogoproto.jsontag) = "mid"];
  111. string name = 3 [(gogoproto.jsontag) = "name"];
  112. string image_url = 4 [(gogoproto.jsontag) = "image_url", (gogoproto.customname) = "ImageURL"];
  113. int64 update_time = 5 [(gogoproto.jsontag) = "update_time", (gogoproto.casttype) = "go-common/library/time.Time"];
  114. int64 ctime = 6 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
  115. int64 publish_time = 7 [(gogoproto.jsontag) = "publish_time", (gogoproto.casttype) = "go-common/library/time.Time"];
  116. string summary = 8 [(gogoproto.jsontag) = "summary"];
  117. int64 words = 9 [(gogoproto.jsontag) = "words"];
  118. int64 read = 10 [(gogoproto.jsontag) = "read"];
  119. int64 articles_count = 11 [(gogoproto.jsontag) = "articles_count"];
  120. }