page.pb.go 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.26.0
  4. // protoc v3.15.6
  5. // source: page.proto
  6. package third_party
  7. import (
  8. reflect "reflect"
  9. sync "sync"
  10. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  11. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  12. )
  13. const (
  14. // Verify that this generated code is sufficiently up-to-date.
  15. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  16. // Verify that runtime/protoimpl is sufficiently up-to-date.
  17. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  18. )
  19. type Page struct {
  20. state protoimpl.MessageState
  21. sizeCache protoimpl.SizeCache
  22. unknownFields protoimpl.UnknownFields
  23. Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
  24. PageSize int64 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
  25. }
  26. func (x *Page) Reset() {
  27. *x = Page{}
  28. if protoimpl.UnsafeEnabled {
  29. mi := &file_page_proto_msgTypes[0]
  30. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  31. ms.StoreMessageInfo(mi)
  32. }
  33. }
  34. func (x *Page) String() string {
  35. return protoimpl.X.MessageStringOf(x)
  36. }
  37. func (*Page) ProtoMessage() {}
  38. func (x *Page) ProtoReflect() protoreflect.Message {
  39. mi := &file_page_proto_msgTypes[0]
  40. if protoimpl.UnsafeEnabled && x != nil {
  41. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  42. if ms.LoadMessageInfo() == nil {
  43. ms.StoreMessageInfo(mi)
  44. }
  45. return ms
  46. }
  47. return mi.MessageOf(x)
  48. }
  49. // Deprecated: Use Page.ProtoReflect.Descriptor instead.
  50. func (*Page) Descriptor() ([]byte, []int) {
  51. return file_page_proto_rawDescGZIP(), []int{0}
  52. }
  53. func (x *Page) GetPage() int64 {
  54. if x != nil {
  55. return x.Page
  56. }
  57. return 0
  58. }
  59. func (x *Page) GetPageSize() int64 {
  60. if x != nil {
  61. return x.PageSize
  62. }
  63. return 0
  64. }
  65. type PageReply struct {
  66. state protoimpl.MessageState
  67. sizeCache protoimpl.SizeCache
  68. unknownFields protoimpl.UnknownFields
  69. Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
  70. Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"`
  71. Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"`
  72. Last bool `protobuf:"varint,4,opt,name=last,proto3" json:"last,omitempty"`
  73. }
  74. func (x *PageReply) Reset() {
  75. *x = PageReply{}
  76. if protoimpl.UnsafeEnabled {
  77. mi := &file_page_proto_msgTypes[1]
  78. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  79. ms.StoreMessageInfo(mi)
  80. }
  81. }
  82. func (x *PageReply) String() string {
  83. return protoimpl.X.MessageStringOf(x)
  84. }
  85. func (*PageReply) ProtoMessage() {}
  86. func (x *PageReply) ProtoReflect() protoreflect.Message {
  87. mi := &file_page_proto_msgTypes[1]
  88. if protoimpl.UnsafeEnabled && x != nil {
  89. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  90. if ms.LoadMessageInfo() == nil {
  91. ms.StoreMessageInfo(mi)
  92. }
  93. return ms
  94. }
  95. return mi.MessageOf(x)
  96. }
  97. // Deprecated: Use PageReply.ProtoReflect.Descriptor instead.
  98. func (*PageReply) Descriptor() ([]byte, []int) {
  99. return file_page_proto_rawDescGZIP(), []int{1}
  100. }
  101. func (x *PageReply) GetPage() int64 {
  102. if x != nil {
  103. return x.Page
  104. }
  105. return 0
  106. }
  107. func (x *PageReply) GetNum() int64 {
  108. if x != nil {
  109. return x.Num
  110. }
  111. return 0
  112. }
  113. func (x *PageReply) GetTotal() int64 {
  114. if x != nil {
  115. return x.Total
  116. }
  117. return 0
  118. }
  119. func (x *PageReply) GetLast() bool {
  120. if x != nil {
  121. return x.Last
  122. }
  123. return false
  124. }
  125. func (this *PageReply) GetPageParams() (pageNum int64, start int64) {
  126. start = this.Page * this.Num
  127. if this.Total <= this.Num {
  128. this.Page = 0
  129. this.Last = true
  130. return this.Total, 0
  131. }
  132. _start := (this.Page + 1) * this.Num
  133. if this.Total-_start < 0 {
  134. this.Last = true
  135. pageCount := this.Total / this.Num
  136. this.Page = pageCount
  137. num := this.Total - pageCount*this.Num
  138. if num == 0 {
  139. pageCount = pageCount - 1
  140. return this.Num, pageCount * this.Num
  141. }
  142. return num, pageCount * this.Num
  143. } else if this.Total-_start == 0 {
  144. this.Last = true
  145. }
  146. return this.Num, start
  147. }
  148. var File_page_proto protoreflect.FileDescriptor
  149. var file_page_proto_rawDesc = []byte{
  150. 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x74, 0x68,
  151. 0x69, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x22, 0x36, 0x0a, 0x04, 0x50, 0x61, 0x67,
  152. 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
  153. 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
  154. 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
  155. 0x65, 0x22, 0x5b, 0x0a, 0x09, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12,
  156. 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61,
  157. 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
  158. 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20,
  159. 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61,
  160. 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x4b,
  161. 0x0a, 0x0b, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x50, 0x01, 0x5a,
  162. 0x3a, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
  163. 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x75, 0x74,
  164. 0x69, 0x6c, 0x73, 0x2f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x3b,
  165. 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f,
  166. 0x74, 0x6f, 0x33,
  167. }
  168. var (
  169. file_page_proto_rawDescOnce sync.Once
  170. file_page_proto_rawDescData = file_page_proto_rawDesc
  171. )
  172. func file_page_proto_rawDescGZIP() []byte {
  173. file_page_proto_rawDescOnce.Do(func() {
  174. file_page_proto_rawDescData = protoimpl.X.CompressGZIP(file_page_proto_rawDescData)
  175. })
  176. return file_page_proto_rawDescData
  177. }
  178. var file_page_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  179. var file_page_proto_goTypes = []interface{}{
  180. (*Page)(nil), // 0: third_party.Page
  181. (*PageReply)(nil), // 1: third_party.PageReply
  182. }
  183. var file_page_proto_depIdxs = []int32{
  184. 0, // [0:0] is the sub-list for method output_type
  185. 0, // [0:0] is the sub-list for method input_type
  186. 0, // [0:0] is the sub-list for extension type_name
  187. 0, // [0:0] is the sub-list for extension extendee
  188. 0, // [0:0] is the sub-list for field type_name
  189. }
  190. func init() { file_page_proto_init() }
  191. func file_page_proto_init() {
  192. if File_page_proto != nil {
  193. return
  194. }
  195. if !protoimpl.UnsafeEnabled {
  196. file_page_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  197. switch v := v.(*Page); i {
  198. case 0:
  199. return &v.state
  200. case 1:
  201. return &v.sizeCache
  202. case 2:
  203. return &v.unknownFields
  204. default:
  205. return nil
  206. }
  207. }
  208. file_page_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  209. switch v := v.(*PageReply); i {
  210. case 0:
  211. return &v.state
  212. case 1:
  213. return &v.sizeCache
  214. case 2:
  215. return &v.unknownFields
  216. default:
  217. return nil
  218. }
  219. }
  220. }
  221. type x struct{}
  222. out := protoimpl.TypeBuilder{
  223. File: protoimpl.DescBuilder{
  224. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  225. RawDescriptor: file_page_proto_rawDesc,
  226. NumEnums: 0,
  227. NumMessages: 2,
  228. NumExtensions: 0,
  229. NumServices: 0,
  230. },
  231. GoTypes: file_page_proto_goTypes,
  232. DependencyIndexes: file_page_proto_depIdxs,
  233. MessageInfos: file_page_proto_msgTypes,
  234. }.Build()
  235. File_page_proto = out.File
  236. file_page_proto_rawDesc = nil
  237. file_page_proto_goTypes = nil
  238. file_page_proto_depIdxs = nil
  239. }