修复:为 user-svc 添加健康检查和启动顺序控制

This commit is contained in:
fish
2026-03-28 21:54:09 +08:00
parent 5ac0a52bb1
commit c5260bcae8
31 changed files with 1995 additions and 167 deletions

View File

@@ -0,0 +1,572 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v6.31.1
// source: shared/proto/common/common.proto
package common
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// 通用响应结构
type Response struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Response) Reset() {
*x = Response{}
mi := &file_shared_proto_common_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Response) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Response) ProtoMessage() {}
func (x *Response) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
func (*Response) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{0}
}
func (x *Response) GetCode() int32 {
if x != nil {
return x.Code
}
return 0
}
func (x *Response) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *Response) GetData() []byte {
if x != nil {
return x.Data
}
return nil
}
// 分页请求
type PaginationRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PaginationRequest) Reset() {
*x = PaginationRequest{}
mi := &file_shared_proto_common_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PaginationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PaginationRequest) ProtoMessage() {}
func (x *PaginationRequest) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PaginationRequest.ProtoReflect.Descriptor instead.
func (*PaginationRequest) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{1}
}
func (x *PaginationRequest) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *PaginationRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
// 分页响应
type PaginationResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Total int32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"`
Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"`
PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
TotalPages int32 `protobuf:"varint,4,opt,name=total_pages,json=totalPages,proto3" json:"total_pages,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PaginationResponse) Reset() {
*x = PaginationResponse{}
mi := &file_shared_proto_common_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PaginationResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PaginationResponse) ProtoMessage() {}
func (x *PaginationResponse) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PaginationResponse.ProtoReflect.Descriptor instead.
func (*PaginationResponse) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{2}
}
func (x *PaginationResponse) GetTotal() int32 {
if x != nil {
return x.Total
}
return 0
}
func (x *PaginationResponse) GetPage() int32 {
if x != nil {
return x.Page
}
return 0
}
func (x *PaginationResponse) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *PaginationResponse) GetTotalPages() int32 {
if x != nil {
return x.TotalPages
}
return 0
}
// 错误信息
type Error struct {
state protoimpl.MessageState `protogen:"open.v1"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
Details string `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Error) Reset() {
*x = Error{}
mi := &file_shared_proto_common_common_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Error) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Error) ProtoMessage() {}
func (x *Error) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
func (*Error) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{3}
}
func (x *Error) GetCode() int32 {
if x != nil {
return x.Code
}
return 0
}
func (x *Error) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
func (x *Error) GetDetails() string {
if x != nil {
return x.Details
}
return ""
}
// 空请求
type EmptyRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *EmptyRequest) Reset() {
*x = EmptyRequest{}
mi := &file_shared_proto_common_common_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *EmptyRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EmptyRequest) ProtoMessage() {}
func (x *EmptyRequest) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EmptyRequest.ProtoReflect.Descriptor instead.
func (*EmptyRequest) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{4}
}
// 空响应
type EmptyResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *EmptyResponse) Reset() {
*x = EmptyResponse{}
mi := &file_shared_proto_common_common_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *EmptyResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*EmptyResponse) ProtoMessage() {}
func (x *EmptyResponse) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.
func (*EmptyResponse) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{5}
}
// ID 请求
type IDRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *IDRequest) Reset() {
*x = IDRequest{}
mi := &file_shared_proto_common_common_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *IDRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IDRequest) ProtoMessage() {}
func (x *IDRequest) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IDRequest.ProtoReflect.Descriptor instead.
func (*IDRequest) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{6}
}
func (x *IDRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
// ID 响应
type IDResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *IDResponse) Reset() {
*x = IDResponse{}
mi := &file_shared_proto_common_common_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *IDResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IDResponse) ProtoMessage() {}
func (x *IDResponse) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use IDResponse.ProtoReflect.Descriptor instead.
func (*IDResponse) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{7}
}
func (x *IDResponse) GetId() string {
if x != nil {
return x.Id
}
return ""
}
// 状态响应
type StatusResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *StatusResponse) Reset() {
*x = StatusResponse{}
mi := &file_shared_proto_common_common_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *StatusResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StatusResponse) ProtoMessage() {}
func (x *StatusResponse) ProtoReflect() protoreflect.Message {
mi := &file_shared_proto_common_common_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) Descriptor() ([]byte, []int) {
return file_shared_proto_common_common_proto_rawDescGZIP(), []int{8}
}
func (x *StatusResponse) GetSuccess() bool {
if x != nil {
return x.Success
}
return false
}
func (x *StatusResponse) GetMessage() string {
if x != nil {
return x.Message
}
return ""
}
var File_shared_proto_common_common_proto protoreflect.FileDescriptor
const file_shared_proto_common_common_proto_rawDesc = "" +
"\n" +
" shared/proto/common/common.proto\x12\x06common\"L\n" +
"\bResponse\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12\x12\n" +
"\x04data\x18\x03 \x01(\fR\x04data\"D\n" +
"\x11PaginationRequest\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" +
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\"|\n" +
"\x12PaginationResponse\x12\x14\n" +
"\x05total\x18\x01 \x01(\x05R\x05total\x12\x12\n" +
"\x04page\x18\x02 \x01(\x05R\x04page\x12\x1b\n" +
"\tpage_size\x18\x03 \x01(\x05R\bpageSize\x12\x1f\n" +
"\vtotal_pages\x18\x04 \x01(\x05R\n" +
"totalPages\"O\n" +
"\x05Error\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12\x18\n" +
"\adetails\x18\x03 \x01(\tR\adetails\"\x0e\n" +
"\fEmptyRequest\"\x0f\n" +
"\rEmptyResponse\"\x1b\n" +
"\tIDRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\"\x1c\n" +
"\n" +
"IDResponse\x12\x0e\n" +
"\x02id\x18\x01 \x01(\tR\x02id\"D\n" +
"\x0eStatusResponse\x12\x18\n" +
"\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessageB\x15Z\x13shared/proto/commonb\x06proto3"
var (
file_shared_proto_common_common_proto_rawDescOnce sync.Once
file_shared_proto_common_common_proto_rawDescData []byte
)
func file_shared_proto_common_common_proto_rawDescGZIP() []byte {
file_shared_proto_common_common_proto_rawDescOnce.Do(func() {
file_shared_proto_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_shared_proto_common_common_proto_rawDesc), len(file_shared_proto_common_common_proto_rawDesc)))
})
return file_shared_proto_common_common_proto_rawDescData
}
var file_shared_proto_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_shared_proto_common_common_proto_goTypes = []any{
(*Response)(nil), // 0: common.Response
(*PaginationRequest)(nil), // 1: common.PaginationRequest
(*PaginationResponse)(nil), // 2: common.PaginationResponse
(*Error)(nil), // 3: common.Error
(*EmptyRequest)(nil), // 4: common.EmptyRequest
(*EmptyResponse)(nil), // 5: common.EmptyResponse
(*IDRequest)(nil), // 6: common.IDRequest
(*IDResponse)(nil), // 7: common.IDResponse
(*StatusResponse)(nil), // 8: common.StatusResponse
}
var file_shared_proto_common_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] 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_shared_proto_common_common_proto_init() }
func file_shared_proto_common_common_proto_init() {
if File_shared_proto_common_common_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_shared_proto_common_common_proto_rawDesc), len(file_shared_proto_common_common_proto_rawDesc)),
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_shared_proto_common_common_proto_goTypes,
DependencyIndexes: file_shared_proto_common_common_proto_depIdxs,
MessageInfos: file_shared_proto_common_common_proto_msgTypes,
}.Build()
File_shared_proto_common_common_proto = out.File
file_shared_proto_common_common_proto_goTypes = nil
file_shared_proto_common_common_proto_depIdxs = nil
}

View File

@@ -2,6 +2,8 @@ syntax = "proto3";
package common;
option go_package = "shared/proto/common";
// 通用响应结构
message Response {
int32 code = 1;