对账单代码上传

This commit is contained in:
songchuang 2023-03-22 16:16:16 +08:00
parent d72727759a
commit baa1bea012
15 changed files with 838 additions and 3305 deletions

View File

@ -0,0 +1,22 @@
package controller
import (
"context"
"fmt"
"github.com/fonchain/fonchain-artistinfo/cmd/internal/logic"
statement "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
)
type ArtistInfoStatementProvider struct {
statement.UnimplementedStatementServer
statementLogic *logic.Statement
}
func (c *ArtistInfoStatementProvider) StatementList(ctx context.Context, req *statement.StatementListRequest) (rep *statement.StatementListRespond, err error) {
fmt.Println("第一处")
if rep, err = c.statementLogic.StatementList(req); err != nil {
return nil, err
}
return rep, nil
}

View File

@ -145,7 +145,7 @@ func GetArtistInfoById(artistUid string) (user model.User, err error) {
return
}
func ContractList(artist_uid string, state int32) (ContractData []*contract.Contracts, err error) {
func ContractList(artist_uid string, state int32) (contractData []*contract.Contracts, err error) {
// if state != 0 {
// if state == 2 {
@ -177,7 +177,7 @@ func ContractList(artist_uid string, state int32) (ContractData []*contract.Cont
SignTime: v.SignTime,
}
ContractData = append(ContractData, Contract)
contractData = append(contractData, Contract)
}
return
@ -193,12 +193,21 @@ func GetContractInfo(contractUid string) (contractInfo model.Contract, err error
}
func UpdateContract(tx *gorm.DB, req *contract.SignContractRequest) (err error) {
fmt.Println("第一处1111")
if err = tx.Model(&model.Contract{}).Where("uid = ?", req.ContractUid).Updates(model.Contract{ViewUrl: req.ViewPdfUrl, DownloadUrl: req.DownloadUrl, ContractId: req.ContractNo, TransactionId: req.TransactionId, State: 1}).Error; err != nil {
zap.L().Error("update contract info err", zap.Error(err))
err = errors.New(m.UPDATE_FAILED)
return
//对账单这边只有TransactionId需要改变
if req.ViewPdfUrl == "" {
if err = tx.Model(&model.Contract{}).Where("uid = ?", req.ContractUid).Updates(model.Contract{TransactionId: req.TransactionId, State: 1}).Error; err != nil {
zap.L().Error("update contract info err", zap.Error(err))
err = errors.New(m.UPDATE_FAILED)
return
}
} else {
if err = tx.Model(&model.Contract{}).Where("uid = ?", req.ContractUid).Updates(model.Contract{ViewUrl: req.ViewPdfUrl, DownloadUrl: req.DownloadUrl, ContractId: req.ContractNo, TransactionId: req.TransactionId, State: 1}).Error; err != nil {
zap.L().Error("update contract info err", zap.Error(err))
err = errors.New(m.UPDATE_FAILED)
return
}
}
return
}

View File

@ -0,0 +1,41 @@
package dao
import (
"errors"
"github.com/fonchain/fonchain-artistinfo/cmd/model"
statement "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
db "github.com/fonchain/fonchain-artistinfo/pkg/db"
"github.com/fonchain/fonchain-artistinfo/pkg/m"
"go.uber.org/zap"
)
func StatementList(artistUid string, state int32) (contractData []*statement.Contracts, err error) {
var contracts []model.Contract
if err = db.DB.Where("artist_uid = ? AND type == 4 AND state = ?", artistUid, state).Find(&contracts).Error; err != nil {
zap.L().Error("get contracts info err", zap.Error(err))
err = errors.New(m.ERROR_SELECT)
return
}
for _, v := range contracts {
Contract := &statement.Contracts{
ContractUid: v.Uid,
ArtistUid: v.ArtistUid,
ArtworkUid: v.ArtworkUid,
ContractId: v.ContractId,
TransactionId: v.TransactionId,
Type: v.Type,
ViewUrl: v.ViewUrl,
DownloadUrl: v.DownloadUrl,
State: v.State,
Status: int32(v.Status),
LockTime: v.LockTime,
SignTime: v.SignTime,
}
contractData = append(contractData, Contract)
}
return
}

View File

@ -0,0 +1,40 @@
package logic
import (
"fmt"
"github.com/fonchain/fonchain-artistinfo/cmd/internal/dao"
statement "github.com/fonchain/fonchain-artistinfo/pb/artistinfoStatement"
)
type IStatement interface {
StatementList(req *statement.StatementListRequest) (rep *statement.StatementListRespond, err error)
}
func NewStatement() IStatement {
return &Statement{}
}
type Statement struct {
}
func (a *Statement) StatementList(req *statement.StatementListRequest) (rep *statement.StatementListRespond, err error) {
//查看是否有该画家
user, err := dao.GetArtistInfoById(req.ArtistUid)
if err != nil {
return
}
fmt.Println("user:", user)
ContractData, err := dao.StatementList(user.MgmtArtistUid, req.State)
if err != nil {
return
}
rep = &statement.StatementListRespond{
Data: ContractData,
}
return
}

View File

@ -3,49 +3,37 @@ package model
// 对账单委托画作批次
type StatementBatch struct {
Model
// StType int32 `gorm:"column:st_type;unqiueIndex:sttype_uid_batchtime_idx;comment:对账单类型 1=版权 2=物权;"`
ArtistUid string `gorm:"column:artist_uid;unqiueIndex:sttype_uid_batchtime_idx;comment:画家uid"`
ArtistName string `gorm:"column:artist_name;comment:画家姓名;"`
BatchTime string `gorm:"column:batch_time;unqiueIndex:sttype_uid_batchtime_idx;comment:批次时间;"`
FlowStatus int32 `gorm:"column:flow_status;default:1;comment:流程状态 1=未生成 2=已生成未签署 3=已签署"`
// FileUrl string `gorm:"column:file_url,comment:对账单文件地址;"`
Uid string `gorm:"column:uid;type:varchar(100);comment:对账单表的唯一表示;NOT NULL" json:"uid"`
StType int32 `gorm:"column:st_type;unqiueIndex:sttype_uid_batchtime_idx;comment:对账单类型 1=版权 2=物权;"`
ArtistUid string `gorm:"column:artist_uid;unqiueIndex:sttype_uid_batchtime_idx;comment:画家uid"`
ArtistName string `gorm:"column:artist_name;comment:画家姓名;"`
BatchTime string `gorm:"column:batch_time;unqiueIndex:sttype_uid_batchtime_idx;comment:批次时间;"`
FlowStatus int32 `gorm:"column:flow_status;default:1;comment:流程状态 1=未生成 2=已生成未签署 3=已签署"`
EntrustList []ArtworkEntrustDetail `gorm:"foreignKey:BatchId"` //当前批次的委托单详情
SalesList []ArtworkSalesDetail `gorm:"foreignKey:BatchId"` //当前批次的销售单详情
ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看对账单链接" json:"view_url"`
DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:对账单下载链接" json:"download_url"`
BatchId int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
EntrustList []ArtworkStatementDetail `gorm:"foreignKey:BatchId;references:ID"` //当前批次的委托单详情
}
func (StatementBatch) TableName() string {
return "statement_batch"
}
// 对账单画作委托详情
type ArtworkEntrustDetail struct {
Model
BatchId int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
TfNum string `gorm:"column:tf_num;unqiueIndex:batchid_tfnum_idx;comment:"泰丰画作编号"`
ArtworkName string `gorm:"column:artwork_name;comment:画作名称"`
Ruler string `gorm:"column:ruler;comment:平尺"`
SaleNo string `gorm:"column:sale_no;comment:销售单号"`
CompleteDate string `gorm:"column:complete_date;comment:成交日期"`
MinPrice float32 `gorm:"column:min_price;comment:委托销售底价"`
GuaranteePrice float32 `gorm:"column:guarantee_price;comment:已收取保证金;"`
}
// // 对账单画作委托详情
// type ArtworkStatementDetail struct {
// Model
// Uid string `gorm:"column:uid;type:varchar(100);comment:对账单画作详情表的唯一表示;NOT NULL" json:"uid"`
// BatchId int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
// TfNum string `gorm:"column:tf_num;unqiueIndex:batchid_tfnum_idx;comment:"泰丰画作编号"`
// ArtworkName string `gorm:"column:artwork_name;comment:画作名称"`
// Ruler string `gorm:"column:ruler;comment:平尺"`
// SaleNo string `gorm:"column:sale_no;comment:销售单号"`
// CompleteDate string `gorm:"column:complete_date;comment:成交日期"`
// MinPrice float32 `gorm:"column:min_price;comment:委托销售底价"`
// GuaranteePrice float32 `gorm:"column:guarantee_price;comment:已收取保证金;"`
// }
func (ArtworkEntrustDetail) TableName() string {
return "artwork_entrust_detail"
}
//对账单画作销售详情
type ArtworkSalesDetail struct {
Model
BatchId int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
TfNum string `gorm:"column:tf_num;unqiueIndex:batchid_tfnum_idx;comment:"泰丰画作编号"`
ArtworkName string `gorm:"column:artwork_name;comment:画作名称"`
Ruler string `gorm:"column:ruler;comment:平尺"`
SaleNo string `gorm:"column:sale_no;comment:销售单号"`
CompleteDate string `gorm:"column:complete_date;comment:成交日期"`
}
func (ArtworkSalesDetail) TableName() string {
return "artwork_sales_detail"
}
// func (ArtworkStatementDetail) TableName() string {
// return "artwork_statement_detail"
// }

View File

@ -4,22 +4,42 @@ import "gorm.io/plugin/soft_delete"
// Contract 用户模型
type Contract struct {
ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Uid string `gorm:"column:uid;type:varchar(100);comment:合同表的唯一表示;NOT NULL" json:"uid"`
ArtistUid string `gorm:"column:artist_uid;type:varchar(100);comment:画家uid;NOT NULL" json:"artist_uid"`
ArtworkUid string `gorm:"column:artwork_uid;type:varchar(1000);comment:画作uid" json:"artwork_uid"`
ContractId string `gorm:"column:contract_id;type:varchar(300);comment:合同id" json:"contract_id"`
TransactionId string `gorm:"column:transaction_id;type:varchar(300);comment:交易id" json:"transaction_id"`
Type int32 `gorm:"column:type;type:int(1);comment:合同类型;NOT NULL" json:"type"`
ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看合同链接" json:"view_url"`
DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:合同下载链接" json:"download_url"`
State int32 `gorm:"column:state;type:int(1);comment:合同状态;NOT NULL" json:"state"` //1 未签署
Status int32 `gorm:"column:status;default:2;comment:2=锁定 3=解锁" json:"status" ` //跟随用户的锁定和解锁状态,用于控制数据的展示
LockTime string `gorm:"column:lock_time;comment:锁定时间" json:"lockTime"`
SignTime string `gorm:"column:sign_time;comment:签署时间" json:"sign_time"`
BatchId int32 `gorm:"column:batch_id;comment:批次ID" json:"batch_id"`
BatchName string `gorm:"column:batch_name;comment:批次名" json:"batch_name"`
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
ID int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Uid string `gorm:"column:uid;type:varchar(100);comment:合同表的唯一表示;NOT NULL" json:"uid"`
ArtistUid string `gorm:"column:artist_uid;type:varchar(100);comment:画家uid;NOT NULL" json:"artist_uid"`
ArtworkUid string `gorm:"column:artwork_uid;type:varchar(1000);comment:画作uid" json:"artwork_uid"`
ContractId string `gorm:"column:contract_id;type:varchar(300);comment:合同id" json:"contract_id"`
TransactionId string `gorm:"column:transaction_id;type:varchar(300);comment:交易id" json:"transaction_id"`
Type int32 `gorm:"column:type;type:int(1);comment:合同类型 (1);NOT NULL" json:"type"`
ViewUrl string `gorm:"column:view_url;type:varchar(500);comment:在线查看合同链接" json:"view_url"`
DownloadUrl string `gorm:"column:download_url;type:varchar(500);comment:合同下载链接" json:"download_url"`
State int32 `gorm:"column:state;type:int(1);comment:合同状态,1:未签署2:已签署;NOT NULL" json:"state"` //1 未签署 2 已签署
Status int32 `gorm:"column:status;default:2;comment:2=锁定 3=解锁" json:"status" ` //跟随用户的锁定和解锁状态,用于控制数据的展示
LockTime string `gorm:"column:lock_time;comment:锁定时间" json:"lockTime"`
SignTime string `gorm:"column:sign_time;comment:签署时间" json:"sign_time"`
BatchName string `gorm:"column:batch_name;comment:批次名" json:"batch_name"`
StType int32 `gorm:"column:st_type;unqiueIndex:sttype_uid_batchtime_idx;comment:对账单类型 1=版权 2=物权;"`
BatchId int32 `gorm:"column:batch_id;comment:批次ID" json:"batch_id"`
ArtworkInfo []ArtworkStatementDetail `gorm:"column:artwork_info;foreignKey:BatchId;references:ID"` //当前批次的委托单详情
CreatedAt int32 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int32 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
// 对账单画作委托详情
type ArtworkStatementDetail struct {
Model
Uid string `gorm:"column:uid;type:varchar(100);comment:对账单画作详情表的唯一表示;NOT NULL" json:"uid"`
BatchId int64 `gorm:"column:batch_id;unqiueIndex:batchid_tfnum_idx;comment:批次id;"`
TfNum string `gorm:"column:tf_num;unqiueIndex:batchid_tfnum_idx;comment:"泰丰画作编号"`
ArtworkName string `gorm:"column:artwork_name;comment:画作名称"`
Ruler string `gorm:"column:ruler;comment:平尺"`
SaleNo string `gorm:"column:sale_no;comment:销售单号"`
CompleteDate string `gorm:"column:complete_date;comment:成交日期"`
MinPrice float32 `gorm:"column:min_price;comment:委托销售底价"`
GuaranteePrice float32 `gorm:"column:guarantee_price;comment:已收取保证金;"`
}
func (ArtworkStatementDetail) TableName() string {
return "artwork_statement_detail"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,418 +0,0 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v4.22.0--rc2
// source: pb/artistinfoStatement.proto
package artistinfoStatement
import (
context "context"
protocol "dubbo.apache.org/dubbo-go/v3/protocol"
dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3"
invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation"
grpc_go "github.com/dubbogo/grpc-go"
codes "github.com/dubbogo/grpc-go/codes"
metadata "github.com/dubbogo/grpc-go/metadata"
status "github.com/dubbogo/grpc-go/status"
common "github.com/dubbogo/triple/pkg/common"
constant "github.com/dubbogo/triple/pkg/common/constant"
triple "github.com/dubbogo/triple/pkg/triple"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc_go.SupportPackageIsVersion7
// StatementClient is the client API for Statement 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 StatementClient interface {
CreateStatementBatch(ctx context.Context, in *StatementBatchRequest, opts ...grpc_go.CallOption) (*CreateStatementBatchResponse, common.ErrorWithAttachment)
BatchCreateStatementBatch(ctx context.Context, in *BatchCreateStatementBatchRequest, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
GetStatementBatchList(ctx context.Context, in *GetStatementBatchListRequest, opts ...grpc_go.CallOption) (*GetStatementBatchListResponse, common.ErrorWithAttachment)
GetStatementBatchTimeMenus(ctx context.Context, in *GetStatementBatchListRequest, opts ...grpc_go.CallOption) (*GetStatementBatchTimeMenusResponse, common.ErrorWithAttachment)
CreateStatementDetail(ctx context.Context, in *StatementDetailRequest, opts ...grpc_go.CallOption) (*CreateStatementDetailResponse, common.ErrorWithAttachment)
BatchCreateStatementDetail(ctx context.Context, in *BatchCreateStatementDetailRequest, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
GetStatementDetailList(ctx context.Context, in *GetStatementDetailListRequest, opts ...grpc_go.CallOption) (*GetStatementDetailListResponse, common.ErrorWithAttachment)
}
type statementClient struct {
cc *triple.TripleConn
}
type StatementClientImpl struct {
CreateStatementBatch func(ctx context.Context, in *StatementBatchRequest) (*CreateStatementBatchResponse, error)
BatchCreateStatementBatch func(ctx context.Context, in *BatchCreateStatementBatchRequest) (*emptypb.Empty, error)
GetStatementBatchList func(ctx context.Context, in *GetStatementBatchListRequest) (*GetStatementBatchListResponse, error)
GetStatementBatchTimeMenus func(ctx context.Context, in *GetStatementBatchListRequest) (*GetStatementBatchTimeMenusResponse, error)
CreateStatementDetail func(ctx context.Context, in *StatementDetailRequest) (*CreateStatementDetailResponse, error)
BatchCreateStatementDetail func(ctx context.Context, in *BatchCreateStatementDetailRequest) (*emptypb.Empty, error)
GetStatementDetailList func(ctx context.Context, in *GetStatementDetailListRequest) (*GetStatementDetailListResponse, error)
}
func (c *StatementClientImpl) GetDubboStub(cc *triple.TripleConn) StatementClient {
return NewStatementClient(cc)
}
func (c *StatementClientImpl) XXX_InterfaceName() string {
return "artistinfo.Statement"
}
func NewStatementClient(cc *triple.TripleConn) StatementClient {
return &statementClient{cc}
}
func (c *statementClient) CreateStatementBatch(ctx context.Context, in *StatementBatchRequest, opts ...grpc_go.CallOption) (*CreateStatementBatchResponse, common.ErrorWithAttachment) {
out := new(CreateStatementBatchResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateStatementBatch", in, out)
}
func (c *statementClient) BatchCreateStatementBatch(ctx context.Context, in *BatchCreateStatementBatchRequest, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
out := new(emptypb.Empty)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BatchCreateStatementBatch", in, out)
}
func (c *statementClient) GetStatementBatchList(ctx context.Context, in *GetStatementBatchListRequest, opts ...grpc_go.CallOption) (*GetStatementBatchListResponse, common.ErrorWithAttachment) {
out := new(GetStatementBatchListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetStatementBatchList", in, out)
}
func (c *statementClient) GetStatementBatchTimeMenus(ctx context.Context, in *GetStatementBatchListRequest, opts ...grpc_go.CallOption) (*GetStatementBatchTimeMenusResponse, common.ErrorWithAttachment) {
out := new(GetStatementBatchTimeMenusResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetStatementBatchTimeMenus", in, out)
}
func (c *statementClient) CreateStatementDetail(ctx context.Context, in *StatementDetailRequest, opts ...grpc_go.CallOption) (*CreateStatementDetailResponse, common.ErrorWithAttachment) {
out := new(CreateStatementDetailResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateStatementDetail", in, out)
}
func (c *statementClient) BatchCreateStatementDetail(ctx context.Context, in *BatchCreateStatementDetailRequest, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
out := new(emptypb.Empty)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BatchCreateStatementDetail", in, out)
}
func (c *statementClient) GetStatementDetailList(ctx context.Context, in *GetStatementDetailListRequest, opts ...grpc_go.CallOption) (*GetStatementDetailListResponse, common.ErrorWithAttachment) {
out := new(GetStatementDetailListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetStatementDetailList", in, out)
}
// StatementServer is the server API for Statement service.
// All implementations must embed UnimplementedStatementServer
// for forward compatibility
type StatementServer interface {
CreateStatementBatch(context.Context, *StatementBatchRequest) (*CreateStatementBatchResponse, error)
BatchCreateStatementBatch(context.Context, *BatchCreateStatementBatchRequest) (*emptypb.Empty, error)
GetStatementBatchList(context.Context, *GetStatementBatchListRequest) (*GetStatementBatchListResponse, error)
GetStatementBatchTimeMenus(context.Context, *GetStatementBatchListRequest) (*GetStatementBatchTimeMenusResponse, error)
CreateStatementDetail(context.Context, *StatementDetailRequest) (*CreateStatementDetailResponse, error)
BatchCreateStatementDetail(context.Context, *BatchCreateStatementDetailRequest) (*emptypb.Empty, error)
GetStatementDetailList(context.Context, *GetStatementDetailListRequest) (*GetStatementDetailListResponse, error)
mustEmbedUnimplementedStatementServer()
}
// UnimplementedStatementServer must be embedded to have forward compatible implementations.
type UnimplementedStatementServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedStatementServer) CreateStatementBatch(context.Context, *StatementBatchRequest) (*CreateStatementBatchResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateStatementBatch not implemented")
}
func (UnimplementedStatementServer) BatchCreateStatementBatch(context.Context, *BatchCreateStatementBatchRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method BatchCreateStatementBatch not implemented")
}
func (UnimplementedStatementServer) GetStatementBatchList(context.Context, *GetStatementBatchListRequest) (*GetStatementBatchListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetStatementBatchList not implemented")
}
func (UnimplementedStatementServer) GetStatementBatchTimeMenus(context.Context, *GetStatementBatchListRequest) (*GetStatementBatchTimeMenusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetStatementBatchTimeMenus not implemented")
}
func (UnimplementedStatementServer) CreateStatementDetail(context.Context, *StatementDetailRequest) (*CreateStatementDetailResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateStatementDetail not implemented")
}
func (UnimplementedStatementServer) BatchCreateStatementDetail(context.Context, *BatchCreateStatementDetailRequest) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method BatchCreateStatementDetail not implemented")
}
func (UnimplementedStatementServer) GetStatementDetailList(context.Context, *GetStatementDetailListRequest) (*GetStatementDetailListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetStatementDetailList not implemented")
}
func (s *UnimplementedStatementServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedStatementServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedStatementServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &Statement_ServiceDesc
}
func (s *UnimplementedStatementServer) XXX_InterfaceName() string {
return "artistinfo.Statement"
}
func (UnimplementedStatementServer) mustEmbedUnimplementedStatementServer() {}
// UnsafeStatementServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to StatementServer will
// result in compilation errors.
type UnsafeStatementServer interface {
mustEmbedUnimplementedStatementServer()
}
func RegisterStatementServer(s grpc_go.ServiceRegistrar, srv StatementServer) {
s.RegisterService(&Statement_ServiceDesc, srv)
}
func _Statement_CreateStatementBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(StatementBatchRequest)
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("CreateStatementBatch", 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 _Statement_BatchCreateStatementBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BatchCreateStatementBatchRequest)
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("BatchCreateStatementBatch", 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 _Statement_GetStatementBatchList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetStatementBatchListRequest)
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("GetStatementBatchList", 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 _Statement_GetStatementBatchTimeMenus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetStatementBatchListRequest)
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("GetStatementBatchTimeMenus", 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 _Statement_CreateStatementDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(StatementDetailRequest)
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("CreateStatementDetail", 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 _Statement_BatchCreateStatementDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BatchCreateStatementDetailRequest)
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("BatchCreateStatementDetail", 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 _Statement_GetStatementDetailList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetStatementDetailListRequest)
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("GetStatementDetailList", 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)
}
// Statement_ServiceDesc is the grpc_go.ServiceDesc for Statement service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var Statement_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "artistinfo.Statement",
HandlerType: (*StatementServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "CreateStatementBatch",
Handler: _Statement_CreateStatementBatch_Handler,
},
{
MethodName: "BatchCreateStatementBatch",
Handler: _Statement_BatchCreateStatementBatch_Handler,
},
{
MethodName: "GetStatementBatchList",
Handler: _Statement_GetStatementBatchList_Handler,
},
{
MethodName: "GetStatementBatchTimeMenus",
Handler: _Statement_GetStatementBatchTimeMenus_Handler,
},
{
MethodName: "CreateStatementDetail",
Handler: _Statement_CreateStatementDetail_Handler,
},
{
MethodName: "BatchCreateStatementDetail",
Handler: _Statement_BatchCreateStatementDetail_Handler,
},
{
MethodName: "GetStatementDetailList",
Handler: _Statement_GetStatementDetailList_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/artistinfoStatement.proto",
}

View File

@ -0,0 +1,436 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.8
// source: statement.proto
package statement
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Contracts struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ContractUid string `protobuf:"bytes,1,opt,name=ContractUid,json=contract_uid,proto3" json:"ContractUid,omitempty"`
ArtistUid string `protobuf:"bytes,2,opt,name=ArtistUid,json=artist_uid,proto3" json:"ArtistUid,omitempty"`
ArtworkUid string `protobuf:"bytes,3,opt,name=ArtworkUid,json=artwork_uid,proto3" json:"ArtworkUid,omitempty"`
ContractId string `protobuf:"bytes,4,opt,name=ContractId,json=contract_id,proto3" json:"ContractId,omitempty"`
TransactionId string `protobuf:"bytes,5,opt,name=TransactionId,json=transaction_id,proto3" json:"TransactionId,omitempty"`
Type int32 `protobuf:"varint,6,opt,name=Type,json=type,proto3" json:"Type,omitempty"`
ViewUrl string `protobuf:"bytes,7,opt,name=ViewUrl,json=view_url,proto3" json:"ViewUrl,omitempty"`
DownloadUrl string `protobuf:"bytes,8,opt,name=DownloadUrl,json=download_url,proto3" json:"DownloadUrl,omitempty"`
State int32 `protobuf:"varint,9,opt,name=State,json=state,proto3" json:"State,omitempty"`
Status int32 `protobuf:"varint,10,opt,name=Status,json=status,proto3" json:"Status,omitempty"`
ExpirationTime string `protobuf:"bytes,11,opt,name=ExpirationTime,json=expiration_time,proto3" json:"ExpirationTime,omitempty"`
LockTime string `protobuf:"bytes,12,opt,name=LockTime,json=lock_time,proto3" json:"LockTime,omitempty"`
SignTime string `protobuf:"bytes,13,opt,name=SignTime,json=sign_time,proto3" json:"SignTime,omitempty"`
}
func (x *Contracts) Reset() {
*x = Contracts{}
if protoimpl.UnsafeEnabled {
mi := &file_statement_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Contracts) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Contracts) ProtoMessage() {}
func (x *Contracts) ProtoReflect() protoreflect.Message {
mi := &file_statement_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Contracts.ProtoReflect.Descriptor instead.
func (*Contracts) Descriptor() ([]byte, []int) {
return file_statement_proto_rawDescGZIP(), []int{0}
}
func (x *Contracts) GetContractUid() string {
if x != nil {
return x.ContractUid
}
return ""
}
func (x *Contracts) GetArtistUid() string {
if x != nil {
return x.ArtistUid
}
return ""
}
func (x *Contracts) GetArtworkUid() string {
if x != nil {
return x.ArtworkUid
}
return ""
}
func (x *Contracts) GetContractId() string {
if x != nil {
return x.ContractId
}
return ""
}
func (x *Contracts) GetTransactionId() string {
if x != nil {
return x.TransactionId
}
return ""
}
func (x *Contracts) GetType() int32 {
if x != nil {
return x.Type
}
return 0
}
func (x *Contracts) GetViewUrl() string {
if x != nil {
return x.ViewUrl
}
return ""
}
func (x *Contracts) GetDownloadUrl() string {
if x != nil {
return x.DownloadUrl
}
return ""
}
func (x *Contracts) GetState() int32 {
if x != nil {
return x.State
}
return 0
}
func (x *Contracts) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *Contracts) GetExpirationTime() string {
if x != nil {
return x.ExpirationTime
}
return ""
}
func (x *Contracts) GetLockTime() string {
if x != nil {
return x.LockTime
}
return ""
}
func (x *Contracts) GetSignTime() string {
if x != nil {
return x.SignTime
}
return ""
}
type StatementListRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ArtistUid string `protobuf:"bytes,1,opt,name=ArtistUid,json=artist_uid,proto3" json:"ArtistUid,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=PageSize,json=pageSize,proto3" json:"PageSize,omitempty"`
Page int32 `protobuf:"varint,3,opt,name=Page,json=page,proto3" json:"Page,omitempty"`
State int32 `protobuf:"varint,4,opt,name=State,json=state,proto3" json:"State,omitempty"`
}
func (x *StatementListRequest) Reset() {
*x = StatementListRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_statement_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StatementListRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatementListRequest) ProtoMessage() {}
func (x *StatementListRequest) ProtoReflect() protoreflect.Message {
mi := &file_statement_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatementListRequest.ProtoReflect.Descriptor instead.
func (*StatementListRequest) Descriptor() ([]byte, []int) {
return file_statement_proto_rawDescGZIP(), []int{1}
}
func (x *StatementListRequest) GetArtistUid() string {
if x != nil {
return x.ArtistUid
}
return ""
}
func (x *StatementListRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *StatementListRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *StatementListRequest) GetState() int32 {
if x != nil {
return x.State
}
return 0
}
type StatementListRespond struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Data []*Contracts `protobuf:"bytes,1,rep,name=Data,json=data,proto3" json:"Data,omitempty"`
Msg string `protobuf:"bytes,2,opt,name=Msg,json=msg,proto3" json:"Msg,omitempty"`
}
func (x *StatementListRespond) Reset() {
*x = StatementListRespond{}
if protoimpl.UnsafeEnabled {
mi := &file_statement_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StatementListRespond) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatementListRespond) ProtoMessage() {}
func (x *StatementListRespond) ProtoReflect() protoreflect.Message {
mi := &file_statement_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatementListRespond.ProtoReflect.Descriptor instead.
func (*StatementListRespond) Descriptor() ([]byte, []int) {
return file_statement_proto_rawDescGZIP(), []int{2}
}
func (x *StatementListRespond) GetData() []*Contracts {
if x != nil {
return x.Data
}
return nil
}
func (x *StatementListRespond) GetMsg() string {
if x != nil {
return x.Msg
}
return ""
}
var File_statement_proto protoreflect.FileDescriptor
var file_statement_proto_rawDesc = []byte{
0x0a, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x99, 0x03, 0x0a,
0x09, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0b, 0x43, 0x6f,
0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a,
0x09, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0a,
0x41, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x55, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0b, 0x61, 0x72, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x75, 0x69, 0x64, 0x12, 0x1f, 0x0a,
0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x12, 0x25,
0x0a, 0x0d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x07, 0x56, 0x69, 0x65,
0x77, 0x55, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77,
0x5f, 0x75, 0x72, 0x6c, 0x12, 0x21, 0x0a, 0x0b, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64,
0x55, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x6f, 0x77, 0x6e, 0x6c,
0x6f, 0x61, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65,
0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x27, 0x0a, 0x0e, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x65,
0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1b,
0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x08, 0x53,
0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73,
0x69, 0x67, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x7b, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74,
0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1d, 0x0a, 0x09, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x55, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x5f, 0x75, 0x69, 0x64, 0x12,
0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x50,
0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0x52, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65,
0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x12, 0x28, 0x0a,
0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x74,
0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74,
0x73, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x32, 0x60, 0x0a, 0x09, 0x53, 0x74, 0x61,
0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x53, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d,
0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d,
0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73,
0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65,
0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x22, 0x00, 0x42, 0x0e, 0x5a, 0x0c, 0x2e,
0x2f, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_statement_proto_rawDescOnce sync.Once
file_statement_proto_rawDescData = file_statement_proto_rawDesc
)
func file_statement_proto_rawDescGZIP() []byte {
file_statement_proto_rawDescOnce.Do(func() {
file_statement_proto_rawDescData = protoimpl.X.CompressGZIP(file_statement_proto_rawDescData)
})
return file_statement_proto_rawDescData
}
var file_statement_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_statement_proto_goTypes = []interface{}{
(*Contracts)(nil), // 0: statement.Contracts
(*StatementListRequest)(nil), // 1: statement.StatementListRequest
(*StatementListRespond)(nil), // 2: statement.StatementListRespond
}
var file_statement_proto_depIdxs = []int32{
0, // 0: statement.StatementListRespond.Data:type_name -> statement.Contracts
1, // 1: statement.Statement.StatementList:input_type -> statement.StatementListRequest
2, // 2: statement.Statement.StatementList:output_type -> statement.StatementListRespond
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_statement_proto_init() }
func file_statement_proto_init() {
if File_statement_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_statement_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Contracts); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_statement_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatementListRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_statement_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StatementListRespond); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_statement_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_statement_proto_goTypes,
DependencyIndexes: file_statement_proto_depIdxs,
MessageInfos: file_statement_proto_msgTypes,
}.Build()
File_statement_proto = out.File
file_statement_proto_rawDesc = nil
file_statement_proto_goTypes = nil
file_statement_proto_depIdxs = nil
}

View File

@ -0,0 +1,36 @@
syntax = "proto3";
package statement;
option go_package = "./;statement";
service Statement {
rpc StatementList (StatementListRequest) returns (StatementListRespond) {}
}
message Contracts{
string ContractUid = 1 [json_name = "contract_uid"];
string ArtistUid = 2 [json_name = "artist_uid"];
string ArtworkUid = 3 [json_name = "artwork_uid"];
string ContractId = 4 [json_name = "contract_id"];
string TransactionId = 5 [json_name = "transaction_id"];
int32 Type = 6 [json_name = "type"];
string ViewUrl = 7 [json_name = "view_url"];
string DownloadUrl = 8 [json_name = "download_url"];
int32 State = 9 [json_name = "state"];
int32 Status = 10 [json_name = "status"];
string ExpirationTime = 11 [json_name = "expiration_time"];
string LockTime = 12 [json_name = "lock_time"];
string SignTime = 13 [json_name = "sign_time"];
}
message StatementListRequest {
string ArtistUid = 1 [json_name = "artist_uid"];
int32 PageSize = 2 [json_name="pageSize"];
int32 Page = 3 [json_name="page"];
int32 State = 4 [json_name="state"];
}
message StatementListRespond {
repeated Contracts Data = 1 [json_name = "data"];
string Msg = 2 [json_name = "msg"];
}

View File

@ -0,0 +1,33 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: statement.proto
package statement
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 *Contracts) Validate() error {
return nil
}
func (this *StatementListRequest) Validate() error {
return nil
}
func (this *StatementListRespond) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}

View File

@ -0,0 +1,147 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v3.21.8
// source: statement.proto
package statement
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
// StatementClient is the client API for Statement 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 StatementClient interface {
StatementList(ctx context.Context, in *StatementListRequest, opts ...grpc_go.CallOption) (*StatementListRespond, common.ErrorWithAttachment)
}
type statementClient struct {
cc *triple.TripleConn
}
type StatementClientImpl struct {
StatementList func(ctx context.Context, in *StatementListRequest) (*StatementListRespond, error)
}
func (c *StatementClientImpl) GetDubboStub(cc *triple.TripleConn) StatementClient {
return NewStatementClient(cc)
}
func (c *StatementClientImpl) XXX_InterfaceName() string {
return "statement.Statement"
}
func NewStatementClient(cc *triple.TripleConn) StatementClient {
return &statementClient{cc}
}
func (c *statementClient) StatementList(ctx context.Context, in *StatementListRequest, opts ...grpc_go.CallOption) (*StatementListRespond, common.ErrorWithAttachment) {
out := new(StatementListRespond)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/StatementList", in, out)
}
// StatementServer is the server API for Statement service.
// All implementations must embed UnimplementedStatementServer
// for forward compatibility
type StatementServer interface {
StatementList(context.Context, *StatementListRequest) (*StatementListRespond, error)
mustEmbedUnimplementedStatementServer()
}
// UnimplementedStatementServer must be embedded to have forward compatible implementations.
type UnimplementedStatementServer struct {
proxyImpl protocol.Invoker
}
func (UnimplementedStatementServer) StatementList(context.Context, *StatementListRequest) (*StatementListRespond, error) {
return nil, status.Errorf(codes.Unimplemented, "method StatementList not implemented")
}
func (s *UnimplementedStatementServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
func (s *UnimplementedStatementServer) XXX_GetProxyImpl() protocol.Invoker {
return s.proxyImpl
}
func (s *UnimplementedStatementServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
return &Statement_ServiceDesc
}
func (s *UnimplementedStatementServer) XXX_InterfaceName() string {
return "statement.Statement"
}
func (UnimplementedStatementServer) mustEmbedUnimplementedStatementServer() {}
// UnsafeStatementServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to StatementServer will
// result in compilation errors.
type UnsafeStatementServer interface {
mustEmbedUnimplementedStatementServer()
}
func RegisterStatementServer(s grpc_go.ServiceRegistrar, srv StatementServer) {
s.RegisterService(&Statement_ServiceDesc, srv)
}
func _Statement_StatementList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(StatementListRequest)
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("StatementList", 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)
}
// Statement_ServiceDesc is the grpc_go.ServiceDesc for Statement service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
var Statement_ServiceDesc = grpc_go.ServiceDesc{
ServiceName: "statement.Statement",
HandlerType: (*StatementServer)(nil),
Methods: []grpc_go.MethodDesc{
{
MethodName: "StatementList",
Handler: _Statement_StatementList_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "statement.proto",
}

View File

@ -59,7 +59,6 @@ message ContractListRequest {
int32 PageSize = 2 [json_name="pageSize"];
int32 Page = 3 [json_name="page"];
int32 State = 4 [json_name="state"];
}
message ContractListRespond {

View File

@ -123,9 +123,10 @@ func migration() {
&model.ArtshowArtistIndex{}, //画展-画家指数
&model.ArtshowArtistSupplement{}, //画展-画家补充信息
&model.Contract{}, //合同
&model.StatementBatch{}, //对账单批次
&model.ArtworkEntrustDetail{}, //
&model.ArtworkSalesDetail{}, //
&model.ArtworkStatementDetail{}, //对账单详情
// &model.StatementBatch{}, //对账单批次
// &model.ArtworkEntrustDetail{}, //
// &model.ArtworkSalesDetail{}, //
)
if err != nil {
fmt.Println("register table fail")