main
parent
394e3ba4b1
commit
545916ec45
@ -0,0 +1,32 @@
|
|||||||
|
// Code generated by Wire. DO NOT EDIT.
|
||||||
|
|
||||||
|
//go:generate go run github.com/google/wire/cmd/wire
|
||||||
|
//go:build !wireinject
|
||||||
|
// +build !wireinject
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"exhibition-register/pkg/app"
|
||||||
|
"exhibition-register/pkg/db"
|
||||||
|
"exhibition-register/pkg/logger"
|
||||||
|
"exhibition-register/pkg/snowf"
|
||||||
|
"exhibition-register/pkg/tracing"
|
||||||
|
)
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "dubbo.apache.org/dubbo-go/v3/filter/tps/strategy"
|
||||||
|
_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||||
|
_ "exhibition-register/internal/handler"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Injectors from wire.go:
|
||||||
|
|
||||||
|
func InitApp() (*app.App, error) {
|
||||||
|
zapLogger := logger.ZapInit()
|
||||||
|
jaegerProvider := tracing.NewTracing()
|
||||||
|
node := snowf.NewSf()
|
||||||
|
gormDB := db.NewDB()
|
||||||
|
appApp := NewApp(zapLogger, jaegerProvider, node, gormDB)
|
||||||
|
return appApp, nil
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package controller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"exhibition-register/internal/logic"
|
||||||
|
"exhibition-register/pb/exhibition"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ExhibitionProvider struct {
|
||||||
|
exhibition.UnsafeExhibitionServer
|
||||||
|
registerLogic logic.Register
|
||||||
|
}
|
@ -1 +0,0 @@
|
|||||||
package logic
|
|
@ -0,0 +1,7 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
type IRegister interface {
|
||||||
|
}
|
||||||
|
|
||||||
|
type Register struct {
|
||||||
|
}
|
@ -1 +1,16 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
|
import "gorm.io/gorm"
|
||||||
|
|
||||||
|
type RegisterRecord struct {
|
||||||
|
gorm.Model
|
||||||
|
|
||||||
|
UUID string `json:"uuid" gorm:"primaryKey;column:uuid;type:varchar(255);not null;comment:报名记录Uid"`
|
||||||
|
ArtistName string `json:"artist_name" gorm:"column:artist_name;type:varchar(255);not null;comment:画家姓名"`
|
||||||
|
Gender int32 `json:"gender" gorm:"column:gender;type:int;comment:性别1男2女"`
|
||||||
|
PhoneNum string `json:"phone_num" gorm:"column:phone_num;type:varchar(255);not null;comment:手机号"`
|
||||||
|
IdCard string `json:"id_card" gorm:"column:id_card;type:varchar(255);not null;comment:身份证号"`
|
||||||
|
Address string `json:"address" gorm:"column:address;type:varchar(2000);not null;comment:通讯地址"`
|
||||||
|
IdCardPhoto string `json:"id_card_photo" gorm:"column:id_card_photo;type:varchar(2000);not null;comment:身份证照片"`
|
||||||
|
ArtistPhoto string `json:"artist_photo" gorm:"column:artist_photo;type:varchar(2000);not null;comment:画家本人近照"`
|
||||||
|
}
|
||||||
|
@ -1,11 +1,39 @@
|
|||||||
syntax = "proto3";
|
syntax = "proto3";
|
||||||
|
|
||||||
package exhibition;
|
package exhibition;
|
||||||
option go_package = "./exhibition";
|
option go_package = "./pb/exhibition";
|
||||||
|
|
||||||
import "pb/descriptor.proto";
|
|
||||||
import "pb/validator.proto";
|
import "pb/validator.proto";
|
||||||
|
import "pb/descriptor.proto";
|
||||||
|
|
||||||
service Exhibition {
|
service Exhibition {
|
||||||
|
rpc CheckPhone(RegisterInfo) returns (CheckPhoneResp);
|
||||||
|
rpc SaveRegisterRecord(RegisterInfo) returns (SaveRegisterRecordResp);
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterInfo{
|
||||||
|
int32 id = 1;
|
||||||
|
string uuid = 2;
|
||||||
|
string artistName = 3;
|
||||||
|
int32 gender = 4;
|
||||||
|
string phoneNum = 5;
|
||||||
|
string idCard = 6;
|
||||||
|
string address = 7;
|
||||||
|
string idCardPhoto = 8;
|
||||||
|
string artistPhoto = 9;
|
||||||
|
string createdAt = 10;
|
||||||
|
string updatedAt = 11;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message SaveRegisterRecordResp{
|
||||||
|
string msg = 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message CheckPhoneResp {
|
||||||
|
bool isExist = 1;
|
||||||
|
string msg = 2;
|
||||||
|
RegisterInfo data = 3;
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,405 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.28.0
|
||||||
|
// protoc v3.21.1
|
||||||
|
// source: pb/exhibition.proto
|
||||||
|
|
||||||
|
package exhibition
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "github.com/mwitkow/go-proto-validators"
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||||
|
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 RegisterInfo struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
|
Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
|
||||||
|
ArtistName string `protobuf:"bytes,3,opt,name=artistName,proto3" json:"artistName,omitempty"`
|
||||||
|
Gender int32 `protobuf:"varint,4,opt,name=gender,proto3" json:"gender,omitempty"`
|
||||||
|
PhoneNum string `protobuf:"bytes,5,opt,name=phoneNum,proto3" json:"phoneNum,omitempty"`
|
||||||
|
IdCard string `protobuf:"bytes,6,opt,name=idCard,proto3" json:"idCard,omitempty"`
|
||||||
|
Address string `protobuf:"bytes,7,opt,name=address,proto3" json:"address,omitempty"`
|
||||||
|
IdCardPhoto string `protobuf:"bytes,8,opt,name=idCardPhoto,proto3" json:"idCardPhoto,omitempty"`
|
||||||
|
ArtistPhoto string `protobuf:"bytes,9,opt,name=artistPhoto,proto3" json:"artistPhoto,omitempty"`
|
||||||
|
CreatedAt string `protobuf:"bytes,10,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
|
||||||
|
UpdatedAt string `protobuf:"bytes,11,opt,name=updatedAt,proto3" json:"updatedAt,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) Reset() {
|
||||||
|
*x = RegisterInfo{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pb_exhibition_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*RegisterInfo) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pb_exhibition_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 RegisterInfo.ProtoReflect.Descriptor instead.
|
||||||
|
func (*RegisterInfo) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pb_exhibition_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetUuid() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Uuid
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetArtistName() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.ArtistName
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetGender() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Gender
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetPhoneNum() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.PhoneNum
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetIdCard() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.IdCard
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetAddress() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Address
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetIdCardPhoto() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.IdCardPhoto
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetArtistPhoto() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.ArtistPhoto
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetCreatedAt() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.CreatedAt
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *RegisterInfo) GetUpdatedAt() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UpdatedAt
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type SaveRegisterRecordResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SaveRegisterRecordResp) Reset() {
|
||||||
|
*x = SaveRegisterRecordResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pb_exhibition_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SaveRegisterRecordResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*SaveRegisterRecordResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *SaveRegisterRecordResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pb_exhibition_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 SaveRegisterRecordResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*SaveRegisterRecordResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pb_exhibition_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *SaveRegisterRecordResp) GetMsg() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Msg
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type CheckPhoneResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
IsExist bool `protobuf:"varint,1,opt,name=isExist,proto3" json:"isExist,omitempty"`
|
||||||
|
Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
|
||||||
|
Data *RegisterInfo `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CheckPhoneResp) Reset() {
|
||||||
|
*x = CheckPhoneResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pb_exhibition_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CheckPhoneResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*CheckPhoneResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *CheckPhoneResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pb_exhibition_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 CheckPhoneResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*CheckPhoneResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pb_exhibition_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CheckPhoneResp) GetIsExist() bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.IsExist
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CheckPhoneResp) GetMsg() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Msg
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *CheckPhoneResp) GetData() *RegisterInfo {
|
||||||
|
if x != nil {
|
||||||
|
return x.Data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_pb_exhibition_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_pb_exhibition_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x13, 0x70, 0x62, 0x2f, 0x65, 0x78, 0x68, 0x69, 0x62, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
|
||||||
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x65, 0x78, 0x68, 0x69, 0x62, 0x69, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x1a, 0x12, 0x70, 0x62, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e,
|
||||||
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x70, 0x62, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,
|
||||||
|
0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x02, 0x0a, 0x0c, 0x52,
|
||||||
|
0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||||
|
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75,
|
||||||
|
0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12,
|
||||||
|
0x1e, 0x0a, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12,
|
||||||
|
0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||||
|
0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65,
|
||||||
|
0x4e, 0x75, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x68, 0x6f, 0x6e, 0x65,
|
||||||
|
0x4e, 0x75, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x64, 0x43, 0x61, 0x72, 0x64, 0x18, 0x06, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x64, 0x43, 0x61, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x61,
|
||||||
|
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64,
|
||||||
|
0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x64, 0x43, 0x61, 0x72, 0x64, 0x50,
|
||||||
|
0x68, 0x6f, 0x74, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x64, 0x43, 0x61,
|
||||||
|
0x72, 0x64, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x72, 0x74, 0x69, 0x73,
|
||||||
|
0x74, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x72,
|
||||||
|
0x74, 0x69, 0x73, 0x74, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x72, 0x65,
|
||||||
|
0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72,
|
||||||
|
0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74,
|
||||||
|
0x65, 0x64, 0x41, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61,
|
||||||
|
0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x2a, 0x0a, 0x16, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x67,
|
||||||
|
0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12,
|
||||||
|
0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73,
|
||||||
|
0x67, 0x22, 0x6a, 0x0a, 0x0e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52,
|
||||||
|
0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x69, 0x73, 0x45, 0x78, 0x69, 0x73, 0x74, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x78, 0x69, 0x73, 0x74, 0x12, 0x10, 0x0a,
|
||||||
|
0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12,
|
||||||
|
0x2c, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e,
|
||||||
|
0x65, 0x78, 0x68, 0x69, 0x62, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73,
|
||||||
|
0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xa4, 0x01,
|
||||||
|
0x0a, 0x0a, 0x45, 0x78, 0x68, 0x69, 0x62, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x0a,
|
||||||
|
0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x18, 0x2e, 0x65, 0x78, 0x68,
|
||||||
|
0x69, 0x62, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72,
|
||||||
|
0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x68, 0x69, 0x62, 0x69, 0x74, 0x69, 0x6f,
|
||||||
|
0x6e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70,
|
||||||
|
0x12, 0x52, 0x0a, 0x12, 0x53, 0x61, 0x76, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72,
|
||||||
|
0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x18, 0x2e, 0x65, 0x78, 0x68, 0x69, 0x62, 0x69, 0x74,
|
||||||
|
0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
|
||||||
|
0x1a, 0x22, 0x2e, 0x65, 0x78, 0x68, 0x69, 0x62, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x61,
|
||||||
|
0x76, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64,
|
||||||
|
0x52, 0x65, 0x73, 0x70, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x2f, 0x70, 0x62, 0x2f, 0x65, 0x78, 0x68,
|
||||||
|
0x69, 0x62, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_pb_exhibition_proto_rawDescOnce sync.Once
|
||||||
|
file_pb_exhibition_proto_rawDescData = file_pb_exhibition_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_pb_exhibition_proto_rawDescGZIP() []byte {
|
||||||
|
file_pb_exhibition_proto_rawDescOnce.Do(func() {
|
||||||
|
file_pb_exhibition_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_exhibition_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_pb_exhibition_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_pb_exhibition_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||||
|
var file_pb_exhibition_proto_goTypes = []interface{}{
|
||||||
|
(*RegisterInfo)(nil), // 0: exhibition.RegisterInfo
|
||||||
|
(*SaveRegisterRecordResp)(nil), // 1: exhibition.SaveRegisterRecordResp
|
||||||
|
(*CheckPhoneResp)(nil), // 2: exhibition.CheckPhoneResp
|
||||||
|
}
|
||||||
|
var file_pb_exhibition_proto_depIdxs = []int32{
|
||||||
|
0, // 0: exhibition.CheckPhoneResp.data:type_name -> exhibition.RegisterInfo
|
||||||
|
0, // 1: exhibition.Exhibition.CheckPhone:input_type -> exhibition.RegisterInfo
|
||||||
|
0, // 2: exhibition.Exhibition.SaveRegisterRecord:input_type -> exhibition.RegisterInfo
|
||||||
|
2, // 3: exhibition.Exhibition.CheckPhone:output_type -> exhibition.CheckPhoneResp
|
||||||
|
1, // 4: exhibition.Exhibition.SaveRegisterRecord:output_type -> exhibition.SaveRegisterRecordResp
|
||||||
|
3, // [3:5] is the sub-list for method output_type
|
||||||
|
1, // [1:3] 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_pb_exhibition_proto_init() }
|
||||||
|
func file_pb_exhibition_proto_init() {
|
||||||
|
if File_pb_exhibition_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_pb_exhibition_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*RegisterInfo); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pb_exhibition_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SaveRegisterRecordResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pb_exhibition_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*CheckPhoneResp); 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_pb_exhibition_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 3,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_pb_exhibition_proto_goTypes,
|
||||||
|
DependencyIndexes: file_pb_exhibition_proto_depIdxs,
|
||||||
|
MessageInfos: file_pb_exhibition_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_pb_exhibition_proto = out.File
|
||||||
|
file_pb_exhibition_proto_rawDesc = nil
|
||||||
|
file_pb_exhibition_proto_goTypes = nil
|
||||||
|
file_pb_exhibition_proto_depIdxs = nil
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
|
// source: pb/exhibition.proto
|
||||||
|
|
||||||
|
package exhibition
|
||||||
|
|
||||||
|
import (
|
||||||
|
fmt "fmt"
|
||||||
|
proto "github.com/golang/protobuf/proto"
|
||||||
|
_ "github.com/mwitkow/go-proto-validators"
|
||||||
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
|
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||||
|
math "math"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
var _ = proto.Marshal
|
||||||
|
var _ = fmt.Errorf
|
||||||
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *RegisterInfo) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SaveRegisterRecordResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *CheckPhoneResp) 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
|
||||||
|
}
|
@ -0,0 +1,192 @@
|
|||||||
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// - protoc-gen-go-triple v1.0.5
|
||||||
|
// - protoc v3.21.1
|
||||||
|
// source: pb/exhibition.proto
|
||||||
|
|
||||||
|
package exhibition
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
// ExhibitionClient is the client API for Exhibition 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 ExhibitionClient interface {
|
||||||
|
CheckPhone(ctx context.Context, in *RegisterInfo, opts ...grpc_go.CallOption) (*CheckPhoneResp, common.ErrorWithAttachment)
|
||||||
|
SaveRegisterRecord(ctx context.Context, in *RegisterInfo, opts ...grpc_go.CallOption) (*SaveRegisterRecordResp, common.ErrorWithAttachment)
|
||||||
|
}
|
||||||
|
|
||||||
|
type exhibitionClient struct {
|
||||||
|
cc *triple.TripleConn
|
||||||
|
}
|
||||||
|
|
||||||
|
type ExhibitionClientImpl struct {
|
||||||
|
CheckPhone func(ctx context.Context, in *RegisterInfo) (*CheckPhoneResp, error)
|
||||||
|
SaveRegisterRecord func(ctx context.Context, in *RegisterInfo) (*SaveRegisterRecordResp, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ExhibitionClientImpl) GetDubboStub(cc *triple.TripleConn) ExhibitionClient {
|
||||||
|
return NewExhibitionClient(cc)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *ExhibitionClientImpl) XXX_InterfaceName() string {
|
||||||
|
return "exhibition.Exhibition"
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewExhibitionClient(cc *triple.TripleConn) ExhibitionClient {
|
||||||
|
return &exhibitionClient{cc}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *exhibitionClient) CheckPhone(ctx context.Context, in *RegisterInfo, opts ...grpc_go.CallOption) (*CheckPhoneResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(CheckPhoneResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CheckPhone", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *exhibitionClient) SaveRegisterRecord(ctx context.Context, in *RegisterInfo, opts ...grpc_go.CallOption) (*SaveRegisterRecordResp, common.ErrorWithAttachment) {
|
||||||
|
out := new(SaveRegisterRecordResp)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SaveRegisterRecord", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ExhibitionServer is the server API for Exhibition service.
|
||||||
|
// All implementations must embed UnimplementedExhibitionServer
|
||||||
|
// for forward compatibility
|
||||||
|
type ExhibitionServer interface {
|
||||||
|
CheckPhone(context.Context, *RegisterInfo) (*CheckPhoneResp, error)
|
||||||
|
SaveRegisterRecord(context.Context, *RegisterInfo) (*SaveRegisterRecordResp, error)
|
||||||
|
mustEmbedUnimplementedExhibitionServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnimplementedExhibitionServer must be embedded to have forward compatible implementations.
|
||||||
|
type UnimplementedExhibitionServer struct {
|
||||||
|
proxyImpl protocol.Invoker
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedExhibitionServer) CheckPhone(context.Context, *RegisterInfo) (*CheckPhoneResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method CheckPhone not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedExhibitionServer) SaveRegisterRecord(context.Context, *RegisterInfo) (*SaveRegisterRecordResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method SaveRegisterRecord not implemented")
|
||||||
|
}
|
||||||
|
func (s *UnimplementedExhibitionServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
|
s.proxyImpl = impl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *UnimplementedExhibitionServer) XXX_GetProxyImpl() protocol.Invoker {
|
||||||
|
return s.proxyImpl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *UnimplementedExhibitionServer) XXX_ServiceDesc() *grpc_go.ServiceDesc {
|
||||||
|
return &Exhibition_ServiceDesc
|
||||||
|
}
|
||||||
|
func (s *UnimplementedExhibitionServer) XXX_InterfaceName() string {
|
||||||
|
return "exhibition.Exhibition"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (UnimplementedExhibitionServer) mustEmbedUnimplementedExhibitionServer() {}
|
||||||
|
|
||||||
|
// UnsafeExhibitionServer may be embedded to opt out of forward compatibility for this service.
|
||||||
|
// Use of this interface is not recommended, as added methods to ExhibitionServer will
|
||||||
|
// result in compilation errors.
|
||||||
|
type UnsafeExhibitionServer interface {
|
||||||
|
mustEmbedUnimplementedExhibitionServer()
|
||||||
|
}
|
||||||
|
|
||||||
|
func RegisterExhibitionServer(s grpc_go.ServiceRegistrar, srv ExhibitionServer) {
|
||||||
|
s.RegisterService(&Exhibition_ServiceDesc, srv)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Exhibition_CheckPhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(RegisterInfo)
|
||||||
|
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("CheckPhone", 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 _Exhibition_SaveRegisterRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(RegisterInfo)
|
||||||
|
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("SaveRegisterRecord", 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exhibition_ServiceDesc is the grpc_go.ServiceDesc for Exhibition service.
|
||||||
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
|
// and not to be introspected or modified (even as a copy)
|
||||||
|
var Exhibition_ServiceDesc = grpc_go.ServiceDesc{
|
||||||
|
ServiceName: "exhibition.Exhibition",
|
||||||
|
HandlerType: (*ExhibitionServer)(nil),
|
||||||
|
Methods: []grpc_go.MethodDesc{
|
||||||
|
{
|
||||||
|
MethodName: "CheckPhone",
|
||||||
|
Handler: _Exhibition_CheckPhone_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SaveRegisterRecord",
|
||||||
|
Handler: _Exhibition_SaveRegisterRecord_Handler,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Streams: []grpc_go.StreamDesc{},
|
||||||
|
Metadata: "pb/exhibition.proto",
|
||||||
|
}
|
Loading…
Reference in New Issue