dev
truthhun 1 year ago
parent 0dde4f77e5
commit 982dc2bfad

@ -36,6 +36,14 @@ doc:
--openapi_out==paths=source_relative:docs \
$$file; \
done
# 整合到单文件
protoc --proto_path=. \
--proto_path=./third_party \
--proto_path=./api \
--doc_out=docs/api \
--doc_opt=markdown,apis.md \
--openapi_out==paths=source_relative:docs \
$(API_PROTO_FILES)
.PHONY: clean-api-go
# clean api go file

@ -18,18 +18,17 @@ message Attachment {
string hash = 2; // MD5
int64 user_id = 3; // ID
int64 type_id = 4; // IDID
int32 type = 5; // 0: 1: 2: 3: 4: 5:
// 6: 7:
bool enable = 6; //
string path = 7; //
string name = 8; //
int64 size = 9; //
int64 width = 10; //
int64 height = 11; //
string ext = 12; // .docx
string ip = 13; // IP
string username = 16; //
string type_name = 17; //
int32 type = 5; // web/utils/enum.js
bool enable = 6; //
string path = 7; //
string name = 8; //
int64 size = 9; //
int64 width = 10; //
int64 height = 11; //
string ext = 12; // .docx
string ip = 13; // IP
string username = 16; //
string type_name = 17; //
string description = 18; //
google.protobuf.Timestamp created_at = 14
[ (gogoproto.stdtime) = true ]; //

@ -19,8 +19,7 @@ message Config {
string name = 3; //
string value = 4; //
string placeholder = 5; //
string input_type = 6; // textareanumberswitch
// element-ui el-input type
string input_type = 6; // textareanumberswitch
string category =
7; // systemfootersecurity web/utils/enum.js
int32 sort = 8; //

@ -981,6 +981,7 @@ func (m *ListDocumentForHomeResponse) GetDocument() []*ListDocumentForHomeItem {
return nil
}
// 文档搜索
type SearchDocumentRequest struct {
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
Size_ int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
@ -1150,6 +1151,7 @@ func (m *DocumentScore) GetUpdatedAt() *time.Time {
return nil
}
// 文档搜索响应
type SearchDocumentReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Spend string `protobuf:"bytes,2,opt,name=spend,proto3" json:"spend,omitempty"`
@ -1210,6 +1212,7 @@ func (m *SearchDocumentReply) GetDocument() []*Document {
return nil
}
// 文档下载
type DownloadDocumentReply struct {
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
}
@ -1394,15 +1397,25 @@ 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 DocumentAPIClient interface {
// 针对首页的文档查询
ListDocumentForHome(ctx context.Context, in *ListDocumentForHomeRequest, opts ...grpc.CallOption) (*ListDocumentForHomeResponse, error)
// 设置文档推荐
SetDocumentRecommend(ctx context.Context, in *SetDocumentRecommendRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 创建文档
CreateDocument(ctx context.Context, in *CreateDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 更新文档
UpdateDocument(ctx context.Context, in *Document, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 删除文档
DeleteDocument(ctx context.Context, in *DeleteDocumentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 查询文档
GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error)
// 根据文档ID查询当前文档的相关文档
GetRelatedDocuments(ctx context.Context, in *Document, opts ...grpc.CallOption) (*ListDocumentReply, error)
// 根据文档ID获取文档下载链接
DownloadDocument(ctx context.Context, in *Document, opts ...grpc.CallOption) (*DownloadDocumentReply, error)
// 文档列表查询
ListDocument(ctx context.Context, in *ListDocumentRequest, opts ...grpc.CallOption) (*ListDocumentReply, error)
// 文档搜索
SearchDocument(ctx context.Context, in *SearchDocumentRequest, opts ...grpc.CallOption) (*SearchDocumentReply, error)
// 设置文档评分
SetDocumentScore(ctx context.Context, in *DocumentScore, opts ...grpc.CallOption) (*emptypb.Empty, error)
@ -1539,15 +1552,25 @@ func (c *documentAPIClient) SetDocumentReconvert(ctx context.Context, in *emptyp
// DocumentAPIServer is the server API for DocumentAPI service.
type DocumentAPIServer interface {
// 针对首页的文档查询
ListDocumentForHome(context.Context, *ListDocumentForHomeRequest) (*ListDocumentForHomeResponse, error)
// 设置文档推荐
SetDocumentRecommend(context.Context, *SetDocumentRecommendRequest) (*emptypb.Empty, error)
// 创建文档
CreateDocument(context.Context, *CreateDocumentRequest) (*emptypb.Empty, error)
// 更新文档
UpdateDocument(context.Context, *Document) (*emptypb.Empty, error)
// 删除文档
DeleteDocument(context.Context, *DeleteDocumentRequest) (*emptypb.Empty, error)
// 查询文档
GetDocument(context.Context, *GetDocumentRequest) (*Document, error)
// 根据文档ID查询当前文档的相关文档
GetRelatedDocuments(context.Context, *Document) (*ListDocumentReply, error)
// 根据文档ID获取文档下载链接
DownloadDocument(context.Context, *Document) (*DownloadDocumentReply, error)
// 文档列表查询
ListDocument(context.Context, *ListDocumentRequest) (*ListDocumentReply, error)
// 文档搜索
SearchDocument(context.Context, *SearchDocumentRequest) (*SearchDocumentReply, error)
// 设置文档评分
SetDocumentScore(context.Context, *DocumentScore) (*emptypb.Empty, error)

@ -112,21 +112,22 @@ message ListDocumentForHomeRequest { int64 limit = 1; }
//
message ListDocumentForHomeItem {
int64 category_id = 1;
string category_cover = 2;
string category_name = 3;
repeated Document document = 4;
int64 category_id = 1; // ID
string category_cover = 2; //
string category_name = 3; //
repeated Document document = 4; //
}
//
message ListDocumentForHomeResponse {
repeated ListDocumentForHomeItem document = 1;
repeated ListDocumentForHomeItem document = 1; //
}
//
message SearchDocumentRequest {
int32 page = 1;
int32 size = 2;
string wd = 3;
int32 page = 1; //
int32 size = 2; //
string wd = 3; //
repeated int64 category_id = 4; //
string sort = 5; //
string ext = 7; //
@ -134,23 +135,30 @@ message SearchDocumentRequest {
//
message DocumentScore {
int64 id = 1;
int64 document_id = 2;
int64 user_id = 3;
int32 score = 4; //
google.protobuf.Timestamp created_at = 5 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 6 [ (gogoproto.stdtime) = true ];
int64 id = 1; // ID
int64 document_id = 2; // ID
int64 user_id = 3; // ID
int32 score = 4; // 100~50010015005
google.protobuf.Timestamp created_at = 5
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 6
[ (gogoproto.stdtime) = true ]; //
}
//
message SearchDocumentReply {
int64 total = 1;
string spend = 2; //
repeated Document document = 3;
int64 total = 1; //
string spend = 2; //
repeated Document document = 3; //
}
//
message DownloadDocumentReply { string url = 1; }
//
service DocumentAPI {
//
rpc ListDocumentForHome(ListDocumentForHomeRequest)
returns (ListDocumentForHomeResponse) {
option (google.api.http) = {
@ -158,6 +166,7 @@ service DocumentAPI {
};
}
//
rpc SetDocumentRecommend(SetDocumentRecommendRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
@ -166,6 +175,7 @@ service DocumentAPI {
};
}
//
rpc CreateDocument(CreateDocumentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post : '/api/v1/document',
@ -173,6 +183,7 @@ service DocumentAPI {
};
}
//
rpc UpdateDocument(Document) returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/document',
@ -180,36 +191,42 @@ service DocumentAPI {
};
}
//
rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/document',
};
}
//
rpc GetDocument(GetDocumentRequest) returns (Document) {
option (google.api.http) = {
get : '/api/v1/document',
};
}
// ID
rpc GetRelatedDocuments(Document) returns (ListDocumentReply) {
option (google.api.http) = {
get : '/api/v1/document/related',
};
}
// ID
rpc DownloadDocument(Document) returns (DownloadDocumentReply) {
option (google.api.http) = {
get : '/api/v1/document/download',
};
}
//
rpc ListDocument(ListDocumentRequest) returns (ListDocumentReply) {
option (google.api.http) = {
get : '/api/v1/document/list',
};
}
//
rpc SearchDocument(SearchDocumentRequest) returns (SearchDocumentReply) {
option (google.api.http) = {
get : '/api/v1/document/search',

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 文档收藏
type Favorite 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"`
@ -149,6 +150,7 @@ func (m *Favorite) GetUpdatedAt() *time.Time {
return nil
}
// 取消收藏
type DeleteFavoriteRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -193,6 +195,7 @@ func (m *DeleteFavoriteRequest) GetId() []int64 {
return nil
}
// 查询用户的收藏
type ListFavoriteRequest 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"`
@ -253,6 +256,7 @@ func (m *ListFavoriteRequest) GetUserId() int64 {
return 0
}
// 查询用户的收藏
type ListFavoriteReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Favorite []*Favorite `protobuf:"bytes,2,rep,name=favorite,proto3" json:"favorite,omitempty"`
@ -305,6 +309,7 @@ func (m *ListFavoriteReply) GetFavorite() []*Favorite {
return nil
}
// 根据文章id查询用户是否有收藏某篇文档
type GetFavoriteRequest struct {
DocumentId int64 `protobuf:"varint,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
}

@ -1,4 +1,4 @@
syntax="proto3";
syntax = "proto3";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
@ -12,65 +12,66 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
message Favorite{
int64 id = 1;
int64 user_id = 2;
int64 document_id = 3;
string title = 6;
string ext = 7;
int32 score = 8;
int64 size = 9;
int32 pages = 10;
google.protobuf.Timestamp created_at = 4 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 5 [ (gogoproto.stdtime) = true ];
//
message Favorite {
int64 id = 1;
int64 user_id = 2;
int64 document_id = 3;
string title = 6;
string ext = 7;
int32 score = 8;
int64 size = 9;
int32 pages = 10;
google.protobuf.Timestamp created_at = 4 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 5 [ (gogoproto.stdtime) = true ];
}
message DeleteFavoriteRequest {
repeated int64 id = 1;
}
//
message DeleteFavoriteRequest { repeated int64 id = 1; }
//
message ListFavoriteRequest {
int64 page = 1;
int64 size = 2;
int64 user_id = 3;
int64 page = 1;
int64 size = 2;
int64 user_id = 3;
}
//
message ListFavoriteReply {
int64 total = 1;
repeated Favorite favorite = 2;
int64 total = 1;
repeated Favorite favorite = 2;
}
message GetFavoriteRequest{
int64 document_id = 1;
}
// id
message GetFavoriteRequest { int64 document_id = 1; }
service FavoriteAPI{
//
rpc CreateFavorite (Favorite) returns (Favorite){
option (google.api.http) = {
post: '/api/v1/favorite',
body: '*',
};
}
service FavoriteAPI {
//
rpc CreateFavorite(Favorite) returns (Favorite) {
option (google.api.http) = {
post : '/api/v1/favorite',
body : '*',
};
}
//
rpc DeleteFavorite (DeleteFavoriteRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
delete: '/api/v1/favorite',
};
}
//
rpc DeleteFavorite(DeleteFavoriteRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/favorite',
};
}
// id
rpc GetFavorite (GetFavoriteRequest) returns (Favorite){
option (google.api.http) = {
get: '/api/v1/favorite',
};
}
// id
rpc GetFavorite(GetFavoriteRequest) returns (Favorite) {
option (google.api.http) = {
get : '/api/v1/favorite',
};
}
//
rpc ListFavorite (ListFavoriteRequest) returns (ListFavoriteReply){
option (google.api.http) = {
get: '/api/v1/favorite/list',
};
}
//
rpc ListFavorite(ListFavoriteRequest) returns (ListFavoriteReply) {
option (google.api.http) = {
get : '/api/v1/favorite/list',
};
}
}

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 友情链接
type Friendlink struct {
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
@ -133,6 +134,7 @@ func (m *Friendlink) GetUpdatedAt() *time.Time {
return nil
}
// 删除友情链接
type DeleteFriendlinkRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -177,6 +179,7 @@ func (m *DeleteFriendlinkRequest) GetId() []int64 {
return nil
}
// 获取友情链接
type GetFriendlinkRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
@ -221,6 +224,7 @@ func (m *GetFriendlinkRequest) GetId() int64 {
return 0
}
// 友情链接列表
type ListFriendlinkRequest struct {
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
Size_ int32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
@ -297,6 +301,7 @@ func (m *ListFriendlinkRequest) GetField() []string {
return nil
}
// 友情链接列表
type ListFriendlinkReply struct {
Friendlink []*Friendlink `protobuf:"bytes,1,rep,name=friendlink,proto3" json:"friendlink,omitempty"`
Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
@ -413,10 +418,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 FriendlinkAPIClient interface {
// 创建友情链接
CreateFriendlink(ctx context.Context, in *Friendlink, opts ...grpc.CallOption) (*Friendlink, error)
// 更新友情链接
UpdateFriendlink(ctx context.Context, in *Friendlink, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 删除友情链接
DeleteFriendlink(ctx context.Context, in *DeleteFriendlinkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 获取友情链接
GetFriendlink(ctx context.Context, in *GetFriendlinkRequest, opts ...grpc.CallOption) (*Friendlink, error)
// 获取友情链接
ListFriendlink(ctx context.Context, in *ListFriendlinkRequest, opts ...grpc.CallOption) (*ListFriendlinkReply, error)
}
@ -475,10 +485,15 @@ func (c *friendlinkAPIClient) ListFriendlink(ctx context.Context, in *ListFriend
// FriendlinkAPIServer is the server API for FriendlinkAPI service.
type FriendlinkAPIServer interface {
// 创建友情链接
CreateFriendlink(context.Context, *Friendlink) (*Friendlink, error)
// 更新友情链接
UpdateFriendlink(context.Context, *Friendlink) (*emptypb.Empty, error)
// 删除友情链接
DeleteFriendlink(context.Context, *DeleteFriendlinkRequest) (*emptypb.Empty, error)
// 获取友情链接
GetFriendlink(context.Context, *GetFriendlinkRequest) (*Friendlink, error)
// 获取友情链接
ListFriendlink(context.Context, *ListFriendlinkRequest) (*ListFriendlinkReply, error)
}

@ -1,4 +1,4 @@
syntax="proto3";
syntax = "proto3";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
@ -12,68 +12,79 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
//
message Friendlink {
int32 id = 1;
string title = 2;
string link = 3;
string description = 4;
int32 sort = 5;
bool enable = 6;
google.protobuf.Timestamp created_at = 7 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 8 [ (gogoproto.stdtime) = true ];
int32 id = 1; //
string title = 2; //
string link = 3; //
string description = 4; //
int32 sort = 5; //
bool enable = 6; //
google.protobuf.Timestamp created_at = 7
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 8
[ (gogoproto.stdtime) = true ]; //
}
message DeleteFriendlinkRequest {
repeated int64 id = 1;
}
//
message DeleteFriendlinkRequest { repeated int64 id = 1; }
message GetFriendlinkRequest {
int64 id = 1;
}
//
message GetFriendlinkRequest { int64 id = 1; }
//
message ListFriendlinkRequest {
int32 page = 1;
int32 size = 2;
string wd = 3;
repeated bool enable = 4;
repeated string field = 5;
int32 page = 1;
int32 size = 2;
string wd = 3;
repeated bool enable = 4;
repeated string field = 5;
}
//
message ListFriendlinkReply {
repeated Friendlink friendlink = 1;
int64 total = 2;
repeated Friendlink friendlink = 1;
int64 total = 2;
}
service FriendlinkAPI{
rpc CreateFriendlink (Friendlink) returns (Friendlink){
option (google.api.http) = {
post: '/api/v1/friendlink',
body: '*',
};
}
//
service FriendlinkAPI {
//
rpc CreateFriendlink(Friendlink) returns (Friendlink) {
option (google.api.http) = {
post : '/api/v1/friendlink',
body : '*',
};
}
rpc UpdateFriendlink (Friendlink) returns (google.protobuf.Empty) {
option (google.api.http) = {
put: '/api/v1/friendlink',
body: '*',
};
}
//
rpc UpdateFriendlink(Friendlink) returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/friendlink',
body : '*',
};
}
rpc DeleteFriendlink (DeleteFriendlinkRequest) returns (google.protobuf.Empty){
option (google.api.http) = {
delete: '/api/v1/friendlink',
};
}
//
rpc DeleteFriendlink(DeleteFriendlinkRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/friendlink',
};
}
rpc GetFriendlink (GetFriendlinkRequest) returns (Friendlink){
option (google.api.http) = {
get: '/api/v1/friendlink',
};
}
//
rpc GetFriendlink(GetFriendlinkRequest) returns (Friendlink) {
option (google.api.http) = {
get : '/api/v1/friendlink',
};
}
rpc ListFriendlink (ListFriendlinkRequest) returns (ListFriendlinkReply){
option (google.api.http) = {
get: '/api/v1/friendlink/list',
};
}
//
rpc ListFriendlink(ListFriendlinkRequest) returns (ListFriendlinkReply) {
option (google.api.http) = {
get : '/api/v1/friendlink/list',
};
}
}

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 用户组,角色
type Group 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"`
@ -165,6 +166,7 @@ func (m *Group) GetUpdatedAt() *time.Time {
return nil
}
// 删除用户组,可以批量删除
type DeleteGroupRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -339,6 +341,7 @@ func (m *ListGroupRequest) GetField() []string {
return nil
}
// 用户组列表
type ListGroupReply struct {
Group []*Group `protobuf:"bytes,1,rep,name=group,proto3" json:"group,omitempty"`
Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
@ -391,6 +394,7 @@ func (m *ListGroupReply) GetTotal() int64 {
return 0
}
// 获取用户组权限
type GetGroupPermissionRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
@ -435,6 +439,7 @@ func (m *GetGroupPermissionRequest) GetId() int64 {
return 0
}
// 更新用户组权限
type UpdateGroupPermissionRequest struct {
GroupId int64 `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
PermissionId []int64 `protobuf:"varint,2,rep,packed,name=permission_id,json=permissionId,proto3" json:"permission_id,omitempty"`
@ -487,6 +492,7 @@ func (m *UpdateGroupPermissionRequest) GetPermissionId() []int64 {
return nil
}
// 用户组权限
type GroupPermissions struct {
PermissionId []int64 `protobuf:"varint,1,rep,packed,name=permission_id,json=permissionId,proto3" json:"permission_id,omitempty"`
}
@ -615,8 +621,9 @@ type GroupAPIClient interface {
UpdateGroup(ctx context.Context, in *Group, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 删除用户组
DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 获取用户组列表
// 获取用户组
GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*Group, error)
// 获取用户组列表
ListGroup(ctx context.Context, in *ListGroupRequest, opts ...grpc.CallOption) (*ListGroupReply, error)
// 获取用户组权限列表
GetGroupPermission(ctx context.Context, in *GetGroupPermissionRequest, opts ...grpc.CallOption) (*GroupPermissions, error)
@ -703,8 +710,9 @@ type GroupAPIServer interface {
UpdateGroup(context.Context, *Group) (*emptypb.Empty, error)
// 删除用户组
DeleteGroup(context.Context, *DeleteGroupRequest) (*emptypb.Empty, error)
// 获取用户组列表
// 获取用户组
GetGroup(context.Context, *GetGroupRequest) (*Group, error)
// 获取用户组列表
ListGroup(context.Context, *ListGroupRequest) (*ListGroupReply, error)
// 获取用户组权限列表
GetGroupPermission(context.Context, *GetGroupPermissionRequest) (*GroupPermissions, error)

@ -12,21 +12,25 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
//
message Group {
int64 id = 1;
string title = 2;
string color = 3;
bool is_default = 4;
bool is_display = 5;
string description = 6;
int32 user_count = 7;
int32 sort = 8;
bool enable_upload = 11;
bool enable_comment_approval = 12;
google.protobuf.Timestamp created_at = 9 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 10 [ (gogoproto.stdtime) = true ];
int64 id = 1; // ID
string title = 2; //
string color = 3; //
bool is_default = 4; //
bool is_display = 5; //
string description = 6; //
int32 user_count = 7; //
int32 sort = 8; //
bool enable_upload = 11; //
bool enable_comment_approval = 12; //
google.protobuf.Timestamp created_at = 9
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 10
[ (gogoproto.stdtime) = true ]; //
}
//
message DeleteGroupRequest { repeated int64 id = 1; }
// ID
@ -44,18 +48,22 @@ message ListGroupRequest {
repeated string field = 5;
}
//
message ListGroupReply {
repeated Group group = 1;
int64 total = 2;
}
//
message GetGroupPermissionRequest { int64 id = 1; }
//
message UpdateGroupPermissionRequest {
int64 group_id = 1;
repeated int64 permission_id = 2;
}
//
message GroupPermissions { repeated int64 permission_id = 1; }
service GroupAPI {
@ -82,13 +90,14 @@ service GroupAPI {
};
}
//
//
rpc GetGroup(GetGroupRequest) returns (Group) {
option (google.api.http) = {
get : '/api/v1/group',
};
}
//
rpc ListGroup(ListGroupRequest) returns (ListGroupReply) {
option (google.api.http) = {
get : '/api/v1/group/list',

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 权限
type Permission struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"`
@ -125,50 +126,7 @@ func (m *Permission) GetUpdatedAt() *time.Time {
return nil
}
type DeletePermissionRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
func (m *DeletePermissionRequest) Reset() { *m = DeletePermissionRequest{} }
func (m *DeletePermissionRequest) String() string { return proto.CompactTextString(m) }
func (*DeletePermissionRequest) ProtoMessage() {}
func (*DeletePermissionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_6f5311b1c95edab2, []int{1}
}
func (m *DeletePermissionRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *DeletePermissionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_DeletePermissionRequest.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 *DeletePermissionRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeletePermissionRequest.Merge(m, src)
}
func (m *DeletePermissionRequest) XXX_Size() int {
return m.Size()
}
func (m *DeletePermissionRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeletePermissionRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeletePermissionRequest proto.InternalMessageInfo
func (m *DeletePermissionRequest) GetId() []int64 {
if m != nil {
return m.Id
}
return nil
}
// 权限请求
type GetPermissionRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
@ -177,7 +135,7 @@ func (m *GetPermissionRequest) Reset() { *m = GetPermissionRequest{} }
func (m *GetPermissionRequest) String() string { return proto.CompactTextString(m) }
func (*GetPermissionRequest) ProtoMessage() {}
func (*GetPermissionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_6f5311b1c95edab2, []int{2}
return fileDescriptor_6f5311b1c95edab2, []int{1}
}
func (m *GetPermissionRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -213,6 +171,7 @@ func (m *GetPermissionRequest) GetId() int64 {
return 0
}
// 权限响应
type GetPermissionReply struct {
Permission *Permission `protobuf:"bytes,1,opt,name=permission,proto3" json:"permission,omitempty"`
}
@ -221,7 +180,7 @@ func (m *GetPermissionReply) Reset() { *m = GetPermissionReply{} }
func (m *GetPermissionReply) String() string { return proto.CompactTextString(m) }
func (*GetPermissionReply) ProtoMessage() {}
func (*GetPermissionReply) Descriptor() ([]byte, []int) {
return fileDescriptor_6f5311b1c95edab2, []int{3}
return fileDescriptor_6f5311b1c95edab2, []int{2}
}
func (m *GetPermissionReply) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -257,6 +216,7 @@ func (m *GetPermissionReply) GetPermission() *Permission {
return nil
}
// 权限列表请求
type ListPermissionRequest 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"`
@ -269,7 +229,7 @@ func (m *ListPermissionRequest) Reset() { *m = ListPermissionRequest{} }
func (m *ListPermissionRequest) String() string { return proto.CompactTextString(m) }
func (*ListPermissionRequest) ProtoMessage() {}
func (*ListPermissionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_6f5311b1c95edab2, []int{4}
return fileDescriptor_6f5311b1c95edab2, []int{3}
}
func (m *ListPermissionRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -333,6 +293,7 @@ func (m *ListPermissionRequest) GetPath() string {
return ""
}
// 权限列表响应
type ListPermissionReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Permission []*Permission `protobuf:"bytes,2,rep,name=permission,proto3" json:"permission,omitempty"`
@ -342,7 +303,7 @@ func (m *ListPermissionReply) Reset() { *m = ListPermissionReply{} }
func (m *ListPermissionReply) String() string { return proto.CompactTextString(m) }
func (*ListPermissionReply) ProtoMessage() {}
func (*ListPermissionReply) Descriptor() ([]byte, []int) {
return fileDescriptor_6f5311b1c95edab2, []int{5}
return fileDescriptor_6f5311b1c95edab2, []int{4}
}
func (m *ListPermissionReply) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -387,7 +348,6 @@ func (m *ListPermissionReply) GetPermission() []*Permission {
func init() {
proto.RegisterType((*Permission)(nil), "api.v1.Permission")
proto.RegisterType((*DeletePermissionRequest)(nil), "api.v1.DeletePermissionRequest")
proto.RegisterType((*GetPermissionRequest)(nil), "api.v1.GetPermissionRequest")
proto.RegisterType((*GetPermissionReply)(nil), "api.v1.GetPermissionReply")
proto.RegisterType((*ListPermissionRequest)(nil), "api.v1.ListPermissionRequest")
@ -397,42 +357,41 @@ func init() {
func init() { proto.RegisterFile("api/v1/permission.proto", fileDescriptor_6f5311b1c95edab2) }
var fileDescriptor_6f5311b1c95edab2 = []byte{
// 549 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xc1, 0x6e, 0xd3, 0x40,
0x10, 0x86, 0xb3, 0x76, 0x12, 0xd4, 0x89, 0x5a, 0xc1, 0x12, 0x1a, 0xe3, 0xb6, 0x8e, 0xe5, 0x03,
0x0a, 0x1c, 0x6c, 0x25, 0x88, 0x0b, 0x1c, 0x50, 0x2a, 0x10, 0x20, 0x71, 0x88, 0x22, 0xb8, 0x20,
0x55, 0x95, 0x1b, 0x2f, 0xe9, 0x4a, 0x76, 0x76, 0xb1, 0x37, 0xa9, 0x02, 0xb7, 0x3e, 0x41, 0x25,
0x5e, 0x87, 0x07, 0xe0, 0x58, 0x89, 0x0b, 0x37, 0x50, 0xc2, 0x83, 0x20, 0xaf, 0xd7, 0x8d, 0x9b,
0xb8, 0x82, 0xdb, 0xec, 0xcc, 0xec, 0xff, 0xcf, 0xce, 0xe7, 0x04, 0x5a, 0x3e, 0xa7, 0xde, 0xac,
0xeb, 0x71, 0x12, 0x47, 0x34, 0x49, 0x28, 0x9b, 0xb8, 0x3c, 0x66, 0x82, 0xe1, 0xba, 0xcf, 0xa9,
0x3b, 0xeb, 0x9a, 0xed, 0x31, 0x63, 0xe3, 0x90, 0x78, 0x32, 0x7b, 0x32, 0xfd, 0xe8, 0x09, 0x1a,
0x91, 0x44, 0xf8, 0x11, 0xcf, 0x1a, 0xcd, 0xe6, 0x98, 0x8d, 0x99, 0x0c, 0xbd, 0x34, 0x52, 0xd9,
0x7d, 0x75, 0x2d, 0x95, 0xf7, 0x27, 0x13, 0x26, 0x7c, 0x41, 0xd9, 0x24, 0x51, 0xd5, 0xbd, 0x75,
0x51, 0x12, 0x71, 0x31, 0xcf, 0x8a, 0xce, 0xb9, 0x06, 0x30, 0xb8, 0x1a, 0x07, 0xef, 0x80, 0x46,
0x03, 0x03, 0xd9, 0xa8, 0xa3, 0x0f, 0x35, 0x1a, 0xe0, 0x5d, 0xa8, 0x47, 0x44, 0x9c, 0xb2, 0xc0,
0xd0, 0x6c, 0xd4, 0xd9, 0x1a, 0xaa, 0x13, 0xc6, 0x50, 0xe5, 0xbe, 0x38, 0x35, 0x74, 0x99, 0x95,
0x31, 0x6e, 0x42, 0x4d, 0x50, 0x11, 0x12, 0xa3, 0x2a, 0x93, 0xd9, 0x01, 0xdb, 0xd0, 0x08, 0x48,
0x32, 0x8a, 0x29, 0x4f, 0x67, 0x32, 0x6a, 0xb2, 0x56, 0x4c, 0xe1, 0xe7, 0x00, 0xa3, 0x98, 0xf8,
0x82, 0x04, 0xc7, 0xbe, 0x30, 0xea, 0x36, 0xea, 0x34, 0x7a, 0xa6, 0x9b, 0x0d, 0xed, 0xe6, 0x43,
0xbb, 0xef, 0xf2, 0x4d, 0x1c, 0x56, 0x2f, 0x7e, 0xb5, 0xd1, 0x70, 0x4b, 0xdd, 0xe9, 0x8b, 0x54,
0x60, 0xca, 0x83, 0x5c, 0xe0, 0xd6, 0xff, 0x0a, 0xa8, 0x3b, 0x7d, 0xe1, 0x3c, 0x84, 0xd6, 0x0b,
0x12, 0x12, 0x41, 0x56, 0x9b, 0x18, 0x92, 0x4f, 0x53, 0x92, 0x88, 0xab, 0x85, 0xe8, 0xd9, 0x42,
0x9c, 0x07, 0xd0, 0x7c, 0x45, 0xc4, 0xcd, 0x7d, 0x6a, 0x71, 0xce, 0x6b, 0xc0, 0x6b, 0x7d, 0x3c,
0x9c, 0xe3, 0x1e, 0xc0, 0x8a, 0xbd, 0xec, 0x6e, 0xf4, 0xb0, 0x9b, 0xc1, 0x77, 0x0b, 0xcd, 0x85,
0x2e, 0xe7, 0x0b, 0xdc, 0x7b, 0x4b, 0x93, 0x12, 0x4b, 0xc9, 0x60, 0x4c, 0x94, 0xa9, 0x8c, 0xd3,
0x5c, 0x42, 0x3f, 0x13, 0x49, 0x4b, 0x1f, 0xca, 0x38, 0x1d, 0xed, 0x2c, 0x50, 0xa4, 0xb4, 0xb3,
0x22, 0xd3, 0xaa, 0xad, 0x97, 0x30, 0xad, 0xad, 0x98, 0x3a, 0xc7, 0x70, 0x77, 0xdd, 0x3c, 0x7d,
0x47, 0x8a, 0x9a, 0x09, 0x3f, 0x54, 0xde, 0xd9, 0x61, 0xed, 0x75, 0x9a, 0xad, 0xff, 0xfb, 0x75,
0xbd, 0x6f, 0x1a, 0x6c, 0xaf, 0x4a, 0xfd, 0xc1, 0x1b, 0x7c, 0x04, 0xb7, 0xdf, 0x4b, 0x32, 0x85,
0xcf, 0xb2, 0x44, 0xc5, 0xdc, 0xdd, 0x20, 0xfc, 0x32, 0xfd, 0xae, 0x9d, 0x83, 0xf3, 0x1f, 0x7f,
0xbe, 0x6a, 0x2d, 0x13, 0x7b, 0x1b, 0xbf, 0xb6, 0xa7, 0xe8, 0x11, 0x3e, 0x82, 0xed, 0x6b, 0x60,
0xf0, 0x7e, 0xae, 0x5d, 0xc6, 0xd5, 0x2c, 0x71, 0x76, 0x4c, 0xe9, 0xd0, 0xc4, 0x25, 0x0e, 0x38,
0x82, 0x9d, 0xeb, 0x0b, 0xc3, 0x07, 0xb9, 0x42, 0x29, 0x45, 0x73, 0xef, 0xa6, 0x32, 0x0f, 0xe7,
0x4e, 0x5b, 0x3a, 0xdd, 0xc7, 0xad, 0x4d, 0x27, 0x2f, 0xa4, 0x89, 0x38, 0x7c, 0xf2, 0x7d, 0x61,
0xa1, 0xcb, 0x85, 0x85, 0x7e, 0x2f, 0x2c, 0x74, 0xb1, 0xb4, 0x2a, 0x97, 0x4b, 0xab, 0xf2, 0x73,
0x69, 0x55, 0x40, 0xfd, 0xa5, 0x0c, 0xd0, 0x87, 0x3b, 0x11, 0x8b, 0x49, 0xc0, 0x46, 0x4a, 0xe3,
0xd9, 0xac, 0x7b, 0x52, 0x97, 0x3b, 0x7b, 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x8f, 0xc9, 0x53,
0xe7, 0x91, 0x04, 0x00, 0x00,
// 534 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0xce, 0x3a, 0x3f, 0xa8, 0x13, 0xb5, 0x82, 0x25, 0x34, 0xc6, 0x6d, 0x1d, 0xcb, 0x07, 0x14,
0x71, 0xb0, 0x95, 0x20, 0x2e, 0x70, 0x40, 0xa9, 0x84, 0x00, 0x89, 0x43, 0x14, 0xc1, 0x05, 0xa9,
0xaa, 0xdc, 0x78, 0x71, 0x57, 0xb2, 0xb3, 0x8b, 0xbd, 0x49, 0x15, 0xb8, 0xf5, 0x09, 0x2a, 0xf1,
0x3a, 0x3c, 0x00, 0xc7, 0x4a, 0x5c, 0xb8, 0x81, 0x12, 0x1e, 0x04, 0x79, 0xbd, 0x26, 0xae, 0x63,
0x04, 0xb7, 0xd9, 0x99, 0xd9, 0xef, 0x9b, 0xf9, 0xbe, 0xb5, 0xa1, 0xeb, 0x71, 0xea, 0x2e, 0x06,
0x2e, 0x27, 0x71, 0x44, 0x93, 0x84, 0xb2, 0x99, 0xc3, 0x63, 0x26, 0x18, 0x6e, 0x79, 0x9c, 0x3a,
0x8b, 0x81, 0xd1, 0x0b, 0x18, 0x0b, 0x42, 0xe2, 0xca, 0xec, 0xd9, 0xfc, 0xbd, 0x2b, 0x68, 0x44,
0x12, 0xe1, 0x45, 0x3c, 0x6b, 0x34, 0x3a, 0x01, 0x0b, 0x98, 0x0c, 0xdd, 0x34, 0x52, 0xd9, 0x43,
0x75, 0x2d, 0x85, 0xf7, 0x66, 0x33, 0x26, 0x3c, 0x41, 0xd9, 0x2c, 0x51, 0xd5, 0x83, 0x32, 0x28,
0x89, 0xb8, 0x58, 0x66, 0x45, 0xfb, 0x52, 0x03, 0x18, 0xff, 0x19, 0x07, 0xef, 0x81, 0x46, 0x7d,
0x1d, 0x59, 0xa8, 0x5f, 0x9f, 0x68, 0xd4, 0xc7, 0xfb, 0xd0, 0x8a, 0x88, 0x38, 0x67, 0xbe, 0xae,
0x59, 0xa8, 0xbf, 0x33, 0x51, 0x27, 0x8c, 0xa1, 0xc1, 0x3d, 0x71, 0xae, 0xd7, 0x65, 0x56, 0xc6,
0xb8, 0x03, 0x4d, 0x41, 0x45, 0x48, 0xf4, 0x86, 0x4c, 0x66, 0x07, 0x6c, 0x41, 0xdb, 0x27, 0xc9,
0x34, 0xa6, 0x3c, 0x9d, 0x49, 0x6f, 0xca, 0x5a, 0x31, 0x85, 0x9f, 0x01, 0x4c, 0x63, 0xe2, 0x09,
0xe2, 0x9f, 0x7a, 0x42, 0x6f, 0x59, 0xa8, 0xdf, 0x1e, 0x1a, 0x4e, 0x36, 0xb4, 0x93, 0x0f, 0xed,
0xbc, 0xc9, 0x95, 0x38, 0x6e, 0x5c, 0xfd, 0xe8, 0xa1, 0xc9, 0x8e, 0xba, 0x33, 0x12, 0x29, 0xc0,
0x9c, 0xfb, 0x39, 0xc0, 0xad, 0xff, 0x05, 0x50, 0x77, 0x46, 0xc2, 0x7e, 0x00, 0x9d, 0x17, 0x44,
0x6c, 0x64, 0x98, 0x90, 0x0f, 0x73, 0x92, 0x88, 0xb2, 0x1a, 0xf6, 0x4b, 0xc0, 0xa5, 0x3e, 0x1e,
0x2e, 0xf1, 0x10, 0x60, 0x63, 0xa8, 0xec, 0x6e, 0x0f, 0xb1, 0x93, 0x39, 0xea, 0x14, 0x9a, 0x0b,
0x5d, 0xf6, 0x27, 0xb8, 0xf7, 0x9a, 0x26, 0x15, 0x94, 0x52, 0xd8, 0x80, 0x28, 0x52, 0x19, 0xa7,
0xb9, 0x84, 0x7e, 0x24, 0xd2, 0x82, 0xfa, 0x44, 0xc6, 0xe9, 0x68, 0x17, 0xbe, 0x92, 0x5f, 0xbb,
0x28, 0x1a, 0xd5, 0xb0, 0xea, 0x15, 0x46, 0x35, 0x37, 0x46, 0xd9, 0xa7, 0x70, 0xb7, 0x4c, 0x9e,
0xee, 0x91, 0xfa, 0xc7, 0x84, 0x17, 0x2a, 0xee, 0xec, 0x50, 0xda, 0x4e, 0xb3, 0xea, 0xff, 0xde,
0x6e, 0xf8, 0x45, 0x83, 0xdd, 0x4d, 0x69, 0x34, 0x7e, 0x85, 0x4f, 0xe0, 0xf6, 0x5b, 0x29, 0x77,
0xe1, 0xad, 0x55, 0xa0, 0x18, 0xfb, 0x5b, 0xb6, 0x3d, 0x4f, 0x1f, 0xab, 0x7d, 0x74, 0xf9, 0xed,
0xd7, 0x67, 0xad, 0x6b, 0x60, 0x77, 0xeb, 0x13, 0x7a, 0x82, 0x1e, 0xe2, 0x13, 0xd8, 0xbd, 0x61,
0x0c, 0x3e, 0xcc, 0xb1, 0xab, 0x7c, 0x35, 0x2a, 0x98, 0x6d, 0x43, 0x32, 0x74, 0x70, 0x05, 0x03,
0x8e, 0x60, 0xef, 0xa6, 0x60, 0xf8, 0x28, 0x47, 0xa8, 0x74, 0xd1, 0x38, 0xf8, 0x5b, 0x99, 0x87,
0x4b, 0xbb, 0x27, 0x99, 0xee, 0xe3, 0xee, 0x36, 0x93, 0x1b, 0xd2, 0x44, 0x1c, 0x3f, 0xfe, 0xba,
0x32, 0xd1, 0xf5, 0xca, 0x44, 0x3f, 0x57, 0x26, 0xba, 0x5a, 0x9b, 0xb5, 0xeb, 0xb5, 0x59, 0xfb,
0xbe, 0x36, 0x6b, 0xa0, 0xfe, 0x13, 0x63, 0xf4, 0xee, 0x4e, 0xc4, 0x62, 0xe2, 0xb3, 0xa9, 0xc2,
0x78, 0xba, 0x18, 0x9c, 0xb5, 0xa4, 0x66, 0x8f, 0x7e, 0x07, 0x00, 0x00, 0xff, 0xff, 0x20, 0x3d,
0xbf, 0x9e, 0x66, 0x04, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -447,8 +406,11 @@ 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 PermissionAPIClient interface {
// 更新权限信息。这里只能操作title和description
UpdatePermission(ctx context.Context, in *Permission, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 查询权限信息
GetPermission(ctx context.Context, in *GetPermissionRequest, opts ...grpc.CallOption) (*Permission, error)
// 查询权限列表
ListPermission(ctx context.Context, in *ListPermissionRequest, opts ...grpc.CallOption) (*ListPermissionReply, error)
}
@ -489,8 +451,11 @@ func (c *permissionAPIClient) ListPermission(ctx context.Context, in *ListPermis
// PermissionAPIServer is the server API for PermissionAPI service.
type PermissionAPIServer interface {
// 更新权限信息。这里只能操作title和description
UpdatePermission(context.Context, *Permission) (*emptypb.Empty, error)
// 查询权限信息
GetPermission(context.Context, *GetPermissionRequest) (*Permission, error)
// 查询权限列表
ListPermission(context.Context, *ListPermissionRequest) (*ListPermissionReply, error)
}
@ -663,48 +628,6 @@ func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *DeletePermissionRequest) 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 *DeletePermissionRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *DeletePermissionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Id) > 0 {
dAtA4 := make([]byte, len(m.Id)*10)
var j3 int
for _, num1 := range m.Id {
num := uint64(num1)
for num >= 1<<7 {
dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j3++
}
dAtA4[j3] = uint8(num)
j3++
}
i -= j3
copy(dAtA[i:], dAtA4[:j3])
i = encodeVarintPermission(dAtA, i, uint64(j3))
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *GetPermissionRequest) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@ -913,22 +836,6 @@ func (m *Permission) Size() (n int) {
return n
}
func (m *DeletePermissionRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Id) > 0 {
l = 0
for _, e := range m.Id {
l += sovPermission(uint64(e))
}
n += 1 + sovPermission(uint64(l)) + l
}
return n
}
func (m *GetPermissionRequest) Size() (n int) {
if m == nil {
return 0
@ -1276,132 +1183,6 @@ func (m *Permission) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *DeletePermissionRequest) 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 ErrIntOverflowPermission
}
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: DeletePermissionRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: DeletePermissionRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType == 0 {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPermission
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Id = append(m.Id, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPermission
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthPermission
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthPermission
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var elementCount int
var count int
for _, integer := range dAtA[iNdEx:postIndex] {
if integer < 128 {
count++
}
}
elementCount = count
if elementCount != 0 && len(m.Id) == 0 {
m.Id = make([]int64, 0, elementCount)
}
for iNdEx < postIndex {
var v int64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowPermission
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Id = append(m.Id, v)
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
}
default:
iNdEx = preIndex
skippy, err := skipPermission(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthPermission
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *GetPermissionRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0

@ -12,22 +12,26 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
//
message Permission {
int64 id = 1;
string method = 2;
string path = 3;
string title = 4;
string description = 5;
google.protobuf.Timestamp created_at = 6 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 7 [ (gogoproto.stdtime) = true ];
int64 id = 1; // ID
string method = 2; //
string path = 3; //
string title = 4; //
string description = 5; //
google.protobuf.Timestamp created_at = 6
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 7
[ (gogoproto.stdtime) = true ]; //
}
message DeletePermissionRequest { repeated int64 id = 1; }
//
message GetPermissionRequest { int64 id = 1; }
//
message GetPermissionReply { Permission permission = 1; }
//
message ListPermissionRequest {
int64 page = 1;
int64 size = 2;
@ -36,17 +40,15 @@ message ListPermissionRequest {
string path = 5;
}
//
message ListPermissionReply {
int64 total = 1;
repeated Permission permission = 2;
}
// message PermissionTree {
// Permission permission = 1;
// repeated PermissionTree children = 2;
// }
// API
service PermissionAPI {
// titledescription
rpc UpdatePermission(Permission) returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/permission',
@ -54,21 +56,17 @@ service PermissionAPI {
};
}
//
rpc GetPermission(GetPermissionRequest) returns (Permission) {
option (google.api.http) = {
get : '/api/v1/permission',
};
}
//
rpc ListPermission(ListPermissionRequest) returns (ListPermissionReply) {
option (google.api.http) = {
get : '/api/v1/permission/list',
};
}
// rpc ListPermissionTree(google.protobuf.Empty) returns (PermissionTree) {
// option (google.api.http) = {
// get : '/api/v1/permission/tree',
// };
// }
}

@ -33,7 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 这里是proto文件中的结构体可以根据需要删除或者调整
// 举报
type Report 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"`
@ -150,6 +150,7 @@ func (m *Report) GetUsername() string {
return ""
}
// 删除举报请求
type DeleteReportRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -194,6 +195,7 @@ func (m *DeleteReportRequest) GetId() []int64 {
return nil
}
// 举报列表请求
type ListReportRequest 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"`
@ -278,6 +280,7 @@ func (m *ListReportRequest) GetStatus() []bool {
return nil
}
// 举报列表响应
type ListReportReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Report []*Report `protobuf:"bytes,2,rep,name=report,proto3" json:"report,omitempty"`
@ -393,9 +396,13 @@ 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 ReportAPIClient interface {
// 创建举报
CreateReport(ctx context.Context, in *Report, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 更新举报,审核举报内容
UpdateReport(ctx context.Context, in *Report, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 删除举报
DeleteReport(ctx context.Context, in *DeleteReportRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 获取举报列表
ListReport(ctx context.Context, in *ListReportRequest, opts ...grpc.CallOption) (*ListReportReply, error)
}
@ -445,9 +452,13 @@ func (c *reportAPIClient) ListReport(ctx context.Context, in *ListReportRequest,
// ReportAPIServer is the server API for ReportAPI service.
type ReportAPIServer interface {
// 创建举报
CreateReport(context.Context, *Report) (*emptypb.Empty, error)
// 更新举报,审核举报内容
UpdateReport(context.Context, *Report) (*emptypb.Empty, error)
// 删除举报
DeleteReport(context.Context, *DeleteReportRequest) (*emptypb.Empty, error)
// 获取举报列表
ListReport(context.Context, *ListReportRequest) (*ListReportReply, error)
}

@ -12,22 +12,26 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
// proto
//
message Report {
int64 id = 1;
int64 document_id = 2;
int64 user_id = 3;
int32 reason = 4;
bool status = 5;
google.protobuf.Timestamp created_at = 6 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 7 [ (gogoproto.stdtime) = true ];
string document_title = 8;
string remark = 9;
string username = 10;
int64 id = 1; // ID
int64 document_id = 2; // ID
int64 user_id = 3; // ID
int32 reason = 4; //
bool status = 5; //
google.protobuf.Timestamp created_at = 6
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 7
[ (gogoproto.stdtime) = true ]; //
string document_title = 8; //
string remark = 9; //
string username = 10; //
}
//
message DeleteReportRequest { repeated int64 id = 1; }
//
message ListReportRequest {
int64 page = 1;
int64 size = 2;
@ -37,12 +41,16 @@ message ListReportRequest {
repeated bool status = 6;
}
//
message ListReportReply {
int64 total = 1;
repeated Report report = 2;
}
//
service ReportAPI {
//
rpc CreateReport(Report) returns (google.protobuf.Empty) {
option (google.api.http) = {
post : '/api/v1/report',
@ -50,6 +58,7 @@ service ReportAPI {
};
}
//
rpc UpdateReport(Report) returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/report',
@ -57,12 +66,14 @@ service ReportAPI {
};
}
//
rpc DeleteReport(DeleteReportRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/report',
};
}
//
rpc ListReport(ListReportRequest) returns (ListReportReply) {
option (google.api.http) = {
get : '/api/v1/report/list',

@ -33,6 +33,7 @@ var _ = time.Kitchen
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// 用户信息
type User struct {
LoginAt *time.Time `protobuf:"bytes,19,opt,name=login_at,json=loginAt,proto3,stdtime" json:"login_at,omitempty"`
CreatedAt *time.Time `protobuf:"bytes,20,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at,omitempty"`
@ -245,6 +246,7 @@ func (m *User) GetCreditCount() int32 {
return 0
}
// 用户注册登录请求
type RegisterAndLoginRequest struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty" validate:"min=3,max=32"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty" validate:"min=6"`
@ -321,6 +323,7 @@ func (m *RegisterAndLoginRequest) GetEmail() string {
return ""
}
// 查询验证码请求
type GetUserCaptchaRequest struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
}
@ -365,6 +368,7 @@ func (m *GetUserCaptchaRequest) GetType() string {
return ""
}
// 用户登录响应
type LoginReply struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"`
@ -417,6 +421,7 @@ func (m *LoginReply) GetUser() *User {
return nil
}
// 删除用户
type DeleteUserRequest struct {
Id []int64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
}
@ -461,6 +466,7 @@ func (m *DeleteUserRequest) GetId() []int64 {
return nil
}
// 获取用户信息
type GetUserRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
@ -505,6 +511,7 @@ func (m *GetUserRequest) GetId() int64 {
return 0
}
// 找回密码
type FindPasswordRequest struct {
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`
Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
@ -581,6 +588,7 @@ func (m *FindPasswordRequest) GetCaptchaId() string {
return ""
}
// 用户列表请求
type ListUserRequest 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"`
@ -681,6 +689,7 @@ func (m *ListUserRequest) GetLimit() int64 {
return 0
}
// 用户列表响应
type ListUserReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
User []*User `protobuf:"bytes,2,rep,name=user,proto3" json:"user,omitempty"`
@ -733,6 +742,7 @@ func (m *ListUserReply) GetUser() []*User {
return nil
}
// 验证码响应
type GetUserCaptchaReply struct {
Enable bool `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
@ -862,6 +872,7 @@ func (m *UpdateUserPasswordRequest) GetNewPassword() string {
return ""
}
// 用户权限信息查询
type GetUserPermissionsReply struct {
Permission []*Permission `protobuf:"bytes,1,rep,name=permission,proto3" json:"permission,omitempty"`
}
@ -906,6 +917,7 @@ func (m *GetUserPermissionsReply) GetPermission() []*Permission {
return nil
}
// 管理后台设置用户信息
type SetUserRequest struct {
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty" validate:"min=3,max=32"`
@ -982,6 +994,7 @@ func (m *SetUserRequest) GetEmail() string {
return ""
}
// 用户动态
type Dynamic 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"`
@ -1074,6 +1087,7 @@ func (m *Dynamic) GetUpdatedAt() *time.Time {
return nil
}
// 用户动态列表请求
type ListUserDynamicRequest 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"`
@ -1134,6 +1148,7 @@ func (m *ListUserDynamicRequest) GetId() int64 {
return 0
}
// 用户动态列表响应
type ListUserDynamicReply struct {
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Dynamic []*Dynamic `protobuf:"bytes,2,rep,name=dynamic,proto3" json:"dynamic,omitempty"`
@ -1186,6 +1201,7 @@ func (m *ListUserDynamicReply) GetDynamic() []*Dynamic {
return nil
}
// 用户签到
type Sign 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"`
@ -1444,7 +1460,9 @@ 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)
// 找回密码:第一步,发送验证码
FindPasswordStepOne(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// 找回密码:第二步,修改密码
FindPasswordStepTwo(ctx context.Context, in *FindPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
@ -1655,7 +1673,9 @@ type UserAPIServer interface {
SignToday(context.Context, *emptypb.Empty) (*Sign, error)
// 获取今日已签到记录
GetSignedToday(context.Context, *emptypb.Empty) (*Sign, error)
// 找回密码:第一步,发送验证码
FindPasswordStepOne(context.Context, *FindPasswordRequest) (*emptypb.Empty, error)
// 找回密码:第二步,修改密码
FindPasswordStepTwo(context.Context, *FindPasswordRequest) (*emptypb.Empty, error)
}

@ -13,129 +13,154 @@ option go_package = "moredoc/api/v1;v1";
option java_multiple_files = true;
option java_package = "api.v1";
//
message User {
google.protobuf.Timestamp login_at = 19 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp created_at = 20 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 21 [ (gogoproto.stdtime) = true ];
int64 id = 1;
string username = 2;
string mobile = 3;
string email = 4;
string address = 5;
string signature = 6;
string last_login_ip = 7;
string register_ip = 8;
int32 doc_count = 9;
int32 follow_count = 10;
int32 fans_count = 11;
int32 favorite_count = 12;
int32 comment_count = 13;
int32 status = 14;
string avatar = 15;
string identity = 16;
string realname = 17;
repeated int64 group_id = 18;
int32 credit_count = 22;
google.protobuf.Timestamp login_at = 19
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp created_at = 20
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 21
[ (gogoproto.stdtime) = true ]; //
int64 id = 1; // ID
string username = 2; //
string mobile = 3; //
string email = 4; //
string address = 5; //
string signature = 6; //
string last_login_ip = 7; // IP
string register_ip = 8; // IP
int32 doc_count = 9; //
int32 follow_count = 10; //
int32 fans_count = 11; //
int32 favorite_count = 12; //
int32 comment_count = 13; //
int32 status = 14; // web/utils/enum.js使
string avatar = 15; //
string identity = 16; //
string realname = 17; //
repeated int64 group_id = 18; // ID
int32 credit_count = 22; //
}
//
message RegisterAndLoginRequest {
string username = 1 [ (gogoproto.moretags) = "validate:\"min=3,max=32\"" ];
string password = 2 [ (gogoproto.moretags) = "validate:\"min=6\"" ];
string captcha = 3;
string captcha_id = 4;
string email = 5;
string username = 1
[ (gogoproto.moretags) = "validate:\"min=3,max=32\"" ]; //
string password = 2 [ (gogoproto.moretags) = "validate:\"min=6\"" ]; //
string captcha = 3; //
string captcha_id = 4; // ID
string email = 5; //
}
//
message GetUserCaptchaRequest {
string type =
1; // registerlogincommentfind_passwordupload
}
//
message LoginReply {
string token = 1;
User user = 2;
}
//
message DeleteUserRequest { repeated int64 id = 1; }
//
message GetUserRequest { int64 id = 1; }
//
message FindPasswordRequest {
string email = 1;
string token = 2;
string password = 3 [ (gogoproto.moretags) = "validate:\"min=6\"" ];
string captcha = 4;
string captcha_id = 5;
string email = 1; //
string token = 2; // token
string password = 3 [ (gogoproto.moretags) = "validate:\"min=6\"" ]; //
string captcha = 4; //
string captcha_id = 5; // ID
}
//
message ListUserRequest {
int64 page = 1;
int64 size = 2;
string wd = 3;
string sort = 4;
repeated int64 id = 5;
repeated int64 group_id = 6;
repeated int32 status = 7;
int64 limit = 8;
int64 page = 1; //
int64 size = 2; //
string wd = 3; //
string sort = 4; //
repeated int64 id = 5; // ID
repeated int64 group_id = 6; // ID
repeated int32 status = 7; //
int64 limit = 8; // 0pagesize
}
//
message ListUserReply {
int64 total = 1;
repeated User user = 2;
int64 total = 1; //
repeated User user = 2; //
}
//
message GetUserCaptchaReply {
bool enable = 1;
string id = 2;
string captcha = 3;
string type = 4;
bool enable = 1; //
string id = 2; // ID
string captcha = 3; //
string type = 4; //
}
//
message UpdateUserPasswordRequest {
int64 id = 1;
string old_password = 2;
string new_password = 3 [ (gogoproto.moretags) = "validate:\"min=6\"" ];
int64 id = 1; // ID
string old_password = 2; //
string new_password = 3
[ (gogoproto.moretags) = "validate:\"min=6\"" ]; //
}
//
message GetUserPermissionsReply { repeated Permission permission = 1; }
//
message SetUserRequest {
int64 id = 1;
string username = 2 [ (gogoproto.moretags) = "validate:\"min=3,max=32\"" ];
string password = 3 [ (gogoproto.moretags) = "validate:\"min=6\"" ];
repeated int64 group_id = 4;
string email = 5;
int64 id = 1; // ID
string username = 2
[ (gogoproto.moretags) = "validate:\"min=3,max=32\"" ]; //
string password = 3 [ (gogoproto.moretags) = "validate:\"min=6\"" ]; //
repeated int64 group_id = 4; // ID
string email = 5; //
}
//
message Dynamic {
int64 id = 1;
int64 user_id = 2;
string content = 3;
int32 type = 4; //
string username = 7;
google.protobuf.Timestamp created_at = 5 [ (gogoproto.stdtime) = true ];
google.protobuf.Timestamp updated_at = 6 [ (gogoproto.stdtime) = true ];
int64 id = 1; // ID
int64 user_id = 2; // ID
string content = 3; //
int32 type = 4; //
string username = 7; //
google.protobuf.Timestamp created_at = 5
[ (gogoproto.stdtime) = true ]; //
google.protobuf.Timestamp updated_at = 6
[ (gogoproto.stdtime) = true ]; //
}
//
message ListUserDynamicRequest {
int64 page = 1;
int64 size = 2;
int64 id = 3;
int64 page = 1; //
int64 size = 2; //
int64 id = 3; // ID
}
//
message ListUserDynamicReply {
int64 total = 1;
repeated Dynamic dynamic = 2;
int64 total = 1; //
repeated Dynamic dynamic = 2; //
}
//
message Sign {
int64 id = 1;
int64 user_id = 2;
int32 sign_at = 3;
string ip = 4;
google.protobuf.Timestamp created_at = 5 [ (gogoproto.stdtime) = true ];
int32 award = 6; //
int64 id = 1; // ID
int64 user_id = 2; // ID
int32 sign_at = 3; //
string ip = 4; // IP
google.protobuf.Timestamp created_at = 5
[ (gogoproto.stdtime) = true ]; //
int32 award = 6; //
}
service UserAPI {
@ -263,6 +288,7 @@ service UserAPI {
};
}
//
rpc FindPasswordStepOne(FindPasswordRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post : '/api/v1/user/findpassword/stepone',
@ -270,6 +296,7 @@ service UserAPI {
};
}
//
rpc FindPasswordStepTwo(FindPasswordRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/user/findpassword/steptwo',

File diff suppressed because it is too large Load Diff

@ -35,10 +35,8 @@
| hash | [string](#string) | | 附件哈希值MD5 |
| user_id | [int64](#int64) | | 上传用户ID |
| type_id | [int64](#int64) | | 附件类型ID如果是文档类型则为文档ID |
| type | [int32](#int32) | | 附件类型0: 未知1: 头像2: 文档3: 文章4: 评论5: |
| enable | [bool](#bool) | | 横幅6: 分类封面7: 配置
是否启用 |
| type | [int32](#int32) | | 附件类型,见 web/utils/enum.js |
| enable | [bool](#bool) | | 是否启用 |
| path | [string](#string) | | 附件路径 |
| name | [string](#string) | | 附件名称 |
| size | [int64](#int64) | | 附件大小,单位:字节 |

@ -42,10 +42,8 @@
| 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 |
| input_type | [string](#string) | | 输入类型textarea、number、switch等 |
| category | [string](#string) | | 配置分类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) | | 创建时间 |

@ -139,12 +139,12 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| document_id | [int64](#int64) | | |
| user_id | [int64](#int64) | | |
| score | [int32](#int32) | | 评分 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int64](#int64) | | 评分ID |
| document_id | [int64](#int64) | | 文档ID |
| user_id | [int64](#int64) | | 用户ID |
| score | [int32](#int32) | | 评分100~500100为1分500为5分 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 评分时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
@ -154,7 +154,7 @@
<a name="api-v1-DownloadDocumentReply"></a>
### DownloadDocumentReply
文档下载
| Field | Type | Label | Description |
@ -190,10 +190,10 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| category_id | [int64](#int64) | | |
| category_cover | [string](#string) | | |
| category_name | [string](#string) | | |
| document | [Document](#api-v1-Document) | repeated | |
| category_id | [int64](#int64) | | 分类ID |
| category_cover | [string](#string) | | 分类封面 |
| category_name | [string](#string) | | 分类名称 |
| document | [Document](#api-v1-Document) | repeated | 文档列表 |
@ -223,7 +223,7 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| document | [ListDocumentForHomeItem](#api-v1-ListDocumentForHomeItem) | repeated | |
| document | [ListDocumentForHomeItem](#api-v1-ListDocumentForHomeItem) | repeated | 文档列表 |
@ -288,14 +288,14 @@
<a name="api-v1-SearchDocumentReply"></a>
### SearchDocumentReply
文档搜索响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| total | [int64](#int64) | | 文档总数 |
| spend | [string](#string) | | 搜索耗时 |
| document | [Document](#api-v1-Document) | repeated | |
| document | [Document](#api-v1-Document) | repeated | 文档列表 |
@ -305,14 +305,14 @@
<a name="api-v1-SearchDocumentRequest"></a>
### SearchDocumentRequest
文档搜索
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int32](#int32) | | |
| size | [int32](#int32) | | |
| wd | [string](#string) | | |
| page | [int32](#int32) | | 页码 |
| size | [int32](#int32) | | 每页数量 |
| wd | [string](#string) | | 搜索关键字 |
| category_id | [int64](#int64) | repeated | 分类 |
| sort | [string](#string) | | 排序 |
| ext | [string](#string) | | 类型 |
@ -347,20 +347,20 @@
<a name="api-v1-DocumentAPI"></a>
### DocumentAPI
文档服务
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ListDocumentForHome | [ListDocumentForHomeRequest](#api-v1-ListDocumentForHomeRequest) | [ListDocumentForHomeResponse](#api-v1-ListDocumentForHomeResponse) | |
| SetDocumentRecommend | [SetDocumentRecommendRequest](#api-v1-SetDocumentRecommendRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| CreateDocument | [CreateDocumentRequest](#api-v1-CreateDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| UpdateDocument | [Document](#api-v1-Document) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| DeleteDocument | [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| GetDocument | [GetDocumentRequest](#api-v1-GetDocumentRequest) | [Document](#api-v1-Document) | |
| GetRelatedDocuments | [Document](#api-v1-Document) | [ListDocumentReply](#api-v1-ListDocumentReply) | |
| DownloadDocument | [Document](#api-v1-Document) | [DownloadDocumentReply](#api-v1-DownloadDocumentReply) | |
| ListDocument | [ListDocumentRequest](#api-v1-ListDocumentRequest) | [ListDocumentReply](#api-v1-ListDocumentReply) | |
| SearchDocument | [SearchDocumentRequest](#api-v1-SearchDocumentRequest) | [SearchDocumentReply](#api-v1-SearchDocumentReply) | |
| ListDocumentForHome | [ListDocumentForHomeRequest](#api-v1-ListDocumentForHomeRequest) | [ListDocumentForHomeResponse](#api-v1-ListDocumentForHomeResponse) | 针对首页的文档查询 |
| SetDocumentRecommend | [SetDocumentRecommendRequest](#api-v1-SetDocumentRecommendRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 设置文档推荐 |
| CreateDocument | [CreateDocumentRequest](#api-v1-CreateDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 创建文档 |
| UpdateDocument | [Document](#api-v1-Document) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新文档 |
| DeleteDocument | [DeleteDocumentRequest](#api-v1-DeleteDocumentRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除文档 |
| GetDocument | [GetDocumentRequest](#api-v1-GetDocumentRequest) | [Document](#api-v1-Document) | 查询文档 |
| GetRelatedDocuments | [Document](#api-v1-Document) | [ListDocumentReply](#api-v1-ListDocumentReply) | 根据文档ID查询当前文档的相关文档 |
| DownloadDocument | [Document](#api-v1-Document) | [DownloadDocumentReply](#api-v1-DownloadDocumentReply) | 根据文档ID获取文档下载链接 |
| ListDocument | [ListDocumentRequest](#api-v1-ListDocumentRequest) | [ListDocumentReply](#api-v1-ListDocumentReply) | 文档列表查询 |
| SearchDocument | [SearchDocumentRequest](#api-v1-SearchDocumentRequest) | [SearchDocumentReply](#api-v1-SearchDocumentReply) | 文档搜索 |
| SetDocumentScore | [DocumentScore](#api-v1-DocumentScore) | [.google.protobuf.Empty](#google-protobuf-Empty) | 设置文档评分 |
| GetDocumentScore | [DocumentScore](#api-v1-DocumentScore) | [DocumentScore](#api-v1-DocumentScore) | 获取当前登录用户的文档评分 |
| SetDocumentReconvert | [.google.protobuf.Empty](#google-protobuf-Empty) | [.google.protobuf.Empty](#google-protobuf-Empty) | 将文档一键设置为重转 |

@ -26,7 +26,7 @@
<a name="api-v1-DeleteFavoriteRequest"></a>
### DeleteFavoriteRequest
取消收藏
| Field | Type | Label | Description |
@ -41,7 +41,7 @@
<a name="api-v1-Favorite"></a>
### Favorite
文档收藏
| Field | Type | Label | Description |
@ -65,7 +65,7 @@
<a name="api-v1-GetFavoriteRequest"></a>
### GetFavoriteRequest
根据文章id查询用户是否有收藏某篇文档
| Field | Type | Label | Description |
@ -80,7 +80,7 @@
<a name="api-v1-ListFavoriteReply"></a>
### ListFavoriteReply
查询用户的收藏
| Field | Type | Label | Description |
@ -96,7 +96,7 @@
<a name="api-v1-ListFavoriteRequest"></a>
### ListFavoriteRequest
查询用户的收藏
| Field | Type | Label | Description |

@ -26,7 +26,7 @@
<a name="api-v1-DeleteFriendlinkRequest"></a>
### DeleteFriendlinkRequest
删除友情链接
| Field | Type | Label | Description |
@ -41,19 +41,19 @@
<a name="api-v1-Friendlink"></a>
### Friendlink
友情链接
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int32](#int32) | | |
| title | [string](#string) | | |
| link | [string](#string) | | |
| description | [string](#string) | | |
| sort | [int32](#int32) | | |
| enable | [bool](#bool) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int32](#int32) | | 主键 |
| title | [string](#string) | | 标题 |
| link | [string](#string) | | 链接 |
| description | [string](#string) | | 描述 |
| sort | [int32](#int32) | | 排序 |
| enable | [bool](#bool) | | 是否启用 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
@ -63,7 +63,7 @@
<a name="api-v1-GetFriendlinkRequest"></a>
### GetFriendlinkRequest
获取友情链接
| Field | Type | Label | Description |
@ -78,7 +78,7 @@
<a name="api-v1-ListFriendlinkReply"></a>
### ListFriendlinkReply
友情链接列表
| Field | Type | Label | Description |
@ -94,7 +94,7 @@
<a name="api-v1-ListFriendlinkRequest"></a>
### ListFriendlinkRequest
友情链接列表
| Field | Type | Label | Description |
@ -119,15 +119,15 @@
<a name="api-v1-FriendlinkAPI"></a>
### FriendlinkAPI
友情链接服务
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| CreateFriendlink | [Friendlink](#api-v1-Friendlink) | [Friendlink](#api-v1-Friendlink) | |
| UpdateFriendlink | [Friendlink](#api-v1-Friendlink) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| DeleteFriendlink | [DeleteFriendlinkRequest](#api-v1-DeleteFriendlinkRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| GetFriendlink | [GetFriendlinkRequest](#api-v1-GetFriendlinkRequest) | [Friendlink](#api-v1-Friendlink) | |
| ListFriendlink | [ListFriendlinkRequest](#api-v1-ListFriendlinkRequest) | [ListFriendlinkReply](#api-v1-ListFriendlinkReply) | |
| CreateFriendlink | [Friendlink](#api-v1-Friendlink) | [Friendlink](#api-v1-Friendlink) | 创建友情链接 |
| UpdateFriendlink | [Friendlink](#api-v1-Friendlink) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新友情链接 |
| DeleteFriendlink | [DeleteFriendlinkRequest](#api-v1-DeleteFriendlinkRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除友情链接 |
| GetFriendlink | [GetFriendlinkRequest](#api-v1-GetFriendlinkRequest) | [Friendlink](#api-v1-Friendlink) | 获取友情链接 |
| ListFriendlink | [ListFriendlinkRequest](#api-v1-ListFriendlinkRequest) | [ListFriendlinkReply](#api-v1-ListFriendlinkReply) | 获取友情链接 |

@ -29,7 +29,7 @@
<a name="api-v1-DeleteGroupRequest"></a>
### DeleteGroupRequest
删除用户组,可以批量删除
| Field | Type | Label | Description |
@ -44,7 +44,7 @@
<a name="api-v1-GetGroupPermissionRequest"></a>
### GetGroupPermissionRequest
获取用户组权限
| Field | Type | Label | Description |
@ -75,23 +75,23 @@
<a name="api-v1-Group"></a>
### Group
用户组,角色
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| title | [string](#string) | | |
| color | [string](#string) | | |
| is_default | [bool](#bool) | | |
| is_display | [bool](#bool) | | |
| description | [string](#string) | | |
| user_count | [int32](#int32) | | |
| sort | [int32](#int32) | | |
| enable_upload | [bool](#bool) | | |
| enable_comment_approval | [bool](#bool) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int64](#int64) | | 用户组ID |
| title | [string](#string) | | 用户组名称 |
| color | [string](#string) | | 用户组颜色 |
| is_default | [bool](#bool) | | 是否是默认用户组 |
| is_display | [bool](#bool) | | 是否显示 |
| description | [string](#string) | | 用户组描述 |
| user_count | [int32](#int32) | | 用户组下的用户数量 |
| sort | [int32](#int32) | | 排序 |
| enable_upload | [bool](#bool) | | 是否允许上传文档 |
| enable_comment_approval | [bool](#bool) | | 是否需要审核评论 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
@ -101,7 +101,7 @@
<a name="api-v1-GroupPermissions"></a>
### GroupPermissions
用户组权限
| Field | Type | Label | Description |
@ -116,7 +116,7 @@
<a name="api-v1-ListGroupReply"></a>
### ListGroupReply
用户组列表
| Field | Type | Label | Description |
@ -151,7 +151,7 @@
<a name="api-v1-UpdateGroupPermissionRequest"></a>
### UpdateGroupPermissionRequest
更新用户组权限
| Field | Type | Label | Description |
@ -180,8 +180,8 @@
| CreateGroup | [Group](#api-v1-Group) | [Group](#api-v1-Group) | 创建用户组 |
| UpdateGroup | [Group](#api-v1-Group) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户组 |
| DeleteGroup | [DeleteGroupRequest](#api-v1-DeleteGroupRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除用户组 |
| GetGroup | [GetGroupRequest](#api-v1-GetGroupRequest) | [Group](#api-v1-Group) | 获取用户组列表 |
| ListGroup | [ListGroupRequest](#api-v1-ListGroupRequest) | [ListGroupReply](#api-v1-ListGroupReply) | |
| GetGroup | [GetGroupRequest](#api-v1-GetGroupRequest) | [Group](#api-v1-Group) | 获取用户组 |
| ListGroup | [ListGroupRequest](#api-v1-ListGroupRequest) | [ListGroupReply](#api-v1-ListGroupReply) | 获取用户组列表 |
| GetGroupPermission | [GetGroupPermissionRequest](#api-v1-GetGroupPermissionRequest) | [GroupPermissions](#api-v1-GroupPermissions) | 获取用户组权限列表 |
| UpdateGroupPermission | [UpdateGroupPermissionRequest](#api-v1-UpdateGroupPermissionRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新用户组权限,给用户组设置权限 |

@ -4,7 +4,6 @@
## Table of Contents
- [api/v1/permission.proto](#api_v1_permission-proto)
- [DeletePermissionRequest](#api-v1-DeletePermissionRequest)
- [GetPermissionReply](#api-v1-GetPermissionReply)
- [GetPermissionRequest](#api-v1-GetPermissionRequest)
- [ListPermissionReply](#api-v1-ListPermissionReply)
@ -24,25 +23,10 @@
<a name="api-v1-DeletePermissionRequest"></a>
### DeletePermissionRequest
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | repeated | |
<a name="api-v1-GetPermissionReply"></a>
### GetPermissionReply
权限响应
| Field | Type | Label | Description |
@ -57,7 +41,7 @@
<a name="api-v1-GetPermissionRequest"></a>
### GetPermissionRequest
权限请求
| Field | Type | Label | Description |
@ -72,7 +56,7 @@
<a name="api-v1-ListPermissionReply"></a>
### ListPermissionReply
权限列表响应
| Field | Type | Label | Description |
@ -88,7 +72,7 @@
<a name="api-v1-ListPermissionRequest"></a>
### ListPermissionRequest
权限列表请求
| Field | Type | Label | Description |
@ -107,18 +91,18 @@
<a name="api-v1-Permission"></a>
### Permission
权限
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| method | [string](#string) | | |
| path | [string](#string) | | |
| title | [string](#string) | | |
| description | [string](#string) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int64](#int64) | | 权限ID |
| method | [string](#string) | | 请求方法 |
| path | [string](#string) | | 请求路径 |
| title | [string](#string) | | 权限名称 |
| description | [string](#string) | | 权限描述 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
@ -134,13 +118,13 @@
<a name="api-v1-PermissionAPI"></a>
### PermissionAPI
权限API服务
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| UpdatePermission | [Permission](#api-v1-Permission) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| GetPermission | [GetPermissionRequest](#api-v1-GetPermissionRequest) | [Permission](#api-v1-Permission) | |
| ListPermission | [ListPermissionRequest](#api-v1-ListPermissionRequest) | [ListPermissionReply](#api-v1-ListPermissionReply) | |
| UpdatePermission | [Permission](#api-v1-Permission) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新权限信息。这里只能操作title和description |
| GetPermission | [GetPermissionRequest](#api-v1-GetPermissionRequest) | [Permission](#api-v1-Permission) | 查询权限信息 |
| ListPermission | [ListPermissionRequest](#api-v1-ListPermissionRequest) | [ListPermissionReply](#api-v1-ListPermissionReply) | 查询权限列表 |

@ -25,7 +25,7 @@
<a name="api-v1-DeleteReportRequest"></a>
### DeleteReportRequest
删除举报请求
| Field | Type | Label | Description |
@ -40,7 +40,7 @@
<a name="api-v1-ListReportReply"></a>
### ListReportReply
举报列表响应
| Field | Type | Label | Description |
@ -56,7 +56,7 @@
<a name="api-v1-ListReportRequest"></a>
### ListReportRequest
举报列表请求
| Field | Type | Label | Description |
@ -76,21 +76,21 @@
<a name="api-v1-Report"></a>
### Report
这里是proto文件中的结构体可以根据需要删除或者调整
举报
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| document_id | [int64](#int64) | | |
| user_id | [int64](#int64) | | |
| reason | [int32](#int32) | | |
| status | [bool](#bool) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| document_title | [string](#string) | | |
| remark | [string](#string) | | |
| username | [string](#string) | | |
| id | [int64](#int64) | | 举报ID |
| document_id | [int64](#int64) | | 文档ID |
| user_id | [int64](#int64) | | 举报人ID |
| reason | [int32](#int32) | | 举报原因 |
| status | [bool](#bool) | | 举报处理状态 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 举报时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 处理时间 |
| document_title | [string](#string) | | 文档标题 |
| remark | [string](#string) | | 处理备注 |
| username | [string](#string) | | 举报人 |
@ -106,14 +106,14 @@
<a name="api-v1-ReportAPI"></a>
### ReportAPI
举报服务
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| CreateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| UpdateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| DeleteReport | [DeleteReportRequest](#api-v1-DeleteReportRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| ListReport | [ListReportRequest](#api-v1-ListReportRequest) | [ListReportReply](#api-v1-ListReportReply) | |
| CreateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | 创建举报 |
| UpdateReport | [Report](#api-v1-Report) | [.google.protobuf.Empty](#google-protobuf-Empty) | 更新举报,审核举报内容 |
| DeleteReport | [DeleteReportRequest](#api-v1-DeleteReportRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 删除举报 |
| ListReport | [ListReportRequest](#api-v1-ListReportRequest) | [ListReportReply](#api-v1-ListReportReply) | 获取举报列表 |

@ -38,7 +38,7 @@
<a name="api-v1-DeleteUserRequest"></a>
### DeleteUserRequest
删除用户
| Field | Type | Label | Description |
@ -53,18 +53,18 @@
<a name="api-v1-Dynamic"></a>
### Dynamic
用户动态
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| user_id | [int64](#int64) | | |
| content | [string](#string) | | |
| id | [int64](#int64) | | 动态ID |
| user_id | [int64](#int64) | | 用户ID |
| content | [string](#string) | | 内容 |
| type | [int32](#int32) | | 类型 |
| username | [string](#string) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| username | [string](#string) | | 用户名 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
@ -74,16 +74,16 @@
<a name="api-v1-FindPasswordRequest"></a>
### FindPasswordRequest
找回密码
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| email | [string](#string) | | |
| token | [string](#string) | | |
| password | [string](#string) | | |
| captcha | [string](#string) | | |
| captcha_id | [string](#string) | | |
| email | [string](#string) | | 邮箱 |
| token | [string](#string) | | 签名token |
| password | [string](#string) | | 新密码 |
| captcha | [string](#string) | | 验证码 |
| captcha_id | [string](#string) | | 验证码ID |
@ -93,15 +93,15 @@
<a name="api-v1-GetUserCaptchaReply"></a>
### GetUserCaptchaReply
验证码响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| enable | [bool](#bool) | | |
| id | [string](#string) | | |
| captcha | [string](#string) | | |
| type | [string](#string) | | |
| enable | [bool](#bool) | | 是否启用验证码 |
| id | [string](#string) | | 验证码ID |
| captcha | [string](#string) | | 验证码 |
| type | [string](#string) | | 验证码类型 |
@ -111,7 +111,7 @@
<a name="api-v1-GetUserCaptchaRequest"></a>
### GetUserCaptchaRequest
查询验证码请求
| Field | Type | Label | Description |
@ -126,7 +126,7 @@
<a name="api-v1-GetUserPermissionsReply"></a>
### GetUserPermissionsReply
用户权限信息查询
| Field | Type | Label | Description |
@ -141,7 +141,7 @@
<a name="api-v1-GetUserRequest"></a>
### GetUserRequest
获取用户信息
| Field | Type | Label | Description |
@ -156,13 +156,13 @@
<a name="api-v1-ListUserDynamicReply"></a>
### ListUserDynamicReply
用户动态列表响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| dynamic | [Dynamic](#api-v1-Dynamic) | repeated | |
| total | [int64](#int64) | | 总数 |
| dynamic | [Dynamic](#api-v1-Dynamic) | repeated | 动态列表 |
@ -172,14 +172,14 @@
<a name="api-v1-ListUserDynamicRequest"></a>
### ListUserDynamicRequest
用户动态列表请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| id | [int64](#int64) | | |
| page | [int64](#int64) | | 页码 |
| size | [int64](#int64) | | 每页数量 |
| id | [int64](#int64) | | 用户ID |
@ -189,13 +189,13 @@
<a name="api-v1-ListUserReply"></a>
### ListUserReply
用户列表响应
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| total | [int64](#int64) | | |
| user | [User](#api-v1-User) | repeated | |
| total | [int64](#int64) | | 总数 |
| user | [User](#api-v1-User) | repeated | 用户列表 |
@ -205,19 +205,19 @@
<a name="api-v1-ListUserRequest"></a>
### ListUserRequest
用户列表请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| page | [int64](#int64) | | |
| size | [int64](#int64) | | |
| wd | [string](#string) | | |
| sort | [string](#string) | | |
| id | [int64](#int64) | repeated | |
| group_id | [int64](#int64) | repeated | |
| status | [int32](#int32) | repeated | |
| limit | [int64](#int64) | | |
| page | [int64](#int64) | | 页码 |
| size | [int64](#int64) | | 每页数量 |
| wd | [string](#string) | | 搜索关键词 |
| sort | [string](#string) | | 排序字段 |
| id | [int64](#int64) | repeated | 用户ID |
| group_id | [int64](#int64) | repeated | 用户组ID |
| status | [int32](#int32) | repeated | 用户状态 |
| limit | [int64](#int64) | | 请求数量限制大于0时page和size无效 |
@ -227,7 +227,7 @@
<a name="api-v1-LoginReply"></a>
### LoginReply
用户登录响应
| Field | Type | Label | Description |
@ -243,16 +243,16 @@
<a name="api-v1-RegisterAndLoginRequest"></a>
### RegisterAndLoginRequest
用户注册登录请求
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| username | [string](#string) | | |
| password | [string](#string) | | |
| captcha | [string](#string) | | |
| captcha_id | [string](#string) | | |
| email | [string](#string) | | |
| username | [string](#string) | | 用户名 |
| password | [string](#string) | | 密码 |
| captcha | [string](#string) | | 验证码 |
| captcha_id | [string](#string) | | 验证码ID |
| email | [string](#string) | | 邮箱 |
@ -262,16 +262,16 @@
<a name="api-v1-SetUserRequest"></a>
### SetUserRequest
管理后台设置用户信息
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| username | [string](#string) | | |
| password | [string](#string) | | |
| group_id | [int64](#int64) | repeated | |
| email | [string](#string) | | |
| id | [int64](#int64) | | 用户ID |
| username | [string](#string) | | 用户名 |
| password | [string](#string) | | 密码 |
| group_id | [int64](#int64) | repeated | 用户组ID |
| email | [string](#string) | | 邮箱 |
@ -281,16 +281,16 @@
<a name="api-v1-Sign"></a>
### Sign
用户签到
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| user_id | [int64](#int64) | | |
| sign_at | [int32](#int32) | | |
| ip | [string](#string) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int64](#int64) | | 签到ID |
| user_id | [int64](#int64) | | 用户ID |
| sign_at | [int32](#int32) | | 签到日期 |
| ip | [string](#string) | | 签到IP |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 创建时间 |
| award | [int32](#int32) | | 签到积分奖励 |
@ -306,9 +306,9 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| id | [int64](#int64) | | |
| old_password | [string](#string) | | |
| new_password | [string](#string) | | |
| id | [int64](#int64) | | 用户ID |
| old_password | [string](#string) | | 旧密码 |
| new_password | [string](#string) | | 新密码 |
@ -318,33 +318,33 @@
<a name="api-v1-User"></a>
### User
用户信息
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| login_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| id | [int64](#int64) | | |
| username | [string](#string) | | |
| mobile | [string](#string) | | |
| email | [string](#string) | | |
| address | [string](#string) | | |
| signature | [string](#string) | | |
| last_login_ip | [string](#string) | | |
| register_ip | [string](#string) | | |
| doc_count | [int32](#int32) | | |
| follow_count | [int32](#int32) | | |
| fans_count | [int32](#int32) | | |
| favorite_count | [int32](#int32) | | |
| comment_count | [int32](#int32) | | |
| status | [int32](#int32) | | |
| avatar | [string](#string) | | |
| identity | [string](#string) | | |
| realname | [string](#string) | | |
| group_id | [int64](#int64) | repeated | |
| credit_count | [int32](#int32) | | |
| login_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 最后登录时间 |
| created_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 注册时间 |
| updated_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | 更新时间 |
| id | [int64](#int64) | | 用户ID |
| username | [string](#string) | | 用户名 |
| mobile | [string](#string) | | 手机号 |
| email | [string](#string) | | 邮箱,唯一 |
| address | [string](#string) | | 地址 |
| signature | [string](#string) | | 个性签名 |
| last_login_ip | [string](#string) | | 最后登录IP |
| register_ip | [string](#string) | | 注册IP |
| doc_count | [int32](#int32) | | 文档数量 |
| follow_count | [int32](#int32) | | 关注数量 |
| fans_count | [int32](#int32) | | 粉丝数量 |
| favorite_count | [int32](#int32) | | 收藏数量 |
| comment_count | [int32](#int32) | | 评论数量 |
| status | [int32](#int32) | | 用户状态,见 web/utils/enum.js当前没有使用 |
| avatar | [string](#string) | | 头像 |
| identity | [string](#string) | | 身份证 |
| realname | [string](#string) | | 真实姓名 |
| group_id | [int64](#int64) | repeated | 用户组ID |
| credit_count | [int32](#int32) | | 积分 |
@ -380,8 +380,8 @@
| ListUserDynamic | [ListUserDynamicRequest](#api-v1-ListUserDynamicRequest) | [ListUserDynamicReply](#api-v1-ListUserDynamicReply) | 获取用户动态,包括获取关注的用户的动态 |
| SignToday | [.google.protobuf.Empty](#google-protobuf-Empty) | [Sign](#api-v1-Sign) | 每日签到 |
| GetSignedToday | [.google.protobuf.Empty](#google-protobuf-Empty) | [Sign](#api-v1-Sign) | 获取今日已签到记录 |
| FindPasswordStepOne | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| FindPasswordStepTwo | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
| FindPasswordStepOne | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 找回密码:第一步,发送验证码 |
| FindPasswordStepTwo | [FindPasswordRequest](#api-v1-FindPasswordRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | 找回密码:第二步,修改密码 |

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save