master
yangyong 2 years ago
parent 302c1a9384
commit 5382e13c62

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/backend.iml" filepath="$PROJECT_DIR$/.idea/backend.iml" />
</modules>
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.29.0 // protoc-gen-go v1.30.0
// protoc v3.14.0 // protoc v3.14.0
// source: api/customer/customer.proto // source: api/customer/customer.proto
@ -374,6 +374,140 @@ func (x *LoginResp) GetTokenLife() int32 {
return 0 return 0
} }
type EstimatePriceReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
}
func (x *EstimatePriceReq) Reset() {
*x = EstimatePriceReq{}
if protoimpl.UnsafeEnabled {
mi := &file_api_customer_customer_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EstimatePriceReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EstimatePriceReq) ProtoMessage() {}
func (x *EstimatePriceReq) ProtoReflect() protoreflect.Message {
mi := &file_api_customer_customer_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EstimatePriceReq.ProtoReflect.Descriptor instead.
func (*EstimatePriceReq) Descriptor() ([]byte, []int) {
return file_api_customer_customer_proto_rawDescGZIP(), []int{6}
}
func (x *EstimatePriceReq) GetOrigin() string {
if x != nil {
return x.Origin
}
return ""
}
func (x *EstimatePriceReq) GetDestination() string {
if x != nil {
return x.Destination
}
return ""
}
type EstimatePriceResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
Origin string `protobuf:"bytes,3,opt,name=origin,proto3" json:"origin,omitempty"`
Destination string `protobuf:"bytes,4,opt,name=destination,proto3" json:"destination,omitempty"`
Price int64 `protobuf:"varint,5,opt,name=price,proto3" json:"price,omitempty"`
}
func (x *EstimatePriceResp) Reset() {
*x = EstimatePriceResp{}
if protoimpl.UnsafeEnabled {
mi := &file_api_customer_customer_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *EstimatePriceResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EstimatePriceResp) ProtoMessage() {}
func (x *EstimatePriceResp) ProtoReflect() protoreflect.Message {
mi := &file_api_customer_customer_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EstimatePriceResp.ProtoReflect.Descriptor instead.
func (*EstimatePriceResp) Descriptor() ([]byte, []int) {
return file_api_customer_customer_proto_rawDescGZIP(), []int{7}
}
func (x *EstimatePriceResp) GetCode() int64 {
if x != nil {
return x.Code
}
return 0
}
func (x *EstimatePriceResp) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *EstimatePriceResp) GetOrigin() string {
if x != nil {
return x.Origin
}
return ""
}
func (x *EstimatePriceResp) GetDestination() string {
if x != nil {
return x.Destination
}
return ""
}
func (x *EstimatePriceResp) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
var File_api_customer_customer_proto protoreflect.FileDescriptor var File_api_customer_customer_proto protoreflect.FileDescriptor
var file_api_customer_customer_proto_rawDesc = []byte{ var file_api_customer_customer_proto_rawDesc = []byte{
@ -415,29 +549,52 @@ var file_api_customer_customer_proto_rawDesc = []byte{
0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6c, 0x69, 0x66, 0x65,
0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4c, 0x69, 0x66,
0x65, 0x32, 0xb8, 0x02, 0x0a, 0x08, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x12, 0x7f, 0x65, 0x22, 0x4c, 0x0a, 0x10, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69,
0x0a, 0x0d, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18,
0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x47, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a,
0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x47, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x91, 0x01, 0x0a, 0x11, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x63,
0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
0x6d, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x2d, 0x63, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73,
0x6f, 0x64, 0x65, 0x2f, 0x7b, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x7d, 0x12, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
0x54, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20,
0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64,
0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a,
0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2f, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x72,
0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x55, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x69, 0x63, 0x65, 0x32, 0xc4, 0x03, 0x0a, 0x08, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x4c, 0x12, 0x7f, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64,
0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65,
0x73, 0x70, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x63, 0x75, 0x73, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x42, 0x20, 0x5a, 0x1e, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x75, 0x73, 0x73, 0x70, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x63, 0x75, 0x73,
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x3b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x62, 0x06, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2f, 0x67, 0x65, 0x74, 0x2d, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2d, 0x63, 0x6f, 0x64, 0x65, 0x2f, 0x7b, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x68, 0x6f, 0x6e, 0x65,
0x7d, 0x12, 0x54, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,
0x65, 0x71, 0x1a, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65,
0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1a, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65,
0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x55, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75,
0x74, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74,
0x52, 0x65, 0x73, 0x70, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x63,
0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x89,
0x01, 0x0a, 0x0d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65,
0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e,
0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71,
0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e,
0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73,
0x70, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x63, 0x75, 0x73, 0x74,
0x6f, 0x6d, 0x65, 0x72, 0x2f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x2d, 0x70, 0x72,
0x69, 0x63, 0x65, 0x2f, 0x7b, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x7d, 0x2f, 0x7b, 0x64, 0x65,
0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x42, 0x20, 0x5a, 0x1e, 0x63, 0x75,
0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x65, 0x72, 0x3b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -452,7 +609,7 @@ func file_api_customer_customer_proto_rawDescGZIP() []byte {
return file_api_customer_customer_proto_rawDescData return file_api_customer_customer_proto_rawDescData
} }
var file_api_customer_customer_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_api_customer_customer_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_api_customer_customer_proto_goTypes = []interface{}{ var file_api_customer_customer_proto_goTypes = []interface{}{
(*LogoutReq)(nil), // 0: api.customer.LogoutReq (*LogoutReq)(nil), // 0: api.customer.LogoutReq
(*LogoutResp)(nil), // 1: api.customer.LogoutResp (*LogoutResp)(nil), // 1: api.customer.LogoutResp
@ -460,16 +617,20 @@ var file_api_customer_customer_proto_goTypes = []interface{}{
(*GetVerifyCodeResp)(nil), // 3: api.customer.GetVerifyCodeResp (*GetVerifyCodeResp)(nil), // 3: api.customer.GetVerifyCodeResp
(*LoginReq)(nil), // 4: api.customer.LoginReq (*LoginReq)(nil), // 4: api.customer.LoginReq
(*LoginResp)(nil), // 5: api.customer.LoginResp (*LoginResp)(nil), // 5: api.customer.LoginResp
(*EstimatePriceReq)(nil), // 6: api.customer.EstimatePriceReq
(*EstimatePriceResp)(nil), // 7: api.customer.EstimatePriceResp
} }
var file_api_customer_customer_proto_depIdxs = []int32{ var file_api_customer_customer_proto_depIdxs = []int32{
2, // 0: api.customer.Customer.GetVerifyCode:input_type -> api.customer.GetVerifyCodeReq 2, // 0: api.customer.Customer.GetVerifyCode:input_type -> api.customer.GetVerifyCodeReq
4, // 1: api.customer.Customer.Login:input_type -> api.customer.LoginReq 4, // 1: api.customer.Customer.Login:input_type -> api.customer.LoginReq
0, // 2: api.customer.Customer.Logout:input_type -> api.customer.LogoutReq 0, // 2: api.customer.Customer.Logout:input_type -> api.customer.LogoutReq
3, // 3: api.customer.Customer.GetVerifyCode:output_type -> api.customer.GetVerifyCodeResp 6, // 3: api.customer.Customer.EstimatePrice:input_type -> api.customer.EstimatePriceReq
5, // 4: api.customer.Customer.Login:output_type -> api.customer.LoginResp 3, // 4: api.customer.Customer.GetVerifyCode:output_type -> api.customer.GetVerifyCodeResp
1, // 5: api.customer.Customer.Logout:output_type -> api.customer.LogoutResp 5, // 5: api.customer.Customer.Login:output_type -> api.customer.LoginResp
3, // [3:6] is the sub-list for method output_type 1, // 6: api.customer.Customer.Logout:output_type -> api.customer.LogoutResp
0, // [0:3] is the sub-list for method input_type 7, // 7: api.customer.Customer.EstimatePrice:output_type -> api.customer.EstimatePriceResp
4, // [4:8] is the sub-list for method output_type
0, // [0:4] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name 0, // [0:0] is the sub-list for field type_name
@ -553,6 +714,30 @@ func file_api_customer_customer_proto_init() {
return nil return nil
} }
} }
file_api_customer_customer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EstimatePriceReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_api_customer_customer_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*EstimatePriceResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
@ -560,7 +745,7 @@ func file_api_customer_customer_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_customer_customer_proto_rawDesc, RawDescriptor: file_api_customer_customer_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 6, NumMessages: 8,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,
}, },

@ -23,6 +23,11 @@ service Customer {
get: "/customer/logout", get: "/customer/logout",
}; };
} }
rpc EstimatePrice (EstimatePriceReq) returns (EstimatePriceResp) {
option (google.api.http) = {
get: "/customer/estimate-price/{origin}/{destination}",
};
}
} }
message LogoutReq { message LogoutReq {
@ -57,3 +62,16 @@ message LoginResp {
int64 token_create_at = 4; int64 token_create_at = 4;
int32 token_life = 5; int32 token_life = 5;
} }
message EstimatePriceReq {
string origin = 1;
string destination = 2;
};
message EstimatePriceResp {
int64 code = 1;
string message = 2;
string origin = 3;
string destination = 4;
int64 price = 5;
};

@ -22,6 +22,7 @@ const (
Customer_GetVerifyCode_FullMethodName = "/api.customer.Customer/GetVerifyCode" Customer_GetVerifyCode_FullMethodName = "/api.customer.Customer/GetVerifyCode"
Customer_Login_FullMethodName = "/api.customer.Customer/Login" Customer_Login_FullMethodName = "/api.customer.Customer/Login"
Customer_Logout_FullMethodName = "/api.customer.Customer/Logout" Customer_Logout_FullMethodName = "/api.customer.Customer/Logout"
Customer_EstimatePrice_FullMethodName = "/api.customer.Customer/EstimatePrice"
) )
// CustomerClient is the client API for Customer service. // CustomerClient is the client API for Customer service.
@ -31,6 +32,7 @@ type CustomerClient interface {
GetVerifyCode(ctx context.Context, in *GetVerifyCodeReq, opts ...grpc.CallOption) (*GetVerifyCodeResp, error) GetVerifyCode(ctx context.Context, in *GetVerifyCodeReq, opts ...grpc.CallOption) (*GetVerifyCodeResp, error)
Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error)
Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*LogoutResp, error) Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*LogoutResp, error)
EstimatePrice(ctx context.Context, in *EstimatePriceReq, opts ...grpc.CallOption) (*EstimatePriceResp, error)
} }
type customerClient struct { type customerClient struct {
@ -68,6 +70,15 @@ func (c *customerClient) Logout(ctx context.Context, in *LogoutReq, opts ...grpc
return out, nil return out, nil
} }
func (c *customerClient) EstimatePrice(ctx context.Context, in *EstimatePriceReq, opts ...grpc.CallOption) (*EstimatePriceResp, error) {
out := new(EstimatePriceResp)
err := c.cc.Invoke(ctx, Customer_EstimatePrice_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CustomerServer is the server API for Customer service. // CustomerServer is the server API for Customer service.
// All implementations must embed UnimplementedCustomerServer // All implementations must embed UnimplementedCustomerServer
// for forward compatibility // for forward compatibility
@ -75,6 +86,7 @@ type CustomerServer interface {
GetVerifyCode(context.Context, *GetVerifyCodeReq) (*GetVerifyCodeResp, error) GetVerifyCode(context.Context, *GetVerifyCodeReq) (*GetVerifyCodeResp, error)
Login(context.Context, *LoginReq) (*LoginResp, error) Login(context.Context, *LoginReq) (*LoginResp, error)
Logout(context.Context, *LogoutReq) (*LogoutResp, error) Logout(context.Context, *LogoutReq) (*LogoutResp, error)
EstimatePrice(context.Context, *EstimatePriceReq) (*EstimatePriceResp, error)
mustEmbedUnimplementedCustomerServer() mustEmbedUnimplementedCustomerServer()
} }
@ -91,6 +103,9 @@ func (UnimplementedCustomerServer) Login(context.Context, *LoginReq) (*LoginResp
func (UnimplementedCustomerServer) Logout(context.Context, *LogoutReq) (*LogoutResp, error) { func (UnimplementedCustomerServer) Logout(context.Context, *LogoutReq) (*LogoutResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented")
} }
func (UnimplementedCustomerServer) EstimatePrice(context.Context, *EstimatePriceReq) (*EstimatePriceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method EstimatePrice not implemented")
}
func (UnimplementedCustomerServer) mustEmbedUnimplementedCustomerServer() {} func (UnimplementedCustomerServer) mustEmbedUnimplementedCustomerServer() {}
// UnsafeCustomerServer may be embedded to opt out of forward compatibility for this service. // UnsafeCustomerServer may be embedded to opt out of forward compatibility for this service.
@ -158,6 +173,24 @@ func _Customer_Logout_Handler(srv interface{}, ctx context.Context, dec func(int
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Customer_EstimatePrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(EstimatePriceReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CustomerServer).EstimatePrice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Customer_EstimatePrice_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CustomerServer).EstimatePrice(ctx, req.(*EstimatePriceReq))
}
return interceptor(ctx, in, info, handler)
}
// Customer_ServiceDesc is the grpc.ServiceDesc for Customer service. // Customer_ServiceDesc is the grpc.ServiceDesc for Customer service.
// It's only intended for direct use with grpc.RegisterService, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
@ -177,6 +210,10 @@ var Customer_ServiceDesc = grpc.ServiceDesc{
MethodName: "Logout", MethodName: "Logout",
Handler: _Customer_Logout_Handler, Handler: _Customer_Logout_Handler,
}, },
{
MethodName: "EstimatePrice",
Handler: _Customer_EstimatePrice_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "api/customer/customer.proto", Metadata: "api/customer/customer.proto",

@ -19,11 +19,13 @@ var _ = binding.EncodeURL
const _ = http.SupportPackageIsVersion1 const _ = http.SupportPackageIsVersion1
const OperationCustomerEstimatePrice = "/api.customer.Customer/EstimatePrice"
const OperationCustomerGetVerifyCode = "/api.customer.Customer/GetVerifyCode" const OperationCustomerGetVerifyCode = "/api.customer.Customer/GetVerifyCode"
const OperationCustomerLogin = "/api.customer.Customer/Login" const OperationCustomerLogin = "/api.customer.Customer/Login"
const OperationCustomerLogout = "/api.customer.Customer/Logout" const OperationCustomerLogout = "/api.customer.Customer/Logout"
type CustomerHTTPServer interface { type CustomerHTTPServer interface {
EstimatePrice(context.Context, *EstimatePriceReq) (*EstimatePriceResp, error)
GetVerifyCode(context.Context, *GetVerifyCodeReq) (*GetVerifyCodeResp, error) GetVerifyCode(context.Context, *GetVerifyCodeReq) (*GetVerifyCodeResp, error)
Login(context.Context, *LoginReq) (*LoginResp, error) Login(context.Context, *LoginReq) (*LoginResp, error)
Logout(context.Context, *LogoutReq) (*LogoutResp, error) Logout(context.Context, *LogoutReq) (*LogoutResp, error)
@ -34,6 +36,7 @@ func RegisterCustomerHTTPServer(s *http.Server, srv CustomerHTTPServer) {
r.GET("/customer/get-verify-code/{telephone}", _Customer_GetVerifyCode0_HTTP_Handler(srv)) r.GET("/customer/get-verify-code/{telephone}", _Customer_GetVerifyCode0_HTTP_Handler(srv))
r.POST("/customer/login", _Customer_Login0_HTTP_Handler(srv)) r.POST("/customer/login", _Customer_Login0_HTTP_Handler(srv))
r.GET("/customer/logout", _Customer_Logout0_HTTP_Handler(srv)) r.GET("/customer/logout", _Customer_Logout0_HTTP_Handler(srv))
r.GET("/customer/estimate-price/{origin}/{destination}", _Customer_EstimatePrice0_HTTP_Handler(srv))
} }
func _Customer_GetVerifyCode0_HTTP_Handler(srv CustomerHTTPServer) func(ctx http.Context) error { func _Customer_GetVerifyCode0_HTTP_Handler(srv CustomerHTTPServer) func(ctx http.Context) error {
@ -96,7 +99,30 @@ func _Customer_Logout0_HTTP_Handler(srv CustomerHTTPServer) func(ctx http.Contex
} }
} }
func _Customer_EstimatePrice0_HTTP_Handler(srv CustomerHTTPServer) func(ctx http.Context) error {
return func(ctx http.Context) error {
var in EstimatePriceReq
if err := ctx.BindQuery(&in); err != nil {
return err
}
if err := ctx.BindVars(&in); err != nil {
return err
}
http.SetOperation(ctx, OperationCustomerEstimatePrice)
h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.EstimatePrice(ctx, req.(*EstimatePriceReq))
})
out, err := h(ctx, &in)
if err != nil {
return err
}
reply := out.(*EstimatePriceResp)
return ctx.Result(200, reply)
}
}
type CustomerHTTPClient interface { type CustomerHTTPClient interface {
EstimatePrice(ctx context.Context, req *EstimatePriceReq, opts ...http.CallOption) (rsp *EstimatePriceResp, err error)
GetVerifyCode(ctx context.Context, req *GetVerifyCodeReq, opts ...http.CallOption) (rsp *GetVerifyCodeResp, err error) GetVerifyCode(ctx context.Context, req *GetVerifyCodeReq, opts ...http.CallOption) (rsp *GetVerifyCodeResp, err error)
Login(ctx context.Context, req *LoginReq, opts ...http.CallOption) (rsp *LoginResp, err error) Login(ctx context.Context, req *LoginReq, opts ...http.CallOption) (rsp *LoginResp, err error)
Logout(ctx context.Context, req *LogoutReq, opts ...http.CallOption) (rsp *LogoutResp, err error) Logout(ctx context.Context, req *LogoutReq, opts ...http.CallOption) (rsp *LogoutResp, err error)
@ -110,6 +136,19 @@ func NewCustomerHTTPClient(client *http.Client) CustomerHTTPClient {
return &CustomerHTTPClientImpl{client} return &CustomerHTTPClientImpl{client}
} }
func (c *CustomerHTTPClientImpl) EstimatePrice(ctx context.Context, in *EstimatePriceReq, opts ...http.CallOption) (*EstimatePriceResp, error) {
var out EstimatePriceResp
pattern := "/customer/estimate-price/{origin}/{destination}"
path := binding.EncodeURL(pattern, in, true)
opts = append(opts, http.Operation(OperationCustomerEstimatePrice))
opts = append(opts, http.PathTemplate(pattern))
err := c.cc.Invoke(ctx, "GET", path, nil, &out, opts...)
if err != nil {
return nil, err
}
return &out, err
}
func (c *CustomerHTTPClientImpl) GetVerifyCode(ctx context.Context, in *GetVerifyCodeReq, opts ...http.CallOption) (*GetVerifyCodeResp, error) { func (c *CustomerHTTPClientImpl) GetVerifyCode(ctx context.Context, in *GetVerifyCodeReq, opts ...http.CallOption) (*GetVerifyCodeResp, error) {
var out GetVerifyCodeResp var out GetVerifyCodeResp
pattern := "/customer/get-verify-code/{telephone}" pattern := "/customer/get-verify-code/{telephone}"

@ -0,0 +1,246 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.30.0
// protoc v3.14.0
// source: api/valuation/valuation.proto
package valuation
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type GetEstimatePriceReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
}
func (x *GetEstimatePriceReq) Reset() {
*x = GetEstimatePriceReq{}
if protoimpl.UnsafeEnabled {
mi := &file_api_valuation_valuation_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetEstimatePriceReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetEstimatePriceReq) ProtoMessage() {}
func (x *GetEstimatePriceReq) ProtoReflect() protoreflect.Message {
mi := &file_api_valuation_valuation_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetEstimatePriceReq.ProtoReflect.Descriptor instead.
func (*GetEstimatePriceReq) Descriptor() ([]byte, []int) {
return file_api_valuation_valuation_proto_rawDescGZIP(), []int{0}
}
func (x *GetEstimatePriceReq) GetOrigin() string {
if x != nil {
return x.Origin
}
return ""
}
func (x *GetEstimatePriceReq) GetDestination() string {
if x != nil {
return x.Destination
}
return ""
}
type GetEstimatePriceReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Origin string `protobuf:"bytes,1,opt,name=origin,proto3" json:"origin,omitempty"`
Destination string `protobuf:"bytes,2,opt,name=destination,proto3" json:"destination,omitempty"`
Price int64 `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"`
}
func (x *GetEstimatePriceReply) Reset() {
*x = GetEstimatePriceReply{}
if protoimpl.UnsafeEnabled {
mi := &file_api_valuation_valuation_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetEstimatePriceReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetEstimatePriceReply) ProtoMessage() {}
func (x *GetEstimatePriceReply) ProtoReflect() protoreflect.Message {
mi := &file_api_valuation_valuation_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetEstimatePriceReply.ProtoReflect.Descriptor instead.
func (*GetEstimatePriceReply) Descriptor() ([]byte, []int) {
return file_api_valuation_valuation_proto_rawDescGZIP(), []int{1}
}
func (x *GetEstimatePriceReply) GetOrigin() string {
if x != nil {
return x.Origin
}
return ""
}
func (x *GetEstimatePriceReply) GetDestination() string {
if x != nil {
return x.Destination
}
return ""
}
func (x *GetEstimatePriceReply) GetPrice() int64 {
if x != nil {
return x.Price
}
return 0
}
var File_api_valuation_valuation_proto protoreflect.FileDescriptor
var file_api_valuation_valuation_proto_rawDesc = []byte{
0x0a, 0x1d, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x0d, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4f,
0x0a, 0x13, 0x47, 0x65, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69,
0x63, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a,
0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22,
0x67, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72,
0x69, 0x63, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67,
0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x03, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x32, 0x69, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x75,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x45, 0x73, 0x74, 0x69,
0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x73, 0x74,
0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x65,
0x74, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x42, 0x22, 0x5a, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x76, 0x61,
0x6c, 0x75, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_api_valuation_valuation_proto_rawDescOnce sync.Once
file_api_valuation_valuation_proto_rawDescData = file_api_valuation_valuation_proto_rawDesc
)
func file_api_valuation_valuation_proto_rawDescGZIP() []byte {
file_api_valuation_valuation_proto_rawDescOnce.Do(func() {
file_api_valuation_valuation_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_valuation_valuation_proto_rawDescData)
})
return file_api_valuation_valuation_proto_rawDescData
}
var file_api_valuation_valuation_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_api_valuation_valuation_proto_goTypes = []interface{}{
(*GetEstimatePriceReq)(nil), // 0: api.valuation.GetEstimatePriceReq
(*GetEstimatePriceReply)(nil), // 1: api.valuation.GetEstimatePriceReply
}
var file_api_valuation_valuation_proto_depIdxs = []int32{
0, // 0: api.valuation.Valuation.GetEstimatePrice:input_type -> api.valuation.GetEstimatePriceReq
1, // 1: api.valuation.Valuation.GetEstimatePrice:output_type -> api.valuation.GetEstimatePriceReply
1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_api_valuation_valuation_proto_init() }
func file_api_valuation_valuation_proto_init() {
if File_api_valuation_valuation_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_api_valuation_valuation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetEstimatePriceReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_api_valuation_valuation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetEstimatePriceReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_valuation_valuation_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_api_valuation_valuation_proto_goTypes,
DependencyIndexes: file_api_valuation_valuation_proto_depIdxs,
MessageInfos: file_api_valuation_valuation_proto_msgTypes,
}.Build()
File_api_valuation_valuation_proto = out.File
file_api_valuation_valuation_proto_rawDesc = nil
file_api_valuation_valuation_proto_goTypes = nil
file_api_valuation_valuation_proto_depIdxs = nil
}

@ -0,0 +1,20 @@
syntax = "proto3";
package api.valuation;
option go_package = "customer/api/valuation;valuation";
service Valuation {
rpc GetEstimatePrice (GetEstimatePriceReq) returns (GetEstimatePriceReply);
}
message GetEstimatePriceReq {
string origin = 1;
string destination = 2;
}
message GetEstimatePriceReply {
string origin = 1;
string destination = 2;
int64 price = 3;
}

@ -0,0 +1,109 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v3.14.0
// source: api/valuation/valuation.proto
package valuation
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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Valuation_GetEstimatePrice_FullMethodName = "/api.valuation.Valuation/GetEstimatePrice"
)
// ValuationClient is the client API for Valuation 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 ValuationClient interface {
GetEstimatePrice(ctx context.Context, in *GetEstimatePriceReq, opts ...grpc.CallOption) (*GetEstimatePriceReply, error)
}
type valuationClient struct {
cc grpc.ClientConnInterface
}
func NewValuationClient(cc grpc.ClientConnInterface) ValuationClient {
return &valuationClient{cc}
}
func (c *valuationClient) GetEstimatePrice(ctx context.Context, in *GetEstimatePriceReq, opts ...grpc.CallOption) (*GetEstimatePriceReply, error) {
out := new(GetEstimatePriceReply)
err := c.cc.Invoke(ctx, Valuation_GetEstimatePrice_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ValuationServer is the server API for Valuation service.
// All implementations must embed UnimplementedValuationServer
// for forward compatibility
type ValuationServer interface {
GetEstimatePrice(context.Context, *GetEstimatePriceReq) (*GetEstimatePriceReply, error)
mustEmbedUnimplementedValuationServer()
}
// UnimplementedValuationServer must be embedded to have forward compatible implementations.
type UnimplementedValuationServer struct {
}
func (UnimplementedValuationServer) GetEstimatePrice(context.Context, *GetEstimatePriceReq) (*GetEstimatePriceReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetEstimatePrice not implemented")
}
func (UnimplementedValuationServer) mustEmbedUnimplementedValuationServer() {}
// UnsafeValuationServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ValuationServer will
// result in compilation errors.
type UnsafeValuationServer interface {
mustEmbedUnimplementedValuationServer()
}
func RegisterValuationServer(s grpc.ServiceRegistrar, srv ValuationServer) {
s.RegisterService(&Valuation_ServiceDesc, srv)
}
func _Valuation_GetEstimatePrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetEstimatePriceReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ValuationServer).GetEstimatePrice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Valuation_GetEstimatePrice_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ValuationServer).GetEstimatePrice(ctx, req.(*GetEstimatePriceReq))
}
return interceptor(ctx, in, info, handler)
}
// Valuation_ServiceDesc is the grpc.ServiceDesc for Valuation service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Valuation_ServiceDesc = grpc.ServiceDesc{
ServiceName: "api.valuation.Valuation",
HandlerType: (*ValuationServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetEstimatePrice",
Handler: _Valuation_GetEstimatePrice_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/valuation/valuation.proto",
}

@ -33,7 +33,8 @@ func wireApp(confServer *conf.Server, confData *conf.Data, logger log.Logger) (*
greeterService := service.NewGreeterService(greeterUsecase) greeterService := service.NewGreeterService(greeterUsecase)
grpcServer := server.NewGRPCServer(confServer, greeterService, logger) grpcServer := server.NewGRPCServer(confServer, greeterService, logger)
customerData := data.NewCusomerData(dataData) customerData := data.NewCusomerData(dataData)
customerService := service.NewCustomerService(customerData) customerBiz := biz.NewCustomerBiz()
customerService := service.NewCustomerService(customerData, customerBiz)
httpServer := server.NewHTTPServer(confServer, customerService, greeterService, logger) httpServer := server.NewHTTPServer(confServer, customerService, greeterService, logger)
app := newApp(logger, grpcServer, httpServer) app := newApp(logger, grpcServer, httpServer)
return app, func() { return app, func() {

@ -29,6 +29,7 @@ require (
github.com/go-playground/form/v4 v4.2.0 // indirect github.com/go-playground/form/v4 v4.2.0 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.2 // indirect
github.com/google/subcommands v1.0.1 // indirect
github.com/google/uuid v1.3.0 // indirect github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
@ -44,11 +45,14 @@ require (
github.com/mattn/go-isatty v0.0.12 // indirect github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect go.opentelemetry.io/otel/trace v1.7.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.7.0 // indirect golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.5.0 // indirect golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.1.12 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )

@ -111,6 +111,7 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/subcommands v1.0.1 h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k=
github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
@ -279,6 +280,7 @@ golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -362,6 +364,7 @@ golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

@ -3,4 +3,4 @@ package biz
import "github.com/google/wire" import "github.com/google/wire"
// ProviderSet is biz providers. // ProviderSet is biz providers.
var ProviderSet = wire.NewSet(NewGreeterUsecase) var ProviderSet = wire.NewSet(NewGreeterUsecase, NewCustomerBiz)

@ -1,7 +1,12 @@
package biz package biz
import ( import (
"context"
"customer/api/valuation"
"database/sql" "database/sql"
"github.com/go-kratos/kratos/contrib/registry/consul/v2"
"github.com/go-kratos/kratos/v2/transport/grpc"
"github.com/hashicorp/consul/api"
"gorm.io/gorm" "gorm.io/gorm"
) )
@ -26,3 +31,41 @@ type CustomerToken struct {
Token string `gorm:"type:varchar(4095);" json:"token"` Token string `gorm:"type:varchar(4095);" json:"token"`
TokenCreatedAt sql.NullTime `gorm:"" json:"token_created_at"` TokenCreatedAt sql.NullTime `gorm:"" json:"token_created_at"`
} }
type CustomerBiz struct {
}
func NewCustomerBiz() *CustomerBiz {
return &CustomerBiz{}
}
func (cb *CustomerBiz) GetEstimatePrice(origin, destination string) (int64, error) {
consulConfig := api.DefaultConfig()
consulConfig.Address = "localhost:8500"
consulClient, err := api.NewClient(consulConfig)
dis := consul.New(consulClient)
if err != nil {
return 0, err
}
endpoint := "discovery:///Valuation"
conn, err := grpc.DialInsecure(
context.Background(),
grpc.WithEndpoint(endpoint),
grpc.WithDiscovery(dis),
)
if err != nil {
return 0, nil
}
defer func() {
_ = conn.Close()
}()
client := valuation.NewValuationClient(conn)
reply, err := client.GetEstimatePrice(context.Background(), &valuation.GetEstimatePriceReq{
Origin: origin,
Destination: destination,
})
if err != nil {
return 0, err
}
return reply.Price, nil
}

@ -20,14 +20,13 @@ import (
type CustomerService struct { type CustomerService struct {
pb.UnimplementedCustomerServer pb.UnimplementedCustomerServer
CD *data.CustomerData CD *data.CustomerData
/** cb *biz.CustomerBiz
todo verifyClient *client.verifyClient
*/
} }
func NewCustomerService(cd *data.CustomerData) *CustomerService { func NewCustomerService(cd *data.CustomerData, cb *biz.CustomerBiz) *CustomerService {
return &CustomerService{ return &CustomerService{
CD: cd, CD: cd,
cb: cb,
} }
} }
@ -147,3 +146,20 @@ func (s *CustomerService) Logout(ctx context.Context, req *pb.LogoutReq) (*pb.Lo
Message: "logout success", Message: "logout success",
}, nil }, nil
} }
func (s *CustomerService) EstimatePrice(ctx context.Context, req *pb.EstimatePriceReq) (*pb.EstimatePriceResp, error) {
price, err := s.cb.GetEstimatePrice(req.Origin, req.Destination)
if err != nil {
return &pb.EstimatePriceResp{
Code: 1,
Message: err.Error(),
}, nil
}
return &pb.EstimatePriceResp{
Code: 0,
Message: "SUCCESS",
Origin: req.Origin,
Destination: req.Destination,
Price: price,
}, nil
}

@ -3,147 +3,8 @@
openapi: 3.0.3 openapi: 3.0.3
info: info:
title: Customer API title: ""
version: 0.0.1 version: 0.0.1
paths: paths: {}
/customer/get-verify-code/{telephone}:
get:
tags:
- Customer
operationId: Customer_GetVerifyCode
parameters:
- name: telephone
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetVerifyCodeResp'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/customer/login:
post:
tags:
- Customer
operationId: Customer_Login
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LoginReq'
required: true
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/LoginResp'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/customer/logout:
get:
tags:
- Customer
operationId: Customer_Logout
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/LogoutResp'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
components: components:
schemas: schemas: {}
GetVerifyCodeResp:
type: object
properties:
code:
type: integer
format: int64
message:
type: string
verifyCode:
type: string
verifyCodeTime:
type: integer
format: int64
verifyCodeLife:
type: integer
format: int32
GoogleProtobufAny:
type: object
properties:
'@type':
type: string
description: The type of the serialized message.
additionalProperties: true
description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.
LoginReq:
type: object
properties:
telephone:
type: string
verifyCode:
type: string
LoginResp:
type: object
properties:
code:
type: integer
format: int64
message:
type: string
token:
type: string
tokenCreateAt:
type: integer
format: int64
tokenLife:
type: integer
format: int32
LogoutResp:
type: object
properties:
code:
type: integer
format: int64
message:
type: string
Status:
type: object
properties:
code:
type: integer
description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
format: int32
message:
type: string
description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
details:
type: array
items:
$ref: '#/components/schemas/GoogleProtobufAny'
description: A list of messages that carry the error details. There is a common set of message types for APIs to use.
description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).'
tags:
- name: Customer

@ -12,6 +12,7 @@ message GetEstimatePriceReq {
string origin = 1; string origin = 1;
string destination = 2; string destination = 2;
} }
message GetEstimatePriceReply { message GetEstimatePriceReply {
string origin = 1; string origin = 1;
string destination = 2; string destination = 2;

@ -31,7 +31,8 @@ func wireApp(confServer *conf.Server, confData *conf.Data, logger log.Logger) (*
greeterRepo := data.NewGreeterRepo(dataData, logger) greeterRepo := data.NewGreeterRepo(dataData, logger)
greeterUsecase := biz.NewGreeterUsecase(greeterRepo, logger) greeterUsecase := biz.NewGreeterUsecase(greeterRepo, logger)
greeterService := service.NewGreeterService(greeterUsecase) greeterService := service.NewGreeterService(greeterUsecase)
valuationBiz := biz.NewValuationBiz() priceRuleInterface := data.NewPriceRuleInterface(dataData)
valuationBiz := biz.NewValuationBiz(priceRuleInterface)
valuationService := service.NewValuationService(valuationBiz) valuationService := service.NewValuationService(valuationBiz)
grpcServer := server.NewGRPCServer(confServer, greeterService, valuationService, logger) grpcServer := server.NewGRPCServer(confServer, greeterService, valuationService, logger)
httpServer := server.NewHTTPServer(confServer, greeterService, logger) httpServer := server.NewHTTPServer(confServer, greeterService, logger)

@ -8,7 +8,7 @@ server:
data: data:
database: database:
driver: mysql driver: mysql
source: root:root@tcp(127.0.0.1:3306)/test source: root:mashibing@tcp(127.0.0.1:3306)/laomadj_valuation?charset=utf8mb4&parseTime=True&loc=Local
redis: redis:
addr: 127.0.0.1:6379 addr: 127.0.0.1:6379
read_timeout: 0.2s read_timeout: 0.2s

@ -7,10 +7,13 @@ require (
github.com/go-kratos/kratos/v2 v2.6.1 github.com/go-kratos/kratos/v2 v2.6.1
github.com/google/uuid v1.3.0 github.com/google/uuid v1.3.0
github.com/google/wire v0.5.0 github.com/google/wire v0.5.0
github.com/hashicorp/consul/api v1.19.1
go.uber.org/automaxprocs v1.5.1 go.uber.org/automaxprocs v1.5.1
google.golang.org/genproto v0.0.0-20220524023933-508584e28198 google.golang.org/genproto v0.0.0-20220524023933-508584e28198
google.golang.org/grpc v1.46.2 google.golang.org/grpc v1.46.2
google.golang.org/protobuf v1.28.0 google.golang.org/protobuf v1.28.0
gorm.io/driver/mysql v1.4.7
gorm.io/gorm v1.24.6
) )
require ( require (
@ -21,10 +24,10 @@ require (
github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/form/v4 v4.2.0 // indirect github.com/go-playground/form/v4 v4.2.0 // indirect
github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect github.com/golang/protobuf v1.5.2 // indirect
github.com/google/subcommands v1.0.1 // indirect github.com/google/subcommands v1.0.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/consul/api v1.19.1 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-hclog v0.14.1 // indirect github.com/hashicorp/go-hclog v0.14.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
@ -32,6 +35,8 @@ require (
github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/serf v0.10.1 // indirect github.com/hashicorp/serf v0.10.1 // indirect
github.com/imdario/mergo v0.3.12 // indirect github.com/imdario/mergo v0.3.12 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/mattn/go-colorable v0.1.6 // indirect github.com/mattn/go-colorable v0.1.6 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect

@ -69,6 +69,8 @@ github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBY
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic=
github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U=
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
@ -158,6 +160,11 @@ github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY
github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4=
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
@ -403,5 +410,10 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y=
gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc=
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.24.6 h1:wy98aq9oFEetsc4CAbKD2SoBCdMzsbSIvSUUFJuHi5s=
gorm.io/gorm v1.24.6/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

@ -5,14 +5,37 @@ import (
"github.com/go-kratos/kratos/contrib/registry/consul/v2" "github.com/go-kratos/kratos/contrib/registry/consul/v2"
"github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/grpc"
"github.com/hashicorp/consul/api" "github.com/hashicorp/consul/api"
"gorm.io/gorm"
"strconv"
"valuation/api/mapService" "valuation/api/mapService"
) )
type PriceRuleInterface interface {
GetRule(cityid uint, curr int) (*PriceRule, error)
}
type PriceRule struct {
gorm.Model
PriceRuleWork
}
type PriceRuleWork struct {
CityID uint
StartFee int64
DistanceFee int64
DurationFee int64
StartAt int
EndAt int
}
type ValuationBiz struct { type ValuationBiz struct {
pri PriceRuleInterface
} }
func NewValuationBiz() *ValuationBiz { func NewValuationBiz(pri PriceRuleInterface) *ValuationBiz {
return &ValuationBiz{} return &ValuationBiz{
pri: pri,
}
} }
func (*ValuationBiz) GetDrivingInfo(ctx context.Context, origin, destination string) (distance string, duration string, err error) { func (*ValuationBiz) GetDrivingInfo(ctx context.Context, origin, destination string) (distance string, duration string, err error) {
@ -46,3 +69,25 @@ func (*ValuationBiz) GetDrivingInfo(ctx context.Context, origin, destination str
distance, duration = reply.Distance, reply.Duration distance, duration = reply.Distance, reply.Duration
return return
} }
func (vb *ValuationBiz) GetPrice(ctx context.Context, distance, duration string, cityId uint, curr int) (int64, error) {
rule, err := vb.pri.GetRule(cityId, curr)
if err != nil {
return 0, err
}
distancInt64, err := strconv.ParseInt(distance, 10, 64)
if err != nil {
return 0, err
}
durationInt64, err := strconv.ParseInt(duration, 10, 64)
if err != nil {
return 0, err
}
distancInt64 /= 1000
durationInt64 /= 60
var startDistance int64 = 5
total := rule.StartFee +
rule.DistanceFee*(distancInt64-startDistance) +
rule.DurationFee*durationInt64
return total, nil
}

@ -1,6 +1,10 @@
package data package data
import ( import (
"gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"valuation/internal/biz"
"valuation/internal/conf" "valuation/internal/conf"
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
@ -8,17 +12,69 @@ import (
) )
// ProviderSet is data providers. // ProviderSet is data providers.
var ProviderSet = wire.NewSet(NewData, NewGreeterRepo) var ProviderSet = wire.NewSet(NewData, NewGreeterRepo, NewPriceRuleInterface)
// Data . // Data .
type Data struct { type Data struct {
// TODO wrapped database client Mdb *gorm.DB
} }
// NewData . // NewData .
func NewData(c *conf.Data, logger log.Logger) (*Data, func(), error) { func NewData(c *conf.Data, logger log.Logger) (*Data, func(), error) {
data := &Data{}
//初始化mysql
dsn := c.Database.Source
db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
if err != nil {
data.Mdb = nil
log.Fatal(err)
}
data.Mdb = db
//migrateTable(db)
cleanup := func() { cleanup := func() {
log.NewHelper(logger).Info("closing the data resources") log.NewHelper(logger).Info("closing the data resources")
} }
return &Data{}, cleanup, nil return data, cleanup, nil
}
func migrateTable(db *gorm.DB) {
if err := db.AutoMigrate(&biz.PriceRule{}); err != nil {
log.Info("price_rule table migrate error, err:", err)
}
rules := []biz.PriceRule{
{
Model: gorm.Model{ID: 1},
PriceRuleWork: biz.PriceRuleWork{
CityID: 1,
StartFee: 300,
DistanceFee: 35,
DurationFee: 10,
StartAt: 7,
EndAt: 23,
},
},
{
Model: gorm.Model{ID: 2},
PriceRuleWork: biz.PriceRuleWork{
CityID: 1,
StartFee: 350,
DistanceFee: 35,
DurationFee: 10,
StartAt: 23,
EndAt: 24,
},
},
{
Model: gorm.Model{ID: 3},
PriceRuleWork: biz.PriceRuleWork{
CityID: 1,
StartFee: 400,
DistanceFee: 35,
DurationFee: 10,
StartAt: 0,
EndAt: 7,
},
},
}
db.Clauses(clause.OnConflict{UpdateAll: true}).Create(rules)
} }

@ -0,0 +1,20 @@
package data
import "valuation/internal/biz"
type PriceRuleData struct {
data *Data
}
func NewPriceRuleInterface(data *Data) biz.PriceRuleInterface {
return &PriceRuleData{data: data}
}
func (prd *PriceRuleData) GetRule(cityid uint, curr int) (*biz.PriceRule, error) {
pr := &biz.PriceRule{}
result := prd.data.Mdb.Where("city_id=? AND start_at <= ? AND end_at > ?", cityid, curr, curr).First(pr)
if result.Error != nil {
return nil, result.Error
}
return pr, nil
}

@ -2,7 +2,6 @@ package service
import ( import (
"context" "context"
"fmt"
"github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/errors"
"valuation/internal/biz" "valuation/internal/biz"
@ -25,6 +24,13 @@ func (s *ValuationService) GetEstimatePrice(ctx context.Context, req *pb.GetEsti
if err != nil { if err != nil {
return nil, errors.New(200, "MAP ERROR", "get driving info error") return nil, errors.New(200, "MAP ERROR", "get driving info error")
} }
fmt.Println(distance, duration) price, err := s.vb.GetPrice(ctx, distance, duration, 1, 9)
return &pb.GetEstimatePriceReply{}, nil if err != nil {
return nil, errors.New(200, "PRICE ERROR", "cal price error")
}
return &pb.GetEstimatePriceReply{
Origin: req.Origin,
Destination: req.Destination,
Price: price,
}, nil
} }

Binary file not shown.

@ -19,8 +19,8 @@ services:
- "3306:3306" - "3306:3306"
environment: environment:
MYSQL_ROOT_PASSWORD: mashibing MYSQL_ROOT_PASSWORD: mashibing
MYSQL_DATABASE: laomadj_customer # MYSQL_DATABASE: laomadj_customer
# command: --init-file /docker-entrypoint-initdb.d/init.sql command: --init-file /docker-entrypoint-initdb.d/init.sql
volumes: volumes:
- ./volumes/mysql/data:/var/lib/mysql - ./volumes/mysql/data:/var/lib/mysql
# - ./volumes/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql - ./volumes/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql

@ -1,2 +1,2 @@
[auto] [auto]
server-uuid=225758bb-c26c-11ed-956d-0242ac140002 server-uuid=f4a10ff5-c46e-11ed-bfdb-0242ac120004

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,8 +1,3 @@
./binlog.000001 ./binlog.000001
./binlog.000002 ./binlog.000002
./binlog.000003 ./binlog.000003
./binlog.000004
./binlog.000005
./binlog.000006
./binlog.000007
./binlog.000008

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -1,4 +1,6 @@
4294967278,286 4294967278,285
4294967279,275
4294967278,284
4294967293,131 4294967293,131
4294967293,130 4294967293,130
4294967293,129 4294967293,129
@ -140,72 +142,76 @@
4243767282,0 4243767282,0
4243767281,0 4243767281,0
4294967293,0 4294967293,0
4294967279,136
4294967279,273
4294967279,137
4294967279,23 4294967279,23
4294967279,24 4294967279,24
4294967279,138
4294967279,25 4294967279,25
4294967279,26
4294967279,139 4294967279,139
4294967279,140 4294967279,140
4294967279,141 4294967279,26
4294967279,27 4294967279,27
4294967279,141
4294967279,142 4294967279,142
4294967279,28 4294967279,28
4294967279,29 4294967279,29
4294967279,30
4294967279,143 4294967279,143
4294967279,30
4294967279,144 4294967279,144
4294967279,145 4294967279,145
4294967279,146
4294967279,31 4294967279,31
4294967279,32 4294967279,32
4294967279,146
4294967279,33 4294967279,33
4294967279,34
4294967279,147 4294967279,147
4294967279,148 4294967279,148
4294967279,149 4294967279,34
4294967279,150
4294967279,35 4294967279,35
4294967279,149
4294967279,36 4294967279,36
4294967279,37 4294967279,150
4294967279,38
4294967279,151 4294967279,151
4294967279,153 4294967279,37
4294967279,152 4294967279,152
4294967279,154 4294967279,38
4294967279,39 4294967279,39
4294967279,153
4294967279,40 4294967279,40
4294967279,155
4294967279,154
4294967279,41 4294967279,41
4294967279,158 4294967279,158
4294967279,42 4294967279,42
4294967279,155
4294967279,156 4294967279,156
4294967279,43
4294967279,157 4294967279,157
4294967279,159 4294967279,159
4294967279,43
4294967279,44 4294967279,44
4294967279,160
4294967279,45 4294967279,45
4294967279,46 4294967279,46
4294967279,160 4294967279,47
4294967279,161 4294967279,161
4294967279,162 4294967279,162
4294967279,47 4294967279,164
4294967279,163 4294967279,163
4294967279,48 4294967279,48
4294967279,49 4294967279,49
4294967279,164
4294967279,50 4294967279,50
4294967279,165
4294967279,51 4294967279,51
4294967279,165
4294967279,166 4294967279,166
4294967279,167 4294967279,167
4294967279,52
4294967279,168 4294967279,168
4294967279,52
4294967279,53 4294967279,53
4294967279,54 4294967279,54
4294967279,55 4294967279,55
4294967279,169 4294967279,169
4294967279,171
4294967279,170 4294967279,170
4294967279,171
4294967279,172 4294967279,172
4294967279,56 4294967279,56
4294967279,57 4294967279,57
@ -213,35 +219,66 @@
4294967279,59 4294967279,59
4294967279,173 4294967279,173
4294967279,175 4294967279,175
4294967279,177
4294967279,176 4294967279,176
4294967279,177
4294967279,60 4294967279,60
4294967279,61 4294967279,61
4294967279,62 4294967279,62
4294967279,63
4294967279,178 4294967279,178
4294967279,63
4294967279,179 4294967279,179
4294967279,180
4294967279,181
4294967279,64 4294967279,64
4294967279,180
4294967279,65 4294967279,65
4294967279,66 4294967279,181
4294967279,67
4294967279,182 4294967279,182
4294967279,66
4294967279,183 4294967279,183
4294967279,184 4294967279,67
4294967279,185
4294967279,68 4294967279,68
4294967279,184
4294967279,69 4294967279,69
4294967279,185
4294967279,70 4294967279,70
4294967279,71
4294967279,186 4294967279,186
4294967279,187 4294967279,187
4294967279,71
4294967279,188 4294967279,188
4294967279,189
4294967279,72 4294967279,72
4294967279,73 4294967279,73
4294967279,189
4294967279,74 4294967279,74
4294967279,75
4294967279,190 4294967279,190
4294967279,191
4294967279,75
4294967279,192 4294967279,192
4294967279,76
4294967279,77
4294967279,193
4294967279,78
4294967279,194
4294967279,195
4294967279,79
4294967279,198
4294967279,80
4294967279,81
4294967279,197
4294967279,196
4294967279,82
4294967279,83
4294967279,84
4294967279,199
4294967279,200
4294967279,201
4294967279,202
4294967279,85
4294967279,86
4294967279,87
4294967279,89
4294967279,203
4294967279,204
4294967279,205
4294967279,206
4294967279,90
4294967279,91
4294967279,92

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"mysqld_version_id":80027,"dd_version":80023,"sdi_version":80019,"dd_object_type":"Table","dd_object":{"name":"accounts","mysql_version_id":80027,"created":20230314132902,"last_altered":20230314132902,"hidden":1,"options":"avg_row_length=0;key_block_size=0;keys_disabled=0;pack_record=0;server_p_s_table=1;stats_auto_recalc=0;stats_sample_pages=0;","columns":[{"name":"USER","type":29,"is_nullable":true,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":1,"char_length":128,"numeric_precision":0,"numeric_scale":0,"numeric_scale_null":true,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":false,"default_value_null":true,"srs_id_null":true,"srs_id":0,"default_value":"","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":4,"column_type_utf8":"char(32)","elements":[],"collation_id":46,"is_explicit_collation":true},{"name":"HOST","type":29,"is_nullable":true,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":2,"char_length":255,"numeric_precision":0,"numeric_scale":0,"numeric_scale_null":true,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":false,"default_value_null":true,"srs_id_null":true,"srs_id":0,"default_value":"","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":1,"column_type_utf8":"char(255)","elements":[],"collation_id":11,"is_explicit_collation":true},{"name":"CURRENT_CONNECTIONS","type":9,"is_nullable":false,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":3,"char_length":20,"numeric_precision":19,"numeric_scale":0,"numeric_scale_null":false,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAA=","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":1,"column_type_utf8":"bigint","elements":[],"collation_id":255,"is_explicit_collation":false},{"name":"TOTAL_CONNECTIONS","type":9,"is_nullable":false,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":4,"char_length":20,"numeric_precision":19,"numeric_scale":0,"numeric_scale_null":false,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAA=","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":1,"column_type_utf8":"bigint","elements":[],"collation_id":255,"is_explicit_collation":false}],"schema_ref":"performance_schema","se_private_id":18446744073709551615,"engine":"PERFORMANCE_SCHEMA","last_checked_for_upgrade_version_id":0,"comment":"","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","row_format":1,"partition_type":0,"partition_expression":"","partition_expression_utf8":"","default_partitioning":0,"subpartition_type":0,"subpartition_expression":"","subpartition_expression_utf8":"","default_subpartitioning":0,"indexes":[{"name":"ACCOUNT","hidden":false,"is_generated":false,"ordinal_position":1,"comment":"","options":"flags=0;","se_private_data":"","type":2,"algorithm":4,"is_algorithm_explicit":false,"is_visible":true,"engine":"PERFORMANCE_SCHEMA","engine_attribute":"","secondary_engine_attribute":"","elements":[{"ordinal_position":1,"length":128,"order":1,"hidden":false,"column_opx":0},{"ordinal_position":2,"length":255,"order":1,"hidden":false,"column_opx":1}]}],"foreign_keys":[],"check_constraints":[],"partitions":[],"collation_id":255}} {"mysqld_version_id":80027,"dd_version":80023,"sdi_version":80019,"dd_object_type":"Table","dd_object":{"name":"accounts","mysql_version_id":80027,"created":20230317025414,"last_altered":20230317025414,"hidden":1,"options":"avg_row_length=0;key_block_size=0;keys_disabled=0;pack_record=0;server_p_s_table=1;stats_auto_recalc=0;stats_sample_pages=0;","columns":[{"name":"USER","type":29,"is_nullable":true,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":1,"char_length":128,"numeric_precision":0,"numeric_scale":0,"numeric_scale_null":true,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":false,"default_value_null":true,"srs_id_null":true,"srs_id":0,"default_value":"","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":4,"column_type_utf8":"char(32)","elements":[],"collation_id":46,"is_explicit_collation":true},{"name":"HOST","type":29,"is_nullable":true,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":2,"char_length":255,"numeric_precision":0,"numeric_scale":0,"numeric_scale_null":true,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":false,"default_value_null":true,"srs_id_null":true,"srs_id":0,"default_value":"","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":1,"column_type_utf8":"char(255)","elements":[],"collation_id":11,"is_explicit_collation":true},{"name":"CURRENT_CONNECTIONS","type":9,"is_nullable":false,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":3,"char_length":20,"numeric_precision":19,"numeric_scale":0,"numeric_scale_null":false,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAA=","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":1,"column_type_utf8":"bigint","elements":[],"collation_id":255,"is_explicit_collation":false},{"name":"TOTAL_CONNECTIONS","type":9,"is_nullable":false,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":4,"char_length":20,"numeric_precision":19,"numeric_scale":0,"numeric_scale_null":false,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAA=","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":1,"column_type_utf8":"bigint","elements":[],"collation_id":255,"is_explicit_collation":false}],"schema_ref":"performance_schema","se_private_id":18446744073709551615,"engine":"PERFORMANCE_SCHEMA","last_checked_for_upgrade_version_id":0,"comment":"","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","row_format":1,"partition_type":0,"partition_expression":"","partition_expression_utf8":"","default_partitioning":0,"subpartition_type":0,"subpartition_expression":"","subpartition_expression_utf8":"","default_subpartitioning":0,"indexes":[{"name":"ACCOUNT","hidden":false,"is_generated":false,"ordinal_position":1,"comment":"","options":"flags=0;","se_private_data":"","type":2,"algorithm":4,"is_algorithm_explicit":false,"is_visible":true,"engine":"PERFORMANCE_SCHEMA","engine_attribute":"","secondary_engine_attribute":"","elements":[{"ordinal_position":1,"length":128,"order":1,"hidden":false,"column_opx":0},{"ordinal_position":2,"length":255,"order":1,"hidden":false,"column_opx":1}]}],"foreign_keys":[],"check_constraints":[],"partitions":[],"collation_id":255}}

File diff suppressed because one or more lines are too long

@ -1 +1 @@
{"mysqld_version_id":80027,"dd_version":80023,"sdi_version":80019,"dd_object_type":"Table","dd_object":{"name":"cond_instances","mysql_version_id":80027,"created":20230314132902,"last_altered":20230314132902,"hidden":1,"options":"avg_row_length=0;key_block_size=0;keys_disabled=0;pack_record=1;server_p_s_table=1;stats_auto_recalc=0;stats_sample_pages=0;","columns":[{"name":"NAME","type":16,"is_nullable":false,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":1,"char_length":512,"numeric_precision":0,"numeric_scale":0,"numeric_scale_null":true,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAA==","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":4,"column_type_utf8":"varchar(128)","elements":[],"collation_id":255,"is_explicit_collation":false},{"name":"OBJECT_INSTANCE_BEGIN","type":9,"is_nullable":false,"is_zerofill":false,"is_unsigned":true,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":2,"char_length":20,"numeric_precision":20,"numeric_scale":0,"numeric_scale_null":false,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAA=","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":2,"column_type_utf8":"bigint unsigned","elements":[],"collation_id":255,"is_explicit_collation":false}],"schema_ref":"performance_schema","se_private_id":18446744073709551615,"engine":"PERFORMANCE_SCHEMA","last_checked_for_upgrade_version_id":0,"comment":"","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","row_format":2,"partition_type":0,"partition_expression":"","partition_expression_utf8":"","default_partitioning":0,"subpartition_type":0,"subpartition_expression":"","subpartition_expression_utf8":"","default_subpartitioning":0,"indexes":[{"name":"PRIMARY","hidden":false,"is_generated":false,"ordinal_position":1,"comment":"","options":"flags=0;","se_private_data":"","type":1,"algorithm":4,"is_algorithm_explicit":false,"is_visible":true,"engine":"PERFORMANCE_SCHEMA","engine_attribute":"","secondary_engine_attribute":"","elements":[{"ordinal_position":1,"length":8,"order":1,"hidden":false,"column_opx":1}]},{"name":"NAME","hidden":false,"is_generated":false,"ordinal_position":2,"comment":"","options":"flags=0;","se_private_data":"","type":3,"algorithm":4,"is_algorithm_explicit":false,"is_visible":true,"engine":"PERFORMANCE_SCHEMA","engine_attribute":"","secondary_engine_attribute":"","elements":[{"ordinal_position":1,"length":512,"order":1,"hidden":false,"column_opx":0}]}],"foreign_keys":[],"check_constraints":[],"partitions":[],"collation_id":255}} {"mysqld_version_id":80027,"dd_version":80023,"sdi_version":80019,"dd_object_type":"Table","dd_object":{"name":"cond_instances","mysql_version_id":80027,"created":20230317025414,"last_altered":20230317025414,"hidden":1,"options":"avg_row_length=0;key_block_size=0;keys_disabled=0;pack_record=1;server_p_s_table=1;stats_auto_recalc=0;stats_sample_pages=0;","columns":[{"name":"NAME","type":16,"is_nullable":false,"is_zerofill":false,"is_unsigned":false,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":1,"char_length":512,"numeric_precision":0,"numeric_scale":0,"numeric_scale_null":true,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\nAA==","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":4,"column_type_utf8":"varchar(128)","elements":[],"collation_id":255,"is_explicit_collation":false},{"name":"OBJECT_INSTANCE_BEGIN","type":9,"is_nullable":false,"is_zerofill":false,"is_unsigned":true,"is_auto_increment":false,"is_virtual":false,"hidden":1,"ordinal_position":2,"char_length":20,"numeric_precision":20,"numeric_scale":0,"numeric_scale_null":false,"datetime_precision":0,"datetime_precision_null":1,"has_no_default":true,"default_value_null":false,"srs_id_null":true,"srs_id":0,"default_value":"AAAAAAAAAAA=","default_value_utf8_null":true,"default_value_utf8":"","default_option":"","update_option":"","comment":"","generation_expression":"","generation_expression_utf8":"","options":"interval_count=0;","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","column_key":2,"column_type_utf8":"bigint unsigned","elements":[],"collation_id":255,"is_explicit_collation":false}],"schema_ref":"performance_schema","se_private_id":18446744073709551615,"engine":"PERFORMANCE_SCHEMA","last_checked_for_upgrade_version_id":0,"comment":"","se_private_data":"","engine_attribute":"","secondary_engine_attribute":"","row_format":2,"partition_type":0,"partition_expression":"","partition_expression_utf8":"","default_partitioning":0,"subpartition_type":0,"subpartition_expression":"","subpartition_expression_utf8":"","default_subpartitioning":0,"indexes":[{"name":"PRIMARY","hidden":false,"is_generated":false,"ordinal_position":1,"comment":"","options":"flags=0;","se_private_data":"","type":1,"algorithm":4,"is_algorithm_explicit":false,"is_visible":true,"engine":"PERFORMANCE_SCHEMA","engine_attribute":"","secondary_engine_attribute":"","elements":[{"ordinal_position":1,"length":8,"order":1,"hidden":false,"column_opx":1}]},{"name":"NAME","hidden":false,"is_generated":false,"ordinal_position":2,"comment":"","options":"flags=0;","se_private_data":"","type":3,"algorithm":4,"is_algorithm_explicit":false,"is_visible":true,"engine":"PERFORMANCE_SCHEMA","engine_attribute":"","secondary_engine_attribute":"","elements":[{"ordinal_position":1,"length":512,"order":1,"hidden":false,"column_opx":0}]}],"foreign_keys":[],"check_constraints":[],"partitions":[],"collation_id":255}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save