Compare commits

...

39 Commits

Author SHA1 Message Date
lzh
34a724268a 修改接口路径 2025-06-13 14:34:28 +08:00
lzh
11b0192a23 添加扩展和余量接口 2025-06-13 14:00:29 +08:00
lzh
44d5704606 修改请求方法 2025-06-12 19:46:55 +08:00
lzh
816d1e108e 修改请求方法 2025-06-12 19:42:12 +08:00
lzh
586d28119a 添加字段 2025-06-12 19:23:11 +08:00
lzh
d621faa3ca 修改proto 2025-06-12 17:20:02 +08:00
lzh
3a47be645f 添加摘要字段 2025-06-12 14:36:29 +08:00
lzh
fb48a52910 修改鉴权 2025-06-12 13:44:20 +08:00
lzh
48365942d1 修改路由路径 2025-06-11 18:16:15 +08:00
lzh
83c218564f 修改文档接口method 2025-06-11 17:51:45 +08:00
lzh
908c7cba05 添加操作人信息 2025-06-11 16:56:24 +08:00
lzh
60111dac43 添加展示字段 2025-06-11 15:56:39 +08:00
lzh
df6a9db80b 添加附件名字段 2025-06-11 15:17:41 +08:00
lzh
dc54b70b59 完善文档相关接口 2025-06-11 14:13:11 +08:00
lzh
8e8cc16853 添加官网新闻接口 2025-06-11 13:59:35 +08:00
lzh
272d59af4c 添加套餐扩展、扩展记录接口 2025-06-09 14:22:39 +08:00
lzh
d067c785fb Merge branch 'dev-resource-library' into dev-lzh 2025-06-09 13:40:19 +08:00
lzh
4b443be4e3 路由错误修改 2025-06-09 13:31:44 +08:00
bd540ad262 合并main 2025-06-09 11:48:50 +08:00
lzh
5a8bb4216c 添加素材库接口 2025-06-03 15:58:52 +08:00
c250930722 Merge branch 'jng' into dev 2025-05-28 15:32:06 +08:00
ed7b95d707 Merge branch 'jng' into dev 2025-05-28 15:04:59 +08:00
jhc
5bbf97eaf2 修改引用问题 2025-05-27 10:56:19 +08:00
jhc
c1978c9ee7 修改冲突 2025-05-27 10:49:22 +08:00
jhc
73f269f847 导出文件 上传 oss 2025-05-27 10:46:36 +08:00
60caecc1b9 Merge branch 'jng' into dev 2025-05-27 09:53:45 +08:00
a23504c746 Merge branch 'jng' into dev 2025-05-27 09:41:45 +08:00
d0cf3bb208 Merge branch 'jng' into dev 2025-05-27 09:36:16 +08:00
8d43eaf18d Merge branch 'jng' into dev 2025-05-27 09:15:44 +08:00
8e30f6c984 Merge branch 'jng' into dev 2025-05-26 17:16:54 +08:00
2d0a24100e Merge branch 'jng' into dev 2025-05-26 17:03:15 +08:00
ef50c8626a 解决冲突 2025-05-26 16:32:36 +08:00
db0a50ed33 Merge branch 'jng' into dev 2025-05-26 09:17:47 +08:00
b4c173df5f Merge branch 'jng' into dev 2025-05-26 09:13:22 +08:00
a6919e8396 11 2025-05-23 11:16:03 +08:00
2779dcc5bd 11 2025-05-23 11:06:08 +08:00
8562d64dd5 11 2025-05-23 10:57:29 +08:00
2de0d9dc9b 解决冲突 2025-05-23 10:54:31 +08:00
a357389fac 11 2025-05-22 20:43:47 +08:00
27 changed files with 11069 additions and 499 deletions

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,36 @@ func (this *CommonResponse) Validate() error {
return nil
}
func (this *BundleProfile) Validate() error {
for _, item := range this.SelectValueAddService {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SelectValueAddService", err)
}
}
}
for _, item := range this.BundleProfileLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleProfileLang", err)
}
}
}
return nil
}
func (this *BundleProfileLang) Validate() error {
for _, item := range this.ValueAddServiceLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceLang", err)
}
}
}
return nil
}
func (this *SaveResponse) Validate() error {
return nil
}
func (this *SelectValueAddService) Validate() error {
return nil
}
func (this *DelBundleRequest) Validate() error {
@ -42,6 +72,9 @@ func (this *BundleListResponse) Validate() error {
func (this *BundleDetailRequest) Validate() error {
return nil
}
func (this *HandShelfRequest) Validate() error {
return nil
}
func (this *BundleDetailResponse) Validate() error {
if this.Bundle != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
@ -50,7 +83,32 @@ func (this *BundleDetailResponse) Validate() error {
}
return nil
}
func (this *BundleDetailResponseV2) Validate() error {
if this.Bundle != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Bundle", err)
}
}
for _, item := range this.SelectValueAddService {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SelectValueAddService", err)
}
}
}
return nil
}
func (this *OrderRecord) Validate() error {
for _, item := range this.PriceOptionsInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PriceOptionsInfo", err)
}
}
}
return nil
}
func (this *PriceOptionsInfo) Validate() error {
return nil
}
func (this *OrderRecordsRequest) Validate() error {
@ -119,3 +177,88 @@ func (this *ValueAddBundleDetailResponse) Validate() error {
func (this *FinancialConfirmationRequest) Validate() error {
return nil
}
func (this *ValueAddService) Validate() error {
for _, item := range this.ServiceLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ServiceLang", err)
}
}
}
return nil
}
func (this *ValueAddServiceLang) Validate() error {
for _, item := range this.Options {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Options", err)
}
}
}
return nil
}
func (this *ValueAddPriceOptions) Validate() error {
return nil
}
func (this *ValueAddServiceListRequest) Validate() error {
return nil
}
func (this *ValueAddServiceListResponse) Validate() error {
for _, item := range this.ValueAddServiceList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceList", err)
}
}
}
return nil
}
func (this *ValueAddServiceDetailRequest) Validate() error {
return nil
}
func (this *ValueAddServiceDetailResponse) Validate() error {
if this.ValueAddServiceLang != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddServiceLang); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceLang", err)
}
}
return nil
}
func (this *BundleExtendRequest) Validate() error {
return nil
}
func (this *BundleExtendResponse) Validate() error {
return nil
}
func (this *BundleExtendRecordsListRequest) Validate() error {
return nil
}
func (this *BundleExtendRecordsListResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *BundleExtendRecordItem) Validate() error {
return nil
}
func (this *GetBundleBalanceReq) Validate() error {
return nil
}
func (this *BundleBalanceItem) Validate() error {
return nil
}
func (this *GetBundleBalanceResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.10.1
// - protoc v3.20.3
// source: pb/bundle.proto
package bundle
@ -31,6 +31,10 @@ type BundleClient interface {
CreateBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
UpdateBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
DeleteBundle(ctx context.Context, in *DelBundleRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
HandShelf(ctx context.Context, in *HandShelfRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
SaveBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
BundleListV2(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment)
BundleDetailV2(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponseV2, common.ErrorWithAttachment)
BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment)
BundleDetail(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponse, common.ErrorWithAttachment)
CreateOrderRecord(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
@ -39,10 +43,18 @@ type BundleClient interface {
OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment)
OrderRecordsDetail(ctx context.Context, in *OrderRecordsDetailRequest, opts ...grpc_go.CallOption) (*OrderRecordsDetailResponse, common.ErrorWithAttachment)
UpdateFinancialConfirmationStatus(ctx context.Context, in *FinancialConfirmationRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
//增值套餐
// 增值套餐
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment)
// 新增值服务
SaveValueAddService(ctx context.Context, in *ValueAddServiceLang, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
ValueAddServiceList(ctx context.Context, in *ValueAddServiceListRequest, opts ...grpc_go.CallOption) (*ValueAddServiceListResponse, common.ErrorWithAttachment)
ValueAddServiceDetail(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceDetailResponse, common.ErrorWithAttachment)
// 余量管理
BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment)
BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment)
GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment)
}
type bundleClient struct {
@ -53,6 +65,10 @@ type BundleClientImpl struct {
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
HandShelf func(ctx context.Context, in *HandShelfRequest) (*CommonResponse, error)
SaveBundle func(ctx context.Context, in *BundleProfile) (*SaveResponse, error)
BundleListV2 func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleDetailV2 func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponseV2, error)
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
@ -64,6 +80,12 @@ type BundleClientImpl struct {
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
SaveValueAddService func(ctx context.Context, in *ValueAddServiceLang) (*SaveResponse, error)
ValueAddServiceList func(ctx context.Context, in *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
ValueAddServiceDetail func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalance func(ctx context.Context, in *GetBundleBalanceReq) (*GetBundleBalanceResp, error)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -96,6 +118,30 @@ func (c *bundleClient) DeleteBundle(ctx context.Context, in *DelBundleRequest, o
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteBundle", in, out)
}
func (c *bundleClient) HandShelf(ctx context.Context, in *HandShelfRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/HandShelf", in, out)
}
func (c *bundleClient) SaveBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment) {
out := new(SaveResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SaveBundle", in, out)
}
func (c *bundleClient) BundleListV2(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) {
out := new(BundleListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleListV2", in, out)
}
func (c *bundleClient) BundleDetailV2(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponseV2, common.ErrorWithAttachment) {
out := new(BundleDetailResponseV2)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleDetailV2", in, out)
}
func (c *bundleClient) BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) {
out := new(BundleListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -162,6 +208,42 @@ func (c *bundleClient) ValueAddBundleDetail(ctx context.Context, in *ValueAddBun
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ValueAddBundleDetail", in, out)
}
func (c *bundleClient) SaveValueAddService(ctx context.Context, in *ValueAddServiceLang, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment) {
out := new(SaveResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SaveValueAddService", in, out)
}
func (c *bundleClient) ValueAddServiceList(ctx context.Context, in *ValueAddServiceListRequest, opts ...grpc_go.CallOption) (*ValueAddServiceListResponse, common.ErrorWithAttachment) {
out := new(ValueAddServiceListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ValueAddServiceList", in, out)
}
func (c *bundleClient) ValueAddServiceDetail(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceDetailResponse, common.ErrorWithAttachment) {
out := new(ValueAddServiceDetailResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ValueAddServiceDetail", in, out)
}
func (c *bundleClient) BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) {
out := new(BundleExtendResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleExtend", in, out)
}
func (c *bundleClient) BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment) {
out := new(BundleExtendRecordsListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleExtendRecordsList", in, out)
}
func (c *bundleClient) GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment) {
out := new(GetBundleBalanceResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalance", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
@ -169,6 +251,10 @@ type BundleServer interface {
CreateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
UpdateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
DeleteBundle(context.Context, *DelBundleRequest) (*CommonResponse, error)
HandShelf(context.Context, *HandShelfRequest) (*CommonResponse, error)
SaveBundle(context.Context, *BundleProfile) (*SaveResponse, error)
BundleListV2(context.Context, *BundleListRequest) (*BundleListResponse, error)
BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error)
BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error)
BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error)
@ -177,10 +263,18 @@ type BundleServer interface {
OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error)
OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
UpdateFinancialConfirmationStatus(context.Context, *FinancialConfirmationRequest) (*CommonResponse, error)
//增值套餐
// 增值套餐
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
// 新增值服务
SaveValueAddService(context.Context, *ValueAddServiceLang) (*SaveResponse, error)
ValueAddServiceList(context.Context, *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
ValueAddServiceDetail(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
// 余量管理
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error)
mustEmbedUnimplementedBundleServer()
}
@ -198,6 +292,18 @@ func (UnimplementedBundleServer) UpdateBundle(context.Context, *BundleProfile) (
func (UnimplementedBundleServer) DeleteBundle(context.Context, *DelBundleRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteBundle not implemented")
}
func (UnimplementedBundleServer) HandShelf(context.Context, *HandShelfRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method HandShelf not implemented")
}
func (UnimplementedBundleServer) SaveBundle(context.Context, *BundleProfile) (*SaveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SaveBundle not implemented")
}
func (UnimplementedBundleServer) BundleListV2(context.Context, *BundleListRequest) (*BundleListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleListV2 not implemented")
}
func (UnimplementedBundleServer) BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleDetailV2 not implemented")
}
func (UnimplementedBundleServer) BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleList not implemented")
}
@ -231,6 +337,24 @@ func (UnimplementedBundleServer) ValueAddBundleList(context.Context, *ValueAddBu
func (UnimplementedBundleServer) ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValueAddBundleDetail not implemented")
}
func (UnimplementedBundleServer) SaveValueAddService(context.Context, *ValueAddServiceLang) (*SaveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SaveValueAddService not implemented")
}
func (UnimplementedBundleServer) ValueAddServiceList(context.Context, *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValueAddServiceList not implemented")
}
func (UnimplementedBundleServer) ValueAddServiceDetail(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ValueAddServiceDetail not implemented")
}
func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleExtend not implemented")
}
func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleExtendRecordsList not implemented")
}
func (UnimplementedBundleServer) GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalance not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
@ -346,6 +470,122 @@ func _Bundle_DeleteBundle_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _Bundle_HandShelf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(HandShelfRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("HandShelf", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_SaveBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleProfile)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("SaveBundle", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleListV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleListRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("BundleListV2", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleDetailV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleDetailRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("BundleDetailV2", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleListRequest)
if err := dec(in); err != nil {
@ -665,6 +905,180 @@ func _Bundle_ValueAddBundleDetail_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _Bundle_SaveValueAddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ValueAddServiceLang)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("SaveValueAddService", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_ValueAddServiceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ValueAddServiceListRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ValueAddServiceList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_ValueAddServiceDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ValueAddServiceDetailRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ValueAddServiceDetail", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleExtend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleExtendRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("BundleExtend", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleExtendRecordsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleExtendRecordsListRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("BundleExtendRecordsList", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleBalanceReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetBundleBalance", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -684,6 +1098,22 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "DeleteBundle",
Handler: _Bundle_DeleteBundle_Handler,
},
{
MethodName: "HandShelf",
Handler: _Bundle_HandShelf_Handler,
},
{
MethodName: "SaveBundle",
Handler: _Bundle_SaveBundle_Handler,
},
{
MethodName: "BundleListV2",
Handler: _Bundle_BundleListV2_Handler,
},
{
MethodName: "BundleDetailV2",
Handler: _Bundle_BundleDetailV2_Handler,
},
{
MethodName: "BundleList",
Handler: _Bundle_BundleList_Handler,
@ -728,6 +1158,30 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "ValueAddBundleDetail",
Handler: _Bundle_ValueAddBundleDetail_Handler,
},
{
MethodName: "SaveValueAddService",
Handler: _Bundle_SaveValueAddService_Handler,
},
{
MethodName: "ValueAddServiceList",
Handler: _Bundle_ValueAddServiceList_Handler,
},
{
MethodName: "ValueAddServiceDetail",
Handler: _Bundle_ValueAddServiceDetail_Handler,
},
{
MethodName: "BundleExtend",
Handler: _Bundle_BundleExtend_Handler,
},
{
MethodName: "BundleExtendRecordsList",
Handler: _Bundle_BundleExtendRecordsList_Handler,
},
{
MethodName: "GetBundleBalance",
Handler: _Bundle_GetBundleBalance_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",

2377
api/files/files.pb.go Normal file

File diff suppressed because it is too large Load Diff

193
api/files/files.proto Normal file
View File

@ -0,0 +1,193 @@
syntax = "proto3";
package files;
option go_package = "./;files";
service File{
rpc List(FileListReq) returns (FileListResp) {} //
rpc Info(FileInfoReq) returns (FileInfoResp) {} //
rpc Create(CreateReq) returns (CreateResp) {} //
rpc Delete(DeleteReq) returns (DeleteResp) {} //
rpc Search(searchReq) returns (searchResp) {} //
rpc Upload(UploadReq) returns (UploadResp) {} //
rpc TusCreate(TusCreateReq) returns (TusCreateResp) {} //
rpc TusUpload(TusUploadReq) returns (TusUploadResp) {} //
rpc ResumableTransfer(ResumableTransferReq) returns (ResumableTransferResp) {} // grpc实现
rpc Preview(PreviewReq) returns (PreviewResp) {} //
rpc Action(ActionReq) returns (ActionResp) {} //
rpc DirDownload(DirDownloadReq) returns (stream DirDownloadResp) {} //
}
message FileListReq{
string path = 1; //
string userSpacePath = 2; //
Sorting sorting = 3;
}
message Items {
string path = 1;
string name = 2;
int64 size = 3;
string extension = 4;
string modified = 5;
string mode = 6;
bool isDir = 7;
bool isSymlink = 8;
string type = 9;
}
message Sorting {
string by = 1;
bool asc = 2;
}
message FileListResp {
repeated Items items = 1;
int32 numDirs = 2;
int32 numFiles = 3;
Sorting sorting = 4;
string path = 5;
string name = 6;
int64 size = 7;
string extension = 8;
string modified = 9;
string mode = 10;
bool isDir = 11;
bool isSymlink = 12;
string type = 13;
}
message CreateReq{
string path = 1;
string userSpacePath = 2;
}
message CreateResp{
}
message DeleteReq{
string path = 1;
string userSpacePath = 2;
}
message DeleteResp{
}
message UploadReq{
string path = 1;
string userSpacePath = 2;
bytes content =3;
}
message UploadResp{
}
message searchReq{
string path = 1;
string userSpacePath = 2;
string query = 3;
}
message searchResp{
message Nested {
bool dir = 1;
string path = 2;
}
repeated Nested items = 1;
}
message TusCreateReq{
string path = 1;
string userSpacePath = 2;
bool override =3 ;
}
message TusCreateResp{
int64 uploadLength = 1;
int64 uploadOffset = 2;
}
message TusUploadReq{
string path = 1;
string userSpacePath = 2;
int64 uploadOffset = 3;
bytes content = 4;
}
message TusUploadResp{
int64 uploadOffset = 1;
}
message ResumableTransferReq{
string path = 1;
string userSpacePath = 2;
int64 offset = 3;
int64 length = 4;
}
message ResumableTransferResp{
bytes content = 1;
}
message FileInfoReq{
string path = 1;
string userSpacePath = 2;
}
message FileInfoResp{
string path = 1;
string name = 2;
int64 size = 3;
string extension = 4;
string modified = 5;
string mode = 6;
bool isDir = 7;
bool isSymlink = 8;
string type = 9;
}
message PreviewReq{
string path = 1;
string userSpacePath = 2;
uint32 size = 3; // 0256x256, 1:1080x1080
}
message PreviewResp{
bytes content = 1;
string fileName = 2;
int64 modTime = 3;
}
message ActionReq{
string path = 1;
string userSpacePath = 2;
string action = 3;
string destination = 4;
bool override = 5;
bool rename = 6;
}
message ActionResp{
}
message DirDownloadReq {
string path = 1;
string userSpacePath = 2;
repeated string files =3;
string algo = 4;
}
message DirDownloadResp {
bytes content = 1;
}

View File

@ -0,0 +1,122 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: files.proto
package files
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *FileListReq) Validate() error {
if this.Sorting != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Sorting); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sorting", err)
}
}
return nil
}
func (this *Items) Validate() error {
return nil
}
func (this *Sorting) Validate() error {
return nil
}
func (this *FileListResp) Validate() error {
for _, item := range this.Items {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
}
}
}
if this.Sorting != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Sorting); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Sorting", err)
}
}
return nil
}
func (this *CreateReq) Validate() error {
return nil
}
func (this *CreateResp) Validate() error {
return nil
}
func (this *DeleteReq) Validate() error {
return nil
}
func (this *DeleteResp) Validate() error {
return nil
}
func (this *UploadReq) Validate() error {
return nil
}
func (this *UploadResp) Validate() error {
return nil
}
func (this *SearchReq) Validate() error {
return nil
}
func (this *SearchResp) Validate() error {
for _, item := range this.Items {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
}
}
}
return nil
}
func (this *SearchResp_Nested) Validate() error {
return nil
}
func (this *TusCreateReq) Validate() error {
return nil
}
func (this *TusCreateResp) Validate() error {
return nil
}
func (this *TusUploadReq) Validate() error {
return nil
}
func (this *TusUploadResp) Validate() error {
return nil
}
func (this *ResumableTransferReq) Validate() error {
return nil
}
func (this *ResumableTransferResp) Validate() error {
return nil
}
func (this *FileInfoReq) Validate() error {
return nil
}
func (this *FileInfoResp) Validate() error {
return nil
}
func (this *PreviewReq) Validate() error {
return nil
}
func (this *PreviewResp) Validate() error {
return nil
}
func (this *ActionReq) Validate() error {
return nil
}
func (this *ActionResp) Validate() error {
return nil
}
func (this *DirDownloadReq) Validate() error {
return nil
}
func (this *DirDownloadResp) Validate() error {
return nil
}

View File

@ -0,0 +1,678 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// source: files.proto
package files
import (
context "context"
constant1 "dubbo.apache.org/dubbo-go/v3/common/constant"
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
fmt "fmt"
grpc_go "github.com/dubbogo/grpc-go"
codes "github.com/dubbogo/grpc-go/codes"
metadata "github.com/dubbogo/grpc-go/metadata"
status "github.com/dubbogo/grpc-go/status"
common "github.com/dubbogo/triple/pkg/common"
constant "github.com/dubbogo/triple/pkg/common/constant"
triple "github.com/dubbogo/triple/pkg/triple"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc_go.SupportPackageIsVersion7
// FileClient is the client API for File service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type FileClient interface {
List(ctx context.Context, in *FileListReq, opts ...grpc_go.CallOption) (*FileListResp, common.ErrorWithAttachment)
Info(ctx context.Context, in *FileInfoReq, opts ...grpc_go.CallOption) (*FileInfoResp, common.ErrorWithAttachment)
Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
Search(ctx context.Context, in *SearchReq, opts ...grpc_go.CallOption) (*SearchResp, common.ErrorWithAttachment)
Upload(ctx context.Context, in *UploadReq, opts ...grpc_go.CallOption) (*UploadResp, common.ErrorWithAttachment)
TusCreate(ctx context.Context, in *TusCreateReq, opts ...grpc_go.CallOption) (*TusCreateResp, common.ErrorWithAttachment)
TusUpload(ctx context.Context, in *TusUploadReq, opts ...grpc_go.CallOption) (*TusUploadResp, common.ErrorWithAttachment)
ResumableTransfer(ctx context.Context, in *ResumableTransferReq, opts ...grpc_go.CallOption) (*ResumableTransferResp, common.ErrorWithAttachment)
Preview(ctx context.Context, in *PreviewReq, opts ...grpc_go.CallOption) (*PreviewResp, common.ErrorWithAttachment)
Action(ctx context.Context, in *ActionReq, opts ...grpc_go.CallOption) (*ActionResp, common.ErrorWithAttachment)
DirDownload(ctx context.Context, in *DirDownloadReq, opts ...grpc_go.CallOption) (File_DirDownloadClient, error)
}
type fileClient struct {
cc *triple.TripleConn
}
type FileClientImpl struct {
List func(ctx context.Context, in *FileListReq) (*FileListResp, error)
Info func(ctx context.Context, in *FileInfoReq) (*FileInfoResp, error)
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
Search func(ctx context.Context, in *SearchReq) (*SearchResp, error)
Upload func(ctx context.Context, in *UploadReq) (*UploadResp, error)
TusCreate func(ctx context.Context, in *TusCreateReq) (*TusCreateResp, error)
TusUpload func(ctx context.Context, in *TusUploadReq) (*TusUploadResp, error)
ResumableTransfer func(ctx context.Context, in *ResumableTransferReq) (*ResumableTransferResp, error)
Preview func(ctx context.Context, in *PreviewReq) (*PreviewResp, error)
Action func(ctx context.Context, in *ActionReq) (*ActionResp, error)
DirDownload func(ctx context.Context, in *DirDownloadReq) (File_DirDownloadClient, error)
}
func (c *FileClientImpl) GetDubboStub(cc *triple.TripleConn) FileClient {
return NewFileClient(cc)
}
func (c *FileClientImpl) XXX_InterfaceName() string {
return "files.File"
}
func NewFileClient(cc *triple.TripleConn) FileClient {
return &fileClient{cc}
}
func (c *fileClient) List(ctx context.Context, in *FileListReq, opts ...grpc_go.CallOption) (*FileListResp, common.ErrorWithAttachment) {
out := new(FileListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out)
}
func (c *fileClient) Info(ctx context.Context, in *FileInfoReq, opts ...grpc_go.CallOption) (*FileInfoResp, common.ErrorWithAttachment) {
out := new(FileInfoResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Info", in, out)
}
func (c *fileClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
out := new(CreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out)
}
func (c *fileClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) {
out := new(DeleteResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out)
}
func (c *fileClient) Search(ctx context.Context, in *SearchReq, opts ...grpc_go.CallOption) (*SearchResp, common.ErrorWithAttachment) {
out := new(SearchResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Search", in, out)
}
func (c *fileClient) Upload(ctx context.Context, in *UploadReq, opts ...grpc_go.CallOption) (*UploadResp, common.ErrorWithAttachment) {
out := new(UploadResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Upload", in, out)
}
func (c *fileClient) TusCreate(ctx context.Context, in *TusCreateReq, opts ...grpc_go.CallOption) (*TusCreateResp, common.ErrorWithAttachment) {
out := new(TusCreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/TusCreate", in, out)
}
func (c *fileClient) TusUpload(ctx context.Context, in *TusUploadReq, opts ...grpc_go.CallOption) (*TusUploadResp, common.ErrorWithAttachment) {
out := new(TusUploadResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/TusUpload", in, out)
}
func (c *fileClient) ResumableTransfer(ctx context.Context, in *ResumableTransferReq, opts ...grpc_go.CallOption) (*ResumableTransferResp, common.ErrorWithAttachment) {
out := new(ResumableTransferResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ResumableTransfer", in, out)
}
func (c *fileClient) Preview(ctx context.Context, in *PreviewReq, opts ...grpc_go.CallOption) (*PreviewResp, common.ErrorWithAttachment) {
out := new(PreviewResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Preview", in, out)
}
func (c *fileClient) Action(ctx context.Context, in *ActionReq, opts ...grpc_go.CallOption) (*ActionResp, common.ErrorWithAttachment) {
out := new(ActionResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Action", in, out)
}
func (c *fileClient) DirDownload(ctx context.Context, in *DirDownloadReq, opts ...grpc_go.CallOption) (File_DirDownloadClient, error) {
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
stream, err := c.cc.NewStream(ctx, "/"+interfaceKey+"/DirDownload", opts...)
if err != nil {
return nil, err
}
x := &fileDirDownloadClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type File_DirDownloadClient interface {
Recv() (*DirDownloadResp, error)
grpc_go.ClientStream
}
type fileDirDownloadClient struct {
grpc_go.ClientStream
}
func (x *fileDirDownloadClient) Recv() (*DirDownloadResp, error) {
m := new(DirDownloadResp)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// FileServer is the server API for File service.
// All implementations must embed UnimplementedFileServer
// for forward compatibility
type FileServer interface {
List(context.Context, *FileListReq) (*FileListResp, error)
Info(context.Context, *FileInfoReq) (*FileInfoResp, error)
Create(context.Context, *CreateReq) (*CreateResp, error)
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
Search(context.Context, *SearchReq) (*SearchResp, error)
Upload(context.Context, *UploadReq) (*UploadResp, error)
TusCreate(context.Context, *TusCreateReq) (*TusCreateResp, error)
TusUpload(context.Context, *TusUploadReq) (*TusUploadResp, error)
ResumableTransfer(context.Context, *ResumableTransferReq) (*ResumableTransferResp, error)
Preview(context.Context, *PreviewReq) (*PreviewResp, error)
Action(context.Context, *ActionReq) (*ActionResp, error)
DirDownload(*DirDownloadReq, File_DirDownloadServer) error
mustEmbedUnimplementedFileServer()
}
// UnimplementedFileServer must be embedded to have forward compatible implementations.
type UnimplementedFileServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedFileServer) List(context.Context, *FileListReq) (*FileListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedFileServer) Info(context.Context, *FileInfoReq) (*FileInfoResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
}
func (UnimplementedFileServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedFileServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedFileServer) Search(context.Context, *SearchReq) (*SearchResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
}
func (UnimplementedFileServer) Upload(context.Context, *UploadReq) (*UploadResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Upload not implemented")
}
func (UnimplementedFileServer) TusCreate(context.Context, *TusCreateReq) (*TusCreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method TusCreate not implemented")
}
func (UnimplementedFileServer) TusUpload(context.Context, *TusUploadReq) (*TusUploadResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method TusUpload not implemented")
}
func (UnimplementedFileServer) ResumableTransfer(context.Context, *ResumableTransferReq) (*ResumableTransferResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResumableTransfer not implemented")
}
func (UnimplementedFileServer) Preview(context.Context, *PreviewReq) (*PreviewResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Preview not implemented")
}
func (UnimplementedFileServer) Action(context.Context, *ActionReq) (*ActionResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Action not implemented")
}
func (UnimplementedFileServer) DirDownload(*DirDownloadReq, File_DirDownloadServer) error {
return status.Errorf(codes.Unimplemented, "method DirDownload not implemented")
}
func (s *UnimplementedFileServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedFileServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedFileServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &File_ServiceDesc
}
func (s *UnimplementedFileServer) XXX_InterfaceName() string {
return "files.File"
}
func (UnimplementedFileServer) mustEmbedUnimplementedFileServer() {}
// UnsafeFileServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to FileServer will
// result in compilation errors.
type UnsafeFileServer interface {
mustEmbedUnimplementedFileServer()
}
func RegisterFileServer(s grpc_go.ServiceRegistrar, srv FileServer) {
s.RegisterService(&File_ServiceDesc, srv)
}
func _File_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(FileListReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("List", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(FileInfoReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Info", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Create", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Delete", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SearchReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Search", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Upload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(UploadReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Upload", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_TusCreate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TusCreateReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("TusCreate", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_TusUpload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(TusUploadReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("TusUpload", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_ResumableTransfer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ResumableTransferReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ResumableTransfer", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Preview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(PreviewReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Preview", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_Action_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ActionReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Action", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _File_DirDownload_Handler(srv interface{}, stream grpc_go.ServerStream) error {
_, ok := srv.(dubbo3.Dubbo3GrpcService)
ctx := stream.Context()
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
stream.(grpc_go.CtxSetterStream).SetContext(context.WithValue(ctx, constant1.AttachmentKey, invAttachment))
invo := invocation.NewRPCInvocation("DirDownload", nil, nil)
if !ok {
fmt.Println(invo)
return nil
}
m := new(DirDownloadReq)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(FileServer).DirDownload(m, &fileDirDownloadServer{stream})
}
type File_DirDownloadServer interface {
Send(*DirDownloadResp) error
grpc_go.ServerStream
}
type fileDirDownloadServer struct {
grpc_go.ServerStream
}
func (x *fileDirDownloadServer) Send(m *DirDownloadResp) error {
return x.ServerStream.SendMsg(m)
}
// File_ServiceDesc is the grpc_go.ServiceDesc for File service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var File_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "files.File",
HandlerType: (*FileServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "List",
Handler: _File_List_Handler,
},
{
MethodName: "Info",
Handler: _File_Info_Handler,
},
{
MethodName: "Create",
Handler: _File_Create_Handler,
},
{
MethodName: "Delete",
Handler: _File_Delete_Handler,
},
{
MethodName: "Search",
Handler: _File_Search_Handler,
},
{
MethodName: "Upload",
Handler: _File_Upload_Handler,
},
{
MethodName: "TusCreate",
Handler: _File_TusCreate_Handler,
},
{
MethodName: "TusUpload",
Handler: _File_TusUpload_Handler,
},
{
MethodName: "ResumableTransfer",
Handler: _File_ResumableTransfer_Handler,
},
{
MethodName: "Preview",
Handler: _File_Preview_Handler,
},
{
MethodName: "Action",
Handler: _File_Action_Handler,
},
},
Streams: []grpc_go.StreamDesc{
{
StreamName: "DirDownload",
Handler: _File_DirDownload_Handler,
ServerStreams: true,
},
},
Metadata: "files.proto",
}

View File

@ -0,0 +1,997 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.29.1
// protoc v3.20.3
// source: governance.proto
package governance
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Item struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"`
AttachmentName string `protobuf:"bytes,4,opt,name=attachmentName,proto3" json:"attachmentName,omitempty"`
Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"`
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
UpdatedAt int64 `protobuf:"varint,7,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
Operator string `protobuf:"bytes,8,opt,name=operator,proto3" json:"operator,omitempty"`
OperatorId int32 `protobuf:"varint,9,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
}
func (x *Item) Reset() {
*x = Item{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Item) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Item) ProtoMessage() {}
func (x *Item) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Item.ProtoReflect.Descriptor instead.
func (*Item) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{0}
}
func (x *Item) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *Item) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *Item) GetAttachment() string {
if x != nil {
return x.Attachment
}
return ""
}
func (x *Item) GetAttachmentName() string {
if x != nil {
return x.AttachmentName
}
return ""
}
func (x *Item) GetSort() int32 {
if x != nil {
return x.Sort
}
return 0
}
func (x *Item) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *Item) GetUpdatedAt() int64 {
if x != nil {
return x.UpdatedAt
}
return 0
}
func (x *Item) GetOperator() string {
if x != nil {
return x.Operator
}
return ""
}
func (x *Item) GetOperatorId() int32 {
if x != nil {
return x.OperatorId
}
return 0
}
type ListReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` // 1 下架 2 上架
Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,4,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
}
func (x *ListReq) Reset() {
*x = ListReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListReq) ProtoMessage() {}
func (x *ListReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListReq.ProtoReflect.Descriptor instead.
func (*ListReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{1}
}
func (x *ListReq) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *ListReq) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *ListReq) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *ListReq) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
type ListResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Data []*Item `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
}
func (x *ListResp) Reset() {
*x = ListResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListResp) ProtoMessage() {}
func (x *ListResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ListResp.ProtoReflect.Descriptor instead.
func (*ListResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{2}
}
func (x *ListResp) GetTotal() int32 {
if x != nil {
return x.Total
}
return 0
}
func (x *ListResp) GetData() []*Item {
if x != nil {
return x.Data
}
return nil
}
type DeleteReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *DeleteReq) Reset() {
*x = DeleteReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteReq) ProtoMessage() {}
func (x *DeleteReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteReq.ProtoReflect.Descriptor instead.
func (*DeleteReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{3}
}
func (x *DeleteReq) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
type DeleteResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DeleteResp) Reset() {
*x = DeleteResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeleteResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteResp) ProtoMessage() {}
func (x *DeleteResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteResp.ProtoReflect.Descriptor instead.
func (*DeleteResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{4}
}
type EditReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"`
AttachmentName string `protobuf:"bytes,4,opt,name=attachmentName,proto3" json:"attachmentName,omitempty"`
Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"`
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"`
Operator string `protobuf:"bytes,7,opt,name=operator,proto3" json:"operator,omitempty"`
OperatorId int32 `protobuf:"varint,8,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
}
func (x *EditReq) Reset() {
*x = EditReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EditReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EditReq) ProtoMessage() {}
func (x *EditReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EditReq.ProtoReflect.Descriptor instead.
func (*EditReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{5}
}
func (x *EditReq) GetId() uint32 {
if x != nil {
return x.Id
}
return 0
}
func (x *EditReq) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *EditReq) GetAttachment() string {
if x != nil {
return x.Attachment
}
return ""
}
func (x *EditReq) GetAttachmentName() string {
if x != nil {
return x.AttachmentName
}
return ""
}
func (x *EditReq) GetSort() int32 {
if x != nil {
return x.Sort
}
return 0
}
func (x *EditReq) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *EditReq) GetOperator() string {
if x != nil {
return x.Operator
}
return ""
}
func (x *EditReq) GetOperatorId() int32 {
if x != nil {
return x.OperatorId
}
return 0
}
type EditResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *EditResp) Reset() {
*x = EditResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EditResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EditResp) ProtoMessage() {}
func (x *EditResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EditResp.ProtoReflect.Descriptor instead.
func (*EditResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{6}
}
type CreateReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
Sort uint32 `protobuf:"varint,2,opt,name=sort,proto3" json:"sort,omitempty"`
Attachment string `protobuf:"bytes,3,opt,name=attachment,proto3" json:"attachment,omitempty"`
AttachmentName string `protobuf:"bytes,4,opt,name=attachmentName,proto3" json:"attachmentName,omitempty"`
Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"`
Operator string `protobuf:"bytes,6,opt,name=operator,proto3" json:"operator,omitempty"`
OperatorId int32 `protobuf:"varint,7,opt,name=operatorId,proto3" json:"operatorId,omitempty"`
}
func (x *CreateReq) Reset() {
*x = CreateReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateReq) ProtoMessage() {}
func (x *CreateReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateReq.ProtoReflect.Descriptor instead.
func (*CreateReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{7}
}
func (x *CreateReq) GetTitle() string {
if x != nil {
return x.Title
}
return ""
}
func (x *CreateReq) GetSort() uint32 {
if x != nil {
return x.Sort
}
return 0
}
func (x *CreateReq) GetAttachment() string {
if x != nil {
return x.Attachment
}
return ""
}
func (x *CreateReq) GetAttachmentName() string {
if x != nil {
return x.AttachmentName
}
return ""
}
func (x *CreateReq) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *CreateReq) GetOperator() string {
if x != nil {
return x.Operator
}
return ""
}
func (x *CreateReq) GetOperatorId() int32 {
if x != nil {
return x.OperatorId
}
return 0
}
type CreateResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *CreateResp) Reset() {
*x = CreateResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CreateResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateResp) ProtoMessage() {}
func (x *CreateResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateResp.ProtoReflect.Descriptor instead.
func (*CreateResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{8}
}
type DisplayReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DisplayReq) Reset() {
*x = DisplayReq{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DisplayReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DisplayReq) ProtoMessage() {}
func (x *DisplayReq) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DisplayReq.ProtoReflect.Descriptor instead.
func (*DisplayReq) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{9}
}
type DisplayResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data []*Item `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
}
func (x *DisplayResp) Reset() {
*x = DisplayResp{}
if protoimpl.UnsafeEnabled {
mi := &file_governance_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DisplayResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DisplayResp) ProtoMessage() {}
func (x *DisplayResp) ProtoReflect() protoreflect.Message {
mi := &file_governance_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DisplayResp.ProtoReflect.Descriptor instead.
func (*DisplayResp) Descriptor() ([]byte, []int) {
return file_governance_proto_rawDescGZIP(), []int{10}
}
func (x *DisplayResp) GetData() []*Item {
if x != nil {
return x.Data
}
return nil
}
var File_governance_proto protoreflect.FileDescriptor
var file_governance_proto_rawDesc = []byte{
0x0a, 0x10, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xfa,
0x01, 0x0a, 0x04, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a,
0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61,
0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x07,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52,
0x0a, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x67, 0x0a, 0x07, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06,
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74,
0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65,
0x53, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65,
0x53, 0x69, 0x7a, 0x65, 0x22, 0x46, 0x0a, 0x08, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70,
0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63,
0x65, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x1b, 0x0a, 0x09,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0xdf, 0x01, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74,
0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x74, 0x74,
0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61,
0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x74, 0x74,
0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52,
0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x0a, 0x0a, 0x08, 0x45, 0x64, 0x69,
0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xd1, 0x01, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72,
0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1e, 0x0a,
0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a,
0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65, 0x6e,
0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6f, 0x70, 0x65,
0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f,
0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x0c, 0x0a, 0x0a, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x0c, 0x0a, 0x0a, 0x44, 0x69, 0x73, 0x70, 0x6c,
0x61, 0x79, 0x52, 0x65, 0x71, 0x22, 0x33, 0x0a, 0x0b, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79,
0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x10, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e,
0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xaa, 0x02, 0x0a, 0x0a, 0x47,
0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x04, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x13, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61,
0x6e, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39,
0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72,
0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a,
0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x04, 0x45, 0x64, 0x69,
0x74, 0x12, 0x13, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x45,
0x64, 0x69, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61,
0x6e, 0x63, 0x65, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x39,
0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x15, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72,
0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x1a,
0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x07, 0x44, 0x69, 0x73,
0x70, 0x6c, 0x61, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63,
0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x67,
0x6f, 0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61,
0x79, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x2e, 0x2f, 0x3b, 0x67, 0x6f,
0x76, 0x65, 0x72, 0x6e, 0x61, 0x6e, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_governance_proto_rawDescOnce sync.Once
file_governance_proto_rawDescData = file_governance_proto_rawDesc
)
func file_governance_proto_rawDescGZIP() []byte {
file_governance_proto_rawDescOnce.Do(func() {
file_governance_proto_rawDescData = protoimpl.X.CompressGZIP(file_governance_proto_rawDescData)
})
return file_governance_proto_rawDescData
}
var file_governance_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_governance_proto_goTypes = []interface{}{
(*Item)(nil), // 0: governance.Item
(*ListReq)(nil), // 1: governance.ListReq
(*ListResp)(nil), // 2: governance.ListResp
(*DeleteReq)(nil), // 3: governance.DeleteReq
(*DeleteResp)(nil), // 4: governance.DeleteResp
(*EditReq)(nil), // 5: governance.EditReq
(*EditResp)(nil), // 6: governance.EditResp
(*CreateReq)(nil), // 7: governance.CreateReq
(*CreateResp)(nil), // 8: governance.CreateResp
(*DisplayReq)(nil), // 9: governance.DisplayReq
(*DisplayResp)(nil), // 10: governance.DisplayResp
}
var file_governance_proto_depIdxs = []int32{
0, // 0: governance.ListResp.data:type_name -> governance.Item
0, // 1: governance.DisplayResp.data:type_name -> governance.Item
1, // 2: governance.Governance.List:input_type -> governance.ListReq
3, // 3: governance.Governance.Delete:input_type -> governance.DeleteReq
5, // 4: governance.Governance.Edit:input_type -> governance.EditReq
7, // 5: governance.Governance.Create:input_type -> governance.CreateReq
9, // 6: governance.Governance.Display:input_type -> governance.DisplayReq
2, // 7: governance.Governance.List:output_type -> governance.ListResp
4, // 8: governance.Governance.Delete:output_type -> governance.DeleteResp
6, // 9: governance.Governance.Edit:output_type -> governance.EditResp
8, // 10: governance.Governance.Create:output_type -> governance.CreateResp
10, // 11: governance.Governance.Display:output_type -> governance.DisplayResp
7, // [7:12] is the sub-list for method output_type
2, // [2:7] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_governance_proto_init() }
func file_governance_proto_init() {
if File_governance_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_governance_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Item); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EditReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EditResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CreateResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DisplayReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_governance_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DisplayResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_governance_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_governance_proto_goTypes,
DependencyIndexes: file_governance_proto_depIdxs,
MessageInfos: file_governance_proto_msgTypes,
}.Build()
File_governance_proto = out.File
file_governance_proto_rawDesc = nil
file_governance_proto_goTypes = nil
file_governance_proto_depIdxs = nil
}

View File

@ -0,0 +1,81 @@
syntax = "proto3";
package governance;
//import "descriptor.proto";
//import "validator.proto";
option go_package = "./;governance";
service Governance{
rpc List(ListReq) returns (ListResp) {}
rpc Delete(DeleteReq) returns (DeleteResp) {}
rpc Edit(EditReq) returns (EditResp) {}
rpc Create(CreateReq) returns (CreateResp) {}
rpc Display(DisplayReq) returns (DisplayResp) {}
}
message Item{
int32 id = 1;
string title = 2;
string attachment = 3;
string attachmentName = 4;
int32 sort = 5;
int32 status = 6;
int64 updatedAt = 7;
string operator = 8;
int32 operatorId = 9;
}
message ListReq{
string title = 1;
int32 status = 2; // 1 2
int32 page = 3;
int32 pageSize = 4;
}
message ListResp{
int32 total = 1;
repeated Item data =2;
}
message DeleteReq{
int32 id = 1;
}
message DeleteResp{
}
message EditReq{
uint32 id = 1;
string title = 2;
string attachment = 3;
string attachmentName = 4;
int32 sort = 5;
int32 status = 6;
string operator = 7;
int32 operatorId = 8;
}
message EditResp{
}
message CreateReq{
string title = 1;
uint32 sort = 2;
string attachment = 3;
string attachmentName = 4;
int32 status = 5;
string operator = 6;
int32 operatorId = 7;
}
message CreateResp{
}
message DisplayReq{
}
message DisplayResp{
repeated Item data = 1;
}

View File

@ -0,0 +1,64 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: governance.proto
package governance
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *Item) Validate() error {
return nil
}
func (this *ListReq) Validate() error {
return nil
}
func (this *ListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *DeleteReq) Validate() error {
return nil
}
func (this *DeleteResp) Validate() error {
return nil
}
func (this *EditReq) Validate() error {
return nil
}
func (this *EditResp) Validate() error {
return nil
}
func (this *CreateReq) Validate() error {
return nil
}
func (this *CreateResp) Validate() error {
return nil
}
func (this *DisplayReq) Validate() error {
return nil
}
func (this *DisplayResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}

View File

@ -0,0 +1,327 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// source: governance.proto
package governance
import (
context "context"
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
grpc_go "github.com/dubbogo/grpc-go"
codes "github.com/dubbogo/grpc-go/codes"
metadata "github.com/dubbogo/grpc-go/metadata"
status "github.com/dubbogo/grpc-go/status"
common "github.com/dubbogo/triple/pkg/common"
constant "github.com/dubbogo/triple/pkg/common/constant"
triple "github.com/dubbogo/triple/pkg/triple"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc_go.SupportPackageIsVersion7
// GovernanceClient is the client API for Governance service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type GovernanceClient interface {
List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment)
Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment)
Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment)
}
type governanceClient struct {
cc *triple.TripleConn
}
type GovernanceClientImpl struct {
List func(ctx context.Context, in *ListReq) (*ListResp, error)
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
Edit func(ctx context.Context, in *EditReq) (*EditResp, error)
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
Display func(ctx context.Context, in *DisplayReq) (*DisplayResp, error)
}
func (c *GovernanceClientImpl) GetDubboStub(cc *triple.TripleConn) GovernanceClient {
return NewGovernanceClient(cc)
}
func (c *GovernanceClientImpl) XXX_InterfaceName() string {
return "governance.Governance"
}
func NewGovernanceClient(cc *triple.TripleConn) GovernanceClient {
return &governanceClient{cc}
}
func (c *governanceClient) List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) {
out := new(ListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out)
}
func (c *governanceClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) {
out := new(DeleteResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out)
}
func (c *governanceClient) Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) {
out := new(EditResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out)
}
func (c *governanceClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
out := new(CreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out)
}
func (c *governanceClient) Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) {
out := new(DisplayResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Display", in, out)
}
// GovernanceServer is the server API for Governance service.
// All implementations must embed UnimplementedGovernanceServer
// for forward compatibility
type GovernanceServer interface {
List(context.Context, *ListReq) (*ListResp, error)
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
Edit(context.Context, *EditReq) (*EditResp, error)
Create(context.Context, *CreateReq) (*CreateResp, error)
Display(context.Context, *DisplayReq) (*DisplayResp, error)
mustEmbedUnimplementedGovernanceServer()
}
// UnimplementedGovernanceServer must be embedded to have forward compatible implementations.
type UnimplementedGovernanceServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedGovernanceServer) List(context.Context, *ListReq) (*ListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedGovernanceServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedGovernanceServer) Edit(context.Context, *EditReq) (*EditResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented")
}
func (UnimplementedGovernanceServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedGovernanceServer) Display(context.Context, *DisplayReq) (*DisplayResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Display not implemented")
}
func (s *UnimplementedGovernanceServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedGovernanceServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedGovernanceServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &Governance_ServiceDesc
}
func (s *UnimplementedGovernanceServer) XXX_InterfaceName() string {
return "governance.Governance"
}
func (UnimplementedGovernanceServer) mustEmbedUnimplementedGovernanceServer() {}
// UnsafeGovernanceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to GovernanceServer will
// result in compilation errors.
type UnsafeGovernanceServer interface {
mustEmbedUnimplementedGovernanceServer()
}
func RegisterGovernanceServer(s grpc_go.ServiceRegistrar, srv GovernanceServer) {
s.RegisterService(&Governance_ServiceDesc, srv)
}
func _Governance_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("List", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Governance_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Delete", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Governance_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(EditReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Edit", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Governance_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Create", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Governance_Display_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DisplayReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Display", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Governance_ServiceDesc is the grpc_go.ServiceDesc for Governance service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var Governance_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "governance.Governance",
HandlerType: (*GovernanceServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "List",
Handler: _Governance_List_Handler,
},
{
MethodName: "Delete",
Handler: _Governance_Delete_Handler,
},
{
MethodName: "Edit",
Handler: _Governance_Edit_Handler,
},
{
MethodName: "Create",
Handler: _Governance_Create_Handler,
},
{
MethodName: "Display",
Handler: _Governance_Display_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "governance.proto",
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,119 @@
syntax = "proto3";
package pressreleases;
//import "descriptor.proto";
//import "validator.proto";
option go_package = "./;pressreleases";
service PressReleases{
rpc List(ListReq) returns (ListResp) {}
rpc Display(DisplayReq) returns (DisplayResp) {}
rpc Edit(EditReq) returns (EditResp) {}
rpc Create(CreateReq) returns (CreateResp) {}
rpc Delete(DeleteReq) returns (DeleteResp) {}
rpc Get(GetReq) returns (GetResp) {}
}
message Item{
uint32 id = 1;
string title = 2;
uint64 createdAt = 3;
uint32 sort = 4;
string content = 5;
string attachment = 6;
string attachmentName = 7;
uint64 updatedAt = 8;
uint32 status = 9;
uint32 display = 10;
string summary = 11;
string operator = 12;
int32 operatorId = 13;
}
message ListReq{
string title = 1;
uint64 startTime = 2;
uint64 endTime = 3;
uint32 status = 4;
uint32 display = 5;
int32 page = 6;
int32 pageSize = 7;
}
message ListResp{
uint64 total = 1;
repeated Item data = 2;
}
message DisplayReq{
string query = 1;
uint32 page = 2;
uint32 pageSize = 3;
int64 timeStart = 4;
int64 timeEnd = 5;
int32 display = 6;
}
message DisplayResp{
int64 total = 1;
repeated Item data = 2;
}
message EditReq{
uint32 id = 1;
string title = 2;
uint64 createdAt = 3;
uint32 sort = 4;
string content = 5;
string attachment = 6;
string attachmentName = 7;
uint32 status = 8;
uint32 display = 9;
string summary = 10;
string operator = 11;
int32 operatorId = 12;
}
message EditResp{
}
message CreateReq{
string title = 1;
uint64 createdAt = 2;
uint32 sort = 3;
string content = 4;
string attachment = 5;
string attachmentName = 6;
uint32 status = 7;
uint32 display = 8;
string summary = 9;
string operator = 10;
int32 operatorId = 11;
}
message CreateResp{
}
message DeleteReq{
uint32 id = 1;
}
message DeleteResp{
}
message GetReq{
int64 id = 1;
}
message GetResp{
uint32 id = 1;
string title = 2;
uint64 createdAt = 3;
string content = 4;
string attachment = 5;
string attachmentName = 6;
string summary = 7;
}

View File

@ -0,0 +1,70 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: press_releases.proto
package pressreleases
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *Item) Validate() error {
return nil
}
func (this *ListReq) Validate() error {
return nil
}
func (this *ListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *DisplayReq) Validate() error {
return nil
}
func (this *DisplayResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *EditReq) Validate() error {
return nil
}
func (this *EditResp) Validate() error {
return nil
}
func (this *CreateReq) Validate() error {
return nil
}
func (this *CreateResp) Validate() error {
return nil
}
func (this *DeleteReq) Validate() error {
return nil
}
func (this *DeleteResp) Validate() error {
return nil
}
func (this *GetReq) Validate() error {
return nil
}
func (this *GetResp) Validate() error {
return nil
}

View File

@ -0,0 +1,372 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.20.3
// source: press_releases.proto
package pressreleases
import (
context "context"
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
grpc_go "github.com/dubbogo/grpc-go"
codes "github.com/dubbogo/grpc-go/codes"
metadata "github.com/dubbogo/grpc-go/metadata"
status "github.com/dubbogo/grpc-go/status"
common "github.com/dubbogo/triple/pkg/common"
constant "github.com/dubbogo/triple/pkg/common/constant"
triple "github.com/dubbogo/triple/pkg/triple"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc_go.SupportPackageIsVersion7
// PressReleasesClient is the client API for PressReleases service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type PressReleasesClient interface {
List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment)
Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment)
Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment)
Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment)
Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment)
Get(ctx context.Context, in *GetReq, opts ...grpc_go.CallOption) (*GetResp, common.ErrorWithAttachment)
}
type pressReleasesClient struct {
cc *triple.TripleConn
}
type PressReleasesClientImpl struct {
List func(ctx context.Context, in *ListReq) (*ListResp, error)
Display func(ctx context.Context, in *DisplayReq) (*DisplayResp, error)
Edit func(ctx context.Context, in *EditReq) (*EditResp, error)
Create func(ctx context.Context, in *CreateReq) (*CreateResp, error)
Delete func(ctx context.Context, in *DeleteReq) (*DeleteResp, error)
Get func(ctx context.Context, in *GetReq) (*GetResp, error)
}
func (c *PressReleasesClientImpl) GetDubboStub(cc *triple.TripleConn) PressReleasesClient {
return NewPressReleasesClient(cc)
}
func (c *PressReleasesClientImpl) XXX_InterfaceName() string {
return "pressreleases.PressReleases"
}
func NewPressReleasesClient(cc *triple.TripleConn) PressReleasesClient {
return &pressReleasesClient{cc}
}
func (c *pressReleasesClient) List(ctx context.Context, in *ListReq, opts ...grpc_go.CallOption) (*ListResp, common.ErrorWithAttachment) {
out := new(ListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/List", in, out)
}
func (c *pressReleasesClient) Display(ctx context.Context, in *DisplayReq, opts ...grpc_go.CallOption) (*DisplayResp, common.ErrorWithAttachment) {
out := new(DisplayResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Display", in, out)
}
func (c *pressReleasesClient) Edit(ctx context.Context, in *EditReq, opts ...grpc_go.CallOption) (*EditResp, common.ErrorWithAttachment) {
out := new(EditResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Edit", in, out)
}
func (c *pressReleasesClient) Create(ctx context.Context, in *CreateReq, opts ...grpc_go.CallOption) (*CreateResp, common.ErrorWithAttachment) {
out := new(CreateResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Create", in, out)
}
func (c *pressReleasesClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc_go.CallOption) (*DeleteResp, common.ErrorWithAttachment) {
out := new(DeleteResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Delete", in, out)
}
func (c *pressReleasesClient) Get(ctx context.Context, in *GetReq, opts ...grpc_go.CallOption) (*GetResp, common.ErrorWithAttachment) {
out := new(GetResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/Get", in, out)
}
// PressReleasesServer is the server API for PressReleases service.
// All implementations must embed UnimplementedPressReleasesServer
// for forward compatibility
type PressReleasesServer interface {
List(context.Context, *ListReq) (*ListResp, error)
Display(context.Context, *DisplayReq) (*DisplayResp, error)
Edit(context.Context, *EditReq) (*EditResp, error)
Create(context.Context, *CreateReq) (*CreateResp, error)
Delete(context.Context, *DeleteReq) (*DeleteResp, error)
Get(context.Context, *GetReq) (*GetResp, error)
mustEmbedUnimplementedPressReleasesServer()
}
// UnimplementedPressReleasesServer must be embedded to have forward compatible implementations.
type UnimplementedPressReleasesServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedPressReleasesServer) List(context.Context, *ListReq) (*ListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedPressReleasesServer) Display(context.Context, *DisplayReq) (*DisplayResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Display not implemented")
}
func (UnimplementedPressReleasesServer) Edit(context.Context, *EditReq) (*EditResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Edit not implemented")
}
func (UnimplementedPressReleasesServer) Create(context.Context, *CreateReq) (*CreateResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedPressReleasesServer) Delete(context.Context, *DeleteReq) (*DeleteResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedPressReleasesServer) Get(context.Context, *GetReq) (*GetResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (s *UnimplementedPressReleasesServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedPressReleasesServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedPressReleasesServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &PressReleases_ServiceDesc
}
func (s *UnimplementedPressReleasesServer) XXX_InterfaceName() string {
return "pressreleases.PressReleases"
}
func (UnimplementedPressReleasesServer) mustEmbedUnimplementedPressReleasesServer() {}
// UnsafePressReleasesServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PressReleasesServer will
// result in compilation errors.
type UnsafePressReleasesServer interface {
mustEmbedUnimplementedPressReleasesServer()
}
func RegisterPressReleasesServer(s grpc_go.ServiceRegistrar, srv PressReleasesServer) {
s.RegisterService(&PressReleases_ServiceDesc, srv)
}
func _PressReleases_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("List", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _PressReleases_Display_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DisplayReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Display", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _PressReleases_Edit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(EditReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Edit", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _PressReleases_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Create", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _PressReleases_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Delete", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _PressReleases_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("Get", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// PressReleases_ServiceDesc is the grpc_go.ServiceDesc for PressReleases service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var PressReleases_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "pressreleases.PressReleases",
HandlerType: (*PressReleasesServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "List",
Handler: _PressReleases_List_Handler,
},
{
MethodName: "Display",
Handler: _PressReleases_Display_Handler,
},
{
MethodName: "Edit",
Handler: _PressReleases_Edit_Handler,
},
{
MethodName: "Create",
Handler: _PressReleases_Create_Handler,
},
{
MethodName: "Delete",
Handler: _PressReleases_Delete_Handler,
},
{
MethodName: "Get",
Handler: _PressReleases_Get_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "press_releases.proto",
}

View File

@ -1,7 +1,6 @@
package middleware
import (
"dubbo.apache.org/dubbo-go/v3/common/logger"
"errors"
"fmt"
"fonchain-fiee/api/account"
@ -14,8 +13,10 @@ import (
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/utils/secret"
"github.com/gin-gonic/gin"
"time"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"github.com/gin-gonic/gin"
)
// CheckLogin 检测登陆
@ -150,7 +151,7 @@ func CheckWebLogin(provider *account.AccountClientImpl) gin.HandlerFunc {
loginInfo := login.Info{
Domain: info.Domain,
ID: info.ID,
//Account: info.Account,
Name: info.NickName,
//NickName: info.NickName,
//PositionUsers: qres.PositionUsers,
//Extend: infoRes.Info.Extend,

View File

@ -4,6 +4,7 @@ import (
"fonchain-fiee/pkg/middleware"
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/bundle"
"github.com/gin-gonic/gin"
)
@ -27,6 +28,12 @@ func BundleRouter(r *gin.RouterGroup) {
bundleAppRoute.POST("bundle-list", bundle.BundleList)
}
bundleExtend := bundleRoute.Group("extend")
{
bundleExtend.POST("", bundle.BundleExtend)
bundleExtend.POST("list", bundle.BundleExtendRecordsList)
}
bundleRoute.POST("balance", bundle.GetBundleBalance)
}
}

View File

@ -15,12 +15,12 @@ func BundleOrderRouter(r *gin.RouterGroup) {
bundleOrderRoute := r.Group("bundle-order")
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
//bundleOrderWebRoute := r.Group("bundle-order")
//bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
bundleOrderWebRoute := r.Group("bundle-order")
bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
// 套餐
{
bundleOrderClientWebRoute := bundleOrderRoute.Group("common/web")
bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
{
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
}
@ -31,8 +31,8 @@ func BundleOrderRouter(r *gin.RouterGroup) {
//bundleOrderWebRoute := bundleOrderRoute.Group("web")
{
bundleOrderRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
bundleOrderRoute.POST("order-export", bundle.ExportOrderInfo)
bundleOrderWebRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfoOss)
}
bundleOrderAppRoute := bundleOrderRoute.Group("app")

View File

@ -5,7 +5,10 @@ import (
"fonchain-fiee/pkg/service"
"fonchain-fiee/pkg/service/account"
"fonchain-fiee/pkg/service/auth"
"fonchain-fiee/pkg/service/file"
"fonchain-fiee/pkg/service/governance"
"fonchain-fiee/pkg/service/lang"
"fonchain-fiee/pkg/service/pressreleases"
"fonchain-fiee/pkg/service/qr"
"fonchain-fiee/pkg/service/redirect"
"fonchain-fiee/pkg/service/upload"
@ -108,6 +111,49 @@ func NewRouter() *gin.Engine {
redirectRoute.POST("sdk/down/v3", auth.DownImgV3)
}
{
// 素材库
resourceRoute := v1.Group("/resource")
resourceRoute.GET("", file.Info)
resourceRoute.DELETE("", file.Delete)
resourceRoute.PUT("", file.Action)
resourceRoute.POST("", file.Create)
resourceRoute.GET("/search", file.Search)
resourceRoute.POST("/upload", file.Upload)
resourceRoute.POST("/tus/create", file.TusCreate)
resourceRoute.POST("/tus/upload", file.TusUpload)
resourceRoute.GET("/raw", file.Raw)
resourceRoute.GET("/raw/dir", file.DirDownload)
resourceRoute.GET("/preview", file.Preview)
resourceRoute.GET("/list", file.List)
}
{
// 官网文档
governanceRoute := v1.Group("/governance")
governanceRouteLogin := governanceRoute.Group("", middleware.CheckWebLogin(service.AccountProvider))
governanceRoute.GET("/display", governance.Display)
governanceRouteLogin.POST("/list", governance.List)
governanceRouteLogin.POST("", governance.Create)
governanceRouteLogin.POST("/edit", governance.Edit)
governanceRouteLogin.POST("/delete", governance.Delete)
}
{
// 官网新闻
pressreleasesRoute := v1.Group("/pressreleases")
pressreleasesRouteLogin := pressreleasesRoute.Group("", middleware.CheckWebLogin(service.AccountProvider))
pressreleasesRoute.POST("/display", pressreleases.Display)
pressreleasesRoute.GET("", pressreleases.Get)
pressreleasesRouteLogin.POST("/list", pressreleases.List)
pressreleasesRouteLogin.POST("", pressreleases.Create)
pressreleasesRouteLogin.POST("/edit", pressreleases.Edit)
pressreleasesRouteLogin.POST("/delete", pressreleases.Delete)
}
//静态文件
r.StaticFS("/api/static", http.Dir("./runtime"))
r.NoRoute(func(c *gin.Context) {

View File

@ -0,0 +1,51 @@
package bundle
import (
"context"
"fonchain-fiee/api/bundle"
"fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin"
)
func BundleExtend(c *gin.Context) {
var req bundle.BundleExtendRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleExtend(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func BundleExtendRecordsList(c *gin.Context) {
var req bundle.BundleExtendRecordsListRequest
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.BundleExtendRecordsList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
func GetBundleBalance(c *gin.Context) {
var req bundle.GetBundleBalanceReq
if err := c.ShouldBindJSON(&req); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.GetBundleBalance(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}

View File

@ -12,6 +12,7 @@ import (
"fonchain-fiee/pkg/service/bundle/common"
"fonchain-fiee/pkg/service/bundle/logic"
bundleModel "fonchain-fiee/pkg/service/bundle/model"
"fonchain-fiee/pkg/service/upload"
"math/big"
"strconv"
"strings"
@ -426,8 +427,93 @@ func ExportOrderInfo(c *gin.Context) {
}
}
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/static", 1)
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/fiee/static", 1)
//var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path)
fmt.Println("exportUrl : ", exportUrl)
service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl})
}
func ExportOrderInfoOss(c *gin.Context) {
var req bundle.OrderRecordsRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.OrderRecordsList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
rows := make([][]interface{}, 0)
for _, orderRecord := range res.OrderRecords {
if orderRecord.CustomerID != "" {
var userID uint64
userID, err = strconv.ParseUint(orderRecord.CustomerID, 10, 64)
if err != nil {
err = nil
continue
}
userInfo, _ := service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
Domain: "app",
ID: userID,
})
if userInfo != nil {
orderRecord.Sex = userInfo.Sex
orderRecord.Nationality = userInfo.Nationality
orderRecord.TelNum = userInfo.TelNum
}
}
status := ""
if orderRecord.Status == bundleModel.OrderSigned {
status = "未支付"
} else if orderRecord.Status == bundleModel.OrderPaid {
status = "已支付"
}
financialConfirmation := ""
if orderRecord.FinancialConfirmation == bundleModel.UnConfirm {
financialConfirmation = "未确认"
} else if orderRecord.FinancialConfirmation == bundleModel.Confirmed {
financialConfirmation = "已确认"
}
rows = append(rows, []interface{}{
orderRecord.OrderNo,
orderRecord.CustomerNum,
orderRecord.CustomerName,
orderRecord.Sex,
orderRecord.TelNum,
orderRecord.Nationality,
orderRecord.BundleName,
orderRecord.SignedTime,
orderRecord.Amount,
orderRecord.Num,
orderRecord.ValueAddBundleAmount,
orderRecord.TotalAmount,
status,
orderRecord.PayTime,
financialConfirmation,
})
}
dirPath := "./runtime"
filePath, err := logic.WriteToExcel(dirPath, rows)
if err != nil {
service.Error(c, err)
return
}
exportUrl, err := upload.PutBos(filePath, "excel", true)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl})
}

View File

@ -4,6 +4,7 @@ import (
"context"
"fonchain-fiee/api/bundle"
"fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)

254
pkg/service/file/file.go Normal file
View File

@ -0,0 +1,254 @@
package file
import (
"bytes"
"errors"
"fmt"
"fonchain-fiee/api/files"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
"io"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/gin-gonic/gin"
)
func Raw(ctx *gin.Context) {
r := ctx.Request
w := ctx.Writer
w.Header().Add("Content-Security-Policy", `script-src 'none';`)
w.Header().Set("Cache-Control", "private")
rs, err := newGrpcReaderSeeker(getUserSpacePath(ctx), ctx.Query("path"))
if err != nil {
service.Error(ctx, err)
return
}
if r.URL.Query().Get("inline") == "true" {
w.Header().Set("Content-Disposition", "inline")
} else {
// As per RFC6266 section 4.3
w.Header().Set("Content-Disposition", "attachment; filename*=utf-8''"+rs.FileName)
}
http.ServeContent(ctx.Writer, r, rs.FileName, time.Now(), rs)
}
func List(ctx *gin.Context) {
path := ctx.DefaultQuery("path", "/")
sortBy := ctx.DefaultQuery("sortBy", "name")
sortAsc, _ := strconv.ParseBool(ctx.DefaultQuery("sortAsc", "true"))
resp, err := service.FilesProvider.List(ctx, &files.FileListReq{
Path: path,
UserSpacePath: getUserSpacePath(ctx),
Sorting: &files.Sorting{
By: sortBy,
Asc: sortAsc,
},
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Info(ctx *gin.Context) {
resp, err := service.FilesProvider.Info(ctx, &files.FileInfoReq{
Path: ctx.DefaultQuery("path", "/"),
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Create(ctx *gin.Context) {
var req files.CreateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
req.UserSpacePath = getUserSpacePath(ctx)
resp, err := service.FilesProvider.Create(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Delete(ctx *gin.Context) {
resp, err := service.FilesProvider.Delete(ctx, &files.DeleteReq{
Path: ctx.DefaultQuery("path", "/"),
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Search(ctx *gin.Context) {
resp, err := service.FilesProvider.Search(ctx, &files.SearchReq{
UserSpacePath: getUserSpacePath(ctx),
Path: ctx.Query("path"),
Query: ctx.Query("query"),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Upload(ctx *gin.Context) {
path, ok := ctx.GetQuery("path")
if !ok {
service.Error(ctx, errors.New("缺失参数路径"))
return
}
b, err := io.ReadAll(ctx.Request.Body)
if !ok {
service.Error(ctx, err)
return
}
resp, err := service.FilesProvider.Upload(ctx, &files.UploadReq{
Path: path,
UserSpacePath: getUserSpacePath(ctx),
Content: b,
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func TusCreate(ctx *gin.Context) {
var req files.TusCreateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
req.UserSpacePath = getUserSpacePath(ctx)
resp, err := service.FilesProvider.TusCreate(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func TusUpload(ctx *gin.Context) {
path, ok := ctx.GetQuery("path")
if !ok {
service.Error(ctx, errors.New("文件路径缺失"))
return
}
uploadOffset, err := getUploadOffset(ctx.Request)
if err != nil {
service.Error(ctx, fmt.Errorf("invalid upload offset: %w", err))
return
}
b, err := io.ReadAll(ctx.Request.Body)
if !ok {
service.Error(ctx, err)
return
}
resp, err := service.FilesProvider.TusUpload(ctx, &files.TusUploadReq{
Path: path,
UploadOffset: uploadOffset,
Content: b,
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
ctx.Writer.Header().Set("Upload-Offset", strconv.FormatInt(resp.UploadOffset, 10))
service.Success(ctx, nil)
}
func Preview(ctx *gin.Context) {
var size int
size, err := strconv.Atoi(ctx.Query("size"))
if err != nil {
size = 1
}
resp, err := service.FilesProvider.Preview(ctx, &files.PreviewReq{
Path: ctx.Query("path"),
UserSpacePath: getUserSpacePath(ctx),
Size: uint32(size),
})
if err != nil {
service.Error(ctx, err)
return
}
ctx.Writer.Header().Set("Cache-Control", "private")
http.ServeContent(ctx.Writer, ctx.Request, resp.FileName, time.UnixMilli(resp.ModTime), bytes.NewReader(resp.Content))
}
func Action(ctx *gin.Context) {
var req files.ActionReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
req.UserSpacePath = getUserSpacePath(ctx)
resp, err := service.FilesProvider.Action(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func DirDownload(ctx *gin.Context) {
path := ctx.Query("path")
fileList := strings.Split(ctx.Query("files"), ",")
algo := ctx.Query("algo")
stream, err := service.FilesProvider.DirDownload(ctx, &files.DirDownloadReq{
Algo: algo,
Files: fileList,
Path: path,
UserSpacePath: getUserSpacePath(ctx),
})
if err != nil {
service.Error(ctx, err)
return
}
header, err := stream.Header()
if err != nil {
service.Error(ctx, err)
return
}
ctx.Writer.Header().Set("Content-Disposition", "attachment; filename*=utf-8''"+url.PathEscape(header.Get("filename")[0]))
for {
recvMsg, err := stream.Recv()
if err != nil {
break
}
ctx.Writer.Write(recvMsg.Content)
}
}
func getUploadOffset(r *http.Request) (int64, error) {
uploadOffset, err := strconv.ParseInt(r.Header.Get("Upload-Offset"), 10, 64)
if err != nil {
return 0, fmt.Errorf("invalid upload offset: %w", err)
}
return uploadOffset, nil
}
func getUserSpacePath(ctx *gin.Context) string {
user := login.GetUserInfoFromC(ctx)
return strconv.Itoa(int(user.ID))
}

View File

@ -0,0 +1,91 @@
package file
import (
"context"
"errors"
"fonchain-fiee/api/files"
"fonchain-fiee/pkg/service"
"io"
)
type grpcReaderSeeker struct {
io.Reader
io.Seeker
path string
userSpacePath string
cursor int64
length int64
FileName string
}
func (g *grpcReaderSeeker) Seek(offset int64, whence int) (int64, error) {
var abs int64
switch whence {
case io.SeekStart:
abs = offset
case io.SeekCurrent:
abs = g.cursor + offset
case io.SeekEnd:
abs = g.length + offset
default:
return 0, errors.New("grpc.Reader.Seek: invalid whence")
}
if abs < 0 {
return 0, errors.New("grpc.Reader.Seek: negative position")
}
g.cursor = abs
return abs, nil
}
func (g *grpcReaderSeeker) Read(b []byte) (n int, err error) {
if g.cursor >= g.length {
return 0, io.EOF
}
data, err := g.getBytesData(len(b))
if err != nil {
return 0, err
}
n = copy(b, data)
g.cursor += int64(n)
return
}
// 通过grpc获取到bytes数据
func (g *grpcReaderSeeker) getBytesData(len int) ([]byte, error) {
resp, err := service.FilesProvider.ResumableTransfer(context.TODO(), &files.ResumableTransferReq{
UserSpacePath: g.userSpacePath,
Path: g.path,
Offset: g.cursor,
Length: int64(len),
})
if err != nil {
return nil, err
}
return resp.Content, nil
}
// grpc 获取到文件信息
func (g *grpcReaderSeeker) initInfo() error {
resp, err := service.FilesProvider.Info(context.TODO(), &files.FileInfoReq{
UserSpacePath: g.userSpacePath,
Path: g.path,
})
if err != nil {
return nil
}
g.FileName = resp.Name
g.length = resp.Size
return err
}
func newGrpcReaderSeeker(userSpacePath string, path string) (*grpcReaderSeeker, error) {
g := new(grpcReaderSeeker)
g.userSpacePath = userSpacePath
g.path = path
err := g.initInfo()
if err != nil {
return nil, err
}
return g, nil
}

View File

@ -0,0 +1,84 @@
package governance
import (
"github.com/gin-gonic/gin"
"fonchain-fiee/api/governance"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
)
func Create(ctx *gin.Context) {
var req governance.CreateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
user := login.GetUserInfoFromC(ctx)
// user := login.Info{
// Name: "test" + strconv.Itoa(rand.Intn(10)),
// ID: uint64(rand.Intn(10)),
// }
req.Operator = user.Name
req.OperatorId = int32(user.ID)
resp, err := service.GovernanceProvider.Create(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Delete(ctx *gin.Context) {
var req governance.DeleteReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.GovernanceProvider.Delete(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Display(ctx *gin.Context) {
resp, err := service.GovernanceProvider.Display(ctx, &governance.DisplayReq{})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func List(ctx *gin.Context) {
var req governance.ListReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.GovernanceProvider.List(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Edit(ctx *gin.Context) {
var req governance.EditReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
user := login.GetUserInfoFromC(ctx)
req.Operator = user.Name
req.OperatorId = int32(user.ID)
resp, err := service.GovernanceProvider.Edit(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}

View File

@ -1,17 +1,21 @@
package service
import (
"dubbo.apache.org/dubbo-go/v3/common/constant"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/imports"
"fmt"
"fonchain-fiee/api/account"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle"
"fonchain-fiee/api/files"
"fonchain-fiee/api/governance"
"fonchain-fiee/api/order"
"fonchain-fiee/api/payment"
"fonchain-fiee/api/pressreleases"
pkConfig "fonchain-fiee/pkg/config"
"os"
"dubbo.apache.org/dubbo-go/v3/common/constant"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/imports"
)
var AccountProvider = new(account.AccountClientImpl)
@ -19,7 +23,10 @@ var AccountFieeProvider = new(accountFiee.AccountFieeClientImpl)
var BundleProvider = new(bundle.BundleClientImpl)
var OrderProvider = new(order.OrderClientImpl)
var FilesProvider = new(files.FileClientImpl)
var PaymentProvider = new(payment.PaymentCentClientImpl)
var GovernanceProvider = new(governance.GovernanceClientImpl)
var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl)
func init() {
config.SetConsumerService(BundleProvider)
@ -27,7 +34,9 @@ func init() {
config.SetConsumerService(AccountProvider)
config.SetConsumerService(PaymentProvider)
config.SetConsumerService(AccountFieeProvider)
config.SetConsumerService(FilesProvider)
config.SetConsumerService(GovernanceProvider)
config.SetConsumerService(PressReleasesProvider)
if err := config.Load(); err != nil {
panic(err)
}

View File

@ -0,0 +1,103 @@
package pressreleases
import (
"strconv"
"github.com/gin-gonic/gin"
"fonchain-fiee/api/pressreleases"
"fonchain-fiee/pkg/model/login"
"fonchain-fiee/pkg/service"
)
func Create(ctx *gin.Context) {
var req pressreleases.CreateReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
user := login.GetUserInfoFromC(ctx)
req.Operator = user.Name
req.OperatorId = int32(user.ID)
resp, err := service.PressReleasesProvider.Create(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Delete(ctx *gin.Context) {
var req pressreleases.DeleteReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.Delete(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Display(ctx *gin.Context) {
var req pressreleases.DisplayReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.Display(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func List(ctx *gin.Context) {
var req pressreleases.ListReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.List(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Edit(ctx *gin.Context) {
var req pressreleases.EditReq
if err := ctx.ShouldBindJSON(&req); err != nil {
service.Error(ctx, err)
return
}
user := login.GetUserInfoFromC(ctx)
req.Operator = user.Name
req.OperatorId = int32(user.ID)
resp, err := service.PressReleasesProvider.Edit(ctx, &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}
func Get(ctx *gin.Context) {
id, err := strconv.Atoi(ctx.Query("id"))
if err != nil {
service.Error(ctx, err)
return
}
resp, err := service.PressReleasesProvider.Get(ctx, &pressreleases.GetReq{
Id: int64(id),
})
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}