修改
This commit is contained in:
parent
88333063d7
commit
49a935d6c6
1298
api/secFilings/secFilings.pb.go
Normal file
1298
api/secFilings/secFilings.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
110
api/secFilings/secFilings.proto
Normal file
110
api/secFilings/secFilings.proto
Normal file
@ -0,0 +1,110 @@
|
||||
syntax = "proto3";
|
||||
package secFilings;
|
||||
//import "descriptor.proto";
|
||||
//import "validator.proto";
|
||||
|
||||
option go_package = "./;secFilings";
|
||||
|
||||
service SecFilings{
|
||||
rpc CreateSecFiling(CreateSecFilingReq) returns (CommonResp) {}
|
||||
rpc UpdateSecFiling(UpdateSecFilingReq) returns (CommonResp) {}
|
||||
rpc DetailSecFiling(DetailSecFilingReq) returns (SecFilingDetailResp) {}
|
||||
rpc ListSecFiling(ListSecFilingReq) returns (SecFilingListResp) {}
|
||||
rpc DeleteSecFiling(DeleteSecFilingReq)returns(CommonResp){}
|
||||
rpc IsSecFilingExist(IsSecFilingExistReq) returns (IsSecFilingExistResp) {}
|
||||
rpc UpdateSecFilingStatus(UpdateSecFilingStatusReq) returns(CommonResp) {}
|
||||
|
||||
}
|
||||
message IsSecFilingExistReq{
|
||||
string filingDate = 1;
|
||||
string form = 2;
|
||||
string finalLink = 3;
|
||||
}
|
||||
message IsSecFilingExistResp{
|
||||
bool exist = 1;
|
||||
}
|
||||
message CommonResp{
|
||||
string msg = 1 [json_name="msg"];
|
||||
string filingKey = 2[json_name="filing_key"];
|
||||
}
|
||||
message SecFiling{
|
||||
int32 idx = 1 [json_name="idx"];
|
||||
string filingKey = 2[json_name="filing_key"];
|
||||
string filingDate = 3[json_name="filing_date"];
|
||||
string form = 4[json_name="form"];
|
||||
string description = 5[json_name="description"];
|
||||
string formDescription = 6[json_name="form_description"];
|
||||
string fileLink = 7[json_name="file_link"];
|
||||
repeated DataFiles dataFiles = 8[json_name="data_files"];
|
||||
string pdfFile = 9[json_name="pdf_file"];
|
||||
string wordFile = 10[json_name="word_file"];
|
||||
string excelFile = 11[json_name="excel_file"];
|
||||
int32 status = 12[json_name="status"];
|
||||
string operator = 13[json_name="operator"];
|
||||
int32 operatorId = 14[json_name="operator_id"];
|
||||
string createdAt =15[json_name="created_at"];
|
||||
string updatedAt=16[json_name="updated_at"];
|
||||
}
|
||||
message DataFiles {
|
||||
string description = 1[json_name="description"];
|
||||
string fileUrl = 2[json_name="file_url"];
|
||||
}
|
||||
message CreateSecFilingReq{
|
||||
string filingDate = 1;
|
||||
string form = 2;
|
||||
string description = 3;
|
||||
string formDescription = 4;
|
||||
string fileLink = 5;
|
||||
repeated DataFiles dataFiles = 6;
|
||||
string pdfFile = 7;
|
||||
string wordFile = 8;
|
||||
string excelFile = 9;
|
||||
string operator = 10;
|
||||
int32 operatorId = 11;
|
||||
}
|
||||
message UpdateSecFilingReq{
|
||||
string filingKey = 1;
|
||||
string form = 2;
|
||||
string description = 3;
|
||||
string formDescription = 4;
|
||||
string fileLink = 5;
|
||||
repeated DataFiles dataFiles = 6;
|
||||
string pdfFile = 7;
|
||||
string wordFile = 8;
|
||||
string excelFile = 9;
|
||||
string operator = 10;
|
||||
int32 operatorId = 11;
|
||||
string filingDate = 12;
|
||||
|
||||
}
|
||||
message DetailSecFilingReq{
|
||||
string filingKey = 1;
|
||||
}
|
||||
message SecFilingDetailResp{
|
||||
string msg = 1;
|
||||
SecFiling data = 2;
|
||||
}
|
||||
message ListSecFilingReq{
|
||||
uint32 page = 1;
|
||||
uint32 pageSize = 2;
|
||||
string form = 3;
|
||||
string filingDateBegin = 4;
|
||||
string filingDateEnd = 5;
|
||||
int32 status = 6;
|
||||
}
|
||||
message SecFilingListResp{
|
||||
string msg = 1 [json_name="msg"];
|
||||
uint32 total = 2 [json_name="total"];
|
||||
repeated SecFiling data = 3 [json_name="data"];
|
||||
}
|
||||
message DeleteSecFilingReq {
|
||||
string filingKey = 1;
|
||||
string operator = 2;
|
||||
int32 operatorId = 3;
|
||||
}
|
||||
message UpdateSecFilingStatusReq{
|
||||
string filingKey = 1;
|
||||
int32 status = 2;
|
||||
string operator = 3;
|
||||
int32 operatorId = 4;
|
||||
}
|
89
api/secFilings/secFilings.validator.pb.go
Normal file
89
api/secFilings/secFilings.validator.pb.go
Normal file
@ -0,0 +1,89 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: api/secFilings/secFilings.proto
|
||||
|
||||
package secFilings
|
||||
|
||||
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 *IsSecFilingExistReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *IsSecFilingExistResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CommonResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SecFiling) Validate() error {
|
||||
for _, item := range this.DataFiles {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DataFiles", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DataFiles) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CreateSecFilingReq) Validate() error {
|
||||
for _, item := range this.DataFiles {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DataFiles", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *UpdateSecFilingReq) Validate() error {
|
||||
for _, item := range this.DataFiles {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("DataFiles", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *DetailSecFilingReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SecFilingDetailResp) Validate() error {
|
||||
if this.Data != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ListSecFilingReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *SecFilingListResp) 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 *DeleteSecFilingReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UpdateSecFilingStatusReq) Validate() error {
|
||||
return nil
|
||||
}
|
417
api/secFilings/secFilings_triple.pb.go
Normal file
417
api/secFilings/secFilings_triple.pb.go
Normal file
@ -0,0 +1,417 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v5.29.2
|
||||
// source: api/secFilings/secFilings.proto
|
||||
|
||||
package secFilings
|
||||
|
||||
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
|
||||
|
||||
// SecFilingsClient is the client API for SecFilings 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 SecFilingsClient interface {
|
||||
CreateSecFiling(ctx context.Context, in *CreateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
|
||||
UpdateSecFiling(ctx context.Context, in *UpdateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
|
||||
DetailSecFiling(ctx context.Context, in *DetailSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingDetailResp, common.ErrorWithAttachment)
|
||||
ListSecFiling(ctx context.Context, in *ListSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingListResp, common.ErrorWithAttachment)
|
||||
DeleteSecFiling(ctx context.Context, in *DeleteSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
|
||||
IsSecFilingExist(ctx context.Context, in *IsSecFilingExistReq, opts ...grpc_go.CallOption) (*IsSecFilingExistResp, common.ErrorWithAttachment)
|
||||
UpdateSecFilingStatus(ctx context.Context, in *UpdateSecFilingStatusReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type secFilingsClient struct {
|
||||
cc *triple.TripleConn
|
||||
}
|
||||
|
||||
type SecFilingsClientImpl struct {
|
||||
CreateSecFiling func(ctx context.Context, in *CreateSecFilingReq) (*CommonResp, error)
|
||||
UpdateSecFiling func(ctx context.Context, in *UpdateSecFilingReq) (*CommonResp, error)
|
||||
DetailSecFiling func(ctx context.Context, in *DetailSecFilingReq) (*SecFilingDetailResp, error)
|
||||
ListSecFiling func(ctx context.Context, in *ListSecFilingReq) (*SecFilingListResp, error)
|
||||
DeleteSecFiling func(ctx context.Context, in *DeleteSecFilingReq) (*CommonResp, error)
|
||||
IsSecFilingExist func(ctx context.Context, in *IsSecFilingExistReq) (*IsSecFilingExistResp, error)
|
||||
UpdateSecFilingStatus func(ctx context.Context, in *UpdateSecFilingStatusReq) (*CommonResp, error)
|
||||
}
|
||||
|
||||
func (c *SecFilingsClientImpl) GetDubboStub(cc *triple.TripleConn) SecFilingsClient {
|
||||
return NewSecFilingsClient(cc)
|
||||
}
|
||||
|
||||
func (c *SecFilingsClientImpl) XXX_InterfaceName() string {
|
||||
return "secFilings.SecFilings"
|
||||
}
|
||||
|
||||
func NewSecFilingsClient(cc *triple.TripleConn) SecFilingsClient {
|
||||
return &secFilingsClient{cc}
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) CreateSecFiling(ctx context.Context, in *CreateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
|
||||
out := new(CommonResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateSecFiling", in, out)
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) UpdateSecFiling(ctx context.Context, in *UpdateSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
|
||||
out := new(CommonResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateSecFiling", in, out)
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) DetailSecFiling(ctx context.Context, in *DetailSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingDetailResp, common.ErrorWithAttachment) {
|
||||
out := new(SecFilingDetailResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DetailSecFiling", in, out)
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) ListSecFiling(ctx context.Context, in *ListSecFilingReq, opts ...grpc_go.CallOption) (*SecFilingListResp, common.ErrorWithAttachment) {
|
||||
out := new(SecFilingListResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListSecFiling", in, out)
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) DeleteSecFiling(ctx context.Context, in *DeleteSecFilingReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
|
||||
out := new(CommonResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteSecFiling", in, out)
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) IsSecFilingExist(ctx context.Context, in *IsSecFilingExistReq, opts ...grpc_go.CallOption) (*IsSecFilingExistResp, common.ErrorWithAttachment) {
|
||||
out := new(IsSecFilingExistResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/IsSecFilingExist", in, out)
|
||||
}
|
||||
|
||||
func (c *secFilingsClient) UpdateSecFilingStatus(ctx context.Context, in *UpdateSecFilingStatusReq, opts ...grpc_go.CallOption) (*CommonResp, common.ErrorWithAttachment) {
|
||||
out := new(CommonResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateSecFilingStatus", in, out)
|
||||
}
|
||||
|
||||
// SecFilingsServer is the server API for SecFilings service.
|
||||
// All implementations must embed UnimplementedSecFilingsServer
|
||||
// for forward compatibility
|
||||
type SecFilingsServer interface {
|
||||
CreateSecFiling(context.Context, *CreateSecFilingReq) (*CommonResp, error)
|
||||
UpdateSecFiling(context.Context, *UpdateSecFilingReq) (*CommonResp, error)
|
||||
DetailSecFiling(context.Context, *DetailSecFilingReq) (*SecFilingDetailResp, error)
|
||||
ListSecFiling(context.Context, *ListSecFilingReq) (*SecFilingListResp, error)
|
||||
DeleteSecFiling(context.Context, *DeleteSecFilingReq) (*CommonResp, error)
|
||||
IsSecFilingExist(context.Context, *IsSecFilingExistReq) (*IsSecFilingExistResp, error)
|
||||
UpdateSecFilingStatus(context.Context, *UpdateSecFilingStatusReq) (*CommonResp, error)
|
||||
mustEmbedUnimplementedSecFilingsServer()
|
||||
}
|
||||
|
||||
// UnimplementedSecFilingsServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedSecFilingsServer struct {
|
||||
proxyImpl protocol.Invoker
|
||||
}
|
||||
|
||||
func (UnimplementedSecFilingsServer) CreateSecFiling(context.Context, *CreateSecFilingReq) (*CommonResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateSecFiling not implemented")
|
||||
}
|
||||
func (UnimplementedSecFilingsServer) UpdateSecFiling(context.Context, *UpdateSecFilingReq) (*CommonResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateSecFiling not implemented")
|
||||
}
|
||||
func (UnimplementedSecFilingsServer) DetailSecFiling(context.Context, *DetailSecFilingReq) (*SecFilingDetailResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DetailSecFiling not implemented")
|
||||
}
|
||||
func (UnimplementedSecFilingsServer) ListSecFiling(context.Context, *ListSecFilingReq) (*SecFilingListResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListSecFiling not implemented")
|
||||
}
|
||||
func (UnimplementedSecFilingsServer) DeleteSecFiling(context.Context, *DeleteSecFilingReq) (*CommonResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteSecFiling not implemented")
|
||||
}
|
||||
func (UnimplementedSecFilingsServer) IsSecFilingExist(context.Context, *IsSecFilingExistReq) (*IsSecFilingExistResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method IsSecFilingExist not implemented")
|
||||
}
|
||||
func (UnimplementedSecFilingsServer) UpdateSecFilingStatus(context.Context, *UpdateSecFilingStatusReq) (*CommonResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateSecFilingStatus not implemented")
|
||||
}
|
||||
func (s *UnimplementedSecFilingsServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
|
||||
func (s *UnimplementedSecFilingsServer) XXX_GetProxyImpl() protocol.Invoker {
|
||||
return s.proxyImpl
|
||||
}
|
||||
|
||||
func (s *UnimplementedSecFilingsServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
||||
return &SecFilings_ServiceDesc
|
||||
}
|
||||
func (s *UnimplementedSecFilingsServer) XXX_InterfaceName() string {
|
||||
return "secFilings.SecFilings"
|
||||
}
|
||||
|
||||
func (UnimplementedSecFilingsServer) mustEmbedUnimplementedSecFilingsServer() {}
|
||||
|
||||
// UnsafeSecFilingsServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SecFilingsServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSecFilingsServer interface {
|
||||
mustEmbedUnimplementedSecFilingsServer()
|
||||
}
|
||||
|
||||
func RegisterSecFilingsServer(s grpc_go.ServiceRegistrar, srv SecFilingsServer) {
|
||||
s.RegisterService(&SecFilings_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SecFilings_CreateSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateSecFilingReq)
|
||||
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("CreateSecFiling", 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 _SecFilings_UpdateSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateSecFilingReq)
|
||||
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("UpdateSecFiling", 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 _SecFilings_DetailSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DetailSecFilingReq)
|
||||
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("DetailSecFiling", 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 _SecFilings_ListSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListSecFilingReq)
|
||||
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("ListSecFiling", 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 _SecFilings_DeleteSecFiling_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteSecFilingReq)
|
||||
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("DeleteSecFiling", 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 _SecFilings_IsSecFilingExist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(IsSecFilingExistReq)
|
||||
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("IsSecFilingExist", 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 _SecFilings_UpdateSecFilingStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateSecFilingStatusReq)
|
||||
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("UpdateSecFilingStatus", 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)
|
||||
}
|
||||
|
||||
// SecFilings_ServiceDesc is the grpc_go.ServiceDesc for SecFilings service.
|
||||
// It's only intended for direct use with grpc_go.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SecFilings_ServiceDesc = grpc_go.ServiceDesc{
|
||||
ServiceName: "secFilings.SecFilings",
|
||||
HandlerType: (*SecFilingsServer)(nil),
|
||||
Methods: []grpc_go.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateSecFiling",
|
||||
Handler: _SecFilings_CreateSecFiling_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateSecFiling",
|
||||
Handler: _SecFilings_UpdateSecFiling_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DetailSecFiling",
|
||||
Handler: _SecFilings_DetailSecFiling_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListSecFiling",
|
||||
Handler: _SecFilings_ListSecFiling_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteSecFiling",
|
||||
Handler: _SecFilings_DeleteSecFiling_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "IsSecFilingExist",
|
||||
Handler: _SecFilings_IsSecFilingExist_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateSecFilingStatus",
|
||||
Handler: _SecFilings_UpdateSecFilingStatus_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "api/secFilings/secFilings.proto",
|
||||
}
|
@ -27,3 +27,7 @@ dubbo:
|
||||
protocol: tri
|
||||
retries: 0
|
||||
interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java
|
||||
SecFilingsClientImpl:
|
||||
protocol: tri
|
||||
retries: 0
|
||||
interface: com.fontree.microservices.fiee.SecFiling
|
@ -42,3 +42,7 @@ dubbo:
|
||||
params:
|
||||
.accessKeyId: "Paymentksl"
|
||||
.secretAccessKey: "BSDY-FDF1-Fontree_payment"
|
||||
SecFilingsClientImpl:
|
||||
protocol: tri
|
||||
retries: 0
|
||||
interface: com.fontree.microservices.fiee.SecFiling
|
||||
|
@ -42,3 +42,7 @@ dubbo:
|
||||
params:
|
||||
.accessKeyId: "Paymentksl"
|
||||
.secretAccessKey: "BSDY-FDF1-Fontree_payment"
|
||||
SecFilingsClientImpl:
|
||||
protocol: tri
|
||||
retries: 0
|
||||
interface: com.fontree.microservices.fiee.SecFiling
|
||||
|
@ -41,6 +41,7 @@ func NewRouter() *gin.Engine {
|
||||
BundleRouter(privateGroup)
|
||||
BundleOrderRouter(privateGroup)
|
||||
ValueAddBundleRouter(privateGroup)
|
||||
SecFilingRouter(privateGroup)
|
||||
|
||||
{
|
||||
v1.POST("version", version.Version) //版本号公共
|
||||
|
24
pkg/router/secfiling.go
Normal file
24
pkg/router/secfiling.go
Normal file
@ -0,0 +1,24 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
"fonchain-fiee/pkg/service/secfilings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func SecFilingRouter(r *gin.RouterGroup) {
|
||||
SecFilingRouter := r.Group("sec-filing")
|
||||
//SecFilingRouter.Use(middleware.CheckWebLogin(service.AccountProvider))
|
||||
|
||||
// sec-filing
|
||||
secFilingRoute := SecFilingRouter.Group("system")
|
||||
{
|
||||
secFilingRoute.POST("create", secfilings.CreateSecFiling)
|
||||
secFilingRoute.POST("update", secfilings.UpdateSecFiling)
|
||||
secFilingRoute.POST("list", secfilings.ListSecFiling)
|
||||
secFilingRoute.POST("detail", secfilings.DetailSecFiling)
|
||||
secFilingRoute.POST("delete", secfilings.DeleteSecFiling)
|
||||
secFilingRoute.POST("get", secfilings.GetSecFilings)
|
||||
secFilingRoute.POST("update/status", secfilings.UpdateSecFilingStatus)
|
||||
}
|
||||
}
|
@ -1,17 +1,19 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"dubbo.apache.org/dubbo-go/v3/common/constant"
|
||||
"dubbo.apache.org/dubbo-go/v3/config"
|
||||
_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||
"fmt"
|
||||
"fonchain-fiee/api/account"
|
||||
"fonchain-fiee/api/accountFiee"
|
||||
"fonchain-fiee/api/bundle"
|
||||
"fonchain-fiee/api/order"
|
||||
"fonchain-fiee/api/payment"
|
||||
"fonchain-fiee/api/secFilings"
|
||||
pkConfig "fonchain-fiee/pkg/config"
|
||||
"os"
|
||||
|
||||
"dubbo.apache.org/dubbo-go/v3/common/constant"
|
||||
"dubbo.apache.org/dubbo-go/v3/config"
|
||||
_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||
)
|
||||
|
||||
var AccountProvider = new(account.AccountClientImpl)
|
||||
@ -20,13 +22,15 @@ var AccountFieeProvider = new(accountFiee.AccountFieeClientImpl)
|
||||
var BundleProvider = new(bundle.BundleClientImpl)
|
||||
var OrderProvider = new(order.OrderClientImpl)
|
||||
var PaymentProvider = new(payment.PaymentCentClientImpl)
|
||||
var SecFilingProvider = new(secFilings.SecFilingsClientImpl)
|
||||
|
||||
func init() {
|
||||
config.SetConsumerService(BundleProvider)
|
||||
config.SetConsumerService(OrderProvider)
|
||||
config.SetConsumerService(AccountProvider)
|
||||
config.SetConsumerService(PaymentProvider)
|
||||
config.SetConsumerService(AccountFieeProvider)
|
||||
// config.SetConsumerService(BundleProvider)
|
||||
// config.SetConsumerService(OrderProvider)
|
||||
// config.SetConsumerService(AccountProvider)
|
||||
// config.SetConsumerService(PaymentProvider)
|
||||
//config.SetConsumerService(AccountFieeProvider)
|
||||
config.SetConsumerService(SecFilingProvider)
|
||||
|
||||
if err := config.Load(); err != nil {
|
||||
panic(err)
|
||||
|
201
pkg/service/secfilings/secfilings.go
Normal file
201
pkg/service/secfilings/secfilings.go
Normal file
@ -0,0 +1,201 @@
|
||||
package secfilings
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"fonchain-fiee/api/secFilings"
|
||||
"fonchain-fiee/pkg/service"
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
)
|
||||
|
||||
func CreateSecFiling(c *gin.Context) {
|
||||
var req secFilings.CreateSecFilingReq
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
//userInfo := login.GetUserInfoFromC(c)
|
||||
//req.Operator = userInfo.Name
|
||||
//req.OperatorId = int32(userInfo.ID)
|
||||
res, err := service.SecFilingProvider.CreateSecFiling(c, &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
func UpdateSecFiling(c *gin.Context) {
|
||||
var req secFilings.UpdateSecFilingReq
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
//userInfo := login.GetUserInfoFromC(c)
|
||||
//req.Operator = userInfo.Name
|
||||
//req.OperatorId = int32(userInfo.ID)
|
||||
res, err := service.SecFilingProvider.UpdateSecFiling(c, &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
func UpdateSecFilingStatus(c *gin.Context) {
|
||||
var req secFilings.UpdateSecFilingStatusReq
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
//userInfo := login.GetUserInfoFromC(c)
|
||||
//req.Operator = userInfo.Name
|
||||
//req.OperatorId = int32(userInfo.ID)
|
||||
res, err := service.SecFilingProvider.UpdateSecFilingStatus(c, &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
func ListSecFiling(c *gin.Context) {
|
||||
var req secFilings.ListSecFilingReq
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
res, err := service.SecFilingProvider.ListSecFiling(c, &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
func DetailSecFiling(c *gin.Context) {
|
||||
var req secFilings.DetailSecFilingReq
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
res, err := service.SecFilingProvider.DetailSecFiling(c, &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
func DeleteSecFiling(c *gin.Context) {
|
||||
var req secFilings.DeleteSecFilingReq
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
//userInfo := login.GetUserInfoFromC(c)
|
||||
//req.Operator = userInfo.Name
|
||||
//req.OperatorId = int32(userInfo.ID)
|
||||
res, err := service.SecFilingProvider.DeleteSecFiling(c, &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
type GetSecFilingsReq struct {
|
||||
FilingDate string `json:"filingDate"`
|
||||
Page string `json:"page"`
|
||||
Limit string `json:"limit"`
|
||||
}
|
||||
type GetSecFilingsData struct {
|
||||
Symbol string `json:"symbol"`
|
||||
Cik string `json:"cik"`
|
||||
FilingDate string `json:"filingDate"`
|
||||
AcceptedDate string `json:"acceptedDate"`
|
||||
FormType string `json:"formType"`
|
||||
Link string `json:"link"`
|
||||
FinalLink string `json:"finalLink"`
|
||||
IsSelect bool `json:"isSelect"`
|
||||
}
|
||||
type GetSecFilingsResp struct {
|
||||
//Symbol string `json:"symbol"`
|
||||
//Cik string `json:"cik"`
|
||||
FilingDate string `json:"filingDate"`
|
||||
Form string `json:"form"`
|
||||
Description string `json:"description"`
|
||||
FormDescription string `json:"formDescription"`
|
||||
FileLink string `json:"fileLink"`
|
||||
IsSelect bool `json:"isSelect"`
|
||||
}
|
||||
|
||||
func GetSecFilings(c *gin.Context) {
|
||||
var req GetSecFilingsReq
|
||||
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
if req.FilingDate == "" {
|
||||
service.Error(c, errors.New("filing_date is empty"))
|
||||
return
|
||||
}
|
||||
fmt.Println(req.FilingDate)
|
||||
symbol := "MINM"
|
||||
beginDate := req.FilingDate
|
||||
endDate := req.FilingDate
|
||||
page := "0"
|
||||
limit := "100"
|
||||
if req.Page != "" {
|
||||
page = req.Page
|
||||
}
|
||||
if req.Limit != "" {
|
||||
limit = req.Limit
|
||||
}
|
||||
baseURL := "https://financialmodelingprep.com/stable/sec-filings-search/symbol"
|
||||
params := url.Values{}
|
||||
params.Add("symbol", symbol)
|
||||
params.Add("from", beginDate)
|
||||
params.Add("to", endDate)
|
||||
params.Add("page", page)
|
||||
params.Add("limit", limit)
|
||||
params.Add("apikey", "lBQWUwdjRmfHVZ7e3I1trWe4jw0ZtDct")
|
||||
|
||||
fullURL := fmt.Sprintf("%s?%s", baseURL, params.Encode())
|
||||
resp, err := http.Get(fullURL)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
service.Error(c, fmt.Errorf("http status code is not 200"))
|
||||
return
|
||||
}
|
||||
var result []GetSecFilingsData
|
||||
err = json.NewDecoder(resp.Body).Decode(&result)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
var data []*GetSecFilingsResp
|
||||
fmt.Println(122222)
|
||||
for _, v := range result {
|
||||
res, err := service.SecFilingProvider.IsSecFilingExist(c, &secFilings.IsSecFilingExistReq{
|
||||
FilingDate: req.FilingDate,
|
||||
Form: v.FormType,
|
||||
FinalLink: v.FinalLink,
|
||||
})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
data = append(data, &GetSecFilingsResp{
|
||||
FilingDate: req.FilingDate,
|
||||
Form: v.FormType,
|
||||
FileLink: v.FinalLink,
|
||||
IsSelect: res.Exist,
|
||||
})
|
||||
}
|
||||
service.Success(c, data)
|
||||
}
|
Loading…
Reference in New Issue
Block a user