From f7c77aa01a6144816a47ad6943cc7327bc56d825 Mon Sep 17 00:00:00 2001
From: truthhun <1272881215@qq.com>
Date: Mon, 24 Apr 2023 22:31:33 +0800
Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E4=B8=8B?=
=?UTF-8?q?=E8=BD=BD=E7=9A=84=E6=96=87=E6=A1=A3=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/v1/download.pb.go | 1413 +++++++++++++++++++++++++++++++
api/v1/download.proto | 80 ++
api/v1/user.pb.go | 651 +++++++++++---
api/v1/user.pb.gw.go | 83 ++
api/v1/user.proto | 19 +
biz/user.go | 25 +
model/download.go | 90 +-
web/api/user.js | 8 +
web/components/UserDownload.vue | 157 ++++
web/pages/me/download.vue | 14 +-
10 files changed, 2371 insertions(+), 169 deletions(-)
create mode 100644 api/v1/download.pb.go
create mode 100644 api/v1/download.proto
create mode 100644 web/components/UserDownload.vue
diff --git a/api/v1/download.pb.go b/api/v1/download.pb.go
new file mode 100644
index 0000000..ecf4e26
--- /dev/null
+++ b/api/v1/download.pb.go
@@ -0,0 +1,1413 @@
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: api/v1/download.proto
+
+package v1
+
+import (
+ context "context"
+ fmt "fmt"
+ _ "github.com/gogo/protobuf/gogoproto"
+ proto "github.com/gogo/protobuf/proto"
+ github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
+ grpc "google.golang.org/grpc"
+ _ "google.golang.org/protobuf/types/known/timestamppb"
+ io "io"
+ math "math"
+ math_bits "math/bits"
+ time "time"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+var _ = time.Kitchen
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+type Download struct {
+ Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+ UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
+ DocumentId int64 `protobuf:"varint,3,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
+ Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
+ IsPay bool `protobuf:"varint,5,opt,name=is_pay,json=isPay,proto3" json:"is_pay,omitempty"`
+ CreatedAt *time.Time `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
+ UpdatedAt *time.Time `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
+ Title string `protobuf:"bytes,8,opt,name=title,proto3" json:"title,omitempty"`
+ Ext string `protobuf:"bytes,9,opt,name=ext,proto3" json:"ext,omitempty"`
+ Score int32 `protobuf:"varint,10,opt,name=score,proto3" json:"score,omitempty"`
+ Size_ int64 `protobuf:"varint,11,opt,name=size,proto3" json:"size,omitempty"`
+ Pages int32 `protobuf:"varint,12,opt,name=pages,proto3" json:"pages,omitempty"`
+}
+
+func (m *Download) Reset() { *m = Download{} }
+func (m *Download) String() string { return proto.CompactTextString(m) }
+func (*Download) ProtoMessage() {}
+func (*Download) Descriptor() ([]byte, []int) {
+ return fileDescriptor_abfc1e2562b8c071, []int{0}
+}
+func (m *Download) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *Download) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_Download.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *Download) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_Download.Merge(m, src)
+}
+func (m *Download) XXX_Size() int {
+ return m.Size()
+}
+func (m *Download) XXX_DiscardUnknown() {
+ xxx_messageInfo_Download.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_Download proto.InternalMessageInfo
+
+func (m *Download) GetId() int64 {
+ if m != nil {
+ return m.Id
+ }
+ return 0
+}
+
+func (m *Download) GetUserId() int64 {
+ if m != nil {
+ return m.UserId
+ }
+ return 0
+}
+
+func (m *Download) GetDocumentId() int64 {
+ if m != nil {
+ return m.DocumentId
+ }
+ return 0
+}
+
+func (m *Download) GetIp() string {
+ if m != nil {
+ return m.Ip
+ }
+ return ""
+}
+
+func (m *Download) GetIsPay() bool {
+ if m != nil {
+ return m.IsPay
+ }
+ return false
+}
+
+func (m *Download) GetCreatedAt() *time.Time {
+ if m != nil {
+ return m.CreatedAt
+ }
+ return nil
+}
+
+func (m *Download) GetUpdatedAt() *time.Time {
+ if m != nil {
+ return m.UpdatedAt
+ }
+ return nil
+}
+
+func (m *Download) GetTitle() string {
+ if m != nil {
+ return m.Title
+ }
+ return ""
+}
+
+func (m *Download) GetExt() string {
+ if m != nil {
+ return m.Ext
+ }
+ return ""
+}
+
+func (m *Download) GetScore() int32 {
+ if m != nil {
+ return m.Score
+ }
+ return 0
+}
+
+func (m *Download) GetSize_() int64 {
+ if m != nil {
+ return m.Size_
+ }
+ return 0
+}
+
+func (m *Download) GetPages() int32 {
+ if m != nil {
+ return m.Pages
+ }
+ return 0
+}
+
+type ListDownloadRequest struct {
+ Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
+ Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
+ Wd string `protobuf:"bytes,3,opt,name=wd,proto3" json:"wd,omitempty"`
+ Field []string `protobuf:"bytes,4,rep,name=field,proto3" json:"field,omitempty"`
+ Order string `protobuf:"bytes,5,opt,name=order,proto3" json:"order,omitempty"`
+}
+
+func (m *ListDownloadRequest) Reset() { *m = ListDownloadRequest{} }
+func (m *ListDownloadRequest) String() string { return proto.CompactTextString(m) }
+func (*ListDownloadRequest) ProtoMessage() {}
+func (*ListDownloadRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_abfc1e2562b8c071, []int{1}
+}
+func (m *ListDownloadRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ListDownloadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_ListDownloadRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *ListDownloadRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ListDownloadRequest.Merge(m, src)
+}
+func (m *ListDownloadRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *ListDownloadRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_ListDownloadRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ListDownloadRequest proto.InternalMessageInfo
+
+func (m *ListDownloadRequest) GetPage() int64 {
+ if m != nil {
+ return m.Page
+ }
+ return 0
+}
+
+func (m *ListDownloadRequest) GetSize_() int64 {
+ if m != nil {
+ return m.Size_
+ }
+ return 0
+}
+
+func (m *ListDownloadRequest) GetWd() string {
+ if m != nil {
+ return m.Wd
+ }
+ return ""
+}
+
+func (m *ListDownloadRequest) GetField() []string {
+ if m != nil {
+ return m.Field
+ }
+ return nil
+}
+
+func (m *ListDownloadRequest) GetOrder() string {
+ if m != nil {
+ return m.Order
+ }
+ return ""
+}
+
+type ListDownloadReply struct {
+ Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
+ Download []*Download `protobuf:"bytes,2,rep,name=download,proto3" json:"download,omitempty"`
+}
+
+func (m *ListDownloadReply) Reset() { *m = ListDownloadReply{} }
+func (m *ListDownloadReply) String() string { return proto.CompactTextString(m) }
+func (*ListDownloadReply) ProtoMessage() {}
+func (*ListDownloadReply) Descriptor() ([]byte, []int) {
+ return fileDescriptor_abfc1e2562b8c071, []int{2}
+}
+func (m *ListDownloadReply) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ListDownloadReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_ListDownloadReply.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *ListDownloadReply) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ListDownloadReply.Merge(m, src)
+}
+func (m *ListDownloadReply) XXX_Size() int {
+ return m.Size()
+}
+func (m *ListDownloadReply) XXX_DiscardUnknown() {
+ xxx_messageInfo_ListDownloadReply.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ListDownloadReply proto.InternalMessageInfo
+
+func (m *ListDownloadReply) GetTotal() int64 {
+ if m != nil {
+ return m.Total
+ }
+ return 0
+}
+
+func (m *ListDownloadReply) GetDownload() []*Download {
+ if m != nil {
+ return m.Download
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*Download)(nil), "api.v1.Download")
+ proto.RegisterType((*ListDownloadRequest)(nil), "api.v1.ListDownloadRequest")
+ proto.RegisterType((*ListDownloadReply)(nil), "api.v1.ListDownloadReply")
+}
+
+func init() { proto.RegisterFile("api/v1/download.proto", fileDescriptor_abfc1e2562b8c071) }
+
+var fileDescriptor_abfc1e2562b8c071 = []byte{
+ // 463 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xc1, 0x8e, 0xd3, 0x30,
+ 0x10, 0x5d, 0xa7, 0x6d, 0xb6, 0x99, 0xc0, 0x6a, 0xd7, 0xec, 0x0a, 0xab, 0x87, 0x34, 0xea, 0x29,
+ 0x07, 0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 0xa6, 0xee, 0xbe, 0xd2, 0x53, 0xfb, 0xa9, 0x62, 0xf6, 0x1c, 0xc2,
+ 0x8e, 0x9d, 0x2f, 0x17, 0xb7, 0x6f, 0xbe, 0x1f, 0x22, 0xf4, 0x74, 0x88, 0xd0, 0xaf, 0x43, 0x84,
+ 0x1e, 0x8f, 0xd1, 0xd9, 0xd3, 0x31, 0x3a, 0xfb, 0x71, 0x8c, 0xce, 0xa0, 0xbd, 0xd1, 0x25, 0xfa,
+ 0x7c, 0xb5, 0x91, 0x15, 0x67, 0x72, 0x9d, 0xb9, 0x63, 0x7e, 0xbb, 0x9d, 0xde, 0xf9, 0xf6, 0x9b,
+ 0x5e, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, 0x06, 0xd6, 0x15, 0x9f, 0xe0, 0x02, 0x00, 0x00,
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConn
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion4
+
+// DownloadAPIClient is the client API for DownloadAPI service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type DownloadAPIClient interface {
+}
+
+type downloadAPIClient struct {
+ cc *grpc.ClientConn
+}
+
+func NewDownloadAPIClient(cc *grpc.ClientConn) DownloadAPIClient {
+ return &downloadAPIClient{cc}
+}
+
+// DownloadAPIServer is the server API for DownloadAPI service.
+type DownloadAPIServer interface {
+}
+
+// UnimplementedDownloadAPIServer can be embedded to have forward compatible implementations.
+type UnimplementedDownloadAPIServer struct {
+}
+
+func RegisterDownloadAPIServer(s *grpc.Server, srv DownloadAPIServer) {
+ s.RegisterService(&_DownloadAPI_serviceDesc, srv)
+}
+
+var _DownloadAPI_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "api.v1.DownloadAPI",
+ HandlerType: (*DownloadAPIServer)(nil),
+ Methods: []grpc.MethodDesc{},
+ Streams: []grpc.StreamDesc{},
+ Metadata: "api/v1/download.proto",
+}
+
+func (m *Download) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *Download) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *Download) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Pages != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.Pages))
+ i--
+ dAtA[i] = 0x60
+ }
+ if m.Size_ != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.Size_))
+ i--
+ dAtA[i] = 0x58
+ }
+ if m.Score != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.Score))
+ i--
+ dAtA[i] = 0x50
+ }
+ if len(m.Ext) > 0 {
+ i -= len(m.Ext)
+ copy(dAtA[i:], m.Ext)
+ i = encodeVarintDownload(dAtA, i, uint64(len(m.Ext)))
+ i--
+ dAtA[i] = 0x4a
+ }
+ if len(m.Title) > 0 {
+ i -= len(m.Title)
+ copy(dAtA[i:], m.Title)
+ i = encodeVarintDownload(dAtA, i, uint64(len(m.Title)))
+ i--
+ dAtA[i] = 0x42
+ }
+ if m.UpdatedAt != nil {
+ n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UpdatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt):])
+ if err1 != nil {
+ return 0, err1
+ }
+ i -= n1
+ i = encodeVarintDownload(dAtA, i, uint64(n1))
+ i--
+ dAtA[i] = 0x3a
+ }
+ if m.CreatedAt != nil {
+ n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt):])
+ if err2 != nil {
+ return 0, err2
+ }
+ i -= n2
+ i = encodeVarintDownload(dAtA, i, uint64(n2))
+ i--
+ dAtA[i] = 0x32
+ }
+ if m.IsPay {
+ i--
+ if m.IsPay {
+ dAtA[i] = 1
+ } else {
+ dAtA[i] = 0
+ }
+ i--
+ dAtA[i] = 0x28
+ }
+ if len(m.Ip) > 0 {
+ i -= len(m.Ip)
+ copy(dAtA[i:], m.Ip)
+ i = encodeVarintDownload(dAtA, i, uint64(len(m.Ip)))
+ i--
+ dAtA[i] = 0x22
+ }
+ if m.DocumentId != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.DocumentId))
+ i--
+ dAtA[i] = 0x18
+ }
+ if m.UserId != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.UserId))
+ i--
+ dAtA[i] = 0x10
+ }
+ if m.Id != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.Id))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *ListDownloadRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ListDownloadRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ListDownloadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Order) > 0 {
+ i -= len(m.Order)
+ copy(dAtA[i:], m.Order)
+ i = encodeVarintDownload(dAtA, i, uint64(len(m.Order)))
+ i--
+ dAtA[i] = 0x2a
+ }
+ if len(m.Field) > 0 {
+ for iNdEx := len(m.Field) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Field[iNdEx])
+ copy(dAtA[i:], m.Field[iNdEx])
+ i = encodeVarintDownload(dAtA, i, uint64(len(m.Field[iNdEx])))
+ i--
+ dAtA[i] = 0x22
+ }
+ }
+ if len(m.Wd) > 0 {
+ i -= len(m.Wd)
+ copy(dAtA[i:], m.Wd)
+ i = encodeVarintDownload(dAtA, i, uint64(len(m.Wd)))
+ i--
+ dAtA[i] = 0x1a
+ }
+ if m.Size_ != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.Size_))
+ i--
+ dAtA[i] = 0x10
+ }
+ if m.Page != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.Page))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *ListDownloadReply) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ListDownloadReply) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ListDownloadReply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Download) > 0 {
+ for iNdEx := len(m.Download) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Download[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintDownload(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ if m.Total != 0 {
+ i = encodeVarintDownload(dAtA, i, uint64(m.Total))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintDownload(dAtA []byte, offset int, v uint64) int {
+ offset -= sovDownload(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *Download) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Id != 0 {
+ n += 1 + sovDownload(uint64(m.Id))
+ }
+ if m.UserId != 0 {
+ n += 1 + sovDownload(uint64(m.UserId))
+ }
+ if m.DocumentId != 0 {
+ n += 1 + sovDownload(uint64(m.DocumentId))
+ }
+ l = len(m.Ip)
+ if l > 0 {
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ if m.IsPay {
+ n += 2
+ }
+ if m.CreatedAt != nil {
+ l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.CreatedAt)
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ if m.UpdatedAt != nil {
+ l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UpdatedAt)
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ l = len(m.Title)
+ if l > 0 {
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ l = len(m.Ext)
+ if l > 0 {
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ if m.Score != 0 {
+ n += 1 + sovDownload(uint64(m.Score))
+ }
+ if m.Size_ != 0 {
+ n += 1 + sovDownload(uint64(m.Size_))
+ }
+ if m.Pages != 0 {
+ n += 1 + sovDownload(uint64(m.Pages))
+ }
+ return n
+}
+
+func (m *ListDownloadRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Page != 0 {
+ n += 1 + sovDownload(uint64(m.Page))
+ }
+ if m.Size_ != 0 {
+ n += 1 + sovDownload(uint64(m.Size_))
+ }
+ l = len(m.Wd)
+ if l > 0 {
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ if len(m.Field) > 0 {
+ for _, s := range m.Field {
+ l = len(s)
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ }
+ l = len(m.Order)
+ if l > 0 {
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ return n
+}
+
+func (m *ListDownloadReply) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Total != 0 {
+ n += 1 + sovDownload(uint64(m.Total))
+ }
+ if len(m.Download) > 0 {
+ for _, e := range m.Download {
+ l = e.Size()
+ n += 1 + l + sovDownload(uint64(l))
+ }
+ }
+ return n
+}
+
+func sovDownload(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozDownload(x uint64) (n int) {
+ return sovDownload(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (m *Download) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: Download: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: Download: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
+ }
+ m.Id = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Id |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType)
+ }
+ m.UserId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.UserId |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 3:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DocumentId", wireType)
+ }
+ m.DocumentId = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.DocumentId |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Ip", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Ip = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 5:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field IsPay", wireType)
+ }
+ var v int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ v |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ m.IsPay = bool(v != 0)
+ case 6:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.CreatedAt == nil {
+ m.CreatedAt = new(time.Time)
+ }
+ if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 7:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.UpdatedAt == nil {
+ m.UpdatedAt = new(time.Time)
+ }
+ if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.UpdatedAt, dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 8:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Title = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 9:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Ext", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Ext = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 10:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Score", wireType)
+ }
+ m.Score = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Score |= int32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 11:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
+ }
+ m.Size_ = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Size_ |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 12:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pages", wireType)
+ }
+ m.Pages = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Pages |= int32(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipDownload(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ListDownloadRequest) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ListDownloadRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ListDownloadRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType)
+ }
+ m.Page = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Page |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
+ }
+ m.Size_ = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Size_ |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Wd", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Wd = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 4:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Field = append(m.Field, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ case 5:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Order", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Order = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipDownload(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ListDownloadReply) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ListDownloadReply: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ListDownloadReply: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
+ }
+ m.Total = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Total |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Download", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthDownload
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Download = append(m.Download, &Download{})
+ if err := m.Download[len(m.Download)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipDownload(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthDownload
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipDownload(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ depth := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ case 1:
+ iNdEx += 8
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowDownload
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if length < 0 {
+ return 0, ErrInvalidLengthDownload
+ }
+ iNdEx += length
+ case 3:
+ depth++
+ case 4:
+ if depth == 0 {
+ return 0, ErrUnexpectedEndOfGroupDownload
+ }
+ depth--
+ case 5:
+ iNdEx += 4
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthDownload
+ }
+ if depth == 0 {
+ return iNdEx, nil
+ }
+ }
+ return 0, io.ErrUnexpectedEOF
+}
+
+var (
+ ErrInvalidLengthDownload = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowDownload = fmt.Errorf("proto: integer overflow")
+ ErrUnexpectedEndOfGroupDownload = fmt.Errorf("proto: unexpected end of group")
+)
diff --git a/api/v1/download.proto b/api/v1/download.proto
new file mode 100644
index 0000000..0b7c433
--- /dev/null
+++ b/api/v1/download.proto
@@ -0,0 +1,80 @@
+syntax = "proto3";
+
+import "google/protobuf/timestamp.proto";
+import "gogoproto/gogo.proto";
+// import "validate/validate.proto";
+// import "google/api/annotations.proto";
+// import "google/protobuf/empty.proto";
+
+package api.v1;
+
+option go_package = "moredoc/api/v1;v1";
+option java_multiple_files = true;
+option java_package = "api.v1";
+
+message Download {
+ int64 id = 1;
+ int64 user_id = 2;
+ int64 document_id = 3;
+ string ip = 4;
+ bool is_pay = 5;
+ google.protobuf.Timestamp created_at = 6 [ (gogoproto.stdtime) = true ];
+ google.protobuf.Timestamp updated_at = 7 [ (gogoproto.stdtime) = true ];
+ string title = 8;
+ string ext = 9;
+ int32 score = 10;
+ int64 size = 11;
+ int32 pages = 12;
+}
+
+// message DeleteDownloadRequest { repeated int64 id = 1; }
+
+// message GetDownloadRequest { int64 id = 1; }
+
+message ListDownloadRequest {
+ int64 page = 1;
+ int64 size = 2;
+ string wd = 3;
+ repeated string field = 4;
+ string order = 5;
+}
+
+message ListDownloadReply {
+ int64 total = 1;
+ repeated Download download = 2;
+}
+
+service DownloadAPI {
+ // rpc CreateDownload(Download) returns (Download) {
+ // option (google.api.http) = {
+ // post : '/api/v1/download',
+ // body : '*',
+ // };
+ // }
+
+ // rpc UpdateDownload(Download) returns (google.protobuf.Empty) {
+ // option (google.api.http) = {
+ // put : '/api/v1/download',
+ // body : '*',
+ // };
+ // }
+
+ // rpc DeleteDownload(DeleteDownloadRequest) returns (google.protobuf.Empty)
+ // {
+ // option (google.api.http) = {
+ // delete : '/api/v1/download',
+ // };
+ // }
+
+ // rpc GetDownload(GetDownloadRequest) returns (Download) {
+ // option (google.api.http) = {
+ // get : '/api/v1/download',
+ // };
+ // }
+
+ // rpc ListDownload(ListDownloadRequest) returns (ListDownloadReply) {
+ // option (google.api.http) = {
+ // get : '/api/v1/download/list',
+ // };
+ // }
+}
\ No newline at end of file
diff --git a/api/v1/user.pb.go b/api/v1/user.pb.go
index 5acda49..fcfaa00 100644
--- a/api/v1/user.pb.go
+++ b/api/v1/user.pb.go
@@ -1278,6 +1278,110 @@ func (m *Sign) GetAward() int32 {
return 0
}
+type ListUserDownloadRequest struct {
+ Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
+ Size_ int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
+}
+
+func (m *ListUserDownloadRequest) Reset() { *m = ListUserDownloadRequest{} }
+func (m *ListUserDownloadRequest) String() string { return proto.CompactTextString(m) }
+func (*ListUserDownloadRequest) ProtoMessage() {}
+func (*ListUserDownloadRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_b74e2e33d57193df, []int{17}
+}
+func (m *ListUserDownloadRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ListUserDownloadRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_ListUserDownloadRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *ListUserDownloadRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ListUserDownloadRequest.Merge(m, src)
+}
+func (m *ListUserDownloadRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *ListUserDownloadRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_ListUserDownloadRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ListUserDownloadRequest proto.InternalMessageInfo
+
+func (m *ListUserDownloadRequest) GetPage() int64 {
+ if m != nil {
+ return m.Page
+ }
+ return 0
+}
+
+func (m *ListUserDownloadRequest) GetSize_() int64 {
+ if m != nil {
+ return m.Size_
+ }
+ return 0
+}
+
+type ListUserDownloadReply struct {
+ Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
+ Download []*Download `protobuf:"bytes,2,rep,name=download,proto3" json:"download,omitempty"`
+}
+
+func (m *ListUserDownloadReply) Reset() { *m = ListUserDownloadReply{} }
+func (m *ListUserDownloadReply) String() string { return proto.CompactTextString(m) }
+func (*ListUserDownloadReply) ProtoMessage() {}
+func (*ListUserDownloadReply) Descriptor() ([]byte, []int) {
+ return fileDescriptor_b74e2e33d57193df, []int{18}
+}
+func (m *ListUserDownloadReply) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *ListUserDownloadReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_ListUserDownloadReply.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *ListUserDownloadReply) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_ListUserDownloadReply.Merge(m, src)
+}
+func (m *ListUserDownloadReply) XXX_Size() int {
+ return m.Size()
+}
+func (m *ListUserDownloadReply) XXX_DiscardUnknown() {
+ xxx_messageInfo_ListUserDownloadReply.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_ListUserDownloadReply proto.InternalMessageInfo
+
+func (m *ListUserDownloadReply) GetTotal() int64 {
+ if m != nil {
+ return m.Total
+ }
+ return 0
+}
+
+func (m *ListUserDownloadReply) GetDownload() []*Download {
+ if m != nil {
+ return m.Download
+ }
+ return nil
+}
+
func init() {
proto.RegisterType((*User)(nil), "api.v1.User")
proto.RegisterType((*RegisterAndLoginRequest)(nil), "api.v1.RegisterAndLoginRequest")
@@ -1296,113 +1400,119 @@ func init() {
proto.RegisterType((*ListUserDynamicRequest)(nil), "api.v1.ListUserDynamicRequest")
proto.RegisterType((*ListUserDynamicReply)(nil), "api.v1.ListUserDynamicReply")
proto.RegisterType((*Sign)(nil), "api.v1.Sign")
+ proto.RegisterType((*ListUserDownloadRequest)(nil), "api.v1.ListUserDownloadRequest")
+ proto.RegisterType((*ListUserDownloadReply)(nil), "api.v1.ListUserDownloadReply")
}
func init() { proto.RegisterFile("api/v1/user.proto", fileDescriptor_b74e2e33d57193df) }
var fileDescriptor_b74e2e33d57193df = []byte{
- // 1607 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x58, 0xcd, 0x6e, 0x1b, 0xc9,
- 0x11, 0xf6, 0xf0, 0x9f, 0x45, 0x49, 0xb6, 0x5a, 0x14, 0x49, 0x8d, 0xb4, 0x22, 0x35, 0x8b, 0x24,
- 0x8a, 0xb2, 0x10, 0x63, 0x19, 0xc9, 0x02, 0x5e, 0x2c, 0x02, 0xfd, 0xec, 0x2e, 0x14, 0x28, 0x88,
- 0x32, 0xb2, 0x10, 0x60, 0x73, 0x10, 0x5a, 0x9c, 0x16, 0xd3, 0xf1, 0xcc, 0xf4, 0x78, 0xa6, 0x29,
- 0x5a, 0x39, 0xe6, 0x92, 0xab, 0x81, 0xbc, 0x46, 0x80, 0xdc, 0x72, 0xca, 0x03, 0xe4, 0x68, 0xc0,
- 0x97, 0x00, 0x01, 0x9c, 0xc0, 0xce, 0x35, 0x17, 0x3f, 0x40, 0x10, 0xf4, 0xdf, 0x90, 0x43, 0x69,
- 0xbc, 0x92, 0x7d, 0x9b, 0xaa, 0xae, 0xfe, 0xba, 0xab, 0xea, 0xab, 0xea, 0x22, 0x61, 0x11, 0x47,
- 0xb4, 0x7f, 0xf9, 0xb0, 0x3f, 0x4a, 0x48, 0xbc, 0x1d, 0xc5, 0x8c, 0x33, 0x54, 0xc1, 0x11, 0xdd,
- 0xbe, 0x7c, 0x68, 0x77, 0x87, 0x8c, 0x0d, 0x7d, 0xd2, 0x97, 0xda, 0xf3, 0xd1, 0x45, 0x9f, 0xd3,
- 0x80, 0x24, 0x1c, 0x07, 0x91, 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0xa4, 0xa1, 0x67, 0x2a,
+ 0xde, 0x30, 0xe1, 0x24, 0x62, 0xa1, 0xac, 0x4e, 0x37, 0x9c, 0xfc, 0x72, 0xca, 0xde, 0xe9, 0x64,
+ 0xfb, 0xff, 0x9c, 0xcc, 0xa7, 0xec, 0x99, 0xf5, 0xe8, 0xf9, 0x4f, 0xfe, 0xf6, 0x7a, 0xdb, 0xfa,
+ 0xea, 0xf5, 0xb6, 0xf5, 0xaf, 0xd7, 0xdb, 0xd6, 0x97, 0x6f, 0xb6, 0xef, 0x7d, 0xf5, 0x66, 0xfb,
+ 0xde, 0x3f, 0xde, 0x6c, 0xdf, 0x03, 0xfd, 0xf7, 0xd9, 0x89, 0xf5, 0xe9, 0x5a, 0xc0, 0x62, 0xe2,
+ 0xb1, 0x91, 0x06, 0xfc, 0xe0, 0xea, 0xc9, 0x45, 0x4d, 0x1e, 0xfa, 0xf4, 0x7f, 0x01, 0x00, 0x00,
+ 0xff, 0xff, 0x46, 0x56, 0xfd, 0x90, 0x77, 0x13, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -1452,6 +1562,8 @@ type UserAPIClient interface {
SignToday(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Sign, error)
// 获取今日已签到记录
GetSignedToday(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Sign, error)
+ // 查询用户的下载记录
+ ListUserDownload(ctx context.Context, in *ListUserDownloadRequest, opts ...grpc.CallOption) (*ListUserDownloadReply, error)
// 找回密码:第一步,发送验证码
FindPasswordStepOne(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 找回密码:第二步,修改密码
@@ -1610,6 +1722,15 @@ func (c *userAPIClient) GetSignedToday(ctx context.Context, in *emptypb.Empty, o
return out, nil
}
+func (c *userAPIClient) ListUserDownload(ctx context.Context, in *ListUserDownloadRequest, opts ...grpc.CallOption) (*ListUserDownloadReply, error) {
+ out := new(ListUserDownloadReply)
+ err := c.cc.Invoke(ctx, "/api.v1.UserAPI/ListUserDownload", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *userAPIClient) FindPasswordStepOne(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, "/api.v1.UserAPI/FindPasswordStepOne", in, out, opts...)
@@ -1665,6 +1786,8 @@ type UserAPIServer interface {
SignToday(context.Context, *emptypb.Empty) (*Sign, error)
// 获取今日已签到记录
GetSignedToday(context.Context, *emptypb.Empty) (*Sign, error)
+ // 查询用户的下载记录
+ ListUserDownload(context.Context, *ListUserDownloadRequest) (*ListUserDownloadReply, error)
// 找回密码:第一步,发送验证码
FindPasswordStepOne(context.Context, *FindPasswordRequest) (*emptypb.Empty, error)
// 找回密码:第二步,修改密码
@@ -1723,6 +1846,9 @@ func (*UnimplementedUserAPIServer) SignToday(ctx context.Context, req *emptypb.E
func (*UnimplementedUserAPIServer) GetSignedToday(ctx context.Context, req *emptypb.Empty) (*Sign, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSignedToday not implemented")
}
+func (*UnimplementedUserAPIServer) ListUserDownload(ctx context.Context, req *ListUserDownloadRequest) (*ListUserDownloadReply, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ListUserDownload not implemented")
+}
func (*UnimplementedUserAPIServer) FindPasswordStepOne(ctx context.Context, req *FindPasswordRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindPasswordStepOne not implemented")
}
@@ -2022,6 +2148,24 @@ func _UserAPI_GetSignedToday_Handler(srv interface{}, ctx context.Context, dec f
return interceptor(ctx, in, info, handler)
}
+func _UserAPI_ListUserDownload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(ListUserDownloadRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(UserAPIServer).ListUserDownload(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/api.v1.UserAPI/ListUserDownload",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(UserAPIServer).ListUserDownload(ctx, req.(*ListUserDownloadRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _UserAPI_FindPasswordStepOne_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FindPasswordRequest)
if err := dec(in); err != nil {
@@ -2126,6 +2270,10 @@ var _UserAPI_serviceDesc = grpc.ServiceDesc{
MethodName: "GetSignedToday",
Handler: _UserAPI_GetSignedToday_Handler,
},
+ {
+ MethodName: "ListUserDownload",
+ Handler: _UserAPI_ListUserDownload_Handler,
+ },
{
MethodName: "FindPasswordStepOne",
Handler: _UserAPI_FindPasswordStepOne_Handler,
@@ -3152,6 +3300,81 @@ func (m *Sign) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *ListUserDownloadRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ListUserDownloadRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ListUserDownloadRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Size_ != 0 {
+ i = encodeVarintUser(dAtA, i, uint64(m.Size_))
+ i--
+ dAtA[i] = 0x10
+ }
+ if m.Page != 0 {
+ i = encodeVarintUser(dAtA, i, uint64(m.Page))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *ListUserDownloadReply) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *ListUserDownloadReply) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *ListUserDownloadReply) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Download) > 0 {
+ for iNdEx := len(m.Download) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Download[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintUser(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ if m.Total != 0 {
+ i = encodeVarintUser(dAtA, i, uint64(m.Total))
+ i--
+ dAtA[i] = 0x8
+ }
+ return len(dAtA) - i, nil
+}
+
func encodeVarintUser(dAtA []byte, offset int, v uint64) int {
offset -= sovUser(v)
base := offset
@@ -3622,6 +3845,39 @@ func (m *Sign) Size() (n int) {
return n
}
+func (m *ListUserDownloadRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Page != 0 {
+ n += 1 + sovUser(uint64(m.Page))
+ }
+ if m.Size_ != 0 {
+ n += 1 + sovUser(uint64(m.Size_))
+ }
+ return n
+}
+
+func (m *ListUserDownloadReply) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Total != 0 {
+ n += 1 + sovUser(uint64(m.Total))
+ }
+ if len(m.Download) > 0 {
+ for _, e := range m.Download {
+ l = e.Size()
+ n += 1 + l + sovUser(uint64(l))
+ }
+ }
+ return n
+}
+
func sovUser(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -6903,6 +7159,197 @@ func (m *Sign) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *ListUserDownloadRequest) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowUser
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ListUserDownloadRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ListUserDownloadRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Page", wireType)
+ }
+ m.Page = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowUser
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Page |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType)
+ }
+ m.Size_ = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowUser
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Size_ |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ default:
+ iNdEx = preIndex
+ skippy, err := skipUser(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthUser
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *ListUserDownloadReply) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowUser
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: ListUserDownloadReply: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: ListUserDownloadReply: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 0 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType)
+ }
+ m.Total = 0
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowUser
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ m.Total |= int64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Download", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowUser
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthUser
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthUser
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Download = append(m.Download, &Download{})
+ if err := m.Download[len(m.Download)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipUser(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthUser
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func skipUser(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/api/v1/user.pb.gw.go b/api/v1/user.pb.gw.go
index 99a4661..9cb420c 100644
--- a/api/v1/user.pb.gw.go
+++ b/api/v1/user.pb.gw.go
@@ -508,6 +508,42 @@ func local_request_UserAPI_GetSignedToday_0(ctx context.Context, marshaler runti
}
+var (
+ filter_UserAPI_ListUserDownload_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_UserAPI_ListUserDownload_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ListUserDownloadRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserAPI_ListUserDownload_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.ListUserDownload(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_UserAPI_ListUserDownload_0(ctx context.Context, marshaler runtime.Marshaler, server UserAPIServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq ListUserDownloadRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserAPI_ListUserDownload_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.ListUserDownload(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_UserAPI_FindPasswordStepOne_0(ctx context.Context, marshaler runtime.Marshaler, client UserAPIClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq FindPasswordRequest
var metadata runtime.ServerMetadata
@@ -950,6 +986,29 @@ func RegisterUserAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, se
})
+ mux.Handle("GET", pattern_UserAPI_ListUserDownload_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_UserAPI_ListUserDownload_0(rctx, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_UserAPI_ListUserDownload_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_UserAPI_FindPasswordStepOne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1357,6 +1416,26 @@ func RegisterUserAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl
})
+ mux.Handle("GET", pattern_UserAPI_ListUserDownload_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_UserAPI_ListUserDownload_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_UserAPI_ListUserDownload_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("POST", pattern_UserAPI_FindPasswordStepOne_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1433,6 +1512,8 @@ var (
pattern_UserAPI_GetSignedToday_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "sign"}, "", runtime.AssumeColonVerbOpt(true)))
+ pattern_UserAPI_ListUserDownload_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v1", "user", "download"}, "", runtime.AssumeColonVerbOpt(true)))
+
pattern_UserAPI_FindPasswordStepOne_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "user", "findpassword", "stepone"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_UserAPI_FindPasswordStepTwo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"api", "v1", "user", "findpassword", "steptwo"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1471,6 +1552,8 @@ var (
forward_UserAPI_GetSignedToday_0 = runtime.ForwardResponseMessage
+ forward_UserAPI_ListUserDownload_0 = runtime.ForwardResponseMessage
+
forward_UserAPI_FindPasswordStepOne_0 = runtime.ForwardResponseMessage
forward_UserAPI_FindPasswordStepTwo_0 = runtime.ForwardResponseMessage
diff --git a/api/v1/user.proto b/api/v1/user.proto
index c9a5572..b227fa0 100644
--- a/api/v1/user.proto
+++ b/api/v1/user.proto
@@ -6,6 +6,7 @@ import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "api/v1/permission.proto";
+import "api/v1/download.proto";
package api.v1;
@@ -164,6 +165,16 @@ message Sign {
int32 award = 6; // 签到积分奖励
}
+message ListUserDownloadRequest {
+ int64 page = 1; // 页码
+ int64 size = 2; // 每页数量
+}
+
+message ListUserDownloadReply {
+ int64 total = 1; // 总数
+ repeated Download download = 2; // 下载列表
+}
+
service UserAPI {
// 用户注册
rpc Register(RegisterAndLoginRequest) returns (LoginReply) {
@@ -289,6 +300,14 @@ service UserAPI {
};
}
+ // 查询用户的下载记录
+ rpc ListUserDownload(ListUserDownloadRequest)
+ returns (ListUserDownloadReply) {
+ option (google.api.http) = {
+ get : '/api/v1/user/download',
+ };
+ }
+
// 找回密码:第一步,发送验证码
rpc FindPasswordStepOne(FindPasswordRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
diff --git a/biz/user.go b/biz/user.go
index 997d54c..d7467a0 100644
--- a/biz/user.go
+++ b/biz/user.go
@@ -724,3 +724,28 @@ func (s *UserAPIService) FindPasswordStepTwo(ctx context.Context, req *v1.FindPa
return &emptypb.Empty{}, nil
}
+
+// 列表下载 ListUserDownload
+func (s *UserAPIService) ListUserDownload(ctx context.Context, req *v1.ListUserDownloadRequest) (res *v1.ListUserDownloadReply, err error) {
+ userClaims, err := checkGRPCLogin(s.dbModel, ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ // 查询下载列表
+ opt := &model.OptionGetDownloadList{
+ QueryIn: make(map[string][]interface{}),
+ Page: int(req.Page),
+ Size: int(req.Size_),
+ WithCount: true,
+ }
+
+ s.logger.Debug("ListUserDownload", zap.Any("opt", opt))
+
+ opt.QueryIn["user_id"] = []interface{}{userClaims.UserId}
+ downloads, total, err := s.dbModel.GetDownloadList(opt)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, err.Error())
+ }
+ return &v1.ListUserDownloadReply{Download: downloads, Total: total}, nil
+}
diff --git a/model/download.go b/model/download.go
index 84cd380..da91ce8 100644
--- a/model/download.go
+++ b/model/download.go
@@ -2,7 +2,7 @@ package model
import (
"fmt"
- "strings"
+ v1 "moredoc/api/v1"
"time"
"go.uber.org/zap"
@@ -79,54 +79,33 @@ func (m *DBModel) GetDownload(id interface{}, fields ...string) (download Downlo
}
type OptionGetDownloadList struct {
- Page int
- Size int
- WithCount bool // 是否返回总数
- Ids []interface{} // id列表
- SelectFields []string // 查询字段
- QueryRange map[string][2]interface{} // map[field][]{min,max}
- QueryIn map[string][]interface{} // map[field][]{value1,value2,...}
- QueryLike map[string][]interface{} // map[field][]{value1,value2,...}
- Sort []string
+ Page int
+ Size int
+ WithCount bool // 是否返回总数
+ Ids []interface{} // id列表
+ QueryIn map[string][]interface{} // map[field][]{value1,value2,...}
}
// GetDownloadList 获取Download列表
-func (m *DBModel) GetDownloadList(opt OptionGetDownloadList) (downloadList []Download, total int64, err error) {
- db := m.db.Model(&Download{})
-
- for field, rangeValue := range opt.QueryRange {
- fields := m.FilterValidFields(Download{}.TableName(), field)
- if len(fields) == 0 {
- continue
- }
- if rangeValue[0] != nil {
- db = db.Where(fmt.Sprintf("%s >= ?", field), rangeValue[0])
- }
- if rangeValue[1] != nil {
- db = db.Where(fmt.Sprintf("%s <= ?", field), rangeValue[1])
- }
- }
-
- for field, values := range opt.QueryIn {
- fields := m.FilterValidFields(Download{}.TableName(), field)
- if len(fields) == 0 {
- continue
- }
- db = db.Where(fmt.Sprintf("%s in (?)", field), values)
- }
-
- for field, values := range opt.QueryLike {
- fields := m.FilterValidFields(Download{}.TableName(), field)
- if len(fields) == 0 {
- continue
- }
- db = db.Where(strings.TrimSuffix(fmt.Sprintf(strings.Join(make([]string, len(values)+1), "%s like ? or"), field), "or"), values...)
- }
+func (m *DBModel) GetDownloadList(opt *OptionGetDownloadList) (downloadList []*v1.Download, total int64, err error) {
+ var (
+ tableDownload = Download{}.TableName()
+ tableDocument = Document{}.TableName()
+ )
+ db := m.db.Model(&Download{})
+ db = m.generateQueryIn(db, tableDownload+" "+tableDownload /* 加上表别名,防止字段冲突 */, opt.QueryIn)
if len(opt.Ids) > 0 {
- db = db.Where("id in (?)", opt.Ids)
+ db = db.Where(fmt.Sprintf("%s.id in (?)", tableDownload), opt.Ids)
}
+ db = db.Joins(
+ fmt.Sprintf(
+ "left join %s on %s.document_id = %s.id",
+ tableDocument, tableDownload, tableDocument,
+ )).
+ Where(fmt.Sprintf("%s.id > ?", tableDocument), 0)
+
if opt.WithCount {
err = db.Count(&total).Error
if err != nil {
@@ -135,30 +114,9 @@ func (m *DBModel) GetDownloadList(opt OptionGetDownloadList) (downloadList []Dow
}
}
- opt.SelectFields = m.FilterValidFields(Download{}.TableName(), opt.SelectFields...)
- if len(opt.SelectFields) > 0 {
- db = db.Select(opt.SelectFields)
- }
-
- if len(opt.Sort) > 0 {
- var sorts []string
- for _, sort := range opt.Sort {
- slice := strings.Split(sort, " ")
- if len(m.FilterValidFields(Download{}.TableName(), slice[0])) == 0 {
- continue
- }
-
- if len(slice) == 2 {
- sorts = append(sorts, fmt.Sprintf("%s %s", slice[0], slice[1]))
- } else {
- sorts = append(sorts, fmt.Sprintf("%s desc", slice[0]))
- }
- }
- if len(sorts) > 0 {
- db = db.Order(strings.Join(sorts, ","))
- }
- }
-
+ // size 为了避免字段冲突,加上了后缀_,即 size_
+ db = db.Select(fmt.Sprintf("%s.*, %s.*, %s.size as size_", tableDocument, tableDownload, tableDocument))
+ db = db.Order(fmt.Sprintf("%s.id desc", tableDownload))
db = db.Offset((opt.Page - 1) * opt.Size).Limit(opt.Size)
err = db.Find(&downloadList).Error
diff --git a/web/api/user.js b/web/api/user.js
index 749812a..e3e3dc1 100644
--- a/web/api/user.js
+++ b/web/api/user.js
@@ -103,6 +103,14 @@ export const getDynamics = (params) => {
})
}
+export const getUserDownloads = (params) => {
+ return service({
+ url: '/api/v1/user/download',
+ method: 'get',
+ params,
+ })
+}
+
export const getUserPermissions = (params) => {
return service({
url: '/api/v1/user/permission',
diff --git a/web/components/UserDownload.vue b/web/components/UserDownload.vue
new file mode 100644
index 0000000..e6a8506
--- /dev/null
+++ b/web/components/UserDownload.vue
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+
diff --git a/web/pages/me/download.vue b/web/pages/me/download.vue
index 35a96c7..27b9d2b 100644
--- a/web/pages/me/download.vue
+++ b/web/pages/me/download.vue
@@ -1,3 +1,15 @@
- download
+
+
+
+