feat user服部署

This commit is contained in:
2025-12-20 21:00:24 +08:00
parent ff1bd1d0b6
commit 69cc960fe5
14 changed files with 83 additions and 28 deletions

View File

@@ -30,11 +30,11 @@ type EtcdConfig struct {
type MySQLConfig struct {
Dsn string `yaml:"dsn"`
MaxOpenConn int32 `yaml:"max_open_conn"`
MaxIdleConn int32 `yaml:"max_idle_conn"`
ConnMaxLifetimeSec int32 `yaml:"conn_max_lifetime_sec"`
ConnMaxIdleTimeSec int32 `yaml:"conn_max_idle_time_sec"`
LogLevel string `yaml:"log_level"`
MaxOpenConn int32 `yaml:"maxOpenConn"`
MaxIdleConn int32 `yaml:"maxIdleConn"`
ConnMaxLifetimeSec int32 `yaml:"connMaxLifetimeSec"`
ConnMaxIdleTimeSec int32 `yaml:"connMaxIdleTimeSec"`
LogLevel string `yaml:"logLevel"`
}
type ServeConfig struct {

View File

@@ -19,16 +19,16 @@ db:
serve:
grpc:
address: "127.0.0.1"
address: "10.0.40.199"
port: 8500
ttl: 20
socket:
web:
address: "127.0.0.1"
address: "0.0.0.0"
port: 8501
raw:
address: "127.0.0.1"
address: "0.0.0.0"
port: 8502
http:
address: "127.0.0.1"
address: "0.0.0.0"
port: 8503

View File

@@ -24,11 +24,11 @@ serve:
ttl: 20
socket:
web:
address: "127.0.0.1"
address: "0.0.0.0"
port: 8501
raw:
address: "127.0.0.1"
address: "0.0.0.0"
port: 8502
http:
address: "127.0.0.1"
address: "0.0.0.0"
port: 8503

View File

@@ -33,7 +33,7 @@ func ErrorHandler(_ context.Context, _ *runtime.ServeMux, _ runtime.Marshaler, w
code = http_resp.Failed.Code()
msg = http_resp.Failed.Error()
}
if st.Code() == codes.Unknown {
if st.Code() == codes.Unknown || st.Code() == codes.Unimplemented {
msg = st.Message()
}
@@ -47,6 +47,8 @@ func grpcCodeToHTTPCode(c codes.Code) int {
switch c {
case codes.OK, codes.Unknown:
return http.StatusOK
case codes.Unimplemented:
return http.StatusNotFound
default:
return http.StatusInternalServerError
}

View File

@@ -14,6 +14,6 @@ db:
serve:
grpc:
address: "127.0.0.1"
address: "10.0.40.199"
port: 8601
ttl: 20

View File

@@ -14,14 +14,14 @@ db:
mysql:
user_db:
dsn: "root:gR9pV4tY7zR6qL3e@tcp(47.108.184.184:3306)/user_db?charset=utf8mb4&parseTime=True&loc=Local"
max_open_conn: 50
max_idle_conn: 20
conn_max_lifetime_sec: 600
conn_max_idle_time_sec: 180
log_level: "warn"
maxOpenConn: 50
maxIdleConn: 20
connMaxLifetimeSec: 600
connMaxIdleTimeSec: 180
logLevel: "warn"
serve:
grpc:
address: "127.0.0.1"
address: "10.0.40.199"
port: 8602
ttl: 20

View File

@@ -13,12 +13,12 @@ db:
endpoints: [ "172.18.28.0:2379" ]
mysql:
user_db:
dsn: "root:gR9pV4tY7zR6qL3e@tcp(47.108.184.184:3306)/user_db?charset=utf8mb4&parseTime=True&loc=Local"
max_open_conn: 50
max_idle_conn: 20
conn_max_lifetime_sec: 600
conn_max_idle_time_sec: 180
log_level: "warn"
dsn: "root:gR9pV4tY7zR6qL3e@tcp(172.18.28.0:3306)/user_db?charset=utf8mb4&parseTime=True&loc=Local"
maxOpenConn: 50
maxIdleConn: 20
connMaxLifetimeSec: 600
connMaxIdleTimeSec: 180
logLevel: "warn"
serve:
grpc: