获取用户下载的文档列表

dev
truthhun 1 year ago
parent acc2ad732a
commit f7c77aa01a

File diff suppressed because it is too large Load Diff

@ -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',
// };
// }
}

@ -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, 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, 0xa5, 0x9c, 0xbd, 0xe1, 0x27,
0x52, 0x61, 0xdc, 0x1f, 0xcb, 0xa3, 0xbe, 0xef, 0xec, 0x64, 0x8e, 0xba, 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

@ -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

@ -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) = {

@ -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
}

@ -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

@ -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',

@ -0,0 +1,157 @@
<template>
<div class="com-user-download">
<el-table v-loading="loading" :data="downloads" style="width: 100%">
<el-table-column prop="title" label="文档" min-width="300" fixed="left">
<template slot-scope="scope">
<nuxt-link
target="_blank"
:to="{
name: 'document-id',
params: { id: scope.row.document_id },
}"
class="el-link el-link--default doc-title"
>
<img :src="`/static/images/${scope.row.icon}_24.png`" alt="" />
{{ scope.row.title || '已被删除' }}
</nuxt-link>
</template>
</el-table-column>
<el-table-column prop="score" label="评分" width="110">
<template slot-scope="scope">
<el-rate
:value="scope.row.score || 0.0"
disabled
score-template="{value}"
></el-rate>
</template>
</el-table-column>
<el-table-column prop="page" label="页数" width="70">
<template slot-scope="scope">{{ scope.row.pages || '-' }}</template>
</el-table-column>
<el-table-column prop="size" label="大小" width="100">
<template slot-scope="scope">{{
formatBytes(scope.row.size)
}}</template>
</el-table-column>
<el-table-column prop="created_at" label="下载时间" width="160">
<template slot-scope="scope">
<el-tooltip
:content="formatDatetime(scope.row.created_at)"
placement="top"
>
<span>{{ formatRelativeTime(scope.row.created_at) }}</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<el-pagination
v-if="total > 0"
:current-page="query.page"
:page-size="query.size"
:layout="
isMobile
? 'total, prev, pager, next'
: 'total, prev, pager, next, jumper'
"
:pager-count="isMobile ? 5 : 7"
:small="isMobile"
:total="total"
class="mgt-20px"
@current-change="pageChange"
>
</el-pagination>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { getUserDownloads } from '~/api/user'
import {
formatDatetime,
formatRelativeTime,
formatBytes,
getIcon,
} from '~/utils/utils'
export default {
name: 'UserDownload',
props: {
userId: {
type: Number,
default: 0,
},
},
data() {
return {
downloads: [],
total: 0,
loading: false,
query: {
page: parseInt(this.$route.query.page) || 1,
size: 20,
},
}
},
watch: {
'$route.query.page': {
handler(val) {
this.query.page = parseInt(val) || 1
this.getUserDownloads()
},
immediate: true,
},
},
computed: {
...mapGetters('user', ['user']),
...mapGetters('device', ['isMobile']),
},
methods: {
formatDatetime,
formatRelativeTime,
formatBytes,
async getUserDownloads() {
this.loading = true
const res = await getUserDownloads({
page: this.query.page,
size: this.query.size,
})
if (res.status === 200) {
let downloads = res.data.download || []
downloads = downloads.map((item) => {
item.score = item.score / 100 || 3.0
try {
item.icon = getIcon(item.ext)
} catch (error) {}
return item
})
this.downloads = downloads
this.total = res.data.total || 0
}
this.loading = false
},
pageChange(page) {
this.$router.push({
query: {
page,
},
})
},
},
}
</script>
<style lang="scss">
.com-user-download {
.doc-title {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 180%;
img {
height: 18px;
position: relative;
top: 3px;
}
}
}
</style>

@ -1,3 +1,15 @@
<template>
<div>download</div>
<div>
<user-download :user-id="user.id" />
</div>
</template>
<script>
export default {
props: {
user: {
type: Object,
default: () => ({}),
},
},
}
</script>

Loading…
Cancel
Save