main
parent
f3af2a2804
commit
28381abfee
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,610 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.10.1
|
||||
// source: pb/artshow.proto
|
||||
|
||||
package grpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"fonchain-artshow/pb/artShow"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// ArtShowClient is the client API for ArtShow 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 ArtShowClient interface {
|
||||
CreateShow(ctx context.Context, in *artShow.SaveShowReq, opts ...grpc.CallOption) (*artShow.SaveShowRes, error)
|
||||
UpdateShow(ctx context.Context, in *artShow.SaveShowReq, opts ...grpc.CallOption) (*artShow.SaveShowRes, error)
|
||||
DelShow(ctx context.Context, in *artShow.DelShowReq, opts ...grpc.CallOption) (*artShow.CommonRes, error)
|
||||
ShowList(ctx context.Context, in *artShow.ShowListReq, opts ...grpc.CallOption) (*artShow.ShowListRes, error)
|
||||
ShowArtworkInfo(ctx context.Context, in *artShow.ShowDetailReq, opts ...grpc.CallOption) (*artShow.ShowArtworkDetailRes, error)
|
||||
ShowDetail(ctx context.Context, in *artShow.ShowDetailReq, opts ...grpc.CallOption) (*artShow.ShowDetailRes, error)
|
||||
ShowStatisticalInfo(ctx context.Context, in *artShow.ShowStatisticalInfoReq, opts ...grpc.CallOption) (*artShow.ShowStatisticalInfoRes, error)
|
||||
ArtworkPrice(ctx context.Context, in *artShow.ArtworkPriceReq, opts ...grpc.CallOption) (*artShow.ArtworkPriceRes, error)
|
||||
CreateApply(ctx context.Context, in *artShow.SaveApplyReq, opts ...grpc.CallOption) (*artShow.SaveApplyRes, error)
|
||||
UpdateApply(ctx context.Context, in *artShow.SaveApplyReq, opts ...grpc.CallOption) (*artShow.SaveApplyRes, error)
|
||||
DelApply(ctx context.Context, in *artShow.DelApplyReq, opts ...grpc.CallOption) (*artShow.CommonRes, error)
|
||||
ShowListWithApply(ctx context.Context, in *artShow.ShowListReq, opts ...grpc.CallOption) (*artShow.ShowListRes, error)
|
||||
UpdateApplyStatus(ctx context.Context, in *artShow.UpdateApplyStatusReq, opts ...grpc.CallOption) (*artShow.CommonRes, error)
|
||||
ApplyList(ctx context.Context, in *artShow.ApplyListReq, opts ...grpc.CallOption) (*artShow.ApplyListRes, error)
|
||||
ApplyDetail(ctx context.Context, in *artShow.ApplyShowReq, opts ...grpc.CallOption) (*artShow.ApplyShowRes, error)
|
||||
}
|
||||
|
||||
type artShowClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewArtShowClient(cc grpc.ClientConnInterface) ArtShowClient {
|
||||
return &artShowClient{cc}
|
||||
}
|
||||
|
||||
func (c *artShowClient) CreateShow(ctx context.Context, in *artShow.SaveShowReq, opts ...grpc.CallOption) (*artShow.SaveShowRes, error) {
|
||||
out := new(artShow.SaveShowRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/CreateShow", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) UpdateShow(ctx context.Context, in *artShow.SaveShowReq, opts ...grpc.CallOption) (*artShow.SaveShowRes, error) {
|
||||
out := new(artShow.SaveShowRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/UpdateShow", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) DelShow(ctx context.Context, in *artShow.DelShowReq, opts ...grpc.CallOption) (*artShow.CommonRes, error) {
|
||||
out := new(artShow.CommonRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/DelShow", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowList(ctx context.Context, in *artShow.ShowListReq, opts ...grpc.CallOption) (*artShow.ShowListRes, error) {
|
||||
out := new(artShow.ShowListRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowArtworkInfo(ctx context.Context, in *artShow.ShowDetailReq, opts ...grpc.CallOption) (*artShow.ShowArtworkDetailRes, error) {
|
||||
out := new(artShow.ShowArtworkDetailRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowArtworkInfo", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowDetail(ctx context.Context, in *artShow.ShowDetailReq, opts ...grpc.CallOption) (*artShow.ShowDetailRes, error) {
|
||||
out := new(artShow.ShowDetailRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowDetail", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowStatisticalInfo(ctx context.Context, in *artShow.ShowStatisticalInfoReq, opts ...grpc.CallOption) (*artShow.ShowStatisticalInfoRes, error) {
|
||||
out := new(artShow.ShowStatisticalInfoRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowStatisticalInfo", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ArtworkPrice(ctx context.Context, in *artShow.ArtworkPriceReq, opts ...grpc.CallOption) (*artShow.ArtworkPriceRes, error) {
|
||||
out := new(artShow.ArtworkPriceRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ArtworkPrice", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) CreateApply(ctx context.Context, in *artShow.SaveApplyReq, opts ...grpc.CallOption) (*artShow.SaveApplyRes, error) {
|
||||
out := new(artShow.SaveApplyRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/CreateApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) UpdateApply(ctx context.Context, in *artShow.SaveApplyReq, opts ...grpc.CallOption) (*artShow.SaveApplyRes, error) {
|
||||
out := new(artShow.SaveApplyRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/UpdateApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) DelApply(ctx context.Context, in *artShow.DelApplyReq, opts ...grpc.CallOption) (*artShow.CommonRes, error) {
|
||||
out := new(artShow.CommonRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/DelApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ShowListWithApply(ctx context.Context, in *artShow.ShowListReq, opts ...grpc.CallOption) (*artShow.ShowListRes, error) {
|
||||
out := new(artShow.ShowListRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ShowListWithApply", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) UpdateApplyStatus(ctx context.Context, in *artShow.UpdateApplyStatusReq, opts ...grpc.CallOption) (*artShow.CommonRes, error) {
|
||||
out := new(artShow.CommonRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/UpdateApplyStatus", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ApplyList(ctx context.Context, in *artShow.ApplyListReq, opts ...grpc.CallOption) (*artShow.ApplyListRes, error) {
|
||||
out := new(artShow.ApplyListRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ApplyList", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *artShowClient) ApplyDetail(ctx context.Context, in *artShow.ApplyShowReq, opts ...grpc.CallOption) (*artShow.ApplyShowRes, error) {
|
||||
out := new(artShow.ApplyShowRes)
|
||||
err := c.cc.Invoke(ctx, "/ArtShow.ArtShow/ApplyDetail", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// ArtShowServer is the server API for ArtShow service.
|
||||
// All implementations must embed UnimplementedArtShowServer
|
||||
// for forward compatibility
|
||||
type ArtShowServer interface {
|
||||
CreateShow(context.Context, *artShow.SaveShowReq) (*artShow.SaveShowRes, error)
|
||||
UpdateShow(context.Context, *artShow.SaveShowReq) (*artShow.SaveShowRes, error)
|
||||
DelShow(context.Context, *artShow.DelShowReq) (*artShow.CommonRes, error)
|
||||
ShowList(context.Context, *artShow.ShowListReq) (*artShow.ShowListRes, error)
|
||||
ShowArtworkInfo(context.Context, *artShow.ShowDetailReq) (*artShow.ShowArtworkDetailRes, error)
|
||||
ShowDetail(context.Context, *artShow.ShowDetailReq) (*artShow.ShowDetailRes, error)
|
||||
ShowStatisticalInfo(context.Context, *artShow.ShowStatisticalInfoReq) (*artShow.ShowStatisticalInfoRes, error)
|
||||
ArtworkPrice(context.Context, *artShow.ArtworkPriceReq) (*artShow.ArtworkPriceRes, error)
|
||||
CreateApply(context.Context, *artShow.SaveApplyReq) (*artShow.SaveApplyRes, error)
|
||||
UpdateApply(context.Context, *artShow.SaveApplyReq) (*artShow.SaveApplyRes, error)
|
||||
DelApply(context.Context, *artShow.DelApplyReq) (*artShow.CommonRes, error)
|
||||
ShowListWithApply(context.Context, *artShow.ShowListReq) (*artShow.ShowListRes, error)
|
||||
UpdateApplyStatus(context.Context, *artShow.UpdateApplyStatusReq) (*artShow.CommonRes, error)
|
||||
ApplyList(context.Context, *artShow.ApplyListReq) (*artShow.ApplyListRes, error)
|
||||
ApplyDetail(context.Context, *artShow.ApplyShowReq) (*artShow.ApplyShowRes, error)
|
||||
mustEmbedUnimplementedArtShowServer()
|
||||
}
|
||||
|
||||
// UnimplementedArtShowServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedArtShowServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedArtShowServer) CreateShow(context.Context, *artShow.SaveShowReq) (*artShow.SaveShowRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateShow not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) UpdateShow(context.Context, *artShow.SaveShowReq) (*artShow.SaveShowRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateShow not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) DelShow(context.Context, *artShow.DelShowReq) (*artShow.CommonRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DelShow not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowList(context.Context, *artShow.ShowListReq) (*artShow.ShowListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowList not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowArtworkInfo(context.Context, *artShow.ShowDetailReq) (*artShow.ShowArtworkDetailRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowArtworkInfo not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowDetail(context.Context, *artShow.ShowDetailReq) (*artShow.ShowDetailRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowDetail not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowStatisticalInfo(context.Context, *artShow.ShowStatisticalInfoReq) (*artShow.ShowStatisticalInfoRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowStatisticalInfo not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ArtworkPrice(context.Context, *artShow.ArtworkPriceReq) (*artShow.ArtworkPriceRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ArtworkPrice not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) CreateApply(context.Context, *artShow.SaveApplyReq) (*artShow.SaveApplyRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) UpdateApply(context.Context, *artShow.SaveApplyReq) (*artShow.SaveApplyRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) DelApply(context.Context, *artShow.DelApplyReq) (*artShow.CommonRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DelApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ShowListWithApply(context.Context, *artShow.ShowListReq) (*artShow.ShowListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ShowListWithApply not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) UpdateApplyStatus(context.Context, *artShow.UpdateApplyStatusReq) (*artShow.CommonRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateApplyStatus not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ApplyList(context.Context, *artShow.ApplyListReq) (*artShow.ApplyListRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ApplyList not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) ApplyDetail(context.Context, *artShow.ApplyShowReq) (*artShow.ApplyShowRes, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ApplyDetail not implemented")
|
||||
}
|
||||
func (UnimplementedArtShowServer) mustEmbedUnimplementedArtShowServer() {}
|
||||
|
||||
// UnsafeArtShowServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to ArtShowServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeArtShowServer interface {
|
||||
mustEmbedUnimplementedArtShowServer()
|
||||
}
|
||||
|
||||
func RegisterArtShowServer(s grpc.ServiceRegistrar, srv ArtShowServer) {
|
||||
s.RegisterService(&ArtShow_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _ArtShow_CreateShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.SaveShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).CreateShow(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/CreateShow",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).CreateShow(ctx, req.(*artShow.SaveShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_UpdateShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.SaveShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).UpdateShow(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/UpdateShow",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).UpdateShow(ctx, req.(*artShow.SaveShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_DelShow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.DelShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).DelShow(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/DelShow",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).DelShow(ctx, req.(*artShow.DelShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ShowListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowList(ctx, req.(*artShow.ShowListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowArtworkInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ShowDetailReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowArtworkInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowArtworkInfo",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowArtworkInfo(ctx, req.(*artShow.ShowDetailReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ShowDetailReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowDetail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowDetail",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowDetail(ctx, req.(*artShow.ShowDetailReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowStatisticalInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ShowStatisticalInfoReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowStatisticalInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowStatisticalInfo",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowStatisticalInfo(ctx, req.(*artShow.ShowStatisticalInfoReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ArtworkPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ArtworkPriceReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ArtworkPrice(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ArtworkPrice",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ArtworkPrice(ctx, req.(*artShow.ArtworkPriceReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_CreateApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.SaveApplyReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).CreateApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/CreateApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).CreateApply(ctx, req.(*artShow.SaveApplyReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_UpdateApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.SaveApplyReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).UpdateApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/UpdateApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).UpdateApply(ctx, req.(*artShow.SaveApplyReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_DelApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.DelApplyReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).DelApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/DelApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).DelApply(ctx, req.(*artShow.DelApplyReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ShowListWithApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ShowListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ShowListWithApply(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ShowListWithApply",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ShowListWithApply(ctx, req.(*artShow.ShowListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_UpdateApplyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.UpdateApplyStatusReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).UpdateApplyStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/UpdateApplyStatus",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).UpdateApplyStatus(ctx, req.(*artShow.UpdateApplyStatusReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ApplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ApplyListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ApplyList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ApplyList",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ApplyList(ctx, req.(*artShow.ApplyListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _ArtShow_ApplyDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(artShow.ApplyShowReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(ArtShowServer).ApplyDetail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/ArtShow.ArtShow/ApplyDetail",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ArtShowServer).ApplyDetail(ctx, req.(*artShow.ApplyShowReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// ArtShow_ServiceDesc is the grpc.ServiceDesc for ArtShow service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var ArtShow_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "ArtShow.ArtShow",
|
||||
HandlerType: (*ArtShowServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "CreateShow",
|
||||
Handler: _ArtShow_CreateShow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateShow",
|
||||
Handler: _ArtShow_UpdateShow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DelShow",
|
||||
Handler: _ArtShow_DelShow_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowList",
|
||||
Handler: _ArtShow_ShowList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowArtworkInfo",
|
||||
Handler: _ArtShow_ShowArtworkInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowDetail",
|
||||
Handler: _ArtShow_ShowDetail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowStatisticalInfo",
|
||||
Handler: _ArtShow_ShowStatisticalInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ArtworkPrice",
|
||||
Handler: _ArtShow_ArtworkPrice_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateApply",
|
||||
Handler: _ArtShow_CreateApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateApply",
|
||||
Handler: _ArtShow_UpdateApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DelApply",
|
||||
Handler: _ArtShow_DelApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ShowListWithApply",
|
||||
Handler: _ArtShow_ShowListWithApply_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateApplyStatus",
|
||||
Handler: _ArtShow_UpdateApplyStatus_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ApplyList",
|
||||
Handler: _ArtShow_ApplyList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ApplyDetail",
|
||||
Handler: _ArtShow_ApplyDetail_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "pb/artshow.proto",
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package serializer
|
||||
|
||||
import (
|
||||
"fonchain-artshow/cmd/model"
|
||||
"fonchain-artshow/pkg/utils"
|
||||
"math"
|
||||
)
|
||||
|
||||
func _CalcPrice(artworks []*model.ArtworkPrice, ruler int32, totalPrice int64) (err error, save []*model.ArtworkPrice) {
|
||||
if totalPrice == 0 || ruler == 0 {
|
||||
return nil, artworks
|
||||
}
|
||||
|
||||
save = make([]*model.ArtworkPrice, 0)
|
||||
|
||||
var (
|
||||
needAddPriceArtworkIndex int
|
||||
currentArtworkRuler int
|
||||
currentTotalPrice int64
|
||||
maxRulerIndex int
|
||||
totalDiv float64
|
||||
)
|
||||
|
||||
price := utils.FormatFloat(float64(totalPrice)/float64(ruler)/10, 2) * 10 // 用于计算的单价
|
||||
//ruler_price := math.Floor(float64(total_price)/float64(ruler)/10) * 10 // 保存的单价
|
||||
|
||||
for i := 0; i < len(artworks); i++ {
|
||||
if currentArtworkRuler < int(artworks[i].Ruler) {
|
||||
currentArtworkRuler = int(artworks[i].Ruler)
|
||||
needAddPriceArtworkIndex = i
|
||||
maxRulerIndex = i
|
||||
} else if currentArtworkRuler == int(artworks[i].Ruler) {
|
||||
currentArtworkRuler = 0
|
||||
needAddPriceArtworkIndex = -1
|
||||
}
|
||||
artworks[i].RulerPrice = int64(price)
|
||||
artworks[i].Price = int64(price * float64(artworks[i].Ruler))
|
||||
artworkPrice := float64(artworks[i].Price) * 0.95
|
||||
artworkPrice, div1 := math.Modf(artworkPrice)
|
||||
artworks[i].ArtworkPrice = int64(artworkPrice)
|
||||
totalDiv += div1 // 小数点 省略掉的 0.5
|
||||
|
||||
copyrightPrice := artworks[i].Price - artworks[i].ArtworkPrice
|
||||
artworks[i].CopyrightPrice = copyrightPrice
|
||||
currentTotalPrice += artworks[i].Price
|
||||
}
|
||||
|
||||
if needAddPriceArtworkIndex == -1 {
|
||||
needAddPriceArtworkIndex = maxRulerIndex
|
||||
}
|
||||
|
||||
artworks[needAddPriceArtworkIndex].RulerPrice = int64(price)
|
||||
artworks[needAddPriceArtworkIndex].FloatPrice = totalPrice - currentTotalPrice - artworks[needAddPriceArtworkIndex].Price
|
||||
artworks[needAddPriceArtworkIndex].Price = int64(float32(totalPrice) - float32(currentTotalPrice) + float32(artworks[needAddPriceArtworkIndex].Price))
|
||||
artworks[needAddPriceArtworkIndex].ArtworkPrice = int64((float64(artworks[needAddPriceArtworkIndex].Price) * 0.95) + totalDiv)
|
||||
artworks[needAddPriceArtworkIndex].CopyrightPrice = artworks[needAddPriceArtworkIndex].Price - artworks[needAddPriceArtworkIndex].ArtworkPrice
|
||||
|
||||
return nil, artworks
|
||||
}
|
||||
|
||||
func CalcReward(artworks []*model.ArtworkPrice, reward int64) (err error, save []*model.ArtworkPrice) {
|
||||
save = artworks
|
||||
if reward == 0 {
|
||||
return nil, artworks
|
||||
}
|
||||
for i := 0; i < len(artworks); i++ {
|
||||
artworks[i].ArtistPrice = reward * int64(artworks[i].Ruler)
|
||||
}
|
||||
return nil, save
|
||||
}
|
Loading…
Reference in New Issue