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. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  9. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  10. reflect "reflect"
  11. sync "sync"
  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, 0x3e, 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, 0x4a, 0x06, 0x08, 0xc8, 0x01, 0x10, 0xad, 0x02, 0x22, 0x63, 0x0a, 0x09, 0x50, 0x61, 0x67,
  156. 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01,
  157. 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75,
  158. 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05,
  159. 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74,
  160. 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x61, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08,
  161. 0x52, 0x04, 0x6c, 0x61, 0x73, 0x74, 0x4a, 0x06, 0x08, 0xc8, 0x01, 0x10, 0xad, 0x02, 0x42, 0x4b,
  162. 0x0a, 0x0b, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x50, 0x01, 0x5a,
  163. 0x3a, 0x67, 0x69, 0x74, 0x2e, 0x69, 0x6b, 0x75, 0x62, 0x61, 0x6e, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
  164. 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2d, 0x75, 0x74,
  165. 0x69, 0x6c, 0x73, 0x2f, 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x3b,
  166. 0x74, 0x68, 0x69, 0x72, 0x64, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f,
  167. 0x74, 0x6f, 0x33,
  168. }
  169. var (
  170. file_page_proto_rawDescOnce sync.Once
  171. file_page_proto_rawDescData = file_page_proto_rawDesc
  172. )
  173. func file_page_proto_rawDescGZIP() []byte {
  174. file_page_proto_rawDescOnce.Do(func() {
  175. file_page_proto_rawDescData = protoimpl.X.CompressGZIP(file_page_proto_rawDescData)
  176. })
  177. return file_page_proto_rawDescData
  178. }
  179. var file_page_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  180. var file_page_proto_goTypes = []interface{}{
  181. (*Page)(nil), // 0: third_party.Page
  182. (*PageReply)(nil), // 1: third_party.PageReply
  183. }
  184. var file_page_proto_depIdxs = []int32{
  185. 0, // [0:0] is the sub-list for method output_type
  186. 0, // [0:0] is the sub-list for method input_type
  187. 0, // [0:0] is the sub-list for extension type_name
  188. 0, // [0:0] is the sub-list for extension extendee
  189. 0, // [0:0] is the sub-list for field type_name
  190. }
  191. func init() { file_page_proto_init() }
  192. func file_page_proto_init() {
  193. if File_page_proto != nil {
  194. return
  195. }
  196. if !protoimpl.UnsafeEnabled {
  197. file_page_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  198. switch v := v.(*Page); i {
  199. case 0:
  200. return &v.state
  201. case 1:
  202. return &v.sizeCache
  203. case 2:
  204. return &v.unknownFields
  205. default:
  206. return nil
  207. }
  208. }
  209. file_page_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  210. switch v := v.(*PageReply); i {
  211. case 0:
  212. return &v.state
  213. case 1:
  214. return &v.sizeCache
  215. case 2:
  216. return &v.unknownFields
  217. default:
  218. return nil
  219. }
  220. }
  221. }
  222. type x struct{}
  223. out := protoimpl.TypeBuilder{
  224. File: protoimpl.DescBuilder{
  225. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  226. RawDescriptor: file_page_proto_rawDesc,
  227. NumEnums: 0,
  228. NumMessages: 2,
  229. NumExtensions: 0,
  230. NumServices: 0,
  231. },
  232. GoTypes: file_page_proto_goTypes,
  233. DependencyIndexes: file_page_proto_depIdxs,
  234. MessageInfos: file_page_proto_msgTypes,
  235. }.Build()
  236. File_page_proto = out.File
  237. file_page_proto_rawDesc = nil
  238. file_page_proto_goTypes = nil
  239. file_page_proto_depIdxs = nil
  240. }