更新 go.mod

This commit is contained in:
蒋海成 2025-02-20 16:38:16 +08:00
parent 7992569ad6
commit beec72296e
14 changed files with 4019 additions and 135 deletions

1317
api/bundle/bundle.pb.go Normal file

File diff suppressed because it is too large Load Diff

109
api/bundle/bundle.proto Normal file
View File

@ -0,0 +1,109 @@
syntax = "proto3";
package bundle;
option go_package = "./bundle";
service Bundle {
rpc CreateBundle(BundleProfile) returns (CommonResponse) {}
rpc UpdateBundle(BundleProfile) returns (CommonResponse) {}
rpc DeleteBundle(DelBundleRequest) returns (CommonResponse) {}
rpc BundleList(BundleListRequest) returns (BundleListResponse) {}
rpc BundleDetail(BundleDetailRequest) returns (BundleDetailResponse) {}
rpc CreateOrderRecords(OrderRecord) returns (CommonResponse) {}
rpc UpdateOrderRecords(OrderRecord) returns (CommonResponse) {}
rpc OrderRecordsList(OrderRecordsRequest) returns (OrderRecordsResponse) {}
rpc OrderRecordsDetail(OrderRecordsDetailRequest) returns (OrderRecordsDetailResponse) {}
}
message CommonResponse {
string msg = 1 [json_name = "msg"];
}
message BundleProfile {
string uuid = 1 [json_name = "uuid"];
string name = 2 [json_name = "name"];
int64 price = 3 [json_name = "price"];
int64 PriceType = 4 [json_name = "priceType"];
string content = 5 [json_name = "content"];
string contract = 6 [json_name = "contract"];
string language = 7 [json_name = "language"];
string createdAt = 8 [json_name = "createdAt"];
string updatedAt = 9 [json_name = "updatedAt"];
}
message DelBundleRequest {
string uuid = 1 [json_name = "uuid"];
}
message BundleListRequest {
int32 page = 1 [json_name = "page"];
int32 pageSize = 2 [json_name = "pageSize"];
string name = 3 [json_name = "name"];
string content = 4 [json_name = "content"];
}
message BundleListResponse {
repeated BundleProfile bundles = 1 [json_name = "bundles"];
int32 total = 2 [json_name = "total"];
}
message BundleDetailRequest {
string uuid = 1 [json_name = "uuid"];
}
message BundleDetailResponse {
BundleProfile bundle = 1 [json_name = "bundle"];
string msg = 2 [json_name = "msg"];
}
message OrderRecord {
string uuid = 1 [json_name = "uuid"];
string bundleUuid = 2 [json_name = "bundleUuid"];
string customerID = 3 [json_name = "customerID"];
string customerNum = 4 [json_name = "customerNum"];
string customerName = 5 [json_name = "customerName"];
int64 amount = 6 [json_name = "amount"];
int64 amountType = 7 [json_name = "amountType"];
string signContract = 8 [json_name = "signContract"];
string signature = 9 [json_name = "signature"];
string signedTime = 10 [json_name = "signedTime"];
int64 payType = 11 [json_name = "payType"];
string payTime = 12 [json_name = "payTime"];
string checkoutSessionId = 13 [json_name = "checkoutSessionId"];
string checkoutSessionUrl = 14 [json_name = "checkoutSessionUrl"];
string status = 15 [json_name = "status"];
string orderNo = 16 [json_name = "orderNo"];
string bundleName = 17 [json_name = "bundleName"];
}
message OrderRecordsRequest {
int32 page = 1 [json_name = "page"];
int32 pageSize = 2 [json_name = "pageSize"];
string customerNum = 3 [json_name = "customerNum"];
string customerName = 4 [json_name = "customerName"];
string bundleUUID = 5 [json_name = "bundleUUID"];
string orderNo = 6 [json_name = "orderNo"];
int64 status = 7 [json_name = "status"];
string bundleName = 8 [json_name = "bundleName"];
string startSignedTime = 9 [json_name = "startSignedTime"];
string endSignedTime = 10 [json_name = "endSignedTime"];
string startPayTime = 11 [json_name = "startPayTime"];
string endPayTime = 12 [json_name = "endPayTime"];
}
message OrderRecordsResponse {
repeated OrderRecord orderRecords = 1 [json_name = "orderRecords"];
int32 total = 2 [json_name = "total"];
}
message OrderRecordsDetailRequest {
string uuid = 1 [json_name = "uuid"];
}
message OrderRecordsDetailResponse {
OrderRecord orderRecord = 1 [json_name = "orderRecord"];
string msg = 2 [json_name = "msg"];
}

View File

@ -0,0 +1,77 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pb/bundle.proto
package bundle
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 *CommonResponse) Validate() error {
return nil
}
func (this *BundleProfile) Validate() error {
return nil
}
func (this *DelBundleRequest) Validate() error {
return nil
}
func (this *BundleListRequest) Validate() error {
return nil
}
func (this *BundleListResponse) Validate() error {
for _, item := range this.Bundles {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Bundles", err)
}
}
}
return nil
}
func (this *BundleDetailRequest) Validate() error {
return nil
}
func (this *BundleDetailResponse) Validate() error {
if this.Bundle != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Bundle", err)
}
}
return nil
}
func (this *OrderRecord) Validate() error {
return nil
}
func (this *OrderRecordsRequest) Validate() error {
return nil
}
func (this *OrderRecordsResponse) Validate() error {
for _, item := range this.OrderRecords {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderRecords", err)
}
}
}
return nil
}
func (this *OrderRecordsDetailRequest) Validate() error {
return nil
}
func (this *OrderRecordsDetailResponse) Validate() error {
if this.OrderRecord != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.OrderRecord); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("OrderRecord", err)
}
}
return nil
}

View File

@ -0,0 +1,507 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.5
// - protoc v5.29.0--rc3
// source: pb/bundle.proto
package bundle
import (
context "context"
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
grpc_go "github.com/dubbogo/grpc-go"
codes "github.com/dubbogo/grpc-go/codes"
metadata "github.com/dubbogo/grpc-go/metadata"
status "github.com/dubbogo/grpc-go/status"
common "github.com/dubbogo/triple/pkg/common"
constant "github.com/dubbogo/triple/pkg/common/constant"
triple "github.com/dubbogo/triple/pkg/triple"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc_go.SupportPackageIsVersion7
// BundleClient is the client API for Bundle 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 BundleClient interface {
CreateBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
UpdateBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
DeleteBundle(ctx context.Context, in *DelBundleRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
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)
CreateOrderRecords(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
UpdateOrderRecords(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment)
OrderRecordsDetail(ctx context.Context, in *OrderRecordsDetailRequest, opts ...grpc_go.CallOption) (*OrderRecordsDetailResponse, common.ErrorWithAttachment)
}
type bundleClient struct {
cc *triple.TripleConn
}
type BundleClientImpl struct {
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecords func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
UpdateOrderRecords func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
OrderRecordsList func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error)
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
return NewBundleClient(cc)
}
func (c *BundleClientImpl) XXX_InterfaceName() string {
return "bundle.Bundle"
}
func NewBundleClient(cc *triple.TripleConn) BundleClient {
return &bundleClient{cc}
}
func (c *bundleClient) CreateBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateBundle", in, out)
}
func (c *bundleClient) UpdateBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateBundle", in, out)
}
func (c *bundleClient) DeleteBundle(ctx context.Context, in *DelBundleRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteBundle", in, out)
}
func (c *bundleClient) BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) {
out := new(BundleListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleList", in, out)
}
func (c *bundleClient) BundleDetail(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponse, common.ErrorWithAttachment) {
out := new(BundleDetailResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleDetail", in, out)
}
func (c *bundleClient) CreateOrderRecords(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateOrderRecords", in, out)
}
func (c *bundleClient) UpdateOrderRecords(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateOrderRecords", in, out)
}
func (c *bundleClient) OrderRecordsList(ctx context.Context, in *OrderRecordsRequest, opts ...grpc_go.CallOption) (*OrderRecordsResponse, common.ErrorWithAttachment) {
out := new(OrderRecordsResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderRecordsList", in, out)
}
func (c *bundleClient) OrderRecordsDetail(ctx context.Context, in *OrderRecordsDetailRequest, opts ...grpc_go.CallOption) (*OrderRecordsDetailResponse, common.ErrorWithAttachment) {
out := new(OrderRecordsDetailResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderRecordsDetail", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
type BundleServer interface {
CreateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
UpdateBundle(context.Context, *BundleProfile) (*CommonResponse, error)
DeleteBundle(context.Context, *DelBundleRequest) (*CommonResponse, error)
BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error)
BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecords(context.Context, *OrderRecord) (*CommonResponse, error)
UpdateOrderRecords(context.Context, *OrderRecord) (*CommonResponse, error)
OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error)
OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
mustEmbedUnimplementedBundleServer()
}
// UnimplementedBundleServer must be embedded to have forward compatible implementations.
type UnimplementedBundleServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedBundleServer) CreateBundle(context.Context, *BundleProfile) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateBundle not implemented")
}
func (UnimplementedBundleServer) UpdateBundle(context.Context, *BundleProfile) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateBundle not implemented")
}
func (UnimplementedBundleServer) DeleteBundle(context.Context, *DelBundleRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteBundle not implemented")
}
func (UnimplementedBundleServer) BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleList not implemented")
}
func (UnimplementedBundleServer) BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleDetail not implemented")
}
func (UnimplementedBundleServer) CreateOrderRecords(context.Context, *OrderRecord) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateOrderRecords not implemented")
}
func (UnimplementedBundleServer) UpdateOrderRecords(context.Context, *OrderRecord) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateOrderRecords not implemented")
}
func (UnimplementedBundleServer) OrderRecordsList(context.Context, *OrderRecordsRequest) (*OrderRecordsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderRecordsList not implemented")
}
func (UnimplementedBundleServer) OrderRecordsDetail(context.Context, *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderRecordsDetail not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedBundleServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedBundleServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &Bundle_ServiceDesc
}
func (s *UnimplementedBundleServer) XXX_InterfaceName() string {
return "bundle.Bundle"
}
func (UnimplementedBundleServer) mustEmbedUnimplementedBundleServer() {}
// UnsafeBundleServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BundleServer will
// result in compilation errors.
type UnsafeBundleServer interface {
mustEmbedUnimplementedBundleServer()
}
func RegisterBundleServer(s grpc_go.ServiceRegistrar, srv BundleServer) {
s.RegisterService(&Bundle_ServiceDesc, srv)
}
func _Bundle_CreateBundle_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("CreateBundle", 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_UpdateBundle_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("UpdateBundle", 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_DeleteBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DelBundleRequest)
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("DeleteBundle", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleListRequest)
if err := dec(in); err != nil {
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("BundleList", 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_BundleDetail_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("BundleDetail", 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_CreateOrderRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OrderRecord)
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("CreateOrderRecords", 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_UpdateOrderRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OrderRecord)
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("UpdateOrderRecords", 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_OrderRecordsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OrderRecordsRequest)
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("OrderRecordsList", 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_OrderRecordsDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(OrderRecordsDetailRequest)
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("OrderRecordsDetail", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var Bundle_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "bundle.Bundle",
HandlerType: (*BundleServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "CreateBundle",
Handler: _Bundle_CreateBundle_Handler,
},
{
MethodName: "UpdateBundle",
Handler: _Bundle_UpdateBundle_Handler,
},
{
MethodName: "DeleteBundle",
Handler: _Bundle_DeleteBundle_Handler,
},
{
MethodName: "BundleList",
Handler: _Bundle_BundleList_Handler,
},
{
MethodName: "BundleDetail",
Handler: _Bundle_BundleDetail_Handler,
},
{
MethodName: "CreateOrderRecords",
Handler: _Bundle_CreateOrderRecords_Handler,
},
{
MethodName: "UpdateOrderRecords",
Handler: _Bundle_UpdateOrderRecords_Handler,
},
{
MethodName: "OrderRecordsList",
Handler: _Bundle_OrderRecordsList_Handler,
},
{
MethodName: "OrderRecordsDetail",
Handler: _Bundle_OrderRecordsDetail_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",
}

View File

@ -19,10 +19,6 @@ package main
import ( import (
"fmt" "fmt"
"github.com/fonchain_enterprise/fonchain-common-client/cmd/config"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/cache"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/common/gpt"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/router"
) )
func main() { func main() {

113
go.mod
View File

@ -1,46 +1,103 @@
module github.com/fonchain_enterprise/fonchain-common-client module fonchain-fiee
go 1.18 go 1.20
require ( require (
github.com/BurntSushi/toml v1.3.2 dubbo.apache.org/dubbo-go/v3 v3.1.1
github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible github.com/BurntSushi/toml v1.4.0
github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gin-contrib/gzip v0.0.6 github.com/dubbogo/grpc-go v1.42.10
github.com/gin-contrib/pprof v1.4.0 github.com/dubbogo/triple v1.2.2-rc3
github.com/gin-gonic/gin v1.9.1 github.com/gin-contrib/gzip v1.2.2
github.com/gin-contrib/pprof v1.5.2
github.com/gin-gonic/gin v1.10.0
github.com/go-redis/redis v6.15.9+incompatible github.com/go-redis/redis v6.15.9+incompatible
github.com/golang/protobuf v1.5.4
github.com/mwitkow/go-proto-validators v0.3.2
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
google.golang.org/protobuf v1.36.5
) )
require ( require (
github.com/bytedance/sonic v1.9.1 // indirect github.com/RoaringBitmap/roaring v1.2.3 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect github.com/Workiva/go-datastructures v1.0.52 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/apache/dubbo-getty v1.4.9 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect github.com/apache/dubbo-go-hessian2 v1.12.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.2.0 // indirect
github.com/bytedance/sonic v1.12.7 // indirect
github.com/bytedance/sonic/loader v0.2.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/creasty/defaults v1.5.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dubbogo/gost v1.14.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
github.com/gin-contrib/sse v1.0.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect github.com/go-playground/validator/v10 v10.24.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect github.com/goccy/go-json v0.10.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/influxdata/tdigest v0.0.1 // indirect
github.com/jinzhu/copier v0.3.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/k0kubun/pp v3.0.1+incompatible // indirect
github.com/leodido/go-urn v1.2.4 // indirect github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect github.com/knadh/koanf v1.5.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect github.com/mschoch/smat v0.2.0 // indirect
github.com/onsi/gomega v1.28.0 // indirect github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/shirou/gopsutil/v3 v3.22.2 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect github.com/uber/jaeger-client-go v2.29.1+incompatible // indirect
golang.org/x/arch v0.3.0 // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
golang.org/x/crypto v0.12.0 // indirect github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/net v0.14.0 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/sys v0.11.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.10.0 // indirect
golang.org/x/text v0.12.0 // indirect go.opentelemetry.io/otel v1.10.0 // indirect
golang.org/x/time v0.6.0 // indirect go.opentelemetry.io/otel/sdk v1.10.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect go.opentelemetry.io/otel/trace v1.10.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/arch v0.13.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef // indirect
google.golang.org/grpc v1.52.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )

1957
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/cache"
"io" "io"
"net/http" "net/http"
"regexp" "regexp"

View File

@ -1,12 +1,12 @@
package router package router
import ( import (
"github.com/fonchain_enterprise/fonchain-common-client/pkg/middleware" "fonchain-fiee/pkg/middleware"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service/auth" "fonchain-fiee/pkg/service/auth"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service/lang" "fonchain-fiee/pkg/service/lang"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service/qr" "fonchain-fiee/pkg/service/qr"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service/redirect" "fonchain-fiee/pkg/service/redirect"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service/version" "fonchain-fiee/pkg/service/version"
"github.com/gin-contrib/gzip" "github.com/gin-contrib/gzip"
"net/http" "net/http"
@ -67,6 +67,16 @@ func NewRouter() *gin.Engine {
redirectRoute.POST("sdk/down/v3", auth.DownImgV3) redirectRoute.POST("sdk/down/v3", auth.DownImgV3)
} }
// 套餐
{
bundleRoute := r.Group("bundle")
bundleClientRoute := bundleRoute.Group("system")
{
bundleClientRoute.POST("create", bundle.CreateBundle)
}
}
//静态文件 //静态文件
r.StaticFS("/static", http.Dir("./runtime")) r.StaticFS("/static", http.Dir("./runtime"))
r.NoRoute(func(c *gin.Context) { r.NoRoute(func(c *gin.Context) {

View File

@ -2,10 +2,7 @@ package auth
import ( import (
"fmt" "fmt"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"io" "io"
"net/http" "net/http"
"os" "os"
@ -17,7 +14,7 @@ type OOInf struct {
File string File string
} }
//DownImg 重定向到指定位置 // DownImg 重定向到指定位置
func DownImg(c *gin.Context) { func DownImg(c *gin.Context) {
var req OOInf var req OOInf

View File

@ -1,13 +1,5 @@
package lang package lang
import (
"github.com/fonchain_enterprise/fonchain-common-client/pkg/common/gpt"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/model/query"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
)
//ChangeLandMsg 语言翻译 //ChangeLandMsg 语言翻译
func ChangeLandMsg(c *gin.Context) { func ChangeLandMsg(c *gin.Context) {

View File

@ -3,16 +3,10 @@ package qr
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/fonchain_enterprise/fonchain-common-client/cmd/config"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/common/utils"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/skip2/go-qrcode"
"net/url" "net/url"
) )
//CreateQr 直接生成二维码 // CreateQr 直接生成二维码
func Upload(c *gin.Context) { func Upload(c *gin.Context) {
realUrl := c.Query("url") realUrl := c.Query("url")
@ -50,7 +44,7 @@ func Upload(c *gin.Context) {
return return
} }
//CreateQr 直接生成二维码 // CreateQr 直接生成二维码
func CreateQr(c *gin.Context) { func CreateQr(c *gin.Context) {
type AuctionBuyListTemp struct { type AuctionBuyListTemp struct {
@ -111,7 +105,7 @@ func CreateQr(c *gin.Context) {
return return
} }
//CreateRedirectQr 生成重定向二维码 // CreateRedirectQr 生成重定向二维码
func CreateRedirectQr(c *gin.Context) { func CreateRedirectQr(c *gin.Context) {
realUrl := c.Query("url") realUrl := c.Query("url")
@ -136,7 +130,7 @@ func CreateRedirectQr(c *gin.Context) {
return return
} }
//CreateQrBase64 直接生成二维码 // CreateQrBase64 直接生成二维码
func CreateQrBase64(c *gin.Context) { func CreateQrBase64(c *gin.Context) {
realUrl := c.Query("url") realUrl := c.Query("url")
@ -161,7 +155,7 @@ func CreateQrBase64(c *gin.Context) {
return return
} }
//CreateRedirectQrBase64 生成重定向二维码 // CreateRedirectQrBase64 生成重定向二维码
func CreateRedirectQrBase64(c *gin.Context) { func CreateRedirectQrBase64(c *gin.Context) {
realUrl := c.Query("url") realUrl := c.Query("url")

View File

@ -3,13 +3,12 @@ package redirect
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/service"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"net/http" "net/http"
"time" "time"
) )
//ToRedirectRealUrl 重定向到指定位置 // ToRedirectRealUrl 重定向到指定位置
func ToRedirectRealUrl(c *gin.Context) { func ToRedirectRealUrl(c *gin.Context) {
realUrl := c.Query("base_redirect_url") realUrl := c.Query("base_redirect_url")
@ -21,7 +20,7 @@ func ToRedirectRealUrl(c *gin.Context) {
c.Redirect(http.StatusMovedPermanently, realUrl) c.Redirect(http.StatusMovedPermanently, realUrl)
} }
//ToRedirectRealUrlAdnRand 重定向到指定位置 // ToRedirectRealUrlAdnRand 重定向到指定位置
func ToRedirectRealUrlAdnRand(c *gin.Context) { func ToRedirectRealUrlAdnRand(c *gin.Context) {
realUrl := c.Query("base_redirect_url") realUrl := c.Query("base_redirect_url")
@ -30,6 +29,5 @@ func ToRedirectRealUrlAdnRand(c *gin.Context) {
return return
} }
c.Redirect(http.StatusMovedPermanently, realUrl+fmt.Sprintf("?time=%d",time.Now().Unix())) c.Redirect(http.StatusMovedPermanently, realUrl+fmt.Sprintf("?time=%d", time.Now().Unix()))
} }

View File

@ -1,10 +1,10 @@
package version package version
import ( import (
"github.com/fonchain_enterprise/fonchain-common-client/pkg/cache" "fonchain-fiee/pkg/cache"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/model/query" "fonchain-fiee/pkg/model/query"
"github.com/fonchain_enterprise/fonchain-common-client/pkg/model/vo" "fonchain-fiee/pkg/model/vo"
"github.com/fonchain_enterprise/fonchain-common-client/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"
) )