server

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2023 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Level_name = map[int32]string{
		0: "UNKNOW",
		1: "COUNTRY",
		2: "PROVINCE",
		3: "CITY",
		4: "DISTRICT",
		5: "STREET",
	}
	Level_value = map[string]int32{
		"UNKNOW":   0,
		"COUNTRY":  1,
		"PROVINCE": 2,
		"CITY":     3,
		"DISTRICT": 4,
		"STREET":   5,
	}
)

Enum value maps for Level.

View Source
var AreaService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "area.AreaService",
	HandlerType: (*AreaServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FreshAreas",
			Handler:    _AreaService_FreshAreas_Handler,
		},
		{
			MethodName: "GetArea",
			Handler:    _AreaService_GetArea_Handler,
		},
		{
			MethodName: "GetProvinces",
			Handler:    _AreaService_GetProvinces_Handler,
		},
		{
			MethodName: "GetCities",
			Handler:    _AreaService_GetCities_Handler,
		},
		{
			MethodName: "GetDistricts",
			Handler:    _AreaService_GetDistricts_Handler,
		},
		{
			MethodName: "GetStreets",
			Handler:    _AreaService_GetStreets_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "area.proto",
}

AreaService_ServiceDesc is the grpc.ServiceDesc for AreaService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterAreaServiceServer

func RegisterAreaServiceServer(s grpc.ServiceRegistrar, srv AreaServiceServer)

Types

type Area

type Area struct {

	// 行政区名称
	Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	// 行政区划级别
	Level Level `protobuf:"varint,2,opt,name=Level,proto3,enum=area.Level" json:"Level,omitempty"`
	// 区域编码
	Code string `protobuf:"bytes,3,opt,name=Code,proto3" json:"Code,omitempty"`
	// 区域中心点
	Center string `protobuf:"bytes,4,opt,name=Center,proto3" json:"Center,omitempty"`
	// 下级行政区列表
	Areas []*Area `protobuf:"bytes,5,rep,name=Areas,proto3" json:"Areas,omitempty"`
	// contains filtered or unexported fields
}

func (*Area) Descriptor deprecated

func (*Area) Descriptor() ([]byte, []int)

Deprecated: Use Area.ProtoReflect.Descriptor instead.

func (*Area) GetAreas

func (x *Area) GetAreas() []*Area

func (*Area) GetCenter

func (x *Area) GetCenter() string

func (*Area) GetCode

func (x *Area) GetCode() string

func (*Area) GetLevel

func (x *Area) GetLevel() Level

func (*Area) GetName

func (x *Area) GetName() string

func (*Area) ProtoMessage

func (*Area) ProtoMessage()

func (*Area) ProtoReflect

func (x *Area) ProtoReflect() protoreflect.Message

func (*Area) Reset

func (x *Area) Reset()

func (*Area) String

func (x *Area) String() string

type AreaServiceClient

type AreaServiceClient interface {
	// 刷新区域
	FreshAreas(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	// 获取指定区域
	GetArea(ctx context.Context, in *GetAreaReq, opts ...grpc.CallOption) (*GetAreaAck, error)
	// 获取省份列表
	GetProvinces(ctx context.Context, in *GetProvincesReq, opts ...grpc.CallOption) (*GetProvincesAck, error)
	// 获取城市列表
	GetCities(ctx context.Context, in *GetCitiesReq, opts ...grpc.CallOption) (*GetCitiesAck, error)
	// 获取区县列表
	GetDistricts(ctx context.Context, in *GetDistrictsReq, opts ...grpc.CallOption) (*GetDistrictsAck, error)
	// 获取街道列表
	GetStreets(ctx context.Context, in *GetStreetsReq, opts ...grpc.CallOption) (*GetStreetsAck, error)
}

AreaServiceClient is the client API for AreaService 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 AreaServiceServer

type AreaServiceServer interface {
	// 刷新区域
	FreshAreas(context.Context, *Empty) (*Empty, error)
	// 获取指定区域
	GetArea(context.Context, *GetAreaReq) (*GetAreaAck, error)
	// 获取省份列表
	GetProvinces(context.Context, *GetProvincesReq) (*GetProvincesAck, error)
	// 获取城市列表
	GetCities(context.Context, *GetCitiesReq) (*GetCitiesAck, error)
	// 获取区县列表
	GetDistricts(context.Context, *GetDistrictsReq) (*GetDistrictsAck, error)
	// 获取街道列表
	GetStreets(context.Context, *GetStreetsReq) (*GetStreetsAck, error)
	// contains filtered or unexported methods
}

AreaServiceServer is the server API for AreaService service. All implementations must embed UnimplementedAreaServiceServer for forward compatibility

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type GetAreaAck

type GetAreaAck struct {

	// 区域信息
	Area *Area `protobuf:"bytes,1,opt,name=Area,proto3" json:"Area,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAreaAck) Descriptor deprecated

func (*GetAreaAck) Descriptor() ([]byte, []int)

Deprecated: Use GetAreaAck.ProtoReflect.Descriptor instead.

func (*GetAreaAck) GetArea

func (x *GetAreaAck) GetArea() *Area

func (*GetAreaAck) ProtoMessage

func (*GetAreaAck) ProtoMessage()

func (*GetAreaAck) ProtoReflect

func (x *GetAreaAck) ProtoReflect() protoreflect.Message

func (*GetAreaAck) Reset

func (x *GetAreaAck) Reset()

func (*GetAreaAck) String

func (x *GetAreaAck) String() string

type GetAreaReq

type GetAreaReq struct {

	// 区域编码
	Code string `protobuf:"bytes,1,opt,name=Code,proto3" json:"Code,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAreaReq) Descriptor deprecated

func (*GetAreaReq) Descriptor() ([]byte, []int)

Deprecated: Use GetAreaReq.ProtoReflect.Descriptor instead.

func (*GetAreaReq) GetCode

func (x *GetAreaReq) GetCode() string

func (*GetAreaReq) ProtoMessage

func (*GetAreaReq) ProtoMessage()

func (*GetAreaReq) ProtoReflect

func (x *GetAreaReq) ProtoReflect() protoreflect.Message

func (*GetAreaReq) Reset

func (x *GetAreaReq) Reset()

func (*GetAreaReq) String

func (x *GetAreaReq) String() string

type GetCitiesAck

type GetCitiesAck struct {

	// 城市列表
	Cities []*Area `protobuf:"bytes,1,rep,name=Cities,proto3" json:"Cities,omitempty"`
	// contains filtered or unexported fields
}

func (*GetCitiesAck) Descriptor deprecated

func (*GetCitiesAck) Descriptor() ([]byte, []int)

Deprecated: Use GetCitiesAck.ProtoReflect.Descriptor instead.

func (*GetCitiesAck) GetCities

func (x *GetCitiesAck) GetCities() []*Area

func (*GetCitiesAck) ProtoMessage

func (*GetCitiesAck) ProtoMessage()

func (*GetCitiesAck) ProtoReflect

func (x *GetCitiesAck) ProtoReflect() protoreflect.Message

func (*GetCitiesAck) Reset

func (x *GetCitiesAck) Reset()

func (*GetCitiesAck) String

func (x *GetCitiesAck) String() string

type GetCitiesReq

type GetCitiesReq struct {

	// 省份区域编码
	ProvinceCode string `protobuf:"bytes,1,opt,name=ProvinceCode,proto3" json:"ProvinceCode,omitempty"`
	// contains filtered or unexported fields
}

func (*GetCitiesReq) Descriptor deprecated

func (*GetCitiesReq) Descriptor() ([]byte, []int)

Deprecated: Use GetCitiesReq.ProtoReflect.Descriptor instead.

func (*GetCitiesReq) GetProvinceCode

func (x *GetCitiesReq) GetProvinceCode() string

func (*GetCitiesReq) ProtoMessage

func (*GetCitiesReq) ProtoMessage()

func (*GetCitiesReq) ProtoReflect

func (x *GetCitiesReq) ProtoReflect() protoreflect.Message

func (*GetCitiesReq) Reset

func (x *GetCitiesReq) Reset()

func (*GetCitiesReq) String

func (x *GetCitiesReq) String() string

type GetDistrictsAck

type GetDistrictsAck struct {

	// 区县列表
	Districts []*Area `protobuf:"bytes,1,rep,name=Districts,proto3" json:"Districts,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDistrictsAck) Descriptor deprecated

func (*GetDistrictsAck) Descriptor() ([]byte, []int)

Deprecated: Use GetDistrictsAck.ProtoReflect.Descriptor instead.

func (*GetDistrictsAck) GetDistricts

func (x *GetDistrictsAck) GetDistricts() []*Area

func (*GetDistrictsAck) ProtoMessage

func (*GetDistrictsAck) ProtoMessage()

func (*GetDistrictsAck) ProtoReflect

func (x *GetDistrictsAck) ProtoReflect() protoreflect.Message

func (*GetDistrictsAck) Reset

func (x *GetDistrictsAck) Reset()

func (*GetDistrictsAck) String

func (x *GetDistrictsAck) String() string

type GetDistrictsReq

type GetDistrictsReq struct {

	// 城市区域编码
	CityCode string `protobuf:"bytes,1,opt,name=CityCode,proto3" json:"CityCode,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDistrictsReq) Descriptor deprecated

func (*GetDistrictsReq) Descriptor() ([]byte, []int)

Deprecated: Use GetDistrictsReq.ProtoReflect.Descriptor instead.

func (*GetDistrictsReq) GetCityCode

func (x *GetDistrictsReq) GetCityCode() string

func (*GetDistrictsReq) ProtoMessage

func (*GetDistrictsReq) ProtoMessage()

func (*GetDistrictsReq) ProtoReflect

func (x *GetDistrictsReq) ProtoReflect() protoreflect.Message

func (*GetDistrictsReq) Reset

func (x *GetDistrictsReq) Reset()

func (*GetDistrictsReq) String

func (x *GetDistrictsReq) String() string

type GetProvincesAck

type GetProvincesAck struct {

	// 省份列表
	Provinces []*Area `protobuf:"bytes,1,rep,name=Provinces,proto3" json:"Provinces,omitempty"`
	// contains filtered or unexported fields
}

func (*GetProvincesAck) Descriptor deprecated

func (*GetProvincesAck) Descriptor() ([]byte, []int)

Deprecated: Use GetProvincesAck.ProtoReflect.Descriptor instead.

func (*GetProvincesAck) GetProvinces

func (x *GetProvincesAck) GetProvinces() []*Area

func (*GetProvincesAck) ProtoMessage

func (*GetProvincesAck) ProtoMessage()

func (*GetProvincesAck) ProtoReflect

func (x *GetProvincesAck) ProtoReflect() protoreflect.Message

func (*GetProvincesAck) Reset

func (x *GetProvincesAck) Reset()

func (*GetProvincesAck) String

func (x *GetProvincesAck) String() string

type GetProvincesReq

type GetProvincesReq struct {
	// contains filtered or unexported fields
}

func (*GetProvincesReq) Descriptor deprecated

func (*GetProvincesReq) Descriptor() ([]byte, []int)

Deprecated: Use GetProvincesReq.ProtoReflect.Descriptor instead.

func (*GetProvincesReq) ProtoMessage

func (*GetProvincesReq) ProtoMessage()

func (*GetProvincesReq) ProtoReflect

func (x *GetProvincesReq) ProtoReflect() protoreflect.Message

func (*GetProvincesReq) Reset

func (x *GetProvincesReq) Reset()

func (*GetProvincesReq) String

func (x *GetProvincesReq) String() string

type GetStreetsAck

type GetStreetsAck struct {

	// 街道列表
	Streets []*Area `protobuf:"bytes,1,rep,name=Streets,proto3" json:"Streets,omitempty"`
	// contains filtered or unexported fields
}

func (*GetStreetsAck) Descriptor deprecated

func (*GetStreetsAck) Descriptor() ([]byte, []int)

Deprecated: Use GetStreetsAck.ProtoReflect.Descriptor instead.

func (*GetStreetsAck) GetStreets

func (x *GetStreetsAck) GetStreets() []*Area

func (*GetStreetsAck) ProtoMessage

func (*GetStreetsAck) ProtoMessage()

func (*GetStreetsAck) ProtoReflect

func (x *GetStreetsAck) ProtoReflect() protoreflect.Message

func (*GetStreetsAck) Reset

func (x *GetStreetsAck) Reset()

func (*GetStreetsAck) String

func (x *GetStreetsAck) String() string

type GetStreetsReq

type GetStreetsReq struct {

	// 区县区域编码
	DistrictCode string `protobuf:"bytes,1,opt,name=DistrictCode,proto3" json:"DistrictCode,omitempty"`
	// contains filtered or unexported fields
}

func (*GetStreetsReq) Descriptor deprecated

func (*GetStreetsReq) Descriptor() ([]byte, []int)

Deprecated: Use GetStreetsReq.ProtoReflect.Descriptor instead.

func (*GetStreetsReq) GetDistrictCode

func (x *GetStreetsReq) GetDistrictCode() string

func (*GetStreetsReq) ProtoMessage

func (*GetStreetsReq) ProtoMessage()

func (*GetStreetsReq) ProtoReflect

func (x *GetStreetsReq) ProtoReflect() protoreflect.Message

func (*GetStreetsReq) Reset

func (x *GetStreetsReq) Reset()

func (*GetStreetsReq) String

func (x *GetStreetsReq) String() string

type Level

type Level int32
const (
	// 未知
	Level_UNKNOW Level = 0
	// 国家
	Level_COUNTRY Level = 1
	// 省份(直辖市会在province显示)
	Level_PROVINCE Level = 2
	// 市(直辖市会在province显示)
	Level_CITY Level = 3
	// 区县
	Level_DISTRICT Level = 4
	// 街道
	Level_STREET Level = 5
)

func (Level) Descriptor

func (Level) Descriptor() protoreflect.EnumDescriptor

func (Level) Enum

func (x Level) Enum() *Level

func (Level) EnumDescriptor deprecated

func (Level) EnumDescriptor() ([]byte, []int)

Deprecated: Use Level.Descriptor instead.

func (Level) Number

func (x Level) Number() protoreflect.EnumNumber

func (Level) String

func (x Level) String() string

func (Level) Type

func (Level) Type() protoreflect.EnumType

type UnimplementedAreaServiceServer

type UnimplementedAreaServiceServer struct {
}

UnimplementedAreaServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAreaServiceServer) FreshAreas

func (UnimplementedAreaServiceServer) GetArea

func (UnimplementedAreaServiceServer) GetCities

func (UnimplementedAreaServiceServer) GetDistricts

func (UnimplementedAreaServiceServer) GetProvinces

func (UnimplementedAreaServiceServer) GetStreets

type UnsafeAreaServiceServer

type UnsafeAreaServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAreaServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AreaServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL