Compare commits

..

No commits in common. "0d28141f653d4c2b7e733d59efb4e4b18d3787c4" and "73ad76501c8886b28081eac8bc60edd4b6063f00" have entirely different histories.

16 changed files with 3679 additions and 2175 deletions

File diff suppressed because it is too large Load Diff

View File

@ -62,9 +62,6 @@ service AccountFiee {
rpc VerifySliderCaptcha(VerifySliderCaptchaRequest) returns (VerifySliderCaptchaResponse) {}// rpc VerifySliderCaptcha(VerifySliderCaptchaRequest) returns (VerifySliderCaptchaResponse) {}//
rpc SendNationMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} // -- rpc SendNationMsg (SendNationMsgRequest) returns (SendMsgStatusResponse) {} // --
rpc VerifySliderStatus(VerifySliderStatusRequest) returns (VerifySliderStatusResponse) {}// rpc VerifySliderStatus(VerifySliderStatusRequest) returns (VerifySliderStatusResponse) {}//
// submit info
rpc SaveSubmitInfo(SubmitInfoRequest) returns (CommonResponse);
} }
message VerifySliderStatusRequest { message VerifySliderStatusRequest {
@ -156,8 +153,6 @@ message UserListRequest{
int32 auditStatus = 7; int32 auditStatus = 7;
uint64 page = 8; uint64 page = 8;
uint64 pageSize = 9; uint64 pageSize = 9;
string blurNameTel = 10;
repeated int64 ids = 11;
} }
message UserInfoResponse{ message UserInfoResponse{
uint64 id = 1; uint64 id = 1;
@ -823,10 +818,3 @@ message ClockLogListResponse{
repeated ClockLogInfo data =1; repeated ClockLogInfo data =1;
uint64 count = 2; uint64 count = 2;
} }
message SubmitInfoRequest{
string firstName = 1;
string lastName = 2;
string email = 3;
string company = 4;
string phone = 5;
}

View File

@ -522,6 +522,3 @@ func (this *ClockLogListResponse) Validate() error {
} }
return nil return nil
} }
func (this *SubmitInfoRequest) Validate() error {
return nil
}

View File

@ -68,8 +68,6 @@ type AccountFieeClient interface {
VerifySliderCaptcha(ctx context.Context, in *VerifySliderCaptchaRequest, opts ...grpc_go.CallOption) (*VerifySliderCaptchaResponse, common.ErrorWithAttachment) VerifySliderCaptcha(ctx context.Context, in *VerifySliderCaptchaRequest, opts ...grpc_go.CallOption) (*VerifySliderCaptchaResponse, common.ErrorWithAttachment)
SendNationMsg(ctx context.Context, in *SendNationMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment) SendNationMsg(ctx context.Context, in *SendNationMsgRequest, opts ...grpc_go.CallOption) (*SendMsgStatusResponse, common.ErrorWithAttachment)
VerifySliderStatus(ctx context.Context, in *VerifySliderStatusRequest, opts ...grpc_go.CallOption) (*VerifySliderStatusResponse, common.ErrorWithAttachment) VerifySliderStatus(ctx context.Context, in *VerifySliderStatusRequest, opts ...grpc_go.CallOption) (*VerifySliderStatusResponse, common.ErrorWithAttachment)
// submit info
SaveSubmitInfo(ctx context.Context, in *SubmitInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
} }
type accountFieeClient struct { type accountFieeClient struct {
@ -116,7 +114,6 @@ type AccountFieeClientImpl struct {
VerifySliderCaptcha func(ctx context.Context, in *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error) VerifySliderCaptcha func(ctx context.Context, in *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error)
SendNationMsg func(ctx context.Context, in *SendNationMsgRequest) (*SendMsgStatusResponse, error) SendNationMsg func(ctx context.Context, in *SendNationMsgRequest) (*SendMsgStatusResponse, error)
VerifySliderStatus func(ctx context.Context, in *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error) VerifySliderStatus func(ctx context.Context, in *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error)
SaveSubmitInfo func(ctx context.Context, in *SubmitInfoRequest) (*CommonResponse, error)
} }
func (c *AccountFieeClientImpl) GetDubboStub(cc *triple.TripleConn) AccountFieeClient { func (c *AccountFieeClientImpl) GetDubboStub(cc *triple.TripleConn) AccountFieeClient {
@ -365,12 +362,6 @@ func (c *accountFieeClient) VerifySliderStatus(ctx context.Context, in *VerifySl
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/VerifySliderStatus", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/VerifySliderStatus", in, out)
} }
func (c *accountFieeClient) SaveSubmitInfo(ctx context.Context, in *SubmitInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SaveSubmitInfo", in, out)
}
// AccountFieeServer is the server API for AccountFiee service. // AccountFieeServer is the server API for AccountFiee service.
// All implementations must embed UnimplementedAccountFieeServer // All implementations must embed UnimplementedAccountFieeServer
// for forward compatibility // for forward compatibility
@ -415,8 +406,6 @@ type AccountFieeServer interface {
VerifySliderCaptcha(context.Context, *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error) VerifySliderCaptcha(context.Context, *VerifySliderCaptchaRequest) (*VerifySliderCaptchaResponse, error)
SendNationMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error) SendNationMsg(context.Context, *SendNationMsgRequest) (*SendMsgStatusResponse, error)
VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error) VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error)
// submit info
SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error)
mustEmbedUnimplementedAccountFieeServer() mustEmbedUnimplementedAccountFieeServer()
} }
@ -542,9 +531,6 @@ func (UnimplementedAccountFieeServer) SendNationMsg(context.Context, *SendNation
func (UnimplementedAccountFieeServer) VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error) { func (UnimplementedAccountFieeServer) VerifySliderStatus(context.Context, *VerifySliderStatusRequest) (*VerifySliderStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method VerifySliderStatus not implemented") return nil, status.Errorf(codes.Unimplemented, "method VerifySliderStatus not implemented")
} }
func (UnimplementedAccountFieeServer) SaveSubmitInfo(context.Context, *SubmitInfoRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SaveSubmitInfo not implemented")
}
func (s *UnimplementedAccountFieeServer) XXX_SetProxyImpl(impl protocol.Invoker) { func (s *UnimplementedAccountFieeServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl s.proxyImpl = impl
} }
@ -1704,35 +1690,6 @@ func _AccountFiee_VerifySliderStatus_Handler(srv interface{}, ctx context.Contex
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _AccountFiee_SaveSubmitInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SubmitInfoRequest)
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("SaveSubmitInfo", 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)
}
// AccountFiee_ServiceDesc is the grpc_go.ServiceDesc for AccountFiee service. // AccountFiee_ServiceDesc is the grpc_go.ServiceDesc for AccountFiee 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)
@ -1896,10 +1853,6 @@ var AccountFiee_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "VerifySliderStatus", MethodName: "VerifySliderStatus",
Handler: _AccountFiee_VerifySliderStatus_Handler, Handler: _AccountFiee_VerifySliderStatus_Handler,
}, },
{
MethodName: "SaveSubmitInfo",
Handler: _AccountFiee_SaveSubmitInfo_Handler,
},
}, },
Streams: []grpc_go.StreamDesc{}, Streams: []grpc_go.StreamDesc{},
Metadata: "api/accountFiee/accountFiee.proto", Metadata: "api/accountFiee/accountFiee.proto",

File diff suppressed because it is too large Load Diff

View File

@ -293,6 +293,9 @@ func (this *BundleExtendRecordsListResponse) Validate() error {
func (this *BundleExtendRecordItem) Validate() error { func (this *BundleExtendRecordItem) Validate() error {
return nil return nil
} }
func (this *GetBundleBalanceListReq) Validate() error {
return nil
}
func (this *GetBundleBalanceReq) Validate() error { func (this *GetBundleBalanceReq) Validate() error {
return nil return nil
} }
@ -309,3 +312,59 @@ func (this *GetBundleBalanceResp) Validate() error {
} }
return nil return nil
} }
func (this *GetBundleBalanceListResp) 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 *CreateBundleBalanceReq) Validate() error {
return nil
}
func (this *CreateBundleBalanceResp) Validate() error {
return nil
}
func (this *AddBundleBalanceReq) Validate() error {
return nil
}
func (this *AddBundleBalanceResp) Validate() error {
return nil
}
func (this *GetUsedRecordListReq) Validate() error {
return nil
}
func (this *GetUsedRecordListResp) 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 *WorkCastItem) Validate() error {
return nil
}
func (this *GetImageWorkDetailReq) Validate() error {
return nil
}
func (this *GetVedioWorkDetailReq) Validate() error {
return nil
}
func (this *GetImageWorkDetailResp) Validate() error {
return nil
}
func (this *GetVedioeWorkDetailResp) Validate() error {
return nil
}
func (this *ToBeComfirmedWorksReq) Validate() error {
return nil
}
func (this *ToBeComfirmedWorksResp) Validate() error {
return nil
}

View File

@ -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.20.3
// source: pb/bundle.proto // source: pb/bundle.proto
package bundle package bundle
@ -59,7 +59,14 @@ type BundleClient interface {
// 余量管理 // 余量管理
BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, 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) BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment)
GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment) GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment)
CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment)
AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment)
// 使用记录
GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment)
GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment)
GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment)
ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment)
} }
type bundleClient struct { type bundleClient struct {
@ -95,7 +102,13 @@ type BundleClientImpl struct {
CalculatePrice func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error) CalculatePrice func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error)
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error) BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalance func(ctx context.Context, in *GetBundleBalanceReq) (*GetBundleBalanceResp, error) GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
GetImageWorkDetail func(ctx context.Context, in *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
GetVedioWorkDetail func(ctx context.Context, in *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
ToBeComfirmedWorks func(ctx context.Context, in *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
} }
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient { func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -278,10 +291,46 @@ func (c *bundleClient) BundleExtendRecordsList(ctx context.Context, in *BundleEx
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleExtendRecordsList", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleExtendRecordsList", in, out)
} }
func (c *bundleClient) GetBundleBalance(ctx context.Context, in *GetBundleBalanceReq, opts ...grpc_go.CallOption) (*GetBundleBalanceResp, common.ErrorWithAttachment) { func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment) {
out := new(GetBundleBalanceResp) out := new(GetBundleBalanceListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string) interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalance", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceList", in, out)
}
func (c *bundleClient) CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment) {
out := new(CreateBundleBalanceResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateBundleBalance", in, out)
}
func (c *bundleClient) AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment) {
out := new(AddBundleBalanceResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AddBundleBalance", in, out)
}
func (c *bundleClient) GetUsedRecordList(ctx context.Context, in *GetUsedRecordListReq, opts ...grpc_go.CallOption) (*GetUsedRecordListResp, common.ErrorWithAttachment) {
out := new(GetUsedRecordListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetUsedRecordList", in, out)
}
func (c *bundleClient) GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment) {
out := new(GetImageWorkDetailResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetImageWorkDetail", in, out)
}
func (c *bundleClient) GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment) {
out := new(GetVedioeWorkDetailResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetVedioWorkDetail", in, out)
}
func (c *bundleClient) ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment) {
out := new(ToBeComfirmedWorksResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ToBeComfirmedWorks", in, out)
} }
// BundleServer is the server API for Bundle service. // BundleServer is the server API for Bundle service.
@ -319,7 +368,14 @@ type BundleServer interface {
// 余量管理 // 余量管理
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
// 使用记录
GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
mustEmbedUnimplementedBundleServer() mustEmbedUnimplementedBundleServer()
} }
@ -412,8 +468,26 @@ func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequ
func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) { func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleExtendRecordsList not implemented") return nil, status.Errorf(codes.Unimplemented, "method BundleExtendRecordsList not implemented")
} }
func (UnimplementedBundleServer) GetBundleBalance(context.Context, *GetBundleBalanceReq) (*GetBundleBalanceResp, error) { func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalance not implemented") return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented")
}
func (UnimplementedBundleServer) CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateBundleBalance not implemented")
}
func (UnimplementedBundleServer) AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddBundleBalance not implemented")
}
func (UnimplementedBundleServer) GetUsedRecordList(context.Context, *GetUsedRecordListReq) (*GetUsedRecordListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUsedRecordList not implemented")
}
func (UnimplementedBundleServer) GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetImageWorkDetail not implemented")
}
func (UnimplementedBundleServer) GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetVedioWorkDetail not implemented")
}
func (UnimplementedBundleServer) ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented")
} }
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) { func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl s.proxyImpl = impl
@ -1255,8 +1329,8 @@ func _Bundle_BundleExtendRecordsList_Handler(srv interface{}, ctx context.Contex
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleBalanceReq) in := new(GetBundleBalanceListReq)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -1268,7 +1342,181 @@ func _Bundle_GetBundleBalance_Handler(srv interface{}, ctx context.Context, dec
for k, v := range md { for k, v := range md {
invAttachment[k] = v invAttachment[k] = v
} }
invo := invocation.NewRPCInvocation("GetBundleBalance", args, invAttachment) invo := invocation.NewRPCInvocation("GetBundleBalanceList", 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_CreateBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateBundleBalanceReq)
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("CreateBundleBalance", 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_AddBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(AddBundleBalanceReq)
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("AddBundleBalance", 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_GetUsedRecordList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetUsedRecordListReq)
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("GetUsedRecordList", 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_GetImageWorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetImageWorkDetailReq)
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("GetImageWorkDetail", 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_GetVedioWorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetVedioWorkDetailReq)
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("GetVedioWorkDetail", 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_ToBeComfirmedWorks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ToBeComfirmedWorksReq)
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("ToBeComfirmedWorks", args, invAttachment)
if interceptor == nil { if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo) result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error() return result, result.Error()
@ -1404,8 +1652,32 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
Handler: _Bundle_BundleExtendRecordsList_Handler, Handler: _Bundle_BundleExtendRecordsList_Handler,
}, },
{ {
MethodName: "GetBundleBalance", MethodName: "GetBundleBalanceList",
Handler: _Bundle_GetBundleBalance_Handler, Handler: _Bundle_GetBundleBalanceList_Handler,
},
{
MethodName: "CreateBundleBalance",
Handler: _Bundle_CreateBundleBalance_Handler,
},
{
MethodName: "AddBundleBalance",
Handler: _Bundle_AddBundleBalance_Handler,
},
{
MethodName: "GetUsedRecordList",
Handler: _Bundle_GetUsedRecordList_Handler,
},
{
MethodName: "GetImageWorkDetail",
Handler: _Bundle_GetImageWorkDetail_Handler,
},
{
MethodName: "GetVedioWorkDetail",
Handler: _Bundle_GetVedioWorkDetail_Handler,
},
{
MethodName: "ToBeComfirmedWorks",
Handler: _Bundle_ToBeComfirmedWorks_Handler,
}, },
}, },
Streams: []grpc_go.StreamDesc{}, Streams: []grpc_go.StreamDesc{},

View File

@ -57,10 +57,6 @@ var EnMessages = map[string]string{
"服务器错误": "Server error", "服务器错误": "Server error",
"验证失败,请控制拼图对齐缺口": "Verification failed, please control puzzle alignment gap", "验证失败,请控制拼图对齐缺口": "Verification failed, please control puzzle alignment gap",
"滑块验证状态不存在,请退出重试": "The slider verification status does not exist. Please exit and try again", "滑块验证状态不存在,请退出重试": "The slider verification status does not exist. Please exit and try again",
"请先实名": "Please use your real name first",
"实名审核中": "Real-name verification is underway",
"实名审核失败": "The real-name verification failed",
"未知实名状态": "Unknown real-name status",
} }
var DeDEMessages = map[string]string{ var DeDEMessages = map[string]string{
@ -112,10 +108,6 @@ var DeDEMessages = map[string]string{
"服务器错误": "Serverfehler", "服务器错误": "Serverfehler",
"验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke", "验证失败,请控制拼图对齐缺口": "Überprüfung fehlgeschlagen, bitte Steuerung Puzzle-Ausrichtungslücke",
"滑块验证状态不存在,请退出重试": "Die krümmbestätigung existiert nicht. Bitte beenden sie den vorgang", "滑块验证状态不存在,请退出重试": "Die krümmbestätigung existiert nicht. Bitte beenden sie den vorgang",
"请先实名": "Bitte, nur der name",
"实名审核中": "Contest läuft",
"实名审核失败": "Die confirmation hat versagt",
"未知实名状态": "Noch nicht registriert",
} }
var JaJPMessages = map[string]string{ var JaJPMessages = map[string]string{
@ -167,10 +159,6 @@ var JaJPMessages = map[string]string{
"服务器错误": "サーバーエラー", "服务器错误": "サーバーエラー",
"验证失败,请控制拼图对齐缺口": "検証に失敗しました。パズルの整列ギャップを制御してください", "验证失败,请控制拼图对齐缺口": "検証に失敗しました。パズルの整列ギャップを制御してください",
"滑块验证状态不存在,请退出重试": "スライダー検証状態が存在しません,リトライをログアウトしてください", "滑块验证状态不存在,请退出重试": "スライダー検証状態が存在しません,リトライをログアウトしてください",
"请先实名": "まずは実名でお願いします",
"实名审核中": "実名審査中です",
"实名审核失败": "実名検証失敗です",
"未知实名状态": "未知の実名状態です",
} }
var ZhTWMessages = map[string]string{ var ZhTWMessages = map[string]string{
@ -222,8 +210,4 @@ var ZhTWMessages = map[string]string{
"服务器错误": "服務器錯誤", "服务器错误": "服務器錯誤",
"验证失败,请控制拼图对齐缺口": "驗證失敗,請控制拼圖對齊缺口", "验证失败,请控制拼图对齐缺口": "驗證失敗,請控制拼圖對齊缺口",
"滑块验证状态不存在,请退出重试": "滑塊驗證狀態不存在,請退出重試", "滑块验证状态不存在,请退出重试": "滑塊驗證狀態不存在,請退出重試",
"请先实名": "請先實名",
"实名审核中": "實名審覈中",
"实名审核失败": "實名審覈失敗",
"未知实名状态": "未知實名狀態",
} }

View File

@ -152,7 +152,6 @@ func CheckWebLogin(provider *account.AccountClientImpl) gin.HandlerFunc {
Domain: info.Domain, Domain: info.Domain,
ID: info.ID, ID: info.ID,
Name: info.NickName, Name: info.NickName,
//Account: info.Account,
//NickName: info.NickName, //NickName: info.NickName,
//PositionUsers: qres.PositionUsers, //PositionUsers: qres.PositionUsers,
//Extend: infoRes.Info.Extend, //Extend: infoRes.Info.Extend,

View File

@ -12,7 +12,7 @@ func BundleOrderRouter(r *gin.RouterGroup) {
r.POST("/stripe-pay/callback", bundle.StripeCheckoutSessionWebhook) r.POST("/stripe-pay/callback", bundle.StripeCheckoutSessionWebhook)
r.POST("/antom/callback", bundle.AntomWebhook) // Antom回调 r.POST("/antom/callback", bundle.AntomWebhook) // Antom回调
r.POST("/home-page/roll", bundle.HomePageRoll)
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")
@ -23,7 +23,6 @@ func BundleOrderRouter(r *gin.RouterGroup) {
bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web") bundleOrderClientWebRoute := bundleOrderWebRoute.Group("common/web")
{ {
bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList) bundleOrderClientWebRoute.POST("bundle-order-list", bundle.OrderRecordsList)
bundleOrderClientWebRoute.POST("bundle-order-list-V2", bundle.OrderRecordsListV2)
} }
bundleOrderClientAppRoute := bundleOrderRoute.Group("common/app") bundleOrderClientAppRoute := bundleOrderRoute.Group("common/app")
{ {
@ -39,7 +38,6 @@ func BundleOrderRouter(r *gin.RouterGroup) {
bundleOrderAppRoute := bundleOrderRoute.Group("app") bundleOrderAppRoute := bundleOrderRoute.Group("app")
{ {
bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature) bundleOrderAppRoute.POST("order-signature", bundle.CreateBundleOrderSignature)
bundleOrderAppRoute.POST("order-add-signature", bundle.CreateBundleOrderAddSignature)
bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid) bundleOrderAppRoute.POST("update-pay", bundle.UpdateBundleOrderStatusPaid)
bundleOrderAppRoute.POST("order-detail", bundle.OrderRecordsDetail) bundleOrderAppRoute.POST("order-detail", bundle.OrderRecordsDetail)

View File

@ -66,7 +66,7 @@ func NewRouter() *gin.Engine {
} }
webAcRouter := privateGroup.Group("/user") webAcRouter := privateGroup.Group("/user")
//webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider)) //webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
webAcRouter.Use(middleware.CheckWebLogin(service.AccountProvider)) webAcRouter.Use(middleware.CheckLogin(service.AccountFieeProvider))
{ {
webAcRouter.POST("list", account.UserList) //用户列表 webAcRouter.POST("list", account.UserList) //用户列表
webAcRouter.POST("approval", account.UserApproval) //实名审核 webAcRouter.POST("approval", account.UserApproval) //实名审核

View File

@ -12,165 +12,17 @@ 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"
"strconv" "strconv"
"strings" "strings"
"time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
) )
func CreateBundleOrderAddSignature(c *gin.Context) {
var req bundle.OrderAddRecord
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
if req.Language == "" {
service.Error(c, errors.New(common.MissLanguageTypes))
return
}
if req.BundleUuid == "" {
service.Error(c, errors.New(common.MissOrderNo))
return
}
// 获取用户信息
userInfo := login.GetUserInfoFromC(c)
if msg, exists := map[int32]string{
1: common.Unnamed,
2: common.UnderReview,
3: common.ReviewFailed,
}[userInfo.Status]; userInfo.Status != 4 {
if exists {
service.Error(c, errors.New(msg))
} else {
service.Error(c, errors.New(common.UnknownStatus))
}
return
}
// 校验套餐是否已购买
orderRecordReq := bundle.OrderRecordsDetailRequest{
BundleUUID: req.BundleUuid,
CustomerID: strconv.FormatUint(userInfo.ID, 10),
}
orderRecordResp, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &orderRecordReq)
if err != nil {
service.Error(c, err)
return
}
if orderRecordResp.OrderRecord.ExpirationTime == "" || orderRecordResp.OrderRecord.ExpirationTime < time.Now().Format("2006-01-02") {
service.Error(c, errors.New(common.ThePackageHasExpired))
return
}
// 获取套餐详情(待替换逻辑)
bundleDetail, err := service.BundleProvider.BundleDetail(context.Background(), &bundle.BundleDetailRequest{
Uuid: req.BundleUuid,
})
if err != nil {
service.Error(c, err)
return
}
// todo 需要判断购买的增值服务是否为可用时长 如果为可以用时长 合同截止日期为购买时长时间 否则合同截止日期为主套餐截止日期
// 处理多个增值服务
type ValueAddServiceInfo struct {
Service *bundle.ValueAddServiceLang
Options *bundle.ValueAddPriceOptions
ID int32
}
// 计算总金额和确定截止日期
var expirationDate string
var addPriceList []*bundle.AddPriceOptionsInfo
var totalAmount float32
for _, svc := range req.AddPriceOptionsList {
valueAddInfo, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &bundle.ValueAddServiceDetailRequest{
Uuid: svc.ValueUid,
Language: req.Language,
})
if err != nil {
service.Error(c, err)
return
}
valuePrice, err := service.BundleProvider.CalculatePrice(context.Background(), &bundle.CalculatePriceRequest{
Uuid: svc.ValueUid,
Num: svc.Num,
Language: req.Language,
})
if err != nil {
service.Error(c, err)
return
}
totalAmount += valuePrice.Price
addPriceList = append(addPriceList, &bundle.AddPriceOptionsInfo{
ValueUid: valueAddInfo.Uuid,
ServiceType: valueAddInfo.ServiceType,
CurrencyType: valueAddInfo.PriceType,
Amount: valuePrice.Price,
Num: svc.Num,
Unit: valueAddInfo.Unit,
})
// 如果是可用时长服务,计算新的截止日期
if valueAddInfo.ServiceType == 5 {
endDate := orderRecordResp.OrderRecord.ExpirationTime
if endDate == "9999-12-31" {
service.Error(c, errors.New(common.ErrorPermanentPackage))
return
}
t, err := time.Parse("2006-01-02", endDate)
if err != nil {
fmt.Println("解析时间出错:", err)
return
}
newDeadline := calculateExpirationDate(t, svc.Num, valueAddInfo.Unit)
expirationDate = newDeadline
//}
}
}
// 如果没有可用时长服务,使用主套餐截止日期
if expirationDate == "" {
expirationDate = orderRecordResp.OrderRecord.ExpirationTime
}
req.CustomerNum = userInfo.SubNum
req.CustomerName = userInfo.Name
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
req.Source = 2
req.SignedTime = common.GetBeijingTime()
req.ExpirationDate = expirationDate
req.AddPriceOptionsList = addPriceList
req.OrderUUID = orderRecordResp.OrderRecord.Uuid
// 当前 未将 签名 写入合同中
signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, totalAmount, expirationDate)
if signContractErr != nil {
service.Error(c, signContractErr)
return
}
req.SignContract = signContract
// 创建增值服务订单记录
res, err := service.BundleProvider.CreateOrderAddRecord(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, res)
}
// 计算截止日期辅助函数
func calculateExpirationDate(startDate time.Time, num int32, unit string) string {
//now := time.Now()
switch unit {
case "天":
return startDate.AddDate(0, 0, int(num)).Format("2006-01-02")
case "月":
return startDate.AddDate(0, int(num), 0).Format("2006-01-02")
case "年":
return startDate.AddDate(int(num), 0, 0).Format("2006-01-02")
default:
return ""
}
}
func CreateBundleOrderSignature(c *gin.Context) { func CreateBundleOrderSignature(c *gin.Context) {
var req bundle.OrderCreateRecord var req bundle.OrderRecord
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err) service.Error(c, err)
@ -181,31 +33,16 @@ 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))
return return
}*/ }*/
statusMessages := map[int32]string{
1: common.Unnamed,
2: common.UnderReview,
3: common.ReviewFailed,
}
// 获取 用户信息 // 获取 用户信息
userInfo := login.GetUserInfoFromC(c) userInfo := login.GetUserInfoFromC(c)
if userInfo.Status != 4 {
if msg, exists := statusMessages[userInfo.Status]; exists {
service.Error(c, errors.New(msg))
return
} else {
service.Error(c, errors.New(common.UnknownStatus))
return
}
}
// 校验 当前用户只能买一次套餐 // 校验 当前用户只能买一次套餐
orderRecordsListReq := bundle.OrderRecordsRequest{ orderRecordsListReq := bundle.OrderRecordsRequest{
CustomerID: strconv.FormatUint(userInfo.ID, 10), CustomerID: strconv.FormatUint(userInfo.ID, 10),
@ -215,10 +52,10 @@ func CreateBundleOrderSignature(c *gin.Context) {
service.Error(c, orderRecordsListErr) service.Error(c, orderRecordsListErr)
return return
} }
//有套餐并且套餐未过期
if orderRecordsList.OrderRecords != nil { if orderRecordsList.OrderRecords != nil {
for _, orderInfo := range orderRecordsList.OrderRecords { for _, order := range orderRecordsList.OrderRecords {
if orderInfo.CustomerID == strconv.FormatUint(userInfo.ID, 10) && orderInfo.ExpirationTime > time.Now().Format("2006-01-02") { if order.CustomerID == strconv.FormatUint(userInfo.ID, 10) {
service.Error(c, errors.New(common.HadOrder)) service.Error(c, errors.New(common.HadOrder))
return return
} }
@ -235,12 +72,19 @@ func CreateBundleOrderSignature(c *gin.Context) {
service.Error(c, lastOrderRecordErr) service.Error(c, lastOrderRecordErr)
return return
} }
lastContractNo := "" lastContractNo := ""
if lastOrderRecord.OrderRecords != nil { if lastOrderRecord.OrderRecords != nil {
for _, lastOrder := range lastOrderRecord.OrderRecords { for _, lastOrder := range lastOrderRecord.OrderRecords {
lastContractNo = lastOrder.ContractNo lastContractNo = lastOrder.ContractNo
} }
} }
req.CustomerNum = userInfo.SubNum
req.CustomerName = userInfo.Name
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
// 获取 套餐信息 // 获取 套餐信息
bundleDetailReq := &bundle.BundleDetailRequest{ bundleDetailReq := &bundle.BundleDetailRequest{
Uuid: req.BundleUuid, Uuid: req.BundleUuid,
@ -250,73 +94,62 @@ func CreateBundleOrderSignature(c *gin.Context) {
service.Error(c, detailErr) service.Error(c, detailErr)
return return
} }
//获取过期时间和增值服务金额
var addRecords []*bundle.OrderCreateAddRecord //获取增值套餐信息
var addTotalPrice float32 if req.ValueAddBundleUuid != "" {
var expirationDay string valueAddBundleDetail, err := service.BundleProvider.ValueAddBundleDetail(context.Background(), &bundle.ValueAddBundleDetailRequest{
for _, i := range req.AddRecords { Uuid: req.ValueAddBundleUuid,
price, err := service.BundleProvider.CalculatePrice(context.Background(), &bundle.CalculatePriceRequest{
Uuid: i.ValueUid,
Num: i.Num,
Language: req.Language,
}) })
if err != nil { if err != nil {
service.Error(c, err) service.Error(c, err)
return return
} }
addTotalPrice += price.Price
addService, err := service.BundleProvider.ValueAddServiceLangByUuidAndLanguage(context.Background(), &bundle.ValueAddServiceDetailRequest{ req.ValueAddBundleUuid = valueAddBundleDetail.Data.Uuid
Uuid: i.ValueUid, req.ValueAddOriginalPrice = valueAddBundleDetail.Data.OriginalPrice
Language: req.Language, req.ValueAddDiscountPrice = valueAddBundleDetail.Data.DiscountPrice
}) req.AddBundleCommonUid = valueAddBundleDetail.Data.AddBundleCommonUid
if err != nil {
service.Error(c, err) if valueAddBundleDetail.Data.Choose { // 可选条数
return req.ValueAddBundleAmount = valueAddBundleDetail.Data.DiscountPrice * float32(req.Num)
discount, _ := new(big.Float).Sub(big.NewFloat(float64(valueAddBundleDetail.Data.OriginalPrice)), big.NewFloat(float64(valueAddBundleDetail.Data.DiscountPrice))).Float32()
req.ValueAddSavedAmount = discount * float32(req.Num)
} else { // 固定条数
req.ValueAddBundleAmount = valueAddBundleDetail.Data.TotalPrice
req.ValueAddSavedAmount = valueAddBundleDetail.Data.SavedAmount
} }
addRecords = append(addRecords, &bundle.OrderCreateAddRecord{
ServiceType: addService.ServiceType, req.TotalAmount, _ = new(big.Float).Add(big.NewFloat(float64(req.ValueAddBundleAmount)), big.NewFloat(float64(bundleDetail.Bundle.Price))).Float32()
ValueUid: i.ValueUid,
CurrencyType: addService.PriceType,
Amount: price.Price,
Num: i.Num,
Unit: addService.Unit,
Source: 1,
PaymentStatus: 1,
})
//服务类型为时长 计算
if addService.ServiceType == 5 {
expirationDay = calculateExpirationDate(time.Now(), i.Num, addService.Unit)
} else {
expirationDay = time.Now().AddDate(0, 0, 7).Format("2006-01-02")
} }
}
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, addTotalPrice, expirationDay)
if signContractErr != nil {
service.Error(c, signContractErr)
return
}
req.CustomerNum = userInfo.SubNum
req.CustomerName = userInfo.Name
req.CustomerID = strconv.FormatUint(userInfo.ID, 10)
req.BundleName = bundleDetail.Bundle.Name req.BundleName = bundleDetail.Bundle.Name
req.Amount = bundleDetail.Bundle.Price req.Amount = bundleDetail.Bundle.Price
req.AmountType = bundleDetail.Bundle.PriceType req.AmountType = bundleDetail.Bundle.PriceType
req.BundleCommonUid = bundleDetail.Bundle.BundleCommonUid req.BundleCommonUid = bundleDetail.Bundle.BundleCommonUid
req.TotalAmount = bundleDetail.Bundle.Price + addTotalPrice req.TotalAmount = req.Amount + req.ValueAddBundleAmount
req.PayType = 1 // 默认 人民币
req.ContractNo = common.GenerateContractNo(lastContractNo) req.ContractNo = common.GenerateContractNo(lastContractNo)
// 当前 未将 签名 写入合同中
signContract, signContractErr := logic.SignContractV2(req.CustomerNum, bundleDetail.Bundle.Contract, req.TotalAmount, bundleDetail.Bundle.ContractDuration)
if signContractErr != nil {
service.Error(c, signContractErr)
return
}
req.SignContract = signContract req.SignContract = signContract
req.SignedTime = common.GetBeijingTime() req.SignedTime = common.GetBeijingTime()
req.Status = bundleModel.OrderSigned req.Status = bundleModel.OrderSigned
req.AddRecords = addRecords
req.ExpirationTime = expirationDay
req.PayType = 1
res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req) res, err := service.BundleProvider.CreateOrderRecord(context.Background(), &req)
if err != nil { if err != nil {
service.Error(c, err) service.Error(c, err)
return return
} }
service.Success(c, res) service.Success(c, res)
} }
@ -398,87 +231,7 @@ func UpdateBundleOrderStatusPaid(c *gin.Context) {
service.Success(c, nil) service.Success(c, nil)
} }
func OrderRecordsListV2(c *gin.Context) {
var req bundle.OrderRecordsRequestV2
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res := &bundle.OrderRecordsResponseV2{}
// Step 1: 如果有姓名/电话筛选,先查用户列表
if req.CustomerName != "" {
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
BlurNameTel: req.CustomerName,
Domain: "app",
})
if err != nil {
service.Error(c, err)
return
}
if len(userListResp.UserList) == 0 {
// 没查到用户,直接返回空结果
res.Page = req.Page
res.PageSize = req.PageSize
res.Total = 0
service.Success(c, res)
return
}
// 提取用户ID列表
for _, u := range userListResp.UserList {
req.UserIds = append(req.UserIds, int64(u.Id))
}
}
// Step 2: 查询订单列表
orderList, err := service.BundleProvider.OrderRecordsListV2(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
// Step 3: 如果订单不为空,查一次用户信息填充(只查一次)
if len(orderList.BundleInfo) > 0 {
// 收集订单里的所有用户ID
userIdSet := make(map[int64]struct{})
for _, i := range orderList.BundleInfo {
userIdSet[i.CustomerId] = struct{}{}
}
var userIds []int64
for id := range userIdSet {
userIds = append(userIds, id)
}
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
Ids: userIds,
Domain: "app",
})
if err != nil {
service.Error(c, err)
return
}
// 建立用户ID -> 用户信息映射
userMap := make(map[int64]*accountFiee.UserListInfo, len(userListResp.UserList))
for _, u := range userListResp.UserList {
userMap[int64(u.Id)] = u
}
// 填充订单中的用户信息
for _, item := range orderList.BundleInfo {
if u, ok := userMap[item.CustomerId]; ok {
item.CustomerName = u.Name
item.TelNum = u.TelNum
}
}
}
service.Success(c, orderList)
}
func OrderRecordsList(c *gin.Context) { func OrderRecordsList(c *gin.Context) {
var req bundle.OrderRecordsRequest var req bundle.OrderRecordsRequest
@ -534,10 +287,10 @@ func OrderRecordsDetail(c *gin.Context) {
return return
} }
// 获取 用户信息 /*// 获取 用户信息
userInfo := login.GetUserInfoFromC(c) userInfo := login.GetUserInfoFromC(c)
req.CustomerID = strconv.FormatUint(userInfo.ID, 10) req.CustomerID = strconv.FormatUint(userInfo.ID, 10)*/
res, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &req) res, err := service.BundleProvider.OrderRecordsDetail(context.Background(), &req)
if err != nil { if err != nil {

View File

@ -11,7 +11,6 @@ const (
const ( const (
MissOrderNo = "缺少订单号" MissOrderNo = "缺少订单号"
MissOrderUUID = "缺少订单信息" MissOrderUUID = "缺少订单信息"
MissLanguageTypes = "缺少语言类型"
NotMatchOrderInfo = "非当前用户订单信息不可操作" NotMatchOrderInfo = "非当前用户订单信息不可操作"
InvalidOrderAmount = "订单金额错误" InvalidOrderAmount = "订单金额错误"
@ -20,8 +19,6 @@ const (
HadOrder = "您已购买过套餐,无法再次购买" HadOrder = "您已购买过套餐,无法再次购买"
InvalidValueAddBundleNum = "套餐数量无效" InvalidValueAddBundleNum = "套餐数量无效"
ThePackageHasExpired = "当前套餐已过期"
ErrorPermanentPackage = "永久套餐无需购买"
) )
const ( const (
@ -37,12 +34,6 @@ const (
ErrorDownloadFile = "下载文件失败" ErrorDownloadFile = "下载文件失败"
ErrorUploadFile = "上传文件失败" ErrorUploadFile = "上传文件失败"
) )
const (
Unnamed = "请先实名"
UnderReview = "实名审核中"
ReviewFailed = "实名审核失败"
UnknownStatus = "未知实名状态"
)
/*var EnMessages = map[string]string{ /*var EnMessages = map[string]string{
"创建套餐信息失败": "Failed to create bundle information", "创建套餐信息失败": "Failed to create bundle information",

View File

@ -14,7 +14,7 @@ import (
"time" "time"
) )
func SignContractV2(customerNum, contract string, price float32, expirationDate string) (outputUrl string, err error) { func SignContractV2(customerNum, contract string, price float32, contractDuration int64) (outputUrl string, err error) {
filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf" filePath := model.MediaPath + customerNum + time.Now().Format("20060102150405") + ".pdf"
downloadFileErr := DownloadFile(filePath, contract) downloadFileErr := DownloadFile(filePath, contract)
if downloadFileErr != nil { if downloadFileErr != nil {
@ -31,7 +31,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
return outputUrl, errors.New(common.ErrorInsertSignature) return outputUrl, errors.New(common.ErrorInsertSignature)
}*/ }*/
signErr := InsertSignatureV2(filePath, signFile, price, expirationDate) signErr := InsertSignatureV2(filePath, signFile, price, contractDuration)
if signErr != nil { if signErr != nil {
zap.L().Error("insert signature error: ", zap.Error(signErr)) zap.L().Error("insert signature error: ", zap.Error(signErr))
return outputUrl, errors.New(common.ErrorInsertSignature) return outputUrl, errors.New(common.ErrorInsertSignature)
@ -46,7 +46,7 @@ func SignContractV2(customerNum, contract string, price float32, expirationDate
return outputUrl, nil return outputUrl, nil
} }
func InsertSignatureV2(templatePath, outputPath string, price float32, expirationDate string) error { func InsertSignatureV2(templatePath, outputPath string, price float32, contractDuration int64) error {
pdf := gopdf.GoPdf{} pdf := gopdf.GoPdf{}
pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4}) pdf.Start(gopdf.Config{PageSize: *gopdf.PageSizeA4})
@ -90,28 +90,22 @@ func InsertSignatureV2(templatePath, outputPath string, price float32, expiratio
pdf.SetPage(limitTimePage) pdf.SetPage(limitTimePage)
// 英文格式的时间 // 英文格式的时间
parsedTime, err := time.Parse("2006-01-02", expirationDate) t := time.Now().AddDate(int(contractDuration), 0, 0)
if err != nil {
panic("日期格式错误!")
}
year := parsedTime.Format("2006") // "2006"
month := parsedTime.Format("01") // "01"
day := parsedTime.Format("02") // "02"
pdf.SetX(160) pdf.SetX(160)
pdf.SetY(387) pdf.SetY(387)
pdf.Cell(nil, expirationDate) pdf.Cell(nil, t.Format("2006-01-02"))
pdf.SetX(330) pdf.SetX(330)
pdf.SetY(403) pdf.SetY(403)
pdf.Cell(nil, year) pdf.Cell(nil, t.Format("2006"))
pdf.SetX(396) pdf.SetX(396)
pdf.SetY(403) pdf.SetY(403)
pdf.Cell(nil, month) pdf.Cell(nil, t.Format("01"))
pdf.SetX(443) pdf.SetX(443)
pdf.SetY(403) pdf.SetY(403)
pdf.Cell(nil, day) pdf.Cell(nil, t.Format("02"))
// 生成新的 PDF // 生成新的 PDF
if err = pdf.WritePdf(outputPath); err != nil { if err = pdf.WritePdf(outputPath); err != nil {

View File

@ -5,7 +5,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"fonchain-fiee/api/accountFiee"
"fonchain-fiee/api/bundle" "fonchain-fiee/api/bundle"
"fonchain-fiee/api/order" "fonchain-fiee/api/order"
"fonchain-fiee/api/payment" "fonchain-fiee/api/payment"
@ -367,56 +366,3 @@ func AntomWebhook(c *gin.Context) {
} }
service.Success(c) service.Success(c)
} }
func HomePageRoll(c *gin.Context) {
//var req order.HomePageRollRequest
res, err := service.BundleProvider.OrderRecordsListV2(context.Background(), &bundle.OrderRecordsRequestV2{
Page: 1,
PageSize: 5,
})
if err != nil {
service.Error(c, err)
return
}
if len(res.BundleInfo) == 0 {
service.Success(c, nil)
return
}
type Roll struct {
Tel string `json:"tel"`
Name string `json:"name"`
}
var userIds []int64
for _, i := range res.BundleInfo {
userIds = append(userIds, i.CustomerId)
}
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
Ids: userIds,
Domain: "app",
})
if err != nil {
service.Error(c, err)
return
}
// 建立用户ID -> 用户信息映射
userMap := make(map[int64]*accountFiee.UserListInfo, len(userListResp.UserList))
for _, u := range userListResp.UserList {
userMap[int64(u.Id)] = u
}
var roll []Roll
for _, i := range res.BundleInfo {
maskedTel := userMap[i.CustomerId].TelNum
if len(userMap[i.CustomerId].TelNum) >= 11 { // 标准11位手机号
maskedTel = userMap[i.CustomerId].TelNum[:3] + "****" + userMap[i.CustomerId].TelNum[7:]
} else if len(userMap[i.CustomerId].TelNum) >= 7 { // 短号处理
maskedTel = userMap[i.CustomerId].TelNum[:3] + "****" + userMap[i.CustomerId].TelNum[7:]
}
roll = append(roll, Roll{
Tel: maskedTel,
Name: i.BundleName,
})
}
service.Success(c, roll)
return
}

View File

@ -30,9 +30,9 @@ var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl)
func init() { func init() {
config.SetConsumerService(BundleProvider) config.SetConsumerService(BundleProvider)
//config.SetConsumerService(OrderProvider) config.SetConsumerService(OrderProvider)
//config.SetConsumerService(AccountProvider) config.SetConsumerService(AccountProvider)
//config.SetConsumerService(PaymentProvider) config.SetConsumerService(PaymentProvider)
config.SetConsumerService(AccountFieeProvider) config.SetConsumerService(AccountFieeProvider)
config.SetConsumerService(FilesProvider) config.SetConsumerService(FilesProvider)
config.SetConsumerService(GovernanceProvider) config.SetConsumerService(GovernanceProvider)