feat: import services and standardize Go 1.26.5

This commit is contained in:
2026-08-09 10:43:45 +08:00
parent 689c74b28f
commit 86024fa81d
1456 changed files with 220765 additions and 2 deletions

View File

@@ -0,0 +1,573 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: agency.proto
package market
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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 LoginRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"` // 账号 必填
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // 密码 必填
Verify string `protobuf:"bytes,3,opt,name=verify,proto3" json:"verify,omitempty"` // 检验码 必填
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *LoginRequest) Reset() {
*x = LoginRequest{}
mi := &file_agency_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *LoginRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginRequest) ProtoMessage() {}
func (x *LoginRequest) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{0}
}
func (x *LoginRequest) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
func (x *LoginRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
func (x *LoginRequest) GetVerify() string {
if x != nil {
return x.Verify
}
return ""
}
type MarketAgenctyItem struct {
state protoimpl.MessageState `protogen:"open.v1"`
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一标识
CreatedAt string `protobuf:"bytes,2,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // 联系人名称 必填
Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
Account string `protobuf:"bytes,5,opt,name=account,proto3" json:"account,omitempty"` // 帐号
Phone string `protobuf:"bytes,6,opt,name=phone,proto3" json:"phone,omitempty"` // 手机号
Password string `protobuf:"bytes,7,opt,name=password,proto3" json:"password,omitempty"` // 密码
OrgName string `protobuf:"bytes,8,opt,name=org_name,proto3" json:"org_name,omitempty"` // 机构名称
OrgPhoto string `protobuf:"bytes,9,opt,name=org_photo,proto3" json:"org_photo,omitempty"` // 机构照片
IdName string `protobuf:"bytes,10,opt,name=id_name,proto3" json:"id_name,omitempty"` // 证件姓名
IdBefore string `protobuf:"bytes,11,opt,name=id_before,proto3" json:"id_before,omitempty"` // 证件照片
IdAfter string `protobuf:"bytes,12,opt,name=id_after,proto3" json:"id_after,omitempty"` // 证件照片
Remark string `protobuf:"bytes,13,opt,name=remark,proto3" json:"remark,omitempty"` // 备注
CommissionRate int32 `protobuf:"varint,14,opt,name=commission_rate,proto3" json:"commission_rate,omitempty"` // 佣金比例
AgencyType int32 `protobuf:"varint,15,opt,name=agency_type,proto3" json:"agency_type,omitempty"` // 服务 状态1代理商 2安装商
Status int32 `protobuf:"varint,16,opt,name=status,proto3" json:"status,omitempty"` // 状态默认为0-1禁止1为正常
Email string `protobuf:"bytes,17,opt,name=email,proto3" json:"email,omitempty"` // 邮箱
Country string `protobuf:"bytes,18,opt,name=country,proto3" json:"country,omitempty"` // 国家
Area string `protobuf:"bytes,19,opt,name=area,proto3" json:"area,omitempty"` // 地区
Approve int32 `protobuf:"varint,20,opt,name=approve,proto3" json:"approve,omitempty"` // 审核状态0待审核 2审核通过 -2审核未通过
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *MarketAgenctyItem) Reset() {
*x = MarketAgenctyItem{}
mi := &file_agency_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *MarketAgenctyItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MarketAgenctyItem) ProtoMessage() {}
func (x *MarketAgenctyItem) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MarketAgenctyItem.ProtoReflect.Descriptor instead.
func (*MarketAgenctyItem) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{1}
}
func (x *MarketAgenctyItem) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *MarketAgenctyItem) GetCreatedAt() string {
if x != nil {
return x.CreatedAt
}
return ""
}
func (x *MarketAgenctyItem) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *MarketAgenctyItem) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MarketAgenctyItem) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
func (x *MarketAgenctyItem) GetPhone() string {
if x != nil {
return x.Phone
}
return ""
}
func (x *MarketAgenctyItem) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
func (x *MarketAgenctyItem) GetOrgName() string {
if x != nil {
return x.OrgName
}
return ""
}
func (x *MarketAgenctyItem) GetOrgPhoto() string {
if x != nil {
return x.OrgPhoto
}
return ""
}
func (x *MarketAgenctyItem) GetIdName() string {
if x != nil {
return x.IdName
}
return ""
}
func (x *MarketAgenctyItem) GetIdBefore() string {
if x != nil {
return x.IdBefore
}
return ""
}
func (x *MarketAgenctyItem) GetIdAfter() string {
if x != nil {
return x.IdAfter
}
return ""
}
func (x *MarketAgenctyItem) GetRemark() string {
if x != nil {
return x.Remark
}
return ""
}
func (x *MarketAgenctyItem) GetCommissionRate() int32 {
if x != nil {
return x.CommissionRate
}
return 0
}
func (x *MarketAgenctyItem) GetAgencyType() int32 {
if x != nil {
return x.AgencyType
}
return 0
}
func (x *MarketAgenctyItem) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *MarketAgenctyItem) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *MarketAgenctyItem) GetCountry() string {
if x != nil {
return x.Country
}
return ""
}
func (x *MarketAgenctyItem) GetArea() string {
if x != nil {
return x.Area
}
return ""
}
func (x *MarketAgenctyItem) GetApprove() int32 {
if x != nil {
return x.Approve
}
return 0
}
type SetPasswordRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"`
OldPassword string `protobuf:"bytes,2,opt,name=old_password,proto3" json:"old_password,omitempty"` // 旧密码
NewPassword string `protobuf:"bytes,3,opt,name=new_password,proto3" json:"new_password,omitempty"` // 新密码
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SetPasswordRequest) Reset() {
*x = SetPasswordRequest{}
mi := &file_agency_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SetPasswordRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetPasswordRequest) ProtoMessage() {}
func (x *SetPasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetPasswordRequest.ProtoReflect.Descriptor instead.
func (*SetPasswordRequest) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{2}
}
func (x *SetPasswordRequest) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *SetPasswordRequest) GetOldPassword() string {
if x != nil {
return x.OldPassword
}
return ""
}
func (x *SetPasswordRequest) GetNewPassword() string {
if x != nil {
return x.NewPassword
}
return ""
}
type AgencyReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // 总数
Data []*MarketAgenctyItem `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` // 数据
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *AgencyReply) Reset() {
*x = AgencyReply{}
mi := &file_agency_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *AgencyReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AgencyReply) ProtoMessage() {}
func (x *AgencyReply) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AgencyReply.ProtoReflect.Descriptor instead.
func (*AgencyReply) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{3}
}
func (x *AgencyReply) GetCount() int64 {
if x != nil {
return x.Count
}
return 0
}
func (x *AgencyReply) GetData() []*MarketAgenctyItem {
if x != nil {
return x.Data
}
return nil
}
type ApproveRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Approve int32 `protobuf:"varint,1,opt,name=approve,proto3" json:"approve,omitempty"` // 1:通过 2:拒绝
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一标识
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ApproveRequest) Reset() {
*x = ApproveRequest{}
mi := &file_agency_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ApproveRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ApproveRequest) ProtoMessage() {}
func (x *ApproveRequest) ProtoReflect() protoreflect.Message {
mi := &file_agency_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ApproveRequest.ProtoReflect.Descriptor instead.
func (*ApproveRequest) Descriptor() ([]byte, []int) {
return file_agency_proto_rawDescGZIP(), []int{4}
}
func (x *ApproveRequest) GetApprove() int32 {
if x != nil {
return x.Approve
}
return 0
}
func (x *ApproveRequest) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
var File_agency_proto protoreflect.FileDescriptor
const file_agency_proto_rawDesc = "" +
"\n" +
"\x16ec/market/agency.proto\x12\x06market\x1a\x13market/blocks.proto\"\\\n" +
"\fLoginRequest\x12\x18\n" +
"\aaccount\x18\x01 \x01(\tR\aaccount\x12\x1a\n" +
"\bpassword\x18\x02 \x01(\tR\bpassword\x12\x16\n" +
"\x06verify\x18\x03 \x01(\tR\x06verify\"\xaf\x04\n" +
"\x11MarketAgenctyItem\x12\x1a\n" +
"\bidentity\x18\x01 \x01(\tR\bidentity\x12\x1e\n" +
"\n" +
"created_at\x18\x02 \x01(\tR\n" +
"created_at\x12\x12\n" +
"\x04name\x18\x03 \x01(\tR\x04name\x12\x16\n" +
"\x06avatar\x18\x04 \x01(\tR\x06avatar\x12\x18\n" +
"\aaccount\x18\x05 \x01(\tR\aaccount\x12\x14\n" +
"\x05phone\x18\x06 \x01(\tR\x05phone\x12\x1a\n" +
"\bpassword\x18\a \x01(\tR\bpassword\x12\x1a\n" +
"\borg_name\x18\b \x01(\tR\borg_name\x12\x1c\n" +
"\torg_photo\x18\t \x01(\tR\torg_photo\x12\x18\n" +
"\aid_name\x18\n" +
" \x01(\tR\aid_name\x12\x1c\n" +
"\tid_before\x18\v \x01(\tR\tid_before\x12\x1a\n" +
"\bid_after\x18\f \x01(\tR\bid_after\x12\x16\n" +
"\x06remark\x18\r \x01(\tR\x06remark\x12(\n" +
"\x0fcommission_rate\x18\x0e \x01(\x05R\x0fcommission_rate\x12 \n" +
"\vagency_type\x18\x0f \x01(\x05R\vagency_type\x12\x16\n" +
"\x06status\x18\x10 \x01(\x05R\x06status\x12\x14\n" +
"\x05email\x18\x11 \x01(\tR\x05email\x12\x18\n" +
"\acountry\x18\x12 \x01(\tR\acountry\x12\x12\n" +
"\x04area\x18\x13 \x01(\tR\x04area\x12\x18\n" +
"\aapprove\x18\x14 \x01(\x05R\aapprove\"x\n" +
"\x12SetPasswordRequest\x12\x1a\n" +
"\bidentity\x18\x01 \x01(\tR\bidentity\x12\"\n" +
"\fold_password\x18\x02 \x01(\tR\fold_password\x12\"\n" +
"\fnew_password\x18\x03 \x01(\tR\fnew_password\"R\n" +
"\vAgencyReply\x12\x14\n" +
"\x05count\x18\x01 \x01(\x03R\x05count\x12-\n" +
"\x04data\x18\x02 \x03(\v2\x19.market.MarketAgenctyItemR\x04data\"F\n" +
"\x0eApproveRequest\x12\x18\n" +
"\aapprove\x18\x01 \x01(\x05R\aapprove\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity2\x90\x04\n" +
"\x06Agency\x123\n" +
"\x05Login\x12\x14.market.LoginRequest\x1a\x12.market.LoginReply\"\x00\x12:\n" +
"\x06Create\x12\x19.market.MarketAgenctyItem\x1a\x13.market.StatusReply\"\x00\x128\n" +
"\x03Get\x12\x14.market.IdentRequest\x1a\x19.market.MarketAgenctyItem\"\x00\x124\n" +
"\x05Fetch\x12\x14.market.FetchRequest\x1a\x13.market.AgencyReply\"\x00\x12:\n" +
"\x06Modify\x12\x19.market.MarketAgenctyItem\x1a\x13.market.StatusReply\"\x00\x125\n" +
"\x06Delete\x12\x14.market.IdentRequest\x1a\x13.market.StatusReply\"\x00\x12@\n" +
"\vSetPassword\x12\x1a.market.SetPasswordRequest\x1a\x13.market.StatusReply\"\x00\x126\n" +
"\aPending\x12\x14.market.FetchRequest\x1a\x13.market.AgencyReply\"\x00\x128\n" +
"\aApprove\x12\x16.market.ApproveRequest\x1a\x13.market.StatusReply\"\x00B\n" +
"Z\b.;marketb\x06proto3"
var (
file_agency_proto_rawDescOnce sync.Once
file_agency_proto_rawDescData []byte
)
func file_agency_proto_rawDescGZIP() []byte {
file_agency_proto_rawDescOnce.Do(func() {
file_agency_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_agency_proto_rawDesc), len(file_agency_proto_rawDesc)))
})
return file_agency_proto_rawDescData
}
var file_agency_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_agency_proto_goTypes = []any{
(*LoginRequest)(nil), // 0: market.LoginRequest
(*MarketAgenctyItem)(nil), // 1: market.MarketAgenctyItem
(*SetPasswordRequest)(nil), // 2: market.SetPasswordRequest
(*AgencyReply)(nil), // 3: market.AgencyReply
(*ApproveRequest)(nil), // 4: market.ApproveRequest
(*IdentRequest)(nil), // 5: market.IdentRequest
(*FetchRequest)(nil), // 6: market.FetchRequest
(*LoginReply)(nil), // 7: market.LoginReply
(*StatusReply)(nil), // 8: market.StatusReply
}
var file_agency_proto_depIdxs = []int32{
1, // 0: market.AgencyReply.data:type_name -> market.MarketAgenctyItem
0, // 1: market.Agency.Login:input_type -> market.LoginRequest
1, // 2: market.Agency.Create:input_type -> market.MarketAgenctyItem
5, // 3: market.Agency.Get:input_type -> market.IdentRequest
6, // 4: market.Agency.Fetch:input_type -> market.FetchRequest
1, // 5: market.Agency.Modify:input_type -> market.MarketAgenctyItem
5, // 6: market.Agency.Delete:input_type -> market.IdentRequest
2, // 7: market.Agency.SetPassword:input_type -> market.SetPasswordRequest
6, // 8: market.Agency.Pending:input_type -> market.FetchRequest
4, // 9: market.Agency.Approve:input_type -> market.ApproveRequest
7, // 10: market.Agency.Login:output_type -> market.LoginReply
8, // 11: market.Agency.Create:output_type -> market.StatusReply
1, // 12: market.Agency.Get:output_type -> market.MarketAgenctyItem
3, // 13: market.Agency.Fetch:output_type -> market.AgencyReply
8, // 14: market.Agency.Modify:output_type -> market.StatusReply
8, // 15: market.Agency.Delete:output_type -> market.StatusReply
8, // 16: market.Agency.SetPassword:output_type -> market.StatusReply
3, // 17: market.Agency.Pending:output_type -> market.AgencyReply
8, // 18: market.Agency.Approve:output_type -> market.StatusReply
10, // [10:19] is the sub-list for method output_type
1, // [1:10] 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_agency_proto_init() }
func file_agency_proto_init() {
if File_agency_proto != nil {
return
}
file_blocks_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_agency_proto_rawDesc), len(file_agency_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_agency_proto_goTypes,
DependencyIndexes: file_agency_proto_depIdxs,
MessageInfos: file_agency_proto_msgTypes,
}.Build()
File_agency_proto = out.File
file_agency_proto_goTypes = nil
file_agency_proto_depIdxs = nil
}

View File

@@ -0,0 +1,658 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: agency.proto
/*
Package market is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package market
import (
"context"
"errors"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var (
_ codes.Code
_ io.Reader
_ status.Status
_ = errors.New
_ = runtime.String
_ = utilities.NewDoubleArray
_ = metadata.Join
)
func request_Agency_Login_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq LoginRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Login(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Login_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq LoginRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Login(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_Create_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketAgenctyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Create_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketAgenctyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Create(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_Get_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Get_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Get(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Fetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Fetch(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_Modify_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketAgenctyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Modify(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Modify_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketAgenctyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Modify(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Delete(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_SetPassword_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq SetPasswordRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_SetPassword_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq SetPasswordRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SetPassword(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_Pending_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Pending(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Pending_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Pending(ctx, &protoReq)
return msg, metadata, err
}
func request_Agency_Approve_0(ctx context.Context, marshaler runtime.Marshaler, client AgencyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq ApproveRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Approve(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Agency_Approve_0(ctx context.Context, marshaler runtime.Marshaler, server AgencyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq ApproveRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Approve(ctx, &protoReq)
return msg, metadata, err
}
// RegisterAgencyHandlerServer registers the http handlers for service Agency to "mux".
// UnaryRPC :call AgencyServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgencyHandlerFromEndpoint instead.
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterAgencyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgencyServer) error {
mux.Handle(http.MethodPost, pattern_Agency_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Login", runtime.WithHTTPPathPattern("/market.Agency/Login"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Login_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Create", runtime.WithHTTPPathPattern("/market.Agency/Create"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Create_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Get", runtime.WithHTTPPathPattern("/market.Agency/Get"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Get_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Get_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Fetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Fetch", runtime.WithHTTPPathPattern("/market.Agency/Fetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Fetch_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Fetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Modify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Modify", runtime.WithHTTPPathPattern("/market.Agency/Modify"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Modify_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Modify_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Delete", runtime.WithHTTPPathPattern("/market.Agency/Delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Delete_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/SetPassword", runtime.WithHTTPPathPattern("/market.Agency/SetPassword"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_SetPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_SetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Pending_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Pending", runtime.WithHTTPPathPattern("/market.Agency/Pending"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Pending_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Pending_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Approve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Agency/Approve", runtime.WithHTTPPathPattern("/market.Agency/Approve"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Agency_Approve_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Approve_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterAgencyHandlerFromEndpoint is same as RegisterAgencyHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAgencyHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.NewClient(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterAgencyHandler(ctx, mux, conn)
}
// RegisterAgencyHandler registers the http handlers for service Agency to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterAgencyHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterAgencyHandlerClient(ctx, mux, NewAgencyClient(conn))
}
// RegisterAgencyHandlerClient registers the http handlers for service Agency
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AgencyClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AgencyClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "AgencyClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterAgencyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AgencyClient) error {
mux.Handle(http.MethodPost, pattern_Agency_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Login", runtime.WithHTTPPathPattern("/market.Agency/Login"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Login_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Login_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Create", runtime.WithHTTPPathPattern("/market.Agency/Create"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Create_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Get", runtime.WithHTTPPathPattern("/market.Agency/Get"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Get_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Get_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Fetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Fetch", runtime.WithHTTPPathPattern("/market.Agency/Fetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Fetch_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Fetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Modify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Modify", runtime.WithHTTPPathPattern("/market.Agency/Modify"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Modify_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Modify_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Delete", runtime.WithHTTPPathPattern("/market.Agency/Delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Delete_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/SetPassword", runtime.WithHTTPPathPattern("/market.Agency/SetPassword"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_SetPassword_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_SetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Pending_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Pending", runtime.WithHTTPPathPattern("/market.Agency/Pending"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Pending_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Pending_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Agency_Approve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Agency/Approve", runtime.WithHTTPPathPattern("/market.Agency/Approve"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Agency_Approve_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Agency_Approve_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Agency_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Login"}, ""))
pattern_Agency_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Create"}, ""))
pattern_Agency_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Get"}, ""))
pattern_Agency_Fetch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Fetch"}, ""))
pattern_Agency_Modify_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Modify"}, ""))
pattern_Agency_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Delete"}, ""))
pattern_Agency_SetPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "SetPassword"}, ""))
pattern_Agency_Pending_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Pending"}, ""))
pattern_Agency_Approve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Agency", "Approve"}, ""))
)
var (
forward_Agency_Login_0 = runtime.ForwardResponseMessage
forward_Agency_Create_0 = runtime.ForwardResponseMessage
forward_Agency_Get_0 = runtime.ForwardResponseMessage
forward_Agency_Fetch_0 = runtime.ForwardResponseMessage
forward_Agency_Modify_0 = runtime.ForwardResponseMessage
forward_Agency_Delete_0 = runtime.ForwardResponseMessage
forward_Agency_SetPassword_0 = runtime.ForwardResponseMessage
forward_Agency_Pending_0 = runtime.ForwardResponseMessage
forward_Agency_Approve_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,447 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: agency.proto
package market
import (
context "context"
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Agency_Login_FullMethodName = "/market.Agency/Login"
Agency_Create_FullMethodName = "/market.Agency/Create"
Agency_Get_FullMethodName = "/market.Agency/Get"
Agency_Fetch_FullMethodName = "/market.Agency/Fetch"
Agency_Modify_FullMethodName = "/market.Agency/Modify"
Agency_Delete_FullMethodName = "/market.Agency/Delete"
Agency_SetPassword_FullMethodName = "/market.Agency/SetPassword"
Agency_Pending_FullMethodName = "/market.Agency/Pending"
Agency_Approve_FullMethodName = "/market.Agency/Approve"
)
// AgencyClient is the client API for Agency 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 AgencyClient interface {
// 登录
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error)
// 新增代理商
Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error)
// 获取一个代理商
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error)
// 代理商列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
// 更新代理商数据
Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error)
// 删除一个代理商
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
// 更新密码
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
//待审核
Pending(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error)
// 审核
Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*StatusReply, error)
}
type agencyClient struct {
cc grpc.ClientConnInterface
}
func NewAgencyClient(cc grpc.ClientConnInterface) AgencyClient {
return &agencyClient{cc}
}
func (c *agencyClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(LoginReply)
err := c.cc.Invoke(ctx, Agency_Login_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) Create(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Agency_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketAgenctyItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MarketAgenctyItem)
err := c.cc.Invoke(ctx, Agency_Get_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AgencyReply)
err := c.cc.Invoke(ctx, Agency_Fetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) Modify(ctx context.Context, in *MarketAgenctyItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Agency_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Agency_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Agency_SetPassword_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) Pending(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*AgencyReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(AgencyReply)
err := c.cc.Invoke(ctx, Agency_Pending_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *agencyClient) Approve(ctx context.Context, in *ApproveRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Agency_Approve_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AgencyServer is the server API for Agency service.
// All implementations must embed UnimplementedAgencyServer
// for forward compatibility.
//
// 营销服务 - 代理商
type AgencyServer interface {
// 登录
Login(context.Context, *LoginRequest) (*LoginReply, error)
// 新增代理商
Create(context.Context, *MarketAgenctyItem) (*StatusReply, error)
// 获取一个代理商
Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error)
// 代理商列表
Fetch(context.Context, *FetchRequest) (*AgencyReply, error)
// 更新代理商数据
Modify(context.Context, *MarketAgenctyItem) (*StatusReply, error)
// 删除一个代理商
Delete(context.Context, *IdentRequest) (*StatusReply, error)
// 更新密码
SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error)
//待审核
Pending(context.Context, *FetchRequest) (*AgencyReply, error)
// 审核
Approve(context.Context, *ApproveRequest) (*StatusReply, error)
mustEmbedUnimplementedAgencyServer()
}
// UnimplementedAgencyServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAgencyServer struct{}
func (UnimplementedAgencyServer) Login(context.Context, *LoginRequest) (*LoginReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
}
func (UnimplementedAgencyServer) Create(context.Context, *MarketAgenctyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedAgencyServer) Get(context.Context, *IdentRequest) (*MarketAgenctyItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedAgencyServer) Fetch(context.Context, *FetchRequest) (*AgencyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedAgencyServer) Modify(context.Context, *MarketAgenctyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedAgencyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedAgencyServer) SetPassword(context.Context, *SetPasswordRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
}
func (UnimplementedAgencyServer) Pending(context.Context, *FetchRequest) (*AgencyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Pending not implemented")
}
func (UnimplementedAgencyServer) Approve(context.Context, *ApproveRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Approve not implemented")
}
func (UnimplementedAgencyServer) mustEmbedUnimplementedAgencyServer() {}
func (UnimplementedAgencyServer) testEmbeddedByValue() {}
// UnsafeAgencyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AgencyServer will
// result in compilation errors.
type UnsafeAgencyServer interface {
mustEmbedUnimplementedAgencyServer()
}
func RegisterAgencyServer(s grpc.ServiceRegistrar, srv AgencyServer) {
// If the following call pancis, it indicates UnimplementedAgencyServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Agency_ServiceDesc, srv)
}
func _Agency_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Login(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Login_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Login(ctx, req.(*LoginRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MarketAgenctyItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Create(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Create_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Create(ctx, req.(*MarketAgenctyItem))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Get_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Get(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Fetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Fetch(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MarketAgenctyItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Modify(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Modify_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Modify(ctx, req.(*MarketAgenctyItem))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Delete(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_SetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetPasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).SetPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_SetPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).SetPassword(ctx, req.(*SetPasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Pending_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Pending(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Pending_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Pending(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Agency_Approve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ApproveRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AgencyServer).Approve(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Agency_Approve_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AgencyServer).Approve(ctx, req.(*ApproveRequest))
}
return interceptor(ctx, in, info, handler)
}
// Agency_ServiceDesc is the grpc.ServiceDesc for Agency service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Agency_ServiceDesc = grpc.ServiceDesc{
ServiceName: "market.Agency",
HandlerType: (*AgencyServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Login",
Handler: _Agency_Login_Handler,
},
{
MethodName: "Create",
Handler: _Agency_Create_Handler,
},
{
MethodName: "Get",
Handler: _Agency_Get_Handler,
},
{
MethodName: "Fetch",
Handler: _Agency_Fetch_Handler,
},
{
MethodName: "Modify",
Handler: _Agency_Modify_Handler,
},
{
MethodName: "Delete",
Handler: _Agency_Delete_Handler,
},
{
MethodName: "SetPassword",
Handler: _Agency_SetPassword_Handler,
},
{
MethodName: "Pending",
Handler: _Agency_Pending_Handler,
},
{
MethodName: "Approve",
Handler: _Agency_Approve_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "agency.proto",
}

View File

@@ -0,0 +1,622 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: blocks.proto
package market
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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 Empty struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Empty) Reset() {
*x = Empty{}
mi := &file_blocks_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Empty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{0}
}
type FetchRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
PageNo int64 `protobuf:"varint,1,opt,name=page_no,proto3" json:"page_no,omitempty"` // 页数
PageSize int64 `protobuf:"varint,2,opt,name=page_size,proto3" json:"page_size,omitempty"` // 每页记录数
Params map[string]string `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // 条件参数,key=val,eg key:categoryId=?,vlaue=11
Identity string `protobuf:"bytes,4,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一标识
Keyword string `protobuf:"bytes,5,opt,name=keyword,proto3" json:"keyword,omitempty"` //关键词
Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` // 状态默认为0-1禁止1为正常
Approve int32 `protobuf:"varint,7,opt,name=approve,proto3" json:"approve,omitempty"` // 审核状态0待审核 2审核通过 -2审核未通过
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *FetchRequest) Reset() {
*x = FetchRequest{}
mi := &file_blocks_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *FetchRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FetchRequest) ProtoMessage() {}
func (x *FetchRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use FetchRequest.ProtoReflect.Descriptor instead.
func (*FetchRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{1}
}
func (x *FetchRequest) GetPageNo() int64 {
if x != nil {
return x.PageNo
}
return 0
}
func (x *FetchRequest) GetPageSize() int64 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *FetchRequest) GetParams() map[string]string {
if x != nil {
return x.Params
}
return nil
}
func (x *FetchRequest) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *FetchRequest) GetKeyword() string {
if x != nil {
return x.Keyword
}
return ""
}
func (x *FetchRequest) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *FetchRequest) GetApprove() int32 {
if x != nil {
return x.Approve
}
return 0
}
type IdentRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 唯一ID
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一码
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *IdentRequest) Reset() {
*x = IdentRequest{}
mi := &file_blocks_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *IdentRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IdentRequest) ProtoMessage() {}
func (x *IdentRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IdentRequest.ProtoReflect.Descriptor instead.
func (*IdentRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{2}
}
func (x *IdentRequest) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *IdentRequest) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
type StoreSerialRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
StoreIdentity string `protobuf:"bytes,1,opt,name=store_identity,proto3" json:"store_identity,omitempty"` // 店铺Identity
SerialId []string `protobuf:"bytes,2,rep,name=serial_id,proto3" json:"serial_id,omitempty"` // 序列Identity
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StoreSerialRequest) Reset() {
*x = StoreSerialRequest{}
mi := &file_blocks_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StoreSerialRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StoreSerialRequest) ProtoMessage() {}
func (x *StoreSerialRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StoreSerialRequest.ProtoReflect.Descriptor instead.
func (*StoreSerialRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{3}
}
func (x *StoreSerialRequest) GetStoreIdentity() string {
if x != nil {
return x.StoreIdentity
}
return ""
}
func (x *StoreSerialRequest) GetSerialId() []string {
if x != nil {
return x.SerialId
}
return nil
}
type StatusReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 状态码
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 标识码
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` //状态说明
Timeseq int64 `protobuf:"varint,4,opt,name=timeseq,proto3" json:"timeseq,omitempty"` // 响应时间序列
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StatusReply) Reset() {
*x = StatusReply{}
mi := &file_blocks_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StatusReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatusReply) ProtoMessage() {}
func (x *StatusReply) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatusReply.ProtoReflect.Descriptor instead.
func (*StatusReply) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{4}
}
func (x *StatusReply) GetCode() int32 {
if x != nil {
return x.Code
}
return 0
}
func (x *StatusReply) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *StatusReply) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *StatusReply) GetTimeseq() int64 {
if x != nil {
return x.Timeseq
}
return 0
}
type LoginReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // token 授权码
Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一标识
MarketIdentity string `protobuf:"bytes,3,opt,name=market_identity,proto3" json:"market_identity,omitempty"` // 店铺唯一标识
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` // 姓名
Account string `protobuf:"bytes,5,opt,name=account,proto3" json:"account,omitempty"` // 账号
Role string `protobuf:"bytes,6,opt,name=role,proto3" json:"role,omitempty"` // 角色
Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` // 状态
CreatedAt string `protobuf:"bytes,8,opt,name=created_at,proto3" json:"created_at,omitempty"` // 创建时间
MarketName string `protobuf:"bytes,9,opt,name=market_name,proto3" json:"market_name,omitempty"` // 店铺名称
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *LoginReply) Reset() {
*x = LoginReply{}
mi := &file_blocks_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *LoginReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginReply) ProtoMessage() {}
func (x *LoginReply) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
func (*LoginReply) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{5}
}
func (x *LoginReply) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *LoginReply) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *LoginReply) GetMarketIdentity() string {
if x != nil {
return x.MarketIdentity
}
return ""
}
func (x *LoginReply) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *LoginReply) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
func (x *LoginReply) GetRole() string {
if x != nil {
return x.Role
}
return ""
}
func (x *LoginReply) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *LoginReply) GetCreatedAt() string {
if x != nil {
return x.CreatedAt
}
return ""
}
func (x *LoginReply) GetMarketName() string {
if x != nil {
return x.MarketName
}
return ""
}
type VersionRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // 时序版本号
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *VersionRequest) Reset() {
*x = VersionRequest{}
mi := &file_blocks_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *VersionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VersionRequest) ProtoMessage() {}
func (x *VersionRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use VersionRequest.ProtoReflect.Descriptor instead.
func (*VersionRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{6}
}
func (x *VersionRequest) GetVersion() int64 {
if x != nil {
return x.Version
}
return 0
}
type SearchRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Keyword string `protobuf:"bytes,1,opt,name=keyword,proto3" json:"keyword,omitempty"` //关键词
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SearchRequest) Reset() {
*x = SearchRequest{}
mi := &file_blocks_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SearchRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SearchRequest) ProtoMessage() {}
func (x *SearchRequest) ProtoReflect() protoreflect.Message {
mi := &file_blocks_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) Descriptor() ([]byte, []int) {
return file_blocks_proto_rawDescGZIP(), []int{7}
}
func (x *SearchRequest) GetKeyword() string {
if x != nil {
return x.Keyword
}
return ""
}
var File_blocks_proto protoreflect.FileDescriptor
const file_blocks_proto_rawDesc = "" +
"\n" +
"\x13market/blocks.proto\x12\x06market\"\a\n" +
"\x05Empty\"\xa3\x02\n" +
"\fFetchRequest\x12\x18\n" +
"\apage_no\x18\x01 \x01(\x03R\apage_no\x12\x1c\n" +
"\tpage_size\x18\x02 \x01(\x03R\tpage_size\x128\n" +
"\x06params\x18\x03 \x03(\v2 .market.FetchRequest.ParamsEntryR\x06params\x12\x1a\n" +
"\bidentity\x18\x04 \x01(\tR\bidentity\x12\x18\n" +
"\akeyword\x18\x05 \x01(\tR\akeyword\x12\x16\n" +
"\x06status\x18\x06 \x01(\x05R\x06status\x12\x18\n" +
"\aapprove\x18\a \x01(\x05R\aapprove\x1a9\n" +
"\vParamsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\":\n" +
"\fIdentRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x03R\x02id\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity\"Z\n" +
"\x12StoreSerialRequest\x12&\n" +
"\x0estore_identity\x18\x01 \x01(\tR\x0estore_identity\x12\x1c\n" +
"\tserial_id\x18\x02 \x03(\tR\tserial_id\"q\n" +
"\vStatusReply\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity\x12\x18\n" +
"\amessage\x18\x03 \x01(\tR\amessage\x12\x18\n" +
"\atimeseq\x18\x04 \x01(\x03R\atimeseq\"\x84\x02\n" +
"\n" +
"LoginReply\x12\x14\n" +
"\x05token\x18\x01 \x01(\tR\x05token\x12\x1a\n" +
"\bidentity\x18\x02 \x01(\tR\bidentity\x12(\n" +
"\x0fmarket_identity\x18\x03 \x01(\tR\x0fmarket_identity\x12\x12\n" +
"\x04name\x18\x04 \x01(\tR\x04name\x12\x18\n" +
"\aaccount\x18\x05 \x01(\tR\aaccount\x12\x12\n" +
"\x04role\x18\x06 \x01(\tR\x04role\x12\x16\n" +
"\x06status\x18\a \x01(\x05R\x06status\x12\x1e\n" +
"\n" +
"created_at\x18\b \x01(\tR\n" +
"created_at\x12 \n" +
"\vmarket_name\x18\t \x01(\tR\vmarket_name\"*\n" +
"\x0eVersionRequest\x12\x18\n" +
"\aversion\x18\x01 \x01(\x03R\aversion\")\n" +
"\rSearchRequest\x12\x18\n" +
"\akeyword\x18\x01 \x01(\tR\akeywordB\n" +
"Z\b.;marketb\x06proto3"
var (
file_blocks_proto_rawDescOnce sync.Once
file_blocks_proto_rawDescData []byte
)
func file_blocks_proto_rawDescGZIP() []byte {
file_blocks_proto_rawDescOnce.Do(func() {
file_blocks_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_blocks_proto_rawDesc), len(file_blocks_proto_rawDesc)))
})
return file_blocks_proto_rawDescData
}
var file_blocks_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_blocks_proto_goTypes = []any{
(*Empty)(nil), // 0: market.Empty
(*FetchRequest)(nil), // 1: market.FetchRequest
(*IdentRequest)(nil), // 2: market.IdentRequest
(*StoreSerialRequest)(nil), // 3: market.StoreSerialRequest
(*StatusReply)(nil), // 4: market.StatusReply
(*LoginReply)(nil), // 5: market.LoginReply
(*VersionRequest)(nil), // 6: market.VersionRequest
(*SearchRequest)(nil), // 7: market.SearchRequest
nil, // 8: market.FetchRequest.ParamsEntry
}
var file_blocks_proto_depIdxs = []int32{
8, // 0: market.FetchRequest.params:type_name -> market.FetchRequest.ParamsEntry
1, // [1:1] is the sub-list for method output_type
1, // [1:1] 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_blocks_proto_init() }
func file_blocks_proto_init() {
if File_blocks_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_blocks_proto_rawDesc), len(file_blocks_proto_rawDesc)),
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_blocks_proto_goTypes,
DependencyIndexes: file_blocks_proto_depIdxs,
MessageInfos: file_blocks_proto_msgTypes,
}.Build()
File_blocks_proto = out.File
file_blocks_proto_goTypes = nil
file_blocks_proto_depIdxs = nil
}

View File

@@ -0,0 +1,319 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: data.proto
package market
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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 OverviewReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
// 待沟通会员
TotalApprove int64 `protobuf:"varint,1,opt,name=total_approve,proto3" json:"total_approve,omitempty"`
// 本月新会员
TotalMonth int64 `protobuf:"varint,2,opt,name=total_month,proto3" json:"total_month,omitempty"`
// 全部会员
TotalAll int64 `protobuf:"varint,3,opt,name=total_all,proto3" json:"total_all,omitempty"`
// 工作人员
TotalStaff int64 `protobuf:"varint,4,opt,name=total_staff,proto3" json:"total_staff,omitempty"`
// 按月统计,最近半年
ReportMonth map[string]int64 `protobuf:"bytes,5,rep,name=report_month,json=reportMonth,proto3" json:"report_month,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
// 按月统计,工作人员
ReportStaff map[string]int64 `protobuf:"bytes,6,rep,name=report_staff,json=reportStaff,proto3" json:"report_staff,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *OverviewReply) Reset() {
*x = OverviewReply{}
mi := &file_data_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *OverviewReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OverviewReply) ProtoMessage() {}
func (x *OverviewReply) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OverviewReply.ProtoReflect.Descriptor instead.
func (*OverviewReply) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{0}
}
func (x *OverviewReply) GetTotalApprove() int64 {
if x != nil {
return x.TotalApprove
}
return 0
}
func (x *OverviewReply) GetTotalMonth() int64 {
if x != nil {
return x.TotalMonth
}
return 0
}
func (x *OverviewReply) GetTotalAll() int64 {
if x != nil {
return x.TotalAll
}
return 0
}
func (x *OverviewReply) GetTotalStaff() int64 {
if x != nil {
return x.TotalStaff
}
return 0
}
func (x *OverviewReply) GetReportMonth() map[string]int64 {
if x != nil {
return x.ReportMonth
}
return nil
}
func (x *OverviewReply) GetReportStaff() map[string]int64 {
if x != nil {
return x.ReportStaff
}
return nil
}
type DataReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // 记录总数
Data []*KeyVal `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` //当前页数据
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DataReply) Reset() {
*x = DataReply{}
mi := &file_data_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DataReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DataReply) ProtoMessage() {}
func (x *DataReply) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DataReply.ProtoReflect.Descriptor instead.
func (*DataReply) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{1}
}
func (x *DataReply) GetCount() int64 {
if x != nil {
return x.Count
}
return 0
}
func (x *DataReply) GetData() []*KeyVal {
if x != nil {
return x.Data
}
return nil
}
type KeyVal struct {
state protoimpl.MessageState `protogen:"open.v1"`
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *KeyVal) Reset() {
*x = KeyVal{}
mi := &file_data_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *KeyVal) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*KeyVal) ProtoMessage() {}
func (x *KeyVal) ProtoReflect() protoreflect.Message {
mi := &file_data_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use KeyVal.ProtoReflect.Descriptor instead.
func (*KeyVal) Descriptor() ([]byte, []int) {
return file_data_proto_rawDescGZIP(), []int{2}
}
func (x *KeyVal) GetKey() string {
if x != nil {
return x.Key
}
return ""
}
func (x *KeyVal) GetVal() string {
if x != nil {
return x.Val
}
return ""
}
var File_data_proto protoreflect.FileDescriptor
const file_data_proto_rawDesc = "" +
"\n" +
"\x14" +
"ec/market/data.proto\x12\x06market\x1a\x13market/blocks.proto\"\xad\x03\n" +
"\rOverviewReply\x12$\n" +
"\rtotal_approve\x18\x01 \x01(\x03R\rtotal_approve\x12 \n" +
"\vtotal_month\x18\x02 \x01(\x03R\vtotal_month\x12\x1c\n" +
"\ttotal_all\x18\x03 \x01(\x03R\ttotal_all\x12 \n" +
"\vtotal_staff\x18\x04 \x01(\x03R\vtotal_staff\x12I\n" +
"\freport_month\x18\x05 \x03(\v2&.market.OverviewReply.ReportMonthEntryR\vreportMonth\x12I\n" +
"\freport_staff\x18\x06 \x03(\v2&.market.OverviewReply.ReportStaffEntryR\vreportStaff\x1a>\n" +
"\x10ReportMonthEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\x03R\x05value:\x028\x01\x1a>\n" +
"\x10ReportStaffEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\x03R\x05value:\x028\x01\"E\n" +
"\tDataReply\x12\x14\n" +
"\x05count\x18\x01 \x01(\x03R\x05count\x12\"\n" +
"\x04data\x18\x02 \x03(\v2\x0e.market.KeyValR\x04data\",\n" +
"\x06KeyVal\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x10\n" +
"\x03val\x18\x02 \x01(\tR\x03val2\x9e\x02\n" +
"\x04Data\x122\n" +
"\bOverview\x12\r.market.Empty\x1a\x15.market.OverviewReply\"\x00\x128\n" +
"\vMemberFetch\x12\x14.market.FetchRequest\x1a\x11.market.DataReply\"\x00\x127\n" +
"\rMemberDetails\x12\x14.market.IdentRequest\x1a\x0e.market.KeyVal\"\x00\x127\n" +
"\n" +
"OrderFetch\x12\x14.market.FetchRequest\x1a\x11.market.DataReply\"\x00\x126\n" +
"\fOrderDetails\x12\x14.market.IdentRequest\x1a\x0e.market.KeyVal\"\x00B\n" +
"Z\b.;marketb\x06proto3"
var (
file_data_proto_rawDescOnce sync.Once
file_data_proto_rawDescData []byte
)
func file_data_proto_rawDescGZIP() []byte {
file_data_proto_rawDescOnce.Do(func() {
file_data_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_data_proto_rawDesc), len(file_data_proto_rawDesc)))
})
return file_data_proto_rawDescData
}
var file_data_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_data_proto_goTypes = []any{
(*OverviewReply)(nil), // 0: market.OverviewReply
(*DataReply)(nil), // 1: market.DataReply
(*KeyVal)(nil), // 2: market.KeyVal
nil, // 3: market.OverviewReply.ReportMonthEntry
nil, // 4: market.OverviewReply.ReportStaffEntry
(*Empty)(nil), // 5: market.Empty
(*FetchRequest)(nil), // 6: market.FetchRequest
(*IdentRequest)(nil), // 7: market.IdentRequest
}
var file_data_proto_depIdxs = []int32{
3, // 0: market.OverviewReply.report_month:type_name -> market.OverviewReply.ReportMonthEntry
4, // 1: market.OverviewReply.report_staff:type_name -> market.OverviewReply.ReportStaffEntry
2, // 2: market.DataReply.data:type_name -> market.KeyVal
5, // 3: market.Data.Overview:input_type -> market.Empty
6, // 4: market.Data.MemberFetch:input_type -> market.FetchRequest
7, // 5: market.Data.MemberDetails:input_type -> market.IdentRequest
6, // 6: market.Data.OrderFetch:input_type -> market.FetchRequest
7, // 7: market.Data.OrderDetails:input_type -> market.IdentRequest
0, // 8: market.Data.Overview:output_type -> market.OverviewReply
1, // 9: market.Data.MemberFetch:output_type -> market.DataReply
2, // 10: market.Data.MemberDetails:output_type -> market.KeyVal
1, // 11: market.Data.OrderFetch:output_type -> market.DataReply
2, // 12: market.Data.OrderDetails:output_type -> market.KeyVal
8, // [8:13] is the sub-list for method output_type
3, // [3:8] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_data_proto_init() }
func file_data_proto_init() {
if File_data_proto != nil {
return
}
file_blocks_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_data_proto_rawDesc), len(file_data_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_data_proto_goTypes,
DependencyIndexes: file_data_proto_depIdxs,
MessageInfos: file_data_proto_msgTypes,
}.Build()
File_data_proto = out.File
file_data_proto_goTypes = nil
file_data_proto_depIdxs = nil
}

View File

@@ -0,0 +1,406 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: data.proto
/*
Package market is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package market
import (
"context"
"errors"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var (
_ codes.Code
_ io.Reader
_ status.Status
_ = errors.New
_ = runtime.String
_ = utilities.NewDoubleArray
_ = metadata.Join
)
func request_Data_Overview_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq Empty
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Overview(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_Overview_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq Empty
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Overview(ctx, &protoReq)
return msg, metadata, err
}
func request_Data_MemberFetch_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.MemberFetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_MemberFetch_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.MemberFetch(ctx, &protoReq)
return msg, metadata, err
}
func request_Data_MemberDetails_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.MemberDetails(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_MemberDetails_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.MemberDetails(ctx, &protoReq)
return msg, metadata, err
}
func request_Data_OrderFetch_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.OrderFetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_OrderFetch_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.OrderFetch(ctx, &protoReq)
return msg, metadata, err
}
func request_Data_OrderDetails_0(ctx context.Context, marshaler runtime.Marshaler, client DataClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.OrderDetails(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Data_OrderDetails_0(ctx context.Context, marshaler runtime.Marshaler, server DataServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.OrderDetails(ctx, &protoReq)
return msg, metadata, err
}
// RegisterDataHandlerServer registers the http handlers for service Data to "mux".
// UnaryRPC :call DataServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterDataHandlerFromEndpoint instead.
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterDataHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DataServer) error {
mux.Handle(http.MethodPost, pattern_Data_Overview_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Data/Overview", runtime.WithHTTPPathPattern("/market.Data/Overview"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Data_Overview_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_Overview_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_MemberFetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Data/MemberFetch", runtime.WithHTTPPathPattern("/market.Data/MemberFetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Data_MemberFetch_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_MemberFetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_MemberDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Data/MemberDetails", runtime.WithHTTPPathPattern("/market.Data/MemberDetails"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Data_MemberDetails_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_MemberDetails_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_OrderFetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Data/OrderFetch", runtime.WithHTTPPathPattern("/market.Data/OrderFetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Data_OrderFetch_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_OrderFetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_OrderDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Data/OrderDetails", runtime.WithHTTPPathPattern("/market.Data/OrderDetails"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Data_OrderDetails_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_OrderDetails_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterDataHandlerFromEndpoint is same as RegisterDataHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDataHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.NewClient(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterDataHandler(ctx, mux, conn)
}
// RegisterDataHandler registers the http handlers for service Data to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterDataHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterDataHandlerClient(ctx, mux, NewDataClient(conn))
}
// RegisterDataHandlerClient registers the http handlers for service Data
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DataClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DataClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "DataClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterDataHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DataClient) error {
mux.Handle(http.MethodPost, pattern_Data_Overview_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Data/Overview", runtime.WithHTTPPathPattern("/market.Data/Overview"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Data_Overview_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_Overview_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_MemberFetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Data/MemberFetch", runtime.WithHTTPPathPattern("/market.Data/MemberFetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Data_MemberFetch_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_MemberFetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_MemberDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Data/MemberDetails", runtime.WithHTTPPathPattern("/market.Data/MemberDetails"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Data_MemberDetails_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_MemberDetails_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_OrderFetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Data/OrderFetch", runtime.WithHTTPPathPattern("/market.Data/OrderFetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Data_OrderFetch_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_OrderFetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Data_OrderDetails_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Data/OrderDetails", runtime.WithHTTPPathPattern("/market.Data/OrderDetails"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Data_OrderDetails_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Data_OrderDetails_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Data_Overview_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Data", "Overview"}, ""))
pattern_Data_MemberFetch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Data", "MemberFetch"}, ""))
pattern_Data_MemberDetails_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Data", "MemberDetails"}, ""))
pattern_Data_OrderFetch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Data", "OrderFetch"}, ""))
pattern_Data_OrderDetails_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Data", "OrderDetails"}, ""))
)
var (
forward_Data_Overview_0 = runtime.ForwardResponseMessage
forward_Data_MemberFetch_0 = runtime.ForwardResponseMessage
forward_Data_MemberDetails_0 = runtime.ForwardResponseMessage
forward_Data_OrderFetch_0 = runtime.ForwardResponseMessage
forward_Data_OrderDetails_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,287 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: data.proto
package market
import (
context "context"
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Data_Overview_FullMethodName = "/market.Data/Overview"
Data_MemberFetch_FullMethodName = "/market.Data/MemberFetch"
Data_MemberDetails_FullMethodName = "/market.Data/MemberDetails"
Data_OrderFetch_FullMethodName = "/market.Data/OrderFetch"
Data_OrderDetails_FullMethodName = "/market.Data/OrderDetails"
)
// DataClient is the client API for Data 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 DataClient interface {
// 概况
Overview(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*OverviewReply, error)
// 会员列表
MemberFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error)
// 会员详情
MemberDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
// 订单列表
OrderFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error)
// 订单详情
OrderDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error)
}
type dataClient struct {
cc grpc.ClientConnInterface
}
func NewDataClient(cc grpc.ClientConnInterface) DataClient {
return &dataClient{cc}
}
func (c *dataClient) Overview(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*OverviewReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(OverviewReply)
err := c.cc.Invoke(ctx, Data_Overview_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *dataClient) MemberFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DataReply)
err := c.cc.Invoke(ctx, Data_MemberFetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *dataClient) MemberDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(KeyVal)
err := c.cc.Invoke(ctx, Data_MemberDetails_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *dataClient) OrderFetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*DataReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DataReply)
err := c.cc.Invoke(ctx, Data_OrderFetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *dataClient) OrderDetails(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*KeyVal, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(KeyVal)
err := c.cc.Invoke(ctx, Data_OrderDetails_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// DataServer is the server API for Data service.
// All implementations must embed UnimplementedDataServer
// for forward compatibility.
//
// 数据服务
type DataServer interface {
// 概况
Overview(context.Context, *Empty) (*OverviewReply, error)
// 会员列表
MemberFetch(context.Context, *FetchRequest) (*DataReply, error)
// 会员详情
MemberDetails(context.Context, *IdentRequest) (*KeyVal, error)
// 订单列表
OrderFetch(context.Context, *FetchRequest) (*DataReply, error)
// 订单详情
OrderDetails(context.Context, *IdentRequest) (*KeyVal, error)
mustEmbedUnimplementedDataServer()
}
// UnimplementedDataServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedDataServer struct{}
func (UnimplementedDataServer) Overview(context.Context, *Empty) (*OverviewReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Overview not implemented")
}
func (UnimplementedDataServer) MemberFetch(context.Context, *FetchRequest) (*DataReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method MemberFetch not implemented")
}
func (UnimplementedDataServer) MemberDetails(context.Context, *IdentRequest) (*KeyVal, error) {
return nil, status.Errorf(codes.Unimplemented, "method MemberDetails not implemented")
}
func (UnimplementedDataServer) OrderFetch(context.Context, *FetchRequest) (*DataReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderFetch not implemented")
}
func (UnimplementedDataServer) OrderDetails(context.Context, *IdentRequest) (*KeyVal, error) {
return nil, status.Errorf(codes.Unimplemented, "method OrderDetails not implemented")
}
func (UnimplementedDataServer) mustEmbedUnimplementedDataServer() {}
func (UnimplementedDataServer) testEmbeddedByValue() {}
// UnsafeDataServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DataServer will
// result in compilation errors.
type UnsafeDataServer interface {
mustEmbedUnimplementedDataServer()
}
func RegisterDataServer(s grpc.ServiceRegistrar, srv DataServer) {
// If the following call pancis, it indicates UnimplementedDataServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Data_ServiceDesc, srv)
}
func _Data_Overview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DataServer).Overview(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Data_Overview_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).Overview(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _Data_MemberFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DataServer).MemberFetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Data_MemberFetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).MemberFetch(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Data_MemberDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DataServer).MemberDetails(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Data_MemberDetails_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).MemberDetails(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Data_OrderFetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DataServer).OrderFetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Data_OrderFetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).OrderFetch(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Data_OrderDetails_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DataServer).OrderDetails(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Data_OrderDetails_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DataServer).OrderDetails(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
// Data_ServiceDesc is the grpc.ServiceDesc for Data service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Data_ServiceDesc = grpc.ServiceDesc{
ServiceName: "market.Data",
HandlerType: (*DataServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Overview",
Handler: _Data_Overview_Handler,
},
{
MethodName: "MemberFetch",
Handler: _Data_MemberFetch_Handler,
},
{
MethodName: "MemberDetails",
Handler: _Data_MemberDetails_Handler,
},
{
MethodName: "OrderFetch",
Handler: _Data_OrderFetch_Handler,
},
{
MethodName: "OrderDetails",
Handler: _Data_OrderDetails_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "data.proto",
}

View File

@@ -0,0 +1,327 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.6
// protoc (unknown)
// source: supply.proto
package market
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
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 MarketSupplyItem struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // 联系人名称 必填
Avatar string `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"` // 头像
CommissionRate int32 `protobuf:"varint,3,opt,name=commission_rate,proto3" json:"commission_rate,omitempty"` // 佣金比例
Account string `protobuf:"bytes,4,opt,name=account,proto3" json:"account,omitempty"` // 帐号
Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` // 手机号
Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` // 密码
OrgName string `protobuf:"bytes,7,opt,name=org_name,proto3" json:"org_name,omitempty"` // 机构名称
OrgPhoto string `protobuf:"bytes,8,opt,name=org_photo,proto3" json:"org_photo,omitempty"` // 机构照片
IdName string `protobuf:"bytes,9,opt,name=id_name,proto3" json:"id_name,omitempty"` // 证件姓名
IdBefore string `protobuf:"bytes,10,opt,name=id_before,proto3" json:"id_before,omitempty"` // 证件照片
IdAfter string `protobuf:"bytes,11,opt,name=id_after,proto3" json:"id_after,omitempty"` // 证件照片
Remark string `protobuf:"bytes,12,opt,name=remark,proto3" json:"remark,omitempty"` // 备注
Identity string `protobuf:"bytes,13,opt,name=identity,proto3" json:"identity,omitempty"` // 唯一标识
Status int32 `protobuf:"varint,14,opt,name=status,proto3" json:"status,omitempty"` // 状态
Id int32 `protobuf:"varint,15,opt,name=id,proto3" json:"id,omitempty"` // id
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *MarketSupplyItem) Reset() {
*x = MarketSupplyItem{}
mi := &file_supply_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *MarketSupplyItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MarketSupplyItem) ProtoMessage() {}
func (x *MarketSupplyItem) ProtoReflect() protoreflect.Message {
mi := &file_supply_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use MarketSupplyItem.ProtoReflect.Descriptor instead.
func (*MarketSupplyItem) Descriptor() ([]byte, []int) {
return file_supply_proto_rawDescGZIP(), []int{0}
}
func (x *MarketSupplyItem) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *MarketSupplyItem) GetAvatar() string {
if x != nil {
return x.Avatar
}
return ""
}
func (x *MarketSupplyItem) GetCommissionRate() int32 {
if x != nil {
return x.CommissionRate
}
return 0
}
func (x *MarketSupplyItem) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
func (x *MarketSupplyItem) GetPhone() string {
if x != nil {
return x.Phone
}
return ""
}
func (x *MarketSupplyItem) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
func (x *MarketSupplyItem) GetOrgName() string {
if x != nil {
return x.OrgName
}
return ""
}
func (x *MarketSupplyItem) GetOrgPhoto() string {
if x != nil {
return x.OrgPhoto
}
return ""
}
func (x *MarketSupplyItem) GetIdName() string {
if x != nil {
return x.IdName
}
return ""
}
func (x *MarketSupplyItem) GetIdBefore() string {
if x != nil {
return x.IdBefore
}
return ""
}
func (x *MarketSupplyItem) GetIdAfter() string {
if x != nil {
return x.IdAfter
}
return ""
}
func (x *MarketSupplyItem) GetRemark() string {
if x != nil {
return x.Remark
}
return ""
}
func (x *MarketSupplyItem) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *MarketSupplyItem) GetStatus() int32 {
if x != nil {
return x.Status
}
return 0
}
func (x *MarketSupplyItem) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
type SupplyReply struct {
state protoimpl.MessageState `protogen:"open.v1"`
Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // 总数
Data []*MarketSupplyItem `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"` // 数据
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SupplyReply) Reset() {
*x = SupplyReply{}
mi := &file_supply_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SupplyReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SupplyReply) ProtoMessage() {}
func (x *SupplyReply) ProtoReflect() protoreflect.Message {
mi := &file_supply_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SupplyReply.ProtoReflect.Descriptor instead.
func (*SupplyReply) Descriptor() ([]byte, []int) {
return file_supply_proto_rawDescGZIP(), []int{1}
}
func (x *SupplyReply) GetCount() int64 {
if x != nil {
return x.Count
}
return 0
}
func (x *SupplyReply) GetData() []*MarketSupplyItem {
if x != nil {
return x.Data
}
return nil
}
var File_supply_proto protoreflect.FileDescriptor
const file_supply_proto_rawDesc = "" +
"\n" +
"\x16ec/market/supply.proto\x12\x06market\x1a\x13market/blocks.proto\"\x9e\x03\n" +
"\x10MarketSupplyItem\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" +
"\x06avatar\x18\x02 \x01(\tR\x06avatar\x12(\n" +
"\x0fcommission_rate\x18\x03 \x01(\x05R\x0fcommission_rate\x12\x18\n" +
"\aaccount\x18\x04 \x01(\tR\aaccount\x12\x14\n" +
"\x05phone\x18\x05 \x01(\tR\x05phone\x12\x1a\n" +
"\bpassword\x18\x06 \x01(\tR\bpassword\x12\x1a\n" +
"\borg_name\x18\a \x01(\tR\borg_name\x12\x1c\n" +
"\torg_photo\x18\b \x01(\tR\torg_photo\x12\x18\n" +
"\aid_name\x18\t \x01(\tR\aid_name\x12\x1c\n" +
"\tid_before\x18\n" +
" \x01(\tR\tid_before\x12\x1a\n" +
"\bid_after\x18\v \x01(\tR\bid_after\x12\x16\n" +
"\x06remark\x18\f \x01(\tR\x06remark\x12\x1a\n" +
"\bidentity\x18\r \x01(\tR\bidentity\x12\x16\n" +
"\x06status\x18\x0e \x01(\x05R\x06status\x12\x0e\n" +
"\x02id\x18\x0f \x01(\x05R\x02id\"Q\n" +
"\vSupplyReply\x12\x14\n" +
"\x05count\x18\x01 \x01(\x03R\x05count\x12,\n" +
"\x04data\x18\x02 \x03(\v2\x18.market.MarketSupplyItemR\x04data2\xa4\x02\n" +
"\x06Supply\x129\n" +
"\x06Create\x12\x18.market.MarketSupplyItem\x1a\x13.market.StatusReply\"\x00\x127\n" +
"\x03Get\x12\x14.market.IdentRequest\x1a\x18.market.MarketSupplyItem\"\x00\x124\n" +
"\x05Fetch\x12\x14.market.FetchRequest\x1a\x13.market.SupplyReply\"\x00\x129\n" +
"\x06Modify\x12\x18.market.MarketSupplyItem\x1a\x13.market.StatusReply\"\x00\x125\n" +
"\x06Delete\x12\x14.market.IdentRequest\x1a\x13.market.StatusReply\"\x00B\n" +
"Z\b.;marketb\x06proto3"
var (
file_supply_proto_rawDescOnce sync.Once
file_supply_proto_rawDescData []byte
)
func file_supply_proto_rawDescGZIP() []byte {
file_supply_proto_rawDescOnce.Do(func() {
file_supply_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_supply_proto_rawDesc), len(file_supply_proto_rawDesc)))
})
return file_supply_proto_rawDescData
}
var file_supply_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_supply_proto_goTypes = []any{
(*MarketSupplyItem)(nil), // 0: market.MarketSupplyItem
(*SupplyReply)(nil), // 1: market.SupplyReply
(*IdentRequest)(nil), // 2: market.IdentRequest
(*FetchRequest)(nil), // 3: market.FetchRequest
(*StatusReply)(nil), // 4: market.StatusReply
}
var file_supply_proto_depIdxs = []int32{
0, // 0: market.SupplyReply.data:type_name -> market.MarketSupplyItem
0, // 1: market.Supply.Create:input_type -> market.MarketSupplyItem
2, // 2: market.Supply.Get:input_type -> market.IdentRequest
3, // 3: market.Supply.Fetch:input_type -> market.FetchRequest
0, // 4: market.Supply.Modify:input_type -> market.MarketSupplyItem
2, // 5: market.Supply.Delete:input_type -> market.IdentRequest
4, // 6: market.Supply.Create:output_type -> market.StatusReply
0, // 7: market.Supply.Get:output_type -> market.MarketSupplyItem
1, // 8: market.Supply.Fetch:output_type -> market.SupplyReply
4, // 9: market.Supply.Modify:output_type -> market.StatusReply
4, // 10: market.Supply.Delete:output_type -> market.StatusReply
6, // [6:11] is the sub-list for method output_type
1, // [1:6] 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_supply_proto_init() }
func file_supply_proto_init() {
if File_supply_proto != nil {
return
}
file_blocks_proto_init()
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_supply_proto_rawDesc), len(file_supply_proto_rawDesc)),
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_supply_proto_goTypes,
DependencyIndexes: file_supply_proto_depIdxs,
MessageInfos: file_supply_proto_msgTypes,
}.Build()
File_supply_proto = out.File
file_supply_proto_goTypes = nil
file_supply_proto_depIdxs = nil
}

View File

@@ -0,0 +1,406 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: supply.proto
/*
Package market is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package market
import (
"context"
"errors"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var (
_ codes.Code
_ io.Reader
_ status.Status
_ = errors.New
_ = runtime.String
_ = utilities.NewDoubleArray
_ = metadata.Join
)
func request_Supply_Create_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketSupplyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Create(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Create_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketSupplyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Create(ctx, &protoReq)
return msg, metadata, err
}
func request_Supply_Get_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Get(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Get_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Get(ctx, &protoReq)
return msg, metadata, err
}
func request_Supply_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Fetch(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Fetch_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq FetchRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Fetch(ctx, &protoReq)
return msg, metadata, err
}
func request_Supply_Modify_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketSupplyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Modify(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Modify_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq MarketSupplyItem
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Modify(ctx, &protoReq)
return msg, metadata, err
}
func request_Supply_Delete_0(ctx context.Context, marshaler runtime.Marshaler, client SupplyClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Delete(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Supply_Delete_0(ctx context.Context, marshaler runtime.Marshaler, server SupplyServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq IdentRequest
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Delete(ctx, &protoReq)
return msg, metadata, err
}
// RegisterSupplyHandlerServer registers the http handlers for service Supply to "mux".
// UnaryRPC :call SupplyServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSupplyHandlerFromEndpoint instead.
// GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterSupplyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SupplyServer) error {
mux.Handle(http.MethodPost, pattern_Supply_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Supply/Create", runtime.WithHTTPPathPattern("/market.Supply/Create"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Supply_Create_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Supply/Get", runtime.WithHTTPPathPattern("/market.Supply/Get"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Supply_Get_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Get_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Fetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Supply/Fetch", runtime.WithHTTPPathPattern("/market.Supply/Fetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Supply_Fetch_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Fetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Modify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Supply/Modify", runtime.WithHTTPPathPattern("/market.Supply/Modify"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Supply_Modify_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Modify_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/market.Supply/Delete", runtime.WithHTTPPathPattern("/market.Supply/Delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Supply_Delete_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterSupplyHandlerFromEndpoint is same as RegisterSupplyHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSupplyHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.NewClient(endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterSupplyHandler(ctx, mux, conn)
}
// RegisterSupplyHandler registers the http handlers for service Supply to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterSupplyHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterSupplyHandlerClient(ctx, mux, NewSupplyClient(conn))
}
// RegisterSupplyHandlerClient registers the http handlers for service Supply
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SupplyClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SupplyClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "SupplyClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterSupplyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SupplyClient) error {
mux.Handle(http.MethodPost, pattern_Supply_Create_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Supply/Create", runtime.WithHTTPPathPattern("/market.Supply/Create"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Supply_Create_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Create_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Get_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Supply/Get", runtime.WithHTTPPathPattern("/market.Supply/Get"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Supply_Get_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Get_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Fetch_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Supply/Fetch", runtime.WithHTTPPathPattern("/market.Supply/Fetch"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Supply_Fetch_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Fetch_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Modify_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Supply/Modify", runtime.WithHTTPPathPattern("/market.Supply/Modify"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Supply_Modify_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Modify_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPost, pattern_Supply_Delete_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/market.Supply/Delete", runtime.WithHTTPPathPattern("/market.Supply/Delete"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Supply_Delete_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Supply_Delete_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_Supply_Create_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Supply", "Create"}, ""))
pattern_Supply_Get_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Supply", "Get"}, ""))
pattern_Supply_Fetch_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Supply", "Fetch"}, ""))
pattern_Supply_Modify_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Supply", "Modify"}, ""))
pattern_Supply_Delete_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"market.Supply", "Delete"}, ""))
)
var (
forward_Supply_Create_0 = runtime.ForwardResponseMessage
forward_Supply_Get_0 = runtime.ForwardResponseMessage
forward_Supply_Fetch_0 = runtime.ForwardResponseMessage
forward_Supply_Modify_0 = runtime.ForwardResponseMessage
forward_Supply_Delete_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,287 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc (unknown)
// source: supply.proto
package market
import (
context "context"
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Supply_Create_FullMethodName = "/market.Supply/Create"
Supply_Get_FullMethodName = "/market.Supply/Get"
Supply_Fetch_FullMethodName = "/market.Supply/Fetch"
Supply_Modify_FullMethodName = "/market.Supply/Modify"
Supply_Delete_FullMethodName = "/market.Supply/Delete"
)
// SupplyClient is the client API for Supply 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 SupplyClient interface {
// 新增供应商
Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error)
// 获取一个供应商
Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error)
// 供应商列表
Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error)
// 更新供应商数据
Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error)
// 删除一个供应商
Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
}
type supplyClient struct {
cc grpc.ClientConnInterface
}
func NewSupplyClient(cc grpc.ClientConnInterface) SupplyClient {
return &supplyClient{cc}
}
func (c *supplyClient) Create(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Supply_Create_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *supplyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*MarketSupplyItem, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(MarketSupplyItem)
err := c.cc.Invoke(ctx, Supply_Get_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *supplyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*SupplyReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SupplyReply)
err := c.cc.Invoke(ctx, Supply_Fetch_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *supplyClient) Modify(ctx context.Context, in *MarketSupplyItem, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Supply_Modify_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *supplyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(StatusReply)
err := c.cc.Invoke(ctx, Supply_Delete_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// SupplyServer is the server API for Supply service.
// All implementations must embed UnimplementedSupplyServer
// for forward compatibility.
//
// 营销服务 - 供应商
type SupplyServer interface {
// 新增供应商
Create(context.Context, *MarketSupplyItem) (*StatusReply, error)
// 获取一个供应商
Get(context.Context, *IdentRequest) (*MarketSupplyItem, error)
// 供应商列表
Fetch(context.Context, *FetchRequest) (*SupplyReply, error)
// 更新供应商数据
Modify(context.Context, *MarketSupplyItem) (*StatusReply, error)
// 删除一个供应商
Delete(context.Context, *IdentRequest) (*StatusReply, error)
mustEmbedUnimplementedSupplyServer()
}
// UnimplementedSupplyServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSupplyServer struct{}
func (UnimplementedSupplyServer) Create(context.Context, *MarketSupplyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedSupplyServer) Get(context.Context, *IdentRequest) (*MarketSupplyItem, error) {
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedSupplyServer) Fetch(context.Context, *FetchRequest) (*SupplyReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedSupplyServer) Modify(context.Context, *MarketSupplyItem) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Modify not implemented")
}
func (UnimplementedSupplyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedSupplyServer) mustEmbedUnimplementedSupplyServer() {}
func (UnimplementedSupplyServer) testEmbeddedByValue() {}
// UnsafeSupplyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SupplyServer will
// result in compilation errors.
type UnsafeSupplyServer interface {
mustEmbedUnimplementedSupplyServer()
}
func RegisterSupplyServer(s grpc.ServiceRegistrar, srv SupplyServer) {
// If the following call pancis, it indicates UnimplementedSupplyServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Supply_ServiceDesc, srv)
}
func _Supply_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MarketSupplyItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SupplyServer).Create(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Supply_Create_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Create(ctx, req.(*MarketSupplyItem))
}
return interceptor(ctx, in, info, handler)
}
func _Supply_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SupplyServer).Get(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Supply_Get_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Get(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Supply_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(FetchRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SupplyServer).Fetch(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Supply_Fetch_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Fetch(ctx, req.(*FetchRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Supply_Modify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MarketSupplyItem)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SupplyServer).Modify(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Supply_Modify_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Modify(ctx, req.(*MarketSupplyItem))
}
return interceptor(ctx, in, info, handler)
}
func _Supply_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IdentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SupplyServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Supply_Delete_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SupplyServer).Delete(ctx, req.(*IdentRequest))
}
return interceptor(ctx, in, info, handler)
}
// Supply_ServiceDesc is the grpc.ServiceDesc for Supply service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Supply_ServiceDesc = grpc.ServiceDesc{
ServiceName: "market.Supply",
HandlerType: (*SupplyServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Create",
Handler: _Supply_Create_Handler,
},
{
MethodName: "Get",
Handler: _Supply_Get_Handler,
},
{
MethodName: "Fetch",
Handler: _Supply_Fetch_Handler,
},
{
MethodName: "Modify",
Handler: _Supply_Modify_Handler,
},
{
MethodName: "Delete",
Handler: _Supply_Delete_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "supply.proto",
}