Compare commits
No commits in common. "dev" and "main" have entirely different histories.
38
.gitignore
vendored
38
.gitignore
vendored
@ -1,38 +0,0 @@
|
|||||||
.gitignore
|
|
||||||
.idea
|
|
||||||
.scannerwork
|
|
||||||
.vscode
|
|
||||||
# local env files
|
|
||||||
.env.local
|
|
||||||
.env.*.local
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
|
|
||||||
*.iml
|
|
||||||
# Binaries for programs and plugins
|
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
|
||||||
*.test
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
|
|
||||||
/cmd/logs/*.log
|
|
||||||
/cmd/runtime/log/*.log
|
|
||||||
/build/*
|
|
8
.idea/.gitignore
vendored
Normal file
8
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
10
.idea/AugmentWebviewStateStore.xml
Normal file
10
.idea/AugmentWebviewStateStore.xml
Normal file
File diff suppressed because one or more lines are too long
9
.idea/fonchain-fiee.iml
Normal file
9
.idea/fonchain-fiee.iml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="Go" enabled="true" />
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
6
.idea/git_toolbox_blame.xml
Normal file
6
.idea/git_toolbox_blame.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GitToolBoxBlameSettings">
|
||||||
|
<option name="version" value="2" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/fonchain-fiee.iml" filepath="$PROJECT_DIR$/.idea/fonchain-fiee.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
File diff suppressed because it is too large
Load Diff
@ -21,29 +21,6 @@ func (this *CommonResponse) Validate() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *BundleProfile) Validate() error {
|
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 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *SaveResponse) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *SelectValueAddService) Validate() error {
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *DelBundleRequest) Validate() error {
|
func (this *DelBundleRequest) Validate() error {
|
||||||
@ -65,9 +42,6 @@ func (this *BundleListResponse) Validate() error {
|
|||||||
func (this *BundleDetailRequest) Validate() error {
|
func (this *BundleDetailRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *HandShelfRequest) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *BundleDetailResponse) Validate() error {
|
func (this *BundleDetailResponse) Validate() error {
|
||||||
if this.Bundle != nil {
|
if this.Bundle != nil {
|
||||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
|
||||||
@ -76,25 +50,7 @@ func (this *BundleDetailResponse) Validate() error {
|
|||||||
}
|
}
|
||||||
return nil
|
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *OrderRecord) Validate() error {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
func (this *OrderRecordsRequest) Validate() error {
|
func (this *OrderRecordsRequest) Validate() error {
|
||||||
@ -163,78 +119,3 @@ func (this *ValueAddBundleDetailResponse) Validate() error {
|
|||||||
func (this *FinancialConfirmationRequest) Validate() error {
|
func (this *FinancialConfirmationRequest) Validate() error {
|
||||||
return nil
|
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.ValueAddService != nil {
|
|
||||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddService); err != nil {
|
|
||||||
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddService", 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 *SetBundleBalanceRequest) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func (this *SetBundleBalanceResponse) Validate() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-triple v1.0.8
|
// - protoc-gen-go-triple v1.0.8
|
||||||
// - protoc v4.24.0--rc1
|
// - protoc v3.10.1
|
||||||
// source: pb/bundle.proto
|
// source: pb/bundle.proto
|
||||||
|
|
||||||
package bundle
|
package bundle
|
||||||
@ -31,10 +31,6 @@ type BundleClient interface {
|
|||||||
CreateBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
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)
|
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)
|
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)
|
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)
|
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)
|
CreateOrderRecord(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
@ -47,13 +43,6 @@ type BundleClient interface {
|
|||||||
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, 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)
|
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)
|
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type bundleClient struct {
|
type bundleClient struct {
|
||||||
@ -64,10 +53,6 @@ type BundleClientImpl struct {
|
|||||||
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||||
UpdateBundle 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)
|
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)
|
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
|
||||||
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
|
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
|
||||||
CreateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
CreateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||||
@ -79,11 +64,6 @@ type BundleClientImpl struct {
|
|||||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, 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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||||
@ -116,30 +96,6 @@ func (c *bundleClient) DeleteBundle(ctx context.Context, in *DelBundleRequest, o
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteBundle", in, out)
|
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) {
|
func (c *bundleClient) BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) {
|
||||||
out := new(BundleListResponse)
|
out := new(BundleListResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -206,36 +162,6 @@ func (c *bundleClient) ValueAddBundleDetail(ctx context.Context, in *ValueAddBun
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ValueAddBundleDetail", in, out)
|
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// BundleServer is the server API for Bundle service.
|
// BundleServer is the server API for Bundle service.
|
||||||
// All implementations must embed UnimplementedBundleServer
|
// All implementations must embed UnimplementedBundleServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -243,10 +169,6 @@ type BundleServer interface {
|
|||||||
CreateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
|
CreateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
|
||||||
UpdateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
|
UpdateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
|
||||||
DeleteBundle(context.Context, *DelBundleRequest) (*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)
|
BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error)
|
||||||
BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error)
|
BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error)
|
||||||
CreateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error)
|
CreateOrderRecord(context.Context, *OrderRecord) (*CommonResponse, error)
|
||||||
@ -259,13 +181,6 @@ type BundleServer interface {
|
|||||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, 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)
|
|
||||||
mustEmbedUnimplementedBundleServer()
|
mustEmbedUnimplementedBundleServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,18 +198,6 @@ func (UnimplementedBundleServer) UpdateBundle(context.Context, *BundleProfile) (
|
|||||||
func (UnimplementedBundleServer) DeleteBundle(context.Context, *DelBundleRequest) (*CommonResponse, error) {
|
func (UnimplementedBundleServer) DeleteBundle(context.Context, *DelBundleRequest) (*CommonResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteBundle not implemented")
|
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) {
|
func (UnimplementedBundleServer) BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method BundleList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method BundleList not implemented")
|
||||||
}
|
}
|
||||||
@ -328,21 +231,6 @@ func (UnimplementedBundleServer) ValueAddBundleList(context.Context, *ValueAddBu
|
|||||||
func (UnimplementedBundleServer) ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error) {
|
func (UnimplementedBundleServer) ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ValueAddBundleDetail not implemented")
|
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 (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -458,122 +346,6 @@ func _Bundle_DeleteBundle_Handler(srv interface{}, ctx context.Context, dec func
|
|||||||
return interceptor(ctx, in, info, handler)
|
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) {
|
func _Bundle_BundleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(BundleListRequest)
|
in := new(BundleListRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -893,151 +665,6 @@ func _Bundle_ValueAddBundleDetail_Handler(srv interface{}, ctx context.Context,
|
|||||||
return interceptor(ctx, in, info, handler)
|
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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -1057,22 +684,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "DeleteBundle",
|
MethodName: "DeleteBundle",
|
||||||
Handler: _Bundle_DeleteBundle_Handler,
|
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",
|
MethodName: "BundleList",
|
||||||
Handler: _Bundle_BundleList_Handler,
|
Handler: _Bundle_BundleList_Handler,
|
||||||
@ -1117,26 +728,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "ValueAddBundleDetail",
|
MethodName: "ValueAddBundleDetail",
|
||||||
Handler: _Bundle_ValueAddBundleDetail_Handler,
|
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,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/bundle.proto",
|
Metadata: "pb/bundle.proto",
|
||||||
|
1469
api/cast/cast.pb.go
1469
api/cast/cast.pb.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,418 +0,0 @@
|
|||||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
|
||||||
// versions:
|
|
||||||
// - protoc-gen-go-triple v1.0.8
|
|
||||||
// - protoc v3.21.1
|
|
||||||
// source: pb/fiee/cast.proto
|
|
||||||
|
|
||||||
package cast
|
|
||||||
|
|
||||||
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"
|
|
||||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 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
|
|
||||||
|
|
||||||
// CastClient is the client API for Cast 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 CastClient interface {
|
|
||||||
MediaUserList(ctx context.Context, in *MediaUserListReq, opts ...grpc_go.CallOption) (*MediaUserListResp, common.ErrorWithAttachment)
|
|
||||||
UpdateMediaAccount(ctx context.Context, in *UpdateMediaAccountReq, opts ...grpc_go.CallOption) (*UpdateMediaAccountResp, common.ErrorWithAttachment)
|
|
||||||
UnbindManager(ctx context.Context, in *UnbindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
|
||||||
BindManager(ctx context.Context, in *BindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
|
||||||
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
|
|
||||||
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
|
|
||||||
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
|
|
||||||
}
|
|
||||||
|
|
||||||
type castClient struct {
|
|
||||||
cc *triple.TripleConn
|
|
||||||
}
|
|
||||||
|
|
||||||
type CastClientImpl struct {
|
|
||||||
MediaUserList func(ctx context.Context, in *MediaUserListReq) (*MediaUserListResp, error)
|
|
||||||
UpdateMediaAccount func(ctx context.Context, in *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
|
|
||||||
UnbindManager func(ctx context.Context, in *UnbindManagerReq) (*emptypb.Empty, error)
|
|
||||||
BindManager func(ctx context.Context, in *BindManagerReq) (*emptypb.Empty, error)
|
|
||||||
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
|
||||||
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
|
||||||
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
|
||||||
return NewCastClient(cc)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *CastClientImpl) XXX_InterfaceName() string {
|
|
||||||
return "Cast.Cast"
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCastClient(cc *triple.TripleConn) CastClient {
|
|
||||||
return &castClient{cc}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) MediaUserList(ctx context.Context, in *MediaUserListReq, opts ...grpc_go.CallOption) (*MediaUserListResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(MediaUserListResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/MediaUserList", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) UpdateMediaAccount(ctx context.Context, in *UpdateMediaAccountReq, opts ...grpc_go.CallOption) (*UpdateMediaAccountResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(UpdateMediaAccountResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateMediaAccount", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) UnbindManager(ctx context.Context, in *UnbindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
|
|
||||||
out := new(emptypb.Empty)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UnbindManager", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) BindManager(ctx context.Context, in *BindManagerReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
|
|
||||||
out := new(emptypb.Empty)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BindManager", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(UpdateWorkImageResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkImage", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(UpdateWorkVideoResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateWorkVideo", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(WorkListResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkList", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
// CastServer is the server API for Cast service.
|
|
||||||
// All implementations must embed UnimplementedCastServer
|
|
||||||
// for forward compatibility
|
|
||||||
type CastServer interface {
|
|
||||||
MediaUserList(context.Context, *MediaUserListReq) (*MediaUserListResp, error)
|
|
||||||
UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error)
|
|
||||||
UnbindManager(context.Context, *UnbindManagerReq) (*emptypb.Empty, error)
|
|
||||||
BindManager(context.Context, *BindManagerReq) (*emptypb.Empty, error)
|
|
||||||
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
|
||||||
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
|
||||||
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
|
|
||||||
mustEmbedUnimplementedCastServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnimplementedCastServer must be embedded to have forward compatible implementations.
|
|
||||||
type UnimplementedCastServer struct {
|
|
||||||
proxyImpl protocol.Invoker
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedCastServer) MediaUserList(context.Context, *MediaUserListReq) (*MediaUserListResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method MediaUserList not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) UpdateMediaAccount(context.Context, *UpdateMediaAccountReq) (*UpdateMediaAccountResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateMediaAccount not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) UnbindManager(context.Context, *UnbindManagerReq) (*emptypb.Empty, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UnbindManager not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) BindManager(context.Context, *BindManagerReq) (*emptypb.Empty, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method BindManager not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkImage not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkVideo not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
|
|
||||||
}
|
|
||||||
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
|
||||||
s.proxyImpl = impl
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *UnimplementedCastServer) XXX_GetProxyImpl() protocol.Invoker {
|
|
||||||
return s.proxyImpl
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *UnimplementedCastServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
|
||||||
return &Cast_ServiceDesc
|
|
||||||
}
|
|
||||||
func (s *UnimplementedCastServer) XXX_InterfaceName() string {
|
|
||||||
return "Cast.Cast"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (UnimplementedCastServer) mustEmbedUnimplementedCastServer() {}
|
|
||||||
|
|
||||||
// UnsafeCastServer may be embedded to opt out of forward compatibility for this service.
|
|
||||||
// Use of this interface is not recommended, as added methods to CastServer will
|
|
||||||
// result in compilation errors.
|
|
||||||
type UnsafeCastServer interface {
|
|
||||||
mustEmbedUnimplementedCastServer()
|
|
||||||
}
|
|
||||||
|
|
||||||
func RegisterCastServer(s grpc_go.ServiceRegistrar, srv CastServer) {
|
|
||||||
s.RegisterService(&Cast_ServiceDesc, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
func _Cast_MediaUserList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(MediaUserListReq)
|
|
||||||
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("MediaUserList", 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 _Cast_UpdateMediaAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(UpdateMediaAccountReq)
|
|
||||||
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("UpdateMediaAccount", 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 _Cast_UnbindManager_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(UnbindManagerReq)
|
|
||||||
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("UnbindManager", 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 _Cast_BindManager_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(BindManagerReq)
|
|
||||||
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("BindManager", 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 _Cast_UpdateWorkImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(UpdateWorkImageReq)
|
|
||||||
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("UpdateWorkImage", 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 _Cast_UpdateWorkVideo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(UpdateWorkVideoReq)
|
|
||||||
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("UpdateWorkVideo", 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 _Cast_WorkList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(WorkListReq)
|
|
||||||
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("WorkList", 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)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cast_ServiceDesc is the grpc_go.ServiceDesc for Cast service.
|
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
|
||||||
// and not to be introspected or modified (even as a copy)
|
|
||||||
var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|
||||||
ServiceName: "Cast.Cast",
|
|
||||||
HandlerType: (*CastServer)(nil),
|
|
||||||
Methods: []grpc_go.MethodDesc{
|
|
||||||
{
|
|
||||||
MethodName: "MediaUserList",
|
|
||||||
Handler: _Cast_MediaUserList_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "UpdateMediaAccount",
|
|
||||||
Handler: _Cast_UpdateMediaAccount_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "UnbindManager",
|
|
||||||
Handler: _Cast_UnbindManager_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "BindManager",
|
|
||||||
Handler: _Cast_BindManager_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "UpdateWorkImage",
|
|
||||||
Handler: _Cast_UpdateWorkImage_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "UpdateWorkVideo",
|
|
||||||
Handler: _Cast_UpdateWorkVideo_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "WorkList",
|
|
||||||
Handler: _Cast_WorkList_Handler,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Streams: []grpc_go.StreamDesc{},
|
|
||||||
Metadata: "pb/fiee/cast.proto",
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,193 +0,0 @@
|
|||||||
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; // 预览大小 0:256x256, 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;
|
|
||||||
}
|
|
@ -1,122 +0,0 @@
|
|||||||
// 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
|
|
||||||
}
|
|
@ -1,678 +0,0 @@
|
|||||||
// 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",
|
|
||||||
}
|
|
@ -109,7 +109,6 @@ type Redis struct {
|
|||||||
|
|
||||||
type System struct {
|
type System struct {
|
||||||
Mode string
|
Mode string
|
||||||
AppMode string
|
|
||||||
Version string
|
Version string
|
||||||
HttpPort string
|
HttpPort string
|
||||||
Host string
|
Host string
|
||||||
|
2
conf/.gitignore
vendored
2
conf/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
conf.ini
|
|
||||||
dubbogo.yaml
|
|
36
conf/conf.ini
Normal file
36
conf/conf.ini
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
[system]
|
||||||
|
Domain = "fiee"
|
||||||
|
AppMode = "debug"
|
||||||
|
HttpPort = ":8085"
|
||||||
|
Host = "http://127.0.0.1:8085"
|
||||||
|
RedirectUri = "/api/redirect/url"
|
||||||
|
|
||||||
|
[bos]
|
||||||
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
|
BucketName = "dci-file-new"
|
||||||
|
BosUrl = ".bj.bcebos.com"
|
||||||
|
BosBaseDir = "fonchain-main"
|
||||||
|
BosHttp = "https://"
|
||||||
|
BosDomain = "cdns.fontree.cn"
|
||||||
|
[oss]
|
||||||
|
AccessKeyId = "LTAI5tLz1fSK53FQAEC9uNSb"
|
||||||
|
AccessKeySecret = "oGB9chrQzQzITXR2IGv37Ji5WxZh4j"
|
||||||
|
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
|
||||||
|
BucketName = "fontree-test"
|
||||||
|
BaseDir = "fonchain-main"
|
||||||
|
CdnHost = "https://cdn-test.szjixun.cn"
|
||||||
|
[redis]
|
||||||
|
RedisDB = "2"
|
||||||
|
RedisAddr = "127.0.0.1:6379"
|
||||||
|
RedisPW = ""
|
||||||
|
RedisDBNAme = "2"
|
||||||
|
|
||||||
|
|
||||||
|
[ai]
|
||||||
|
Host = "https://erpapi.fontree.cn"
|
||||||
|
TelNum = "18021272627"
|
||||||
|
Password = "Gy.123456"
|
||||||
|
|
||||||
|
[service]
|
||||||
|
IsHTTPS = false
|
29
conf/dubbogo.yaml
Normal file
29
conf/dubbogo.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
dubbo:
|
||||||
|
registries:
|
||||||
|
demoZK:
|
||||||
|
protocol: zookeeper
|
||||||
|
timeout: 5s
|
||||||
|
address: 127.0.0.1:2181
|
||||||
|
consumer:
|
||||||
|
references:
|
||||||
|
AccountClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
retries: 0
|
||||||
|
interface: com.fontree.microservices.common.Account
|
||||||
|
filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute
|
||||||
|
params:
|
||||||
|
.accessKeyId: "Accountksl"
|
||||||
|
.secretAccessKey: "BSDY-FDF1-Fontree_account"
|
||||||
|
|
||||||
|
AccountFieeClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
retries: 0
|
||||||
|
interface: com.fontree.microservices.common.micro.account.fiee
|
||||||
|
# filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
|
||||||
|
# params:
|
||||||
|
# .accessKeyId: "Accountksl"
|
||||||
|
# .secretAccessKey: "BSDY-FDF1-Fontree_account"
|
||||||
|
BundleClientImpl:
|
||||||
|
protocol: tri
|
||||||
|
retries: 0
|
||||||
|
interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java
|
@ -1,6 +1,6 @@
|
|||||||
[system]
|
[system]
|
||||||
Domain = "artistinfo"
|
Domain = "artistinfo"
|
||||||
AppMode = "dev"
|
AppMode = "debug"
|
||||||
HttpPort = ":8085"
|
HttpPort = ":8085"
|
||||||
Host = "https://common.szjixun.cn"
|
Host = "https://common.szjixun.cn"
|
||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
|
@ -4,8 +4,8 @@ dubbo:
|
|||||||
protocol: zookeeper
|
protocol: zookeeper
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
# address: 121.229.45.214:9004
|
# address: 121.229.45.214:9004
|
||||||
# address: 172.16.100.93:2181
|
address: 172.16.100.93:2181
|
||||||
address: 127.0.0.1:2181
|
# address: 127.0.0.1:2181
|
||||||
# address: 114.218.158.24:2181
|
# address: 114.218.158.24:2181
|
||||||
consumer:
|
consumer:
|
||||||
filter: tracing
|
filter: tracing
|
||||||
@ -42,6 +42,3 @@ dubbo:
|
|||||||
params:
|
params:
|
||||||
.accessKeyId: "Paymentksl"
|
.accessKeyId: "Paymentksl"
|
||||||
.secretAccessKey: "BSDY-FDF1-Fontree_payment"
|
.secretAccessKey: "BSDY-FDF1-Fontree_payment"
|
||||||
CastClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
interface: com.fontree.microservices.fiee.multicast
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[system]
|
[system]
|
||||||
Domain = "artistinfo"
|
Domain = "artistinfo"
|
||||||
AppMode = "prod"
|
AppMode = "debug"
|
||||||
HttpPort = ":8085"
|
HttpPort = ":8085"
|
||||||
Host = "https://common.szjixun.cn"
|
Host = "https://common.szjixun.cn"
|
||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
|
@ -42,6 +42,3 @@ dubbo:
|
|||||||
params:
|
params:
|
||||||
.accessKeyId: "Paymentksl"
|
.accessKeyId: "Paymentksl"
|
||||||
.secretAccessKey: "BSDY-FDF1-Fontree_payment"
|
.secretAccessKey: "BSDY-FDF1-Fontree_payment"
|
||||||
CastClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
interface: com.fontree.microservices.fiee.multicast
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[system]
|
[system]
|
||||||
Domain = "artistinfo"
|
Domain = "artistinfo"
|
||||||
AppMode = "test"
|
AppMode = "debug"
|
||||||
HttpPort = ":8085"
|
HttpPort = ":8085"
|
||||||
Host = "https://common.szjixun.cn"
|
Host = "https://common.szjixun.cn"
|
||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
@ -8,29 +8,18 @@ RedirectUri = "/api/redirect/url"
|
|||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
BucketName = "dci-file-new"
|
BucketName = "dci-file-new"
|
||||||
BosUrl = ".bj.bcebos.com"
|
BosUrl = ".bj.bcebos.com"
|
||||||
BosBaseDir = "fiee"
|
BosBaseDir = "fonchain-main"
|
||||||
BosHttp = "https://"
|
BosHttp = "https://"
|
||||||
BosDomain = "cdns.fontree.cn"
|
|
||||||
[oss]
|
|
||||||
AccessKeyId = "LTAI5tLz1fSK53FQAEC9uNSb"
|
|
||||||
AccessKeySecret = "oGB9chrQzQzITXR2IGv37Ji5WxZh4j"
|
|
||||||
Endpoint = "oss-cn-hangzhou.aliyuncs.com"
|
|
||||||
BucketName = "fontree-test"
|
|
||||||
BaseDir = "fiee"
|
|
||||||
CdnHost = "https://cdn-test.szjixun.cn"
|
|
||||||
|
|
||||||
[redis]
|
[redis]
|
||||||
RedisDB = "2"
|
RedisDB = "2"
|
||||||
RedisAddr = "172.16.100.114:6379"
|
RedisAddr = "redis:6379"
|
||||||
RedisPW = "kP6tW4tS3qB2dW4aE6uI5cX2"
|
RedisPW = "root"
|
||||||
RedisDBNAme = "2"
|
RedisDBNAme = "2"
|
||||||
|
|
||||||
[ai]
|
[ai]
|
||||||
Host = "https://erpapi.fontree.cn"
|
Host = "https://erpapi.fontree.cn"
|
||||||
TelNum = "18021272627"
|
TelNum = "18021272627"
|
||||||
Password = "Gy.123456"
|
Password = "Gy.123456"
|
||||||
|
|
||||||
[stripe]
|
|
||||||
Webhookkey = "whsec_uOQpG6IZTqtfLuePIDtfLCGJPqedSCCN"
|
|
@ -4,44 +4,5 @@ dubbo:
|
|||||||
protocol: zookeeper
|
protocol: zookeeper
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
# address: 121.229.45.214:9004
|
# address: 121.229.45.214:9004
|
||||||
address: 172.16.100.93:2181
|
address: 127.0.0.1:2181
|
||||||
# address: 127.0.0.1:2181
|
# address: 114.218.158.24:2181
|
||||||
# address: 114.218.158.24:2181
|
|
||||||
consumer:
|
|
||||||
filter: tracing
|
|
||||||
request-timeout: 30s
|
|
||||||
references:
|
|
||||||
OrderClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
retries: 0
|
|
||||||
interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java
|
|
||||||
# filter: cshutdown,sign,fonDomainFilter,fonValidateFilter
|
|
||||||
params:
|
|
||||||
.accessKeyId: "SYD8-order-04"
|
|
||||||
.secretAccessKey: "Al-order-FDF112"
|
|
||||||
BundleClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
retries: 0
|
|
||||||
interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java
|
|
||||||
AccountClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
retries: 0
|
|
||||||
interface: com.fontree.microservices.common.Account
|
|
||||||
filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute
|
|
||||||
params:
|
|
||||||
.accessKeyId: "Accountksl"
|
|
||||||
.secretAccessKey: "BSDY-FDF1-Fontree_account"
|
|
||||||
AccountFieeClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
retries: 3
|
|
||||||
interface: com.fontree.microservices.common.micro.account.fiee
|
|
||||||
# filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute,pshutdown,auth,fonValidateFilter
|
|
||||||
PaymentCentClientImpl:
|
|
||||||
interface: com.fontree.microservices.common.payment # must be compatible with grpc or dubbo-java
|
|
||||||
filter: cshutdown,sign,auth
|
|
||||||
params:
|
|
||||||
.accessKeyId: "Paymentksl"
|
|
||||||
.secretAccessKey: "BSDY-FDF1-Fontree_payment"
|
|
||||||
CastClientImpl:
|
|
||||||
protocol: tri
|
|
||||||
interface: com.fontree.microservices.fiee.multicast
|
|
4
go.mod
4
go.mod
@ -5,7 +5,7 @@ go 1.18
|
|||||||
replace (
|
replace (
|
||||||
github.com/fonchain_enterprise/utils/aes => ../utils/aes
|
github.com/fonchain_enterprise/utils/aes => ../utils/aes
|
||||||
github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
|
github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
|
||||||
//github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-新/utils/objstorage
|
//github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-新/utils/objstorage
|
||||||
)
|
)
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -101,7 +101,6 @@ require (
|
|||||||
github.com/BurntSushi/toml v1.2.1
|
github.com/BurntSushi/toml v1.2.1
|
||||||
github.com/PuerkitoBio/goquery v1.8.1
|
github.com/PuerkitoBio/goquery v1.8.1
|
||||||
github.com/disintegration/imaging v1.6.2
|
github.com/disintegration/imaging v1.6.2
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0
|
|
||||||
github.com/fonchain_enterprise/utils/objstorage v0.0.0-00010101000000-000000000000
|
github.com/fonchain_enterprise/utils/objstorage v0.0.0-00010101000000-000000000000
|
||||||
github.com/gin-contrib/pprof v1.4.0
|
github.com/gin-contrib/pprof v1.4.0
|
||||||
github.com/go-redis/redis v6.15.9+incompatible
|
github.com/go-redis/redis v6.15.9+incompatible
|
||||||
@ -132,6 +131,7 @@ require (
|
|||||||
github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 // indirect
|
github.com/dubbogo/go-zookeeper v1.0.4-0.20211212162352-f9d2183d89d5 // indirect
|
||||||
github.com/emicklei/go-restful/v3 v3.7.4 // indirect
|
github.com/emicklei/go-restful/v3 v3.7.4 // indirect
|
||||||
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
|
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
|
||||||
|
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||||
github.com/ghodss/yaml v1.0.0 // indirect
|
github.com/ghodss/yaml v1.0.0 // indirect
|
||||||
github.com/go-co-op/gocron v1.9.0 // indirect
|
github.com/go-co-op/gocron v1.9.0 // indirect
|
||||||
|
@ -2,7 +2,7 @@ package middleware
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -24,14 +24,11 @@ func NewLogger() gin.HandlerFunc {
|
|||||||
latencyTime := endTime.Sub(startTime) // 请求方式
|
latencyTime := endTime.Sub(startTime) // 请求方式
|
||||||
path := c.Request.URL.Path
|
path := c.Request.URL.Path
|
||||||
query := c.Request.URL.RawQuery
|
query := c.Request.URL.RawQuery
|
||||||
data, _ := io.ReadAll(c.Request.Body)
|
data, _ := ioutil.ReadAll(c.Request.Body)
|
||||||
val := c.GetHeader("Accept-Language")
|
|
||||||
if val == "" {
|
|
||||||
c.Request.Header.Set("Accept-Language", "zh-CN")
|
|
||||||
}
|
|
||||||
log.Printf("[%s] %s %d %s %s %s %s %s %s", path, c.Request.Method, c.Writer.Status(), query,
|
log.Printf("[%s] %s %d %s %s %s %s %s %s", path, c.Request.Method, c.Writer.Status(), query,
|
||||||
string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String())
|
string(data), c.ClientIP(), c.Request.UserAgent(), c.Errors.ByType(gin.ErrorTypePrivate).String(), latencyTime.String())
|
||||||
c.Request.Body = io.NopCloser(bytes.NewBuffer(data))
|
|
||||||
|
c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(data))
|
||||||
c.Next()
|
c.Next()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"fonchain-fiee/pkg/middleware"
|
"fonchain-fiee/pkg/middleware"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/service/bundle"
|
"fonchain-fiee/pkg/service/bundle"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,20 +21,11 @@ func BundleRouter(r *gin.RouterGroup) {
|
|||||||
bundleClientRoute.POST("remove", bundle.DeleteBundle)
|
bundleClientRoute.POST("remove", bundle.DeleteBundle)
|
||||||
bundleClientRoute.POST("bundle-list", bundle.BundleList)
|
bundleClientRoute.POST("bundle-list", bundle.BundleList)
|
||||||
}
|
}
|
||||||
bundleClientRouteV2 := bundleRoute.Group("system/v2")
|
|
||||||
bundleClientRouteV2.POST("save", bundle.SaveBundleV2)
|
|
||||||
bundleClientRouteV2.POST("update/shelfStatus", bundle.HandShelf)
|
|
||||||
|
|
||||||
bundleAppRoute = bundleAppRoute.Group("common")
|
bundleAppRoute = bundleAppRoute.Group("common")
|
||||||
{
|
{
|
||||||
bundleAppRoute.POST("bundle-list", bundle.BundleList)
|
bundleAppRoute.POST("bundle-list", bundle.BundleList)
|
||||||
}
|
}
|
||||||
bundleAppRouteV2 := bundleRoute.Group("common/v2")
|
|
||||||
{
|
|
||||||
bundleAppRouteV2.POST("bundle-list", bundle.BundleListV2)
|
|
||||||
bundleAppRouteV2.POST("bundle-detail", bundle.BundleDetailV2)
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,12 +15,12 @@ func BundleOrderRouter(r *gin.RouterGroup) {
|
|||||||
|
|
||||||
bundleOrderRoute := r.Group("bundle-order")
|
bundleOrderRoute := r.Group("bundle-order")
|
||||||
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
bundleOrderRoute.Use(middleware.CheckLogin(service.AccountFieeProvider))
|
||||||
bundleOrderWebRoute := r.Group("bundle-order")
|
//bundleOrderWebRoute := r.Group("bundle-order")
|
||||||
bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
|
//bundleOrderWebRoute.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||||
|
|
||||||
// 套餐
|
// 套餐
|
||||||
{
|
{
|
||||||
bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
|
bundleOrderClientWebRoute := bundleOrderRoute.Group("common/web")
|
||||||
{
|
{
|
||||||
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
|
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
|
||||||
}
|
}
|
||||||
@ -31,8 +31,8 @@ func BundleOrderRouter(r *gin.RouterGroup) {
|
|||||||
|
|
||||||
//bundleOrderWebRoute := bundleOrderRoute.Group("web")
|
//bundleOrderWebRoute := bundleOrderRoute.Group("web")
|
||||||
{
|
{
|
||||||
bundleOrderWebRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
|
bundleOrderRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
|
||||||
bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfoOss)
|
bundleOrderRoute.POST("order-export", bundle.ExportOrderInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
bundleOrderAppRoute := bundleOrderRoute.Group("app")
|
bundleOrderAppRoute := bundleOrderRoute.Group("app")
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
package router
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fonchain-fiee/pkg/middleware"
|
|
||||||
"fonchain-fiee/pkg/service"
|
|
||||||
serviceCast "fonchain-fiee/pkg/service/cast"
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
)
|
|
||||||
|
|
||||||
func MediaRouter(r *gin.RouterGroup) {
|
|
||||||
//noAuth := r.Group("")
|
|
||||||
auth := r.Group("")
|
|
||||||
auth.Use(middleware.CheckWebLogin(service.AccountProvider))
|
|
||||||
media := auth.Group("media")
|
|
||||||
{
|
|
||||||
media.POST("user-list", serviceCast.MediaUserList)
|
|
||||||
media.POST("unbind-manager", serviceCast.UnbindManager)
|
|
||||||
media.POST("bind-manager", serviceCast.BindManager)
|
|
||||||
media.POST("update-account", serviceCast.UpdateMediaAccount)
|
|
||||||
}
|
|
||||||
|
|
||||||
work := auth.Group("work")
|
|
||||||
{
|
|
||||||
work.POST("update-work-image", serviceCast.UpdateWorkImage)
|
|
||||||
work.POST("update-work-video", serviceCast.UpdateWorkVideo)
|
|
||||||
}
|
|
||||||
}
|
|
@ -5,7 +5,6 @@ import (
|
|||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
"fonchain-fiee/pkg/service/account"
|
"fonchain-fiee/pkg/service/account"
|
||||||
"fonchain-fiee/pkg/service/auth"
|
"fonchain-fiee/pkg/service/auth"
|
||||||
"fonchain-fiee/pkg/service/file"
|
|
||||||
"fonchain-fiee/pkg/service/lang"
|
"fonchain-fiee/pkg/service/lang"
|
||||||
"fonchain-fiee/pkg/service/qr"
|
"fonchain-fiee/pkg/service/qr"
|
||||||
"fonchain-fiee/pkg/service/redirect"
|
"fonchain-fiee/pkg/service/redirect"
|
||||||
@ -42,7 +41,6 @@ func NewRouter() *gin.Engine {
|
|||||||
BundleRouter(privateGroup)
|
BundleRouter(privateGroup)
|
||||||
BundleOrderRouter(privateGroup)
|
BundleOrderRouter(privateGroup)
|
||||||
ValueAddBundleRouter(privateGroup)
|
ValueAddBundleRouter(privateGroup)
|
||||||
MediaRouter(privateGroup)
|
|
||||||
|
|
||||||
{
|
{
|
||||||
v1.POST("version", version.Version) //版本号公共
|
v1.POST("version", version.Version) //版本号公共
|
||||||
@ -110,23 +108,6 @@ func NewRouter() *gin.Engine {
|
|||||||
redirectRoute.POST("sdk/down/v3", auth.DownImgV3)
|
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)
|
|
||||||
}
|
|
||||||
//静态文件
|
//静态文件
|
||||||
r.StaticFS("/api/static", http.Dir("./runtime"))
|
r.StaticFS("/api/static", http.Dir("./runtime"))
|
||||||
r.NoRoute(func(c *gin.Context) {
|
r.NoRoute(func(c *gin.Context) {
|
||||||
|
@ -23,12 +23,6 @@ func ValueAddBundleRouter(r *gin.RouterGroup) {
|
|||||||
bundleClientRoute.POST("list", bundle.ValueAddBundleList)
|
bundleClientRoute.POST("list", bundle.ValueAddBundleList)
|
||||||
bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail)
|
bundleClientRoute.POST("detail", bundle.ValueAddBundleDetail)
|
||||||
}
|
}
|
||||||
bundleClientRouteV2 := valueAddBundleRoute.Group("system/v2")
|
|
||||||
{
|
|
||||||
bundleClientRouteV2.POST("save", bundle.SaveValueAddService)
|
|
||||||
bundleClientRouteV2.POST("list", bundle.ValueAddServiceList)
|
|
||||||
bundleClientRouteV2.POST("detail", bundle.ValueAddServiceDetail)
|
|
||||||
}
|
|
||||||
|
|
||||||
valueAddBundleAppRoute = valueAddBundleAppRoute.Group("system")
|
valueAddBundleAppRoute = valueAddBundleAppRoute.Group("system")
|
||||||
{
|
{
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
package bundle
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fonchain-fiee/api/bundle"
|
|
||||||
"fonchain-fiee/pkg/service"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"github.com/gin-gonic/gin/binding"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BundleExtend(c *gin.Context) {
|
|
||||||
var req bundle.BundleExtendRequest
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); 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.ShouldBindBodyWith(&req, binding.JSON); 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)
|
|
||||||
}
|
|
@ -12,7 +12,6 @@ import (
|
|||||||
"fonchain-fiee/pkg/service/bundle/common"
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
"fonchain-fiee/pkg/service/bundle/logic"
|
"fonchain-fiee/pkg/service/bundle/logic"
|
||||||
bundleModel "fonchain-fiee/pkg/service/bundle/model"
|
bundleModel "fonchain-fiee/pkg/service/bundle/model"
|
||||||
"fonchain-fiee/pkg/service/upload"
|
|
||||||
"math/big"
|
"math/big"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -33,10 +32,7 @@ func CreateBundleOrderSignature(c *gin.Context) {
|
|||||||
service.Error(c, errors.New(common.MissBundleUUID))
|
service.Error(c, errors.New(common.MissBundleUUID))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if req.Language == "" {
|
|
||||||
service.Error(c, errors.New(common.MissLanguageTypes))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 不去校验 签名
|
// 不去校验 签名
|
||||||
/*if req.Signature == "" {
|
/*if req.Signature == "" {
|
||||||
service.Error(c, errors.New(common.MissOrderSignature))
|
service.Error(c, errors.New(common.MissOrderSignature))
|
||||||
@ -430,93 +426,8 @@ func ExportOrderInfo(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/fiee/static", 1)
|
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/static", 1)
|
||||||
//var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path)
|
//var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path)
|
||||||
fmt.Println("exportUrl : ", exportUrl)
|
fmt.Println("exportUrl : ", exportUrl)
|
||||||
service.Success(c, &bundleModel.ExportResponse{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})
|
|
||||||
}
|
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
"fonchain-fiee/pkg/service"
|
"fonchain-fiee/pkg/service"
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gin-gonic/gin/binding"
|
"github.com/gin-gonic/gin/binding"
|
||||||
)
|
)
|
||||||
@ -77,66 +76,3 @@ func BundleList(c *gin.Context) {
|
|||||||
|
|
||||||
service.Success(c, res)
|
service.Success(c, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveBundleV2(c *gin.Context) {
|
|
||||||
var req bundle.BundleProfile
|
|
||||||
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.SaveBundle(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
|
||||||
func BundleListV2(c *gin.Context) {
|
|
||||||
var req bundle.BundleListRequest
|
|
||||||
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.BundleListV2(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
func BundleDetailV2(c *gin.Context) {
|
|
||||||
var req bundle.BundleDetailRequest
|
|
||||||
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.BundleDetailV2(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
func HandShelf(c *gin.Context) {
|
|
||||||
var req bundle.HandShelfRequest
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
res, err := service.BundleProvider.HandShelf(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
@ -9,9 +9,8 @@ const (
|
|||||||
|
|
||||||
// 订单
|
// 订单
|
||||||
const (
|
const (
|
||||||
MissOrderNo = "缺少订单号"
|
MissOrderNo = "缺少订单号"
|
||||||
MissOrderUUID = "缺少订单信息"
|
MissOrderUUID = "缺少订单信息"
|
||||||
MissLanguageTypes = "缺少语言类型"
|
|
||||||
|
|
||||||
NotMatchOrderInfo = "非当前用户订单信息不可操作"
|
NotMatchOrderInfo = "非当前用户订单信息不可操作"
|
||||||
InvalidOrderAmount = "订单金额错误"
|
InvalidOrderAmount = "订单金额错误"
|
||||||
|
@ -67,49 +67,3 @@ func ValueAddBundleDetail(c *gin.Context) {
|
|||||||
|
|
||||||
service.Success1(c, res.Msg, res)
|
service.Success1(c, res.Msg, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SaveValueAddService(c *gin.Context) {
|
|
||||||
var req bundle.ValueAddServiceLang
|
|
||||||
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
||||||
service.Error1(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.SaveValueAddService(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
func ValueAddServiceList(c *gin.Context) {
|
|
||||||
var req bundle.ValueAddServiceListRequest
|
|
||||||
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
||||||
service.Error1(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.ValueAddServiceList(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
func ValueAddServiceDetail(c *gin.Context) {
|
|
||||||
var req bundle.ValueAddServiceDetailRequest
|
|
||||||
|
|
||||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
||||||
service.Error1(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := service.BundleProvider.ValueAddServiceDetail(context.Background(), &req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(c, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(c, res)
|
|
||||||
}
|
|
||||||
|
@ -1,118 +0,0 @@
|
|||||||
package cast
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"errors"
|
|
||||||
"fonchain-fiee/api/accountFiee"
|
|
||||||
"fonchain-fiee/api/cast"
|
|
||||||
"fonchain-fiee/cmd/config"
|
|
||||||
"fonchain-fiee/pkg/e"
|
|
||||||
"fonchain-fiee/pkg/service"
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"strconv"
|
|
||||||
)
|
|
||||||
|
|
||||||
func MediaUserList(ctx *gin.Context) {
|
|
||||||
var req *cast.MediaUserListReq
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if err = req.Validate(); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, err := service.CastProvider.MediaUserList(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func UnbindManager(ctx *gin.Context) {
|
|
||||||
var req *cast.UnbindManagerReq
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if err = req.Validate(); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, err = service.CastProvider.UnbindManager(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, nil)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func BindManager(ctx *gin.Context) {
|
|
||||||
var req *cast.BindManagerReq
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if err = req.Validate(); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, err = service.CastProvider.BindManager(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, nil)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func UpdateMediaAccount(ctx *gin.Context) {
|
|
||||||
var req *cast.UpdateMediaAccountReq
|
|
||||||
var infoResp *accountFiee.UserInfoResponse
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if err = req.Validate(); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 查询艺人的信息
|
|
||||||
// 字符串转整型
|
|
||||||
artistID, err := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
|
||||||
if config.AppConfig.System.AppMode != "dev" {
|
|
||||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
|
||||||
ID: artistID,
|
|
||||||
Domain: "app",
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
infoResp = &accountFiee.UserInfoResponse{
|
|
||||||
Name: "小波",
|
|
||||||
TelNum: "18288888888",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req.ArtistName = infoResp.Name
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
|
||||||
if _, ok := cast.PlatformIDENUM_name[int32(req.PlatformID)]; !ok {
|
|
||||||
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, err := service.CastProvider.UpdateMediaAccount(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
package cast
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fonchain-fiee/api/accountFiee"
|
|
||||||
"fonchain-fiee/api/cast"
|
|
||||||
"fonchain-fiee/cmd/config"
|
|
||||||
"fonchain-fiee/pkg/service"
|
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
"strconv"
|
|
||||||
)
|
|
||||||
|
|
||||||
func UpdateWorkImage(ctx *gin.Context) {
|
|
||||||
var req *cast.UpdateWorkImageReq
|
|
||||||
var infoResp *accountFiee.UserInfoResponse
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if config.AppConfig.System.AppMode != "dev" {
|
|
||||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
|
||||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
|
||||||
ID: artistId,
|
|
||||||
Domain: "app",
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
infoResp = &accountFiee.UserInfoResponse{
|
|
||||||
Name: "小波",
|
|
||||||
TelNum: "18288888888",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
|
||||||
resp, err := service.CastProvider.UpdateWorkImage(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func UpdateWorkVideo(ctx *gin.Context) {
|
|
||||||
var req *cast.UpdateWorkVideoReq
|
|
||||||
var infoResp *accountFiee.UserInfoResponse
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if config.AppConfig.System.AppMode != "dev" {
|
|
||||||
artistId, _ := strconv.ParseUint(req.ArtistUuid, 10, 64)
|
|
||||||
infoResp, err = service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
|
|
||||||
ID: artistId,
|
|
||||||
Domain: "app",
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
infoResp = &accountFiee.UserInfoResponse{
|
|
||||||
Name: "小波",
|
|
||||||
TelNum: "18288888888",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
|
||||||
resp, err := service.CastProvider.UpdateWorkVideo(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,254 +0,0 @@
|
|||||||
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))
|
|
||||||
}
|
|
@ -1,91 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
@ -1,20 +1,17 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"dubbo.apache.org/dubbo-go/v3/common/constant"
|
||||||
|
"dubbo.apache.org/dubbo-go/v3/config"
|
||||||
|
_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fonchain-fiee/api/account"
|
"fonchain-fiee/api/account"
|
||||||
"fonchain-fiee/api/accountFiee"
|
"fonchain-fiee/api/accountFiee"
|
||||||
"fonchain-fiee/api/bundle"
|
"fonchain-fiee/api/bundle"
|
||||||
"fonchain-fiee/api/cast"
|
|
||||||
"fonchain-fiee/api/files"
|
|
||||||
"fonchain-fiee/api/order"
|
"fonchain-fiee/api/order"
|
||||||
"fonchain-fiee/api/payment"
|
"fonchain-fiee/api/payment"
|
||||||
pkConfig "fonchain-fiee/pkg/config"
|
pkConfig "fonchain-fiee/pkg/config"
|
||||||
"os"
|
"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)
|
var AccountProvider = new(account.AccountClientImpl)
|
||||||
@ -22,9 +19,7 @@ var AccountFieeProvider = new(accountFiee.AccountFieeClientImpl)
|
|||||||
|
|
||||||
var BundleProvider = new(bundle.BundleClientImpl)
|
var BundleProvider = new(bundle.BundleClientImpl)
|
||||||
var OrderProvider = new(order.OrderClientImpl)
|
var OrderProvider = new(order.OrderClientImpl)
|
||||||
var FilesProvider = new(files.FileClientImpl)
|
|
||||||
var PaymentProvider = new(payment.PaymentCentClientImpl)
|
var PaymentProvider = new(payment.PaymentCentClientImpl)
|
||||||
var CastProvider = new(cast.CastClientImpl)
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
config.SetConsumerService(BundleProvider)
|
config.SetConsumerService(BundleProvider)
|
||||||
@ -32,8 +27,6 @@ func init() {
|
|||||||
config.SetConsumerService(AccountProvider)
|
config.SetConsumerService(AccountProvider)
|
||||||
config.SetConsumerService(PaymentProvider)
|
config.SetConsumerService(PaymentProvider)
|
||||||
config.SetConsumerService(AccountFieeProvider)
|
config.SetConsumerService(AccountFieeProvider)
|
||||||
config.SetConsumerService(CastProvider)
|
|
||||||
config.SetConsumerService(FilesProvider)
|
|
||||||
|
|
||||||
if err := config.Load(); err != nil {
|
if err := config.Load(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user