完成文档回收站功能

dev
truthhun 2 years ago
parent 5901bd1f63
commit bae096436c

@ -95,7 +95,9 @@ service DocumentAPI {
get : '/api/v1/document/list',
};
}
}
service RecycleAPI {
//
rpc ListRecycleDocument(ListDocumentRequest) returns (ListDocumentReply) {
option (google.api.http) = {
@ -104,7 +106,8 @@ service DocumentAPI {
}
//
rpc RecoverRecycleDocument(RecoverRecycleDocumentRequest) returns (google.protobuf.Empty) {
rpc RecoverRecycleDocument(RecoverRecycleDocumentRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
put : '/api/v1/document/recycle',
body : '*',
@ -112,17 +115,18 @@ service DocumentAPI {
}
//
rpc DeleteRecycleDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) {
rpc DeleteRecycleDocument(DeleteDocumentRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/document/recycle',
};
}
//
rpc ClearRecycleDocument(google.protobuf.Empty) returns (google.protobuf.Empty) {
rpc ClearRecycleDocument(google.protobuf.Empty)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete : '/api/v1/document/recycle/all',
};
}
}

@ -95,5 +95,13 @@ func RegisterGRPCService(dbModel *model.DBModel, logger *zap.Logger, endpoint st
return
}
// 文档回收站服务
v1.RegisterRecycleAPIServer(grpcServer, documentAPIService)
err = v1.RegisterRecycleAPIHandlerFromEndpoint(context.Background(), gwmux, endpoint, dialOpts)
if err != nil {
logger.Error("RegisterRecycleAPIHandlerFromEndpoint", zap.Error(err))
return
}
return
}

@ -100,12 +100,6 @@ export const user = {
}
})
} catch (error) {}
// TODO: 剔除。这里只是开发的时候暂时用到
allowPages.push(
'/admin/document',
'/admin/document/list',
'/admin/document/recycle'
)
commit('setAllowPages', allowPages)
} else {
Message({

@ -7,6 +7,12 @@ const cumstomPermissionMap = {
children: [],
pages: ['/admin/document', '/admin/document/list'],
},
'api.v1.RecycleAPI': {
label: '回收站管理',
path: 'ListRecycleDocument',
children: [],
pages: ['/admin/document', '/admin/document/recycle'],
},
'api.v1.CategoryAPI': {
label: '分类管理',
path: 'ListCategory',

Loading…
Cancel
Save