truthhun 1 year ago
parent 568b6a07f7
commit 0dde4f77e5

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 文档分类
type Category struct {
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
ParentId int32 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
@ -141,6 +142,7 @@ func (m *Category) GetUpdatedAt() *time.Time {
return nil
}
// 分类列表请求
type ListCategoryRequest 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"`
@ -225,6 +227,7 @@ func (m *ListCategoryRequest) GetField() []string {
return nil
}
// 分类列表响应
type ListCategoryReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Category []*Category `protobuf:"bytes,2,rep,name=category,proto3" json:"category,omitempty"`
@ -277,6 +280,7 @@ func (m *ListCategoryReply) GetCategory() []*Category {
return nil
}
// 删除分类请求
type DeleteCategoryRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -321,6 +325,7 @@ func (m *DeleteCategoryRequest) GetId() []int64 {
return nil
}
// 获取分类请求
type GetCategoryRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
@ -432,10 +437,15 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type CategoryAPIClient interface {
// 创建分类
CreateCategory(ctx context.Context, in *Category, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 更新分类
UpdateCategory(ctx context.Context, in *Category, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 删除分类
DeleteCategory(ctx context.Context, in *DeleteCategoryRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 获取分类
GetCategory(ctx context.Context, in *GetCategoryRequest, opts ...grpc.CallOption) (*Category, error)
// 分类列表
ListCategory(ctx context.Context, in *ListCategoryRequest, opts ...grpc.CallOption) (*ListCategoryReply, error)
}
@ -494,10 +504,15 @@ func (c *categoryAPIClient) ListCategory(ctx context.Context, in *ListCategoryRe
// CategoryAPIServer is the server API for CategoryAPI service.
type CategoryAPIServer interface {
// 创建分类
CreateCategory(context.Context, *Category) (*emptypb.Empty, error)
// 更新分类
UpdateCategory(context.Context, *Category) (*emptypb.Empty, error)
// 删除分类
DeleteCategory(context.Context, *DeleteCategoryRequest) (*emptypb.Empty, error)
// 获取分类
GetCategory(context.Context, *GetCategoryRequest) (*Category, error)
// 分类列表
ListCategory(context.Context, *ListCategoryRequest) (*ListCategoryReply, error)
}

@ -12,41 +12,48 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
//
message Category {
int32 id = 1;
int32 parent_id = 2;
string title = 3 [(gogoproto.moretags) = "validate:\"required\""];
int32 doc_count = 4;
int32 sort = 5;
bool enable = 6;
int32 id = 1; // ID
int32 parent_id = 2; // ID
string title = 3
[ (gogoproto.moretags) = "validate:\"required\"" ]; //
int32 doc_count = 4; //
int32 sort = 5; //
bool enable = 6; //
string cover = 9; //
google.protobuf.Timestamp created_at = 7 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 8 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp created_at = 7
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 8
[ (gogoproto.stdtime) = true ]; //
}
//
message ListCategoryRequest {
int64 page = 1;
int64 size = 2;
repeated int64 parent_id = 3;
string wd = 4;
repeated bool enable = 5;
repeated string field = 6;
int64 page = 1; //
int64 size = 2; //
repeated int64 parent_id = 3; // ID
string wd = 4; //
repeated bool enable = 5; //
repeated string field = 6; //
}
//
message ListCategoryReply {
int64 total = 1;
repeated Category category = 2;
int64 total = 1; //
repeated Category category = 2; //
}
message DeleteCategoryRequest{
repeated int64 id = 1;
}
//
message DeleteCategoryRequest { repeated int64 id = 1; }
message GetCategoryRequest{
int64 id = 1;
}
//
message GetCategoryRequest { int64 id = 1; }
// API
service CategoryAPI {
//
rpc CreateCategory(Category) returns (google.protobuf.Empty) {
option (google.api.http) = {
post : '/api/v1/category',
@ -54,6 +61,7 @@ service CategoryAPI {
};
}
//
rpc UpdateCategory(Category) returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/category',
@ -61,18 +69,21 @@ service CategoryAPI {
};
}
//
rpc DeleteCategory(DeleteCategoryRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/category',
};
}
//
rpc GetCategory(GetCategoryRequest) returns (Category) {
option (google.api.http) = {
get : '/api/v1/category',
};
}
//
rpc ListCategory(ListCategoryRequest) returns (ListCategoryReply) {
option (google.api.http) = {
get : '/api/v1/category/list',

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 评论
type Comment struct {
CreatedAt *time.Time `protobuf:"bytes,1,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
UpdatedAt *time.Time `protobuf:"bytes,2,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
@ -157,6 +158,7 @@ func (m *Comment) GetDocumentTitle() string {
return ""
}
// 审核评论,修改评论状态
type CheckCommentRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
@ -209,6 +211,7 @@ func (m *CheckCommentRequest) GetStatus() int32 {
return 0
}
// 删除评论请求
type DeleteCommentRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -253,6 +256,7 @@ func (m *DeleteCommentRequest) GetId() []int64 {
return nil
}
// 获取评论请求
type GetCommentRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
@ -297,6 +301,7 @@ func (m *GetCommentRequest) GetId() int64 {
return 0
}
// 获取评论列表请求
type ListCommentRequest 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"`
@ -413,6 +418,7 @@ func (m *ListCommentRequest) GetWithDocumentTitle() bool {
return false
}
// 获取评论列表响应
type ListCommentReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Comment []*Comment `protobuf:"bytes,2,rep,name=comment,proto3" json:"comment,omitempty"`
@ -465,6 +471,7 @@ func (m *ListCommentReply) GetComment() []*Comment {
return nil
}
// 创建评论请求
type CreateCommentRequest struct {
DocumentId int64 `protobuf:"varint,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
ParentId int64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
@ -620,6 +627,7 @@ const _ = grpc.SupportPackageIsVersion4
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type CommentAPIClient interface {
// 创建评论
CreateComment(ctx context.Context, in *CreateCommentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 更新评论,仅限管理员操作
UpdateComment(ctx context.Context, in *Comment, opts ...grpc.CallOption) (*emptypb.Empty, error)
@ -697,6 +705,7 @@ func (c *commentAPIClient) CheckComment(ctx context.Context, in *CheckCommentReq
// CommentAPIServer is the server API for CommentAPI service.
type CommentAPIServer interface {
// 创建评论
CreateComment(context.Context, *CreateCommentRequest) (*emptypb.Empty, error)
// 更新评论,仅限管理员操作
UpdateComment(context.Context, *Comment) (*emptypb.Empty, error)

@ -1,4 +1,4 @@
syntax="proto3";
syntax = "proto3";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
@ -13,101 +13,109 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
message Comment{
google.protobuf.Timestamp created_at = 1 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 2 [ (gogoproto.stdtime) = true ];
int64 id = 3;
int64 parent_id = 4;
string content = 5;
int64 document_id = 6;
int32 status = 7;
int32 comment_count = 8;
int64 user_id = 9;
User user = 10;
string document_title=11;
//
message Comment {
google.protobuf.Timestamp created_at = 1
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 2
[ (gogoproto.stdtime) = true ]; //
int64 id = 3; // ID
int64 parent_id = 4; // ID
string content = 5; //
int64 document_id = 6; // ID
int32 status = 7; // web/utils/enum.js
int32 comment_count = 8; //
int64 user_id = 9; // ID
User user = 10; //
string document_title = 11; //
}
//
message CheckCommentRequest {
repeated int64 id = 1;
int32 status = 2;
repeated int64 id = 1; // ID
int32 status = 2; // web/utils/enum.js
}
message DeleteCommentRequest {
repeated int64 id = 1;
}
//
message DeleteCommentRequest { repeated int64 id = 1; }
message GetCommentRequest {
int64 id = 1;
}
//
message GetCommentRequest { int64 id = 1; }
//
message ListCommentRequest {
int64 page = 1;
int64 size = 2;
string wd = 3;
repeated string field = 4;
string order = 5;
repeated int32 status = 6;
int64 document_id = 7;
int64 user_id = 8;
repeated int64 parent_id = 9;
bool with_document_title = 10;
int64 page = 1; //
int64 size = 2; //
string wd = 3; //
repeated string field = 4; //
string order = 5; //
repeated int32 status = 6; // web/utils/enum.js
int64 document_id = 7; // ID
int64 user_id = 8; // ID
repeated int64 parent_id = 9; // ID
bool with_document_title = 10; //
}
//
message ListCommentReply {
int64 total = 1;
repeated Comment comment = 2;
int64 total = 1; //
repeated Comment comment = 2; //
}
message CreateCommentRequest{
int64 document_id = 1;
int64 parent_id = 2;
string content = 3;
string captcha_id = 4;
string captcha = 5;
//
message CreateCommentRequest {
int64 document_id = 1; // ID
int64 parent_id = 2; // ID
string content = 3; //
string captcha_id = 4; // ID
string captcha = 5; //
}
service CommentAPI{
rpc CreateComment (CreateCommentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: '/api/v1/comment',
body: '*',
};
}
//
rpc UpdateComment (Comment) returns (google.protobuf.Empty){
option (google.api.http) = {
put: '/api/v1/comment',
body: '*',
};
}
//
rpc DeleteComment (DeleteCommentRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
delete: '/api/v1/comment',
};
}
//
rpc GetComment (GetCommentRequest) returns (Comment){
option (google.api.http) = {
get: '/api/v1/comment',
};
}
//
rpc ListComment (ListCommentRequest) returns (ListCommentReply){
option (google.api.http) = {
get: '/api/v1/comment/list',
};
}
//
rpc CheckComment (CheckCommentRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
post: '/api/v1/comment/check',
body: '*',
};
}
//
service CommentAPI {
//
rpc CreateComment(CreateCommentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post : '/api/v1/comment',
body : '*',
};
}
//
rpc UpdateComment(Comment) returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/comment',
body : '*',
};
}
//
rpc DeleteComment(DeleteCommentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/comment',
};
}
//
rpc GetComment(GetCommentRequest) returns (Comment) {
option (google.api.http) = {
get : '/api/v1/comment',
};
}
//
rpc ListComment(ListCommentRequest) returns (ListCommentReply) {
option (google.api.http) = {
get : '/api/v1/comment/list',
};
}
//
rpc CheckComment(CheckCommentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post : '/api/v1/comment/check',
body : '*',
};
}
}

@ -33,18 +33,20 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 配置
type Config struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
Placeholder string `protobuf:"bytes,5,opt,name=placeholder,proto3" json:"placeholder,omitempty"`
InputType string `protobuf:"bytes,6,opt,name=input_type,json=inputType,proto3" json:"input_type,omitempty"`
Category string `protobuf:"bytes,7,opt,name=category,proto3" json:"category,omitempty"`
Sort int32 `protobuf:"varint,8,opt,name=sort,proto3" json:"sort,omitempty"`
Options string `protobuf:"bytes,9,opt,name=options,proto3" json:"options,omitempty"`
CreatedAt *time.Time `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
UpdatedAt *time.Time `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
Placeholder string `protobuf:"bytes,5,opt,name=placeholder,proto3" json:"placeholder,omitempty"`
InputType string `protobuf:"bytes,6,opt,name=input_type,json=inputType,proto3" json:"input_type,omitempty"`
// element-ui 的 el-input 的 type 属性
Category string `protobuf:"bytes,7,opt,name=category,proto3" json:"category,omitempty"`
Sort int32 `protobuf:"varint,8,opt,name=sort,proto3" json:"sort,omitempty"`
Options string `protobuf:"bytes,9,opt,name=options,proto3" json:"options,omitempty"`
CreatedAt *time.Time `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
UpdatedAt *time.Time `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3,stdtime" json:"updated_at,omitempty"`
}
func (m *Config) Reset() { *m = Config{} }
@ -157,6 +159,7 @@ func (m *Config) GetUpdatedAt() *time.Time {
return nil
}
// 查询配置项请求
type ListConfigRequest struct {
Category []string `protobuf:"bytes,1,rep,name=category,proto3" json:"category,omitempty"`
}
@ -201,6 +204,7 @@ func (m *ListConfigRequest) GetCategory() []string {
return nil
}
// 配置列表
type Configs struct {
Config []*Config `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"`
}
@ -463,7 +467,7 @@ func (m *ConfigSystem) GetVersion() string {
return ""
}
// 底链配置项
// 底链配置项,为跳转的链接地址
type ConfigFooter struct {
About string `protobuf:"bytes,1,opt,name=about,proto3" json:"about,omitempty"`
Contact string `protobuf:"bytes,2,opt,name=contact,proto3" json:"contact,omitempty"`
@ -665,6 +669,7 @@ func (m *ConfigSecurity) GetLoginRequired() bool {
return false
}
// 系统配置
type Settings struct {
System *ConfigSystem `protobuf:"bytes,1,opt,name=system,proto3" json:"system,omitempty"`
Footer *ConfigFooter `protobuf:"bytes,2,opt,name=footer,proto3" json:"footer,omitempty"`
@ -725,6 +730,7 @@ func (m *Settings) GetSecurity() *ConfigSecurity {
return nil
}
// 依赖项
type EnvDependent struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
@ -817,6 +823,7 @@ func (m *EnvDependent) GetIsRequired() bool {
return false
}
// 依赖项列表
type Envs struct {
Envs []*EnvDependent `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty"`
}
@ -861,6 +868,7 @@ func (m *Envs) GetEnvs() []*EnvDependent {
return nil
}
// 系统状态
type Stats struct {
UserCount int64 `protobuf:"varint,1,opt,name=user_count,json=userCount,proto3" json:"user_count,omitempty"`
DocumentCount int64 `protobuf:"varint,2,opt,name=document_count,json=documentCount,proto3" json:"document_count,omitempty"`

@ -12,81 +12,92 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
//
message Config {
int64 id = 1;
string label = 2;
string name = 3;
string value = 4;
string placeholder = 5;
string input_type = 6;
string category = 7;
int32 sort = 8;
string options = 9;
google.protobuf.Timestamp created_at = 10 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 11 [ (gogoproto.stdtime) = true ];
int64 id = 1; // ID
string label = 2; //
string name = 3; //
string value = 4; //
string placeholder = 5; //
string input_type = 6; // textareanumberswitch
// element-ui el-input type
string category =
7; // systemfootersecurity web/utils/enum.js
int32 sort = 8; //
string options =
9; // selectoption key=value
google.protobuf.Timestamp created_at = 10
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 11
[ (gogoproto.stdtime) = true ]; //
}
//
message ListConfigRequest { repeated string category = 1; }
//
message Configs { repeated Config config = 1; }
//
message ConfigCaptcha {
int32 length = 1;
int32 width = 2;
int32 height = 3;
string type = 4;
int32 length = 1; //
int32 width = 2; //
int32 height = 3; //
string type = 4; // web/utils/enum.js
}
//
message ConfigSystem {
string domain = 1;
string title = 2;
string keywords = 3;
string description = 4;
string logo = 5;
string favicon = 6;
string icp = 7;
string analytics = 8;
string sitename = 9;
string copyright_start_year = 10;
string register_background = 11;
string login_background = 12;
repeated string recommend_words = 13;
string version = 14; //
string domain = 1; // https://moredoc.mnt.ltd
string title = 2; //
string keywords = 3; // SEO
string description = 4; // SEO
string logo = 5; // logo
string favicon = 6; // favicon
string icp = 7; //
string analytics = 8; //
string sitename = 9; //
string copyright_start_year =
10; // 2018 2018 - 2023
string register_background = 11; //
string login_background = 12; //
repeated string recommend_words = 13; //
string version = 14; //
}
//
//
message ConfigFooter {
string about = 1;
string contact = 2;
string agreement = 3;
string copyright = 4;
string feedback = 5;
string about = 1; //
string contact = 2; //
string agreement = 3; //
string copyright = 4; //
string feedback = 5; //
}
//
message ConfigSecurity {
bool is_close = 1;
string close_statement = 2;
bool enable_register = 3;
bool enable_captcha_login = 4;
bool enable_captcha_register = 5;
bool enable_captcha_comment = 6;
bool enable_captcha_find_password = 7;
bool enable_captcha_upload = 8;
int32 max_document_size = 9;
repeated string document_allowed_ext = 10;
bool login_required = 11; // 访
bool is_close = 1; //
string close_statement = 2; // HTML
bool enable_register = 3; //
bool enable_captcha_login = 4; //
bool enable_captcha_register = 5; //
bool enable_captcha_comment = 6; //
bool enable_captcha_find_password = 7; //
bool enable_captcha_upload = 8; //
int32 max_document_size = 9; //
repeated string document_allowed_ext = 10; //
bool login_required = 11; // 访
}
//
message Settings {
ConfigSystem system = 1;
ConfigFooter footer = 2;
ConfigSecurity security = 3;
ConfigSystem system = 1; //
ConfigFooter footer = 2; //
ConfigSecurity security = 3; //
// ConfigCaptcha captcha = 4;
}
//
message EnvDependent {
string name = 1; //
string description = 2; //
@ -98,24 +109,28 @@ message EnvDependent {
bool is_required = 7; //
}
//
message Envs { repeated EnvDependent envs = 1; }
//
message Stats {
int64 user_count = 1;
int64 document_count = 2;
int64 category_count = 3;
int64 article_count = 4;
int64 comment_count = 5;
int64 banner_count = 6;
int64 friendlink_count = 7;
string os = 8;
string version = 9;
string hash = 10;
string build_at = 11;
int64 report_count = 12;
int64 user_count = 1; //
int64 document_count = 2; //
int64 category_count = 3; //
int64 article_count = 4; //
int64 comment_count = 5; //
int64 banner_count = 6; // banner
int64 friendlink_count = 7; //
string os = 8; //
string version = 9; //
string hash = 10; // git hash
string build_at = 11; //
int64 report_count = 12; //
}
//
service ConfigAPI {
//
rpc GetSettings(google.protobuf.Empty) returns (Settings) {
option (google.api.http) = {

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 文档
type Document struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
@ -333,6 +334,7 @@ func (m *Document) GetConvertError() string {
return ""
}
// 删除文档,放入回收站
type DeleteDocumentRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -377,6 +379,7 @@ func (m *DeleteDocumentRequest) GetId() []int64 {
return nil
}
// 恢复文档
type RecoverRecycleDocumentRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -421,6 +424,7 @@ func (m *RecoverRecycleDocumentRequest) GetId() []int64 {
return nil
}
// 查询文档
type GetDocumentRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
WithAuthor bool `protobuf:"varint,2,opt,name=with_author,json=withAuthor,proto3" json:"with_author,omitempty"`
@ -473,6 +477,7 @@ func (m *GetDocumentRequest) GetWithAuthor() bool {
return false
}
// 文档列表
type ListDocumentRequest 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"`
@ -589,6 +594,7 @@ func (m *ListDocumentRequest) GetLimit() int64 {
return 0
}
// 文档列表
type ListDocumentReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Document []*Document `protobuf:"bytes,2,rep,name=document,proto3" json:"document,omitempty"`
@ -641,6 +647,7 @@ func (m *ListDocumentReply) GetDocument() []*Document {
return nil
}
// 创建文档
type CreateDocumentItem struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
AttachmentId int64 `protobuf:"varint,2,opt,name=attachment_id,json=attachmentId,proto3" json:"attachment_id,omitempty"`
@ -701,6 +708,7 @@ func (m *CreateDocumentItem) GetPrice() int32 {
return 0
}
// 创建文档
type CreateDocumentRequest struct {
Overwrite bool `protobuf:"varint,1,opt,name=overwrite,proto3" json:"overwrite,omitempty"`
CategoryId []int64 `protobuf:"varint,2,rep,packed,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"`
@ -761,6 +769,7 @@ func (m *CreateDocumentRequest) GetDocument() []*CreateDocumentItem {
return nil
}
// 设置文档推荐
type SetDocumentRecommendRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
Type int32 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
@ -813,6 +822,7 @@ func (m *SetDocumentRecommendRequest) GetType() int32 {
return 0
}
// 查询文档(针对首页的查询)
type ListDocumentForHomeRequest struct {
Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"`
}
@ -857,6 +867,7 @@ func (m *ListDocumentForHomeRequest) GetLimit() int64 {
return 0
}
// 首页文档查询返回项
type ListDocumentForHomeItem struct {
CategoryId int64 `protobuf:"varint,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"`
CategoryCover string `protobuf:"bytes,2,opt,name=category_cover,json=categoryCover,proto3" json:"category_cover,omitempty"`
@ -925,6 +936,7 @@ func (m *ListDocumentForHomeItem) GetDocument() []*Document {
return nil
}
// 查询文档(针对首页的查询)
type ListDocumentForHomeResponse struct {
Document []*ListDocumentForHomeItem `protobuf:"bytes,1,rep,name=document,proto3" json:"document,omitempty"`
}
@ -1053,6 +1065,7 @@ func (m *SearchDocumentRequest) GetExt() string {
return ""
}
// 文档评分
type DocumentScore struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
DocumentId int64 `protobuf:"varint,2,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`

@ -14,87 +14,103 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
//
message Document {
int64 id = 1;
string title = 2;
string keywords = 3;
string description = 4;
int64 user_id = 5;
string cover = 6;
int32 width = 7;
int32 height = 8;
int32 preview = 9;
int32 pages = 10;
string uuid = 11;
int32 download_count = 12;
int32 view_count = 13;
int32 favorite_count = 14;
int32 comment_count = 15;
int32 score = 16;
int32 score_count = 17;
int32 price = 18;
int64 size = 19;
int32 status = 20;
google.protobuf.Timestamp created_at = 21 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 22 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp deleted_at = 23 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp recommend_at = 29 [ (gogoproto.stdtime) = true ];
int64 deleted_user_id = 24;
string username = 25;
repeated int64 category_id = 26;
string deleted_username = 27;
string ext = 28;
Attachment attachment = 30;
User user = 31;
bool enable_gzip = 32;
string convert_error = 33;
int64 id = 1; // ID
string title = 2; //
string keywords = 3; //
string description = 4; //
int64 user_id = 5; //
string cover = 6; //
int32 width = 7; //
int32 height = 8; //
int32 preview = 9; // 0
int32 pages = 10; //
string uuid = 11; // UUID
int32 download_count = 12; //
int32 view_count = 13; //
int32 favorite_count = 14; //
int32 comment_count = 15; //
int32 score = 16; //
int32 score_count = 17; //
int32 price = 18; //
int64 size = 19; //
int32 status = 20; // web/utils/enum.js
google.protobuf.Timestamp created_at = 21
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 22
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp deleted_at = 23
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp recommend_at = 29
[ (gogoproto.stdtime) = true ]; //
int64 deleted_user_id = 24; //
string username = 25; //
repeated int64 category_id = 26; // ID
string deleted_username = 27; //
string ext = 28; //
Attachment attachment = 30; //
User user = 31; //
bool enable_gzip = 32; // gzip
string convert_error = 33; //
}
//
message DeleteDocumentRequest { repeated int64 id = 1; }
//
message RecoverRecycleDocumentRequest { repeated int64 id = 1; }
//
message GetDocumentRequest {
int64 id = 1;
bool with_author = 2;
int64 id = 1; // ID
bool with_author = 2; //
}
//
message ListDocumentRequest {
int64 page = 1;
int64 size = 2;
string wd = 3;
repeated string field = 4;
string order = 5;
repeated int64 category_id = 6;
repeated int64 user_id = 7;
repeated int32 status = 8;
repeated bool is_recommend = 9;
int64 limit = 10;
int64 page = 1; //
int64 size = 2; //
string wd = 3; //
repeated string field = 4; //
string order = 5; //
repeated int64 category_id = 6; // ID
repeated int64 user_id = 7; // ID
repeated int32 status = 8; //
repeated bool is_recommend = 9; //
int64 limit = 10; // 0pagesize
}
//
message ListDocumentReply {
int64 total = 1;
repeated Document document = 2;
int64 total = 1; //
repeated Document document = 2; //
}
//
message CreateDocumentItem {
string title = 1;
int64 attachment_id = 2;
int32 price = 3;
string title = 1; //
int64 attachment_id = 2; // ID
int32 price = 3; //
}
//
message CreateDocumentRequest {
bool overwrite = 1;
repeated int64 category_id = 2;
repeated CreateDocumentItem document = 3;
bool overwrite = 1; //
repeated int64 category_id = 2; // ID
repeated CreateDocumentItem document = 3; //
}
//
message SetDocumentRecommendRequest {
repeated int64 id = 1;
int32 type = 2; // 0, 1: 2:
repeated int64 id = 1; // ID
int32 type = 2; // 0, 1: 2:
}
//
message ListDocumentForHomeRequest { int64 limit = 1; }
//
message ListDocumentForHomeItem {
int64 category_id = 1;
string category_cover = 2;
@ -102,6 +118,7 @@ message ListDocumentForHomeItem {
repeated Document document = 4;
}
//
message ListDocumentForHomeResponse {
repeated ListDocumentForHomeItem document = 1;
}
@ -115,11 +132,12 @@ message SearchDocumentRequest {
string ext = 7; //
}
//
message DocumentScore {
int64 id = 1;
int64 document_id = 2;
int64 user_id = 3;
int32 score = 4;
int32 score = 4; //
google.protobuf.Timestamp created_at = 5 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 6 [ (gogoproto.stdtime) = true ];
}

@ -26,20 +26,20 @@
<a name="api-v1-Category"></a>
### Category
文档分类
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int32](#int32) | | |
| parent_id | [int32](#int32) | | |
| title | [string](#string) | | |
| doc_count | [int32](#int32) | | |
| sort | [int32](#int32) | | |
| enable | [bool](#bool) | | |
| id | [int32](#int32) | | 分类ID |
| parent_id | [int32](#int32) | | 父分类ID |
| title | [string](#string) | | 分类标题 |
| doc_count | [int32](#int32) | | 文档数量 |
| sort | [int32](#int32) | | 排序,倒序排序,值越大越靠前 |
| enable | [bool](#bool) | | 是否启用 |
| cover | [string](#string) | | 分类封面 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
@ -49,7 +49,7 @@
<a name="api-v1-DeleteCategoryRequest"></a>
### DeleteCategoryRequest
删除分类请求
| Field | Type | Label | Description |
@ -64,7 +64,7 @@
<a name="api-v1-GetCategoryRequest"></a>
### GetCategoryRequest
获取分类请求
| Field | Type | Label | Description |
@ -79,13 +79,13 @@
<a name="api-v1-ListCategoryReply"></a>
### ListCategoryReply
分类列表响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| category | [Category](#api-v1-Category) | repeated | |
| total | [int64](#int64) | | 总数 |
| category | [Category](#api-v1-Category) | repeated | 分类列表 |
@ -95,17 +95,17 @@
<a name="api-v1-ListCategoryRequest"></a>
### ListCategoryRequest
分类列表请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| parent_id | [int64](#int64) | repeated | |
| wd | [string](#string) | | |
| enable | [bool](#bool) | repeated | |
| field | [string](#string) | repeated | |
| page | [int64](#int64) | | 页码 |
| size | [int64](#int64) | | 每页数量 |
| parent_id | [int64](#int64) | repeated | 父分类ID |
| wd | [string](#string) | | 搜索关键字 |
| enable | [bool](#bool) | repeated | 是否启用 |
| field | [string](#string) | repeated | 查询字段 |
@ -121,15 +121,15 @@
<a name="api-v1-CategoryAPI"></a>
### CategoryAPI
文档分类API服务
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| CreateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| UpdateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| DeleteCategory | [DeleteCategoryRequest](#api-v1-DeleteCategoryRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| GetCategory | [GetCategoryRequest](#api-v1-GetCategoryRequest) | [Category](#api-v1-Category) | |
| ListCategory | [ListCategoryRequest](#api-v1-ListCategoryRequest) | [ListCategoryReply](#api-v1-ListCategoryReply) | |
| CreateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | 创建分类 |
| UpdateCategory | [Category](#api-v1-Category) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新分类 |
| DeleteCategory | [DeleteCategoryRequest](#api-v1-DeleteCategoryRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除分类 |
| GetCategory | [GetCategoryRequest](#api-v1-GetCategoryRequest) | [Category](#api-v1-Category) | 获取分类 |
| ListCategory | [ListCategoryRequest](#api-v1-ListCategoryRequest) | [ListCategoryReply](#api-v1-ListCategoryReply) | 分类列表 |

@ -28,13 +28,13 @@
<a name="api-v1-CheckCommentRequest"></a>
### CheckCommentRequest
审核评论,修改评论状态
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
| status | [int32](#int32) | | |
| id | [int64](#int64) | repeated | 评论ID |
| status | [int32](#int32) | | 状态,见 web/utils/enum.js 枚举 |
@ -44,22 +44,22 @@
<a name="api-v1-Comment"></a>
### Comment
评论
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int64](#int64) | | |
| parent_id | [int64](#int64) | | |
| content | [string](#string) | | |
| document_id | [int64](#int64) | | |
| status | [int32](#int32) | | |
| comment_count | [int32](#int32) | | |
| user_id | [int64](#int64) | | |
| user | [User](#api-v1-User) | | |
| document_title | [string](#string) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
| id | [int64](#int64) | | 评论ID |
| parent_id | [int64](#int64) | | 父评论ID |
| content | [string](#string) | | 评论内容 |
| document_id | [int64](#int64) | | 文档ID |
| status | [int32](#int32) | | 状态,见 web/utils/enum.js 枚举 |
| comment_count | [int32](#int32) | | 回复数量 |
| user_id | [int64](#int64) | | 用户ID |
| user | [User](#api-v1-User) | | 用户信息 |
| document_title | [string](#string) | | 文档标题 |
@ -69,16 +69,16 @@
<a name="api-v1-CreateCommentRequest"></a>
### CreateCommentRequest
创建评论请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| document_id | [int64](#int64) | | |
| parent_id | [int64](#int64) | | |
| content | [string](#string) | | |
| captcha_id | [string](#string) | | |
| captcha | [string](#string) | | |
| document_id | [int64](#int64) | | 文档ID |
| parent_id | [int64](#int64) | | 父评论ID |
| content | [string](#string) | | 评论内容 |
| captcha_id | [string](#string) | | 验证码ID |
| captcha | [string](#string) | | 验证码 |
@ -88,7 +88,7 @@
<a name="api-v1-DeleteCommentRequest"></a>
### DeleteCommentRequest
删除评论请求
| Field | Type | Label | Description |
@ -103,7 +103,7 @@
<a name="api-v1-GetCommentRequest"></a>
### GetCommentRequest
获取评论请求
| Field | Type | Label | Description |
@ -118,13 +118,13 @@
<a name="api-v1-ListCommentReply"></a>
### ListCommentReply
获取评论列表响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| comment | [Comment](#api-v1-Comment) | repeated | |
| total | [int64](#int64) | | 总数 |
| comment | [Comment](#api-v1-Comment) | repeated | 评论列表 |
@ -134,21 +134,21 @@
<a name="api-v1-ListCommentRequest"></a>
### ListCommentRequest
获取评论列表请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| wd | [string](#string) | | |
| field | [string](#string) | repeated | |
| order | [string](#string) | | |
| status | [int32](#int32) | repeated | |
| document_id | [int64](#int64) | | |
| user_id | [int64](#int64) | | |
| parent_id | [int64](#int64) | repeated | |
| with_document_title | [bool](#bool) | | |
| page | [int64](#int64) | | 页码 |
| size | [int64](#int64) | | 每页数量 |
| wd | [string](#string) | | 搜索关键词 |
| field | [string](#string) | repeated | 查询的数据字段 |
| order | [string](#string) | | 排序字段 |
| status | [int32](#int32) | repeated | 状态,见 web/utils/enum.js 枚举 |
| document_id | [int64](#int64) | | 文档ID |
| user_id | [int64](#int64) | | 用户ID |
| parent_id | [int64](#int64) | repeated | 父评论ID |
| with_document_title | [bool](#bool) | | 是否返回文档标题 |
@ -164,11 +164,11 @@
<a name="api-v1-CommentAPI"></a>
### CommentAPI
评论服务
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| CreateComment | [CreateCommentRequest](#api-v1-CreateCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| CreateComment | [CreateCommentRequest](#api-v1-CreateCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 创建评论 |
| UpdateComment | [Comment](#api-v1-Comment) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新评论,仅限管理员操作 |
| DeleteComment | [DeleteCommentRequest](#api-v1-DeleteCommentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 管理员或用户自己删除自己的评论 |
| GetComment | [GetCommentRequest](#api-v1-GetCommentRequest) | [Comment](#api-v1-Comment) | 获取单个评论 |

@ -32,22 +32,24 @@
<a name="api-v1-Config"></a>
### Config
配置
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| label | [string](#string) | | |
| name | [string](#string) | | |
| value | [string](#string) | | |
| placeholder | [string](#string) | | |
| input_type | [string](#string) | | |
| category | [string](#string) | | |
| sort | [int32](#int32) | | |
| options | [string](#string) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int64](#int64) | | 配置ID |
| label | [string](#string) | | 配置标签 |
| name | [string](#string) | | 配置名称 |
| value | [string](#string) | | 配置值 |
| placeholder | [string](#string) | | 配置占位符 |
| input_type | [string](#string) | | 输入类型textarea、number、switch等为 |
| category | [string](#string) | | element-ui 的 el-input 的 type 属性
配置分类system、footer、security等见 web/utils/enum.js |
| sort | [int32](#int32) | | 排序,越小越靠前 |
| options | [string](#string) | | 配置项枚举一个一行如select的option选项用 key=value 的形式 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
@ -62,10 +64,10 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| length | [int32](#int32) | | |
| width | [int32](#int32) | | |
| height | [int32](#int32) | | |
| type | [string](#string) | | |
| length | [int32](#int32) | | 验证码长度 |
| width | [int32](#int32) | | 验证码宽度 |
| height | [int32](#int32) | | 验证码高度 |
| type | [string](#string) | | 验证码类型,见 web/utils/enum.js |
@ -75,16 +77,16 @@
<a name="api-v1-ConfigFooter"></a>
### ConfigFooter
底链配置项
底链配置项,为跳转的链接地址
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| about | [string](#string) | | |
| contact | [string](#string) | | |
| agreement | [string](#string) | | |
| copyright | [string](#string) | | |
| feedback | [string](#string) | | |
| about | [string](#string) | | 关于我们 |
| contact | [string](#string) | | 联系我们 |
| agreement | [string](#string) | | 用户协议、文库协议 |
| copyright | [string](#string) | | 版权声明 |
| feedback | [string](#string) | | 意见和建议反馈 |
@ -99,16 +101,16 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| is_close | [bool](#bool) | | |
| close_statement | [string](#string) | | |
| enable_register | [bool](#bool) | | |
| enable_captcha_login | [bool](#bool) | | |
| enable_captcha_register | [bool](#bool) | | |
| enable_captcha_comment | [bool](#bool) | | |
| enable_captcha_find_password | [bool](#bool) | | |
| enable_captcha_upload | [bool](#bool) | | |
| max_document_size | [int32](#int32) | | |
| document_allowed_ext | [string](#string) | repeated | |
| is_close | [bool](#bool) | | 是否关闭站点 |
| close_statement | [string](#string) | | 关闭站点的说明支持HTML |
| enable_register | [bool](#bool) | | 是否开放注册 |
| enable_captcha_login | [bool](#bool) | | 是否开启登录验证码 |
| enable_captcha_register | [bool](#bool) | | 是否开启注册验证码 |
| enable_captcha_comment | [bool](#bool) | | 是否开启评论验证码 |
| enable_captcha_find_password | [bool](#bool) | | 是否开启找回密码验证码 |
| enable_captcha_upload | [bool](#bool) | | 是否开启上传验证码 |
| max_document_size | [int32](#int32) | | 文档最大大小 |
| document_allowed_ext | [string](#string) | repeated | 文档允许的扩展名 |
| login_required | [bool](#bool) | | 是否登录才能访问 |
@ -124,19 +126,19 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| domain | [string](#string) | | |
| title | [string](#string) | | |
| keywords | [string](#string) | | |
| description | [string](#string) | | |
| logo | [string](#string) | | |
| favicon | [string](#string) | | |
| icp | [string](#string) | | |
| analytics | [string](#string) | | |
| sitename | [string](#string) | | |
| copyright_start_year | [string](#string) | | |
| register_background | [string](#string) | | |
| login_background | [string](#string) | | |
| recommend_words | [string](#string) | repeated | |
| domain | [string](#string) | | 站点域名,如: https://moredoc.mnt.ltd |
| title | [string](#string) | | 站点标题,首页显示 |
| keywords | [string](#string) | | 站点关键词SEO用 |
| description | [string](#string) | | 站点描述SEO用 |
| logo | [string](#string) | | 站点logo |
| favicon | [string](#string) | | 站点favicon |
| icp | [string](#string) | | 站点备案号 |
| analytics | [string](#string) | | 站点统计代码,目前只支持百度统计 |
| sitename | [string](#string) | | 站点名称 |
| copyright_start_year | [string](#string) | | 站点版权起始年份2018则底部显示 2018 - 2023 |
| register_background | [string](#string) | | 注册页背景图 |
| login_background | [string](#string) | | 登录页背景图 |
| recommend_words | [string](#string) | repeated | 推荐搜索词,首页展示 |
| version | [string](#string) | | 程序版本号 |
@ -147,7 +149,7 @@
<a name="api-v1-Configs"></a>
### Configs
配置列表
| Field | Type | Label | Description |
@ -162,7 +164,7 @@
<a name="api-v1-EnvDependent"></a>
### EnvDependent
依赖项
| Field | Type | Label | Description |
@ -183,7 +185,7 @@
<a name="api-v1-Envs"></a>
### Envs
依赖项列表
| Field | Type | Label | Description |
@ -198,7 +200,7 @@
<a name="api-v1-ListConfigRequest"></a>
### ListConfigRequest
查询配置项请求
| Field | Type | Label | Description |
@ -213,14 +215,14 @@
<a name="api-v1-Settings"></a>
### Settings
系统配置
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| system | [ConfigSystem](#api-v1-ConfigSystem) | | |
| footer | [ConfigFooter](#api-v1-ConfigFooter) | | |
| security | [ConfigSecurity](#api-v1-ConfigSecurity) | | ConfigCaptcha captcha = 4; |
| system | [ConfigSystem](#api-v1-ConfigSystem) | | 系统配置 |
| footer | [ConfigFooter](#api-v1-ConfigFooter) | | 底链配置 |
| security | [ConfigSecurity](#api-v1-ConfigSecurity) | | 安全配置 |
@ -230,23 +232,23 @@
<a name="api-v1-Stats"></a>
### Stats
系统状态
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| user_count | [int64](#int64) | | |
| document_count | [int64](#int64) | | |
| category_count | [int64](#int64) | | |
| article_count | [int64](#int64) | | |
| comment_count | [int64](#int64) | | |
| banner_count | [int64](#int64) | | |
| friendlink_count | [int64](#int64) | | |
| os | [string](#string) | | |
| version | [string](#string) | | |
| hash | [string](#string) | | |
| build_at | [string](#string) | | |
| report_count | [int64](#int64) | | |
| user_count | [int64](#int64) | | 用户数量 |
| document_count | [int64](#int64) | | 文档数量 |
| category_count | [int64](#int64) | | 分类数量 |
| article_count | [int64](#int64) | | 文章数量 |
| comment_count | [int64](#int64) | | 评论数量 |
| banner_count | [int64](#int64) | | banner数量 |
| friendlink_count | [int64](#int64) | | 友情链接数量 |
| os | [string](#string) | | 操作系统 |
| version | [string](#string) | | 程序版本号 |
| hash | [string](#string) | | 程序构建时的 git hash |
| build_at | [string](#string) | | 程序构建时间 |
| report_count | [int64](#int64) | | 举报数量 |
@ -262,7 +264,7 @@
<a name="api-v1-ConfigAPI"></a>
### ConfigAPI
配置服务
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|

@ -38,14 +38,14 @@
<a name="api-v1-CreateDocumentItem"></a>
### CreateDocumentItem
创建文档
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| title | [string](#string) | | |
| attachment_id | [int64](#int64) | | |
| price | [int32](#int32) | | |
| title | [string](#string) | | 文档标题 |
| attachment_id | [int64](#int64) | | 文档附件ID |
| price | [int32](#int32) | | 文档价格 |
@ -55,14 +55,14 @@
<a name="api-v1-CreateDocumentRequest"></a>
### CreateDocumentRequest
创建文档
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| overwrite | [bool](#bool) | | |
| category_id | [int64](#int64) | repeated | |
| document | [CreateDocumentItem](#api-v1-CreateDocumentItem) | repeated | |
| overwrite | [bool](#bool) | | 是否覆盖。暂时用不到 |
| category_id | [int64](#int64) | repeated | 文档分类ID |
| document | [CreateDocumentItem](#api-v1-CreateDocumentItem) | repeated | 文档列表 |
@ -72,7 +72,7 @@
<a name="api-v1-DeleteDocumentRequest"></a>
### DeleteDocumentRequest
删除文档,放入回收站
| Field | Type | Label | Description |
@ -87,44 +87,44 @@
<a name="api-v1-Document"></a>
### Document
文档
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| title | [string](#string) | | |
| keywords | [string](#string) | | |
| description | [string](#string) | | |
| user_id | [int64](#int64) | | |
| cover | [string](#string) | | |
| width | [int32](#int32) | | |
| height | [int32](#int32) | | |
| preview | [int32](#int32) | | |
| pages | [int32](#int32) | | |
| uuid | [string](#string) | | |
| download_count | [int32](#int32) | | |
| view_count | [int32](#int32) | | |
| favorite_count | [int32](#int32) | | |
| comment_count | [int32](#int32) | | |
| score | [int32](#int32) | | |
| score_count | [int32](#int32) | | |
| price | [int32](#int32) | | |
| size | [int64](#int64) | | |
| status | [int32](#int32) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| deleted_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| recommend_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| deleted_user_id | [int64](#int64) | | |
| username | [string](#string) | | |
| category_id | [int64](#int64) | repeated | |
| deleted_username | [string](#string) | | |
| ext | [string](#string) | | |
| attachment | [Attachment](#api-v1-Attachment) | | |
| user | [User](#api-v1-User) | | |
| enable_gzip | [bool](#bool) | | |
| convert_error | [string](#string) | | |
| id | [int64](#int64) | | 文档ID |
| title | [string](#string) | | 文档标题 |
| keywords | [string](#string) | | 文档关键字 |
| description | [string](#string) | | 文档描述 |
| user_id | [int64](#int64) | | 文档作者 |
| cover | [string](#string) | | 文档封面 |
| width | [int32](#int32) | | 文档宽度 |
| height | [int32](#int32) | | 文档高度 |
| preview | [int32](#int32) | | 文档可预览页数0表示不限制 |
| pages | [int32](#int32) | | 文档页数 |
| uuid | [string](#string) | | 文档UUID |
| download_count | [int32](#int32) | | 文档下载次数 |
| view_count | [int32](#int32) | | 文档浏览次数 |
| favorite_count | [int32](#int32) | | 文档收藏次数 |
| comment_count | [int32](#int32) | | 文档评论次数 |
| score | [int32](#int32) | | 文档评分 |
| score_count | [int32](#int32) | | 文档评分次数 |
| price | [int32](#int32) | | 文档价格 |
| size | [int64](#int64) | | 文档大小 |
| status | [int32](#int32) | | 文档状态,见 web/utils/enum.js |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 文档创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 文档更新时间 |
| deleted_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 文档删除时间 |
| recommend_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 文档推荐时间 |
| deleted_user_id | [int64](#int64) | | 删除文档的用户 |
| username | [string](#string) | | 文档作者用户名 |
| category_id | [int64](#int64) | repeated | 文档分类ID |
| deleted_username | [string](#string) | | 删除文档的用户名 |
| ext | [string](#string) | | 文档扩展名 |
| attachment | [Attachment](#api-v1-Attachment) | | 文档附件 |
| user | [User](#api-v1-User) | | 文档作者 |
| enable_gzip | [bool](#bool) | | 是否启用gzip压缩 |
| convert_error | [string](#string) | | 转换错误信息 |
@ -134,7 +134,7 @@
<a name="api-v1-DocumentScore"></a>
### DocumentScore
文档评分
| Field | Type | Label | Description |
@ -142,7 +142,7 @@
| id | [int64](#int64) | | |
| document_id | [int64](#int64) | | |
| user_id | [int64](#int64) | | |
| score | [int32](#int32) | | |
| score | [int32](#int32) | | 评分 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
@ -169,13 +169,13 @@
<a name="api-v1-GetDocumentRequest"></a>
### GetDocumentRequest
查询文档
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| with_author | [bool](#bool) | | |
| id | [int64](#int64) | | 文档ID |
| with_author | [bool](#bool) | | 是否查询作者信息 |
@ -185,7 +185,7 @@
<a name="api-v1-ListDocumentForHomeItem"></a>
### ListDocumentForHomeItem
首页文档查询返回项
| Field | Type | Label | Description |
@ -203,7 +203,7 @@
<a name="api-v1-ListDocumentForHomeRequest"></a>
### ListDocumentForHomeRequest
查询文档(针对首页的查询)
| Field | Type | Label | Description |
@ -218,7 +218,7 @@
<a name="api-v1-ListDocumentForHomeResponse"></a>
### ListDocumentForHomeResponse
查询文档(针对首页的查询)
| Field | Type | Label | Description |
@ -233,13 +233,13 @@
<a name="api-v1-ListDocumentReply"></a>
### ListDocumentReply
文档列表
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| document | [Document](#api-v1-Document) | repeated | |
| total | [int64](#int64) | | 文档总数 |
| document | [Document](#api-v1-Document) | repeated | 文档列表 |
@ -249,21 +249,21 @@
<a name="api-v1-ListDocumentRequest"></a>
### ListDocumentRequest
文档列表
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| wd | [string](#string) | | |
| field | [string](#string) | repeated | |
| order | [string](#string) | | |
| category_id | [int64](#int64) | repeated | |
| user_id | [int64](#int64) | repeated | |
| status | [int32](#int32) | repeated | |
| is_recommend | [bool](#bool) | repeated | |
| limit | [int64](#int64) | | |
| page | [int64](#int64) | | 页码 |
| size | [int64](#int64) | | 每页数量 |
| wd | [string](#string) | | 搜索关键字 |
| field | [string](#string) | repeated | 查询字段 |
| order | [string](#string) | | 排序 |
| category_id | [int64](#int64) | repeated | 分类ID |
| user_id | [int64](#int64) | repeated | 用户ID |
| status | [int32](#int32) | repeated | 文档状态 |
| is_recommend | [bool](#bool) | repeated | 是否推荐 |
| limit | [int64](#int64) | | 查询数量显示。当该值大于0时page和size无效 |
@ -273,7 +273,7 @@
<a name="api-v1-RecoverRecycleDocumentRequest"></a>
### RecoverRecycleDocumentRequest
恢复文档
| Field | Type | Label | Description |
@ -325,12 +325,12 @@
<a name="api-v1-SetDocumentRecommendRequest"></a>
### SetDocumentRecommendRequest
设置文档推荐
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
| id | [int64](#int64) | repeated | 文档ID |
| type | [int32](#int32) | | 0, 取消推荐1:推荐 2:重新推荐 |

Loading…
Cancel
Save