feat: Dockerfile remove config
This commit is contained in:
@@ -3,11 +3,8 @@ package config
|
||||
import "github.com/zeromicro/go-zero/zrpc"
|
||||
|
||||
type Config struct {
|
||||
zrpc.RpcServerConf
|
||||
Nacos NacosConf
|
||||
Mysql MysqlConf
|
||||
BizRedis RedisConf
|
||||
AppLog LogConf
|
||||
Nacos NacosConf
|
||||
zrpc.RpcClientConf
|
||||
}
|
||||
|
||||
type NacosConf struct {
|
||||
@@ -15,37 +12,5 @@ type NacosConf struct {
|
||||
NamespaceId string `json:",optional"`
|
||||
Group string `json:",optional"`
|
||||
RegisterIP string `json:",optional"`
|
||||
}
|
||||
|
||||
type MysqlConf struct {
|
||||
Host string
|
||||
Port int
|
||||
User string
|
||||
Password string
|
||||
Database string
|
||||
Charset string `json:",default=utf8mb4"`
|
||||
Prefix string `json:",optional"`
|
||||
|
||||
ReadHost string `json:",optional"`
|
||||
ReadPort int `json:",optional"`
|
||||
ReadUser string `json:",optional"`
|
||||
ReadPassword string `json:",optional"`
|
||||
ReadDatabase string `json:",optional"`
|
||||
}
|
||||
|
||||
type RedisConf struct {
|
||||
Host string
|
||||
Port int `json:",default=6379"`
|
||||
Password string `json:",optional"`
|
||||
DB int `json:",optional"`
|
||||
}
|
||||
|
||||
type LogConf struct {
|
||||
Path string `json:",default=logs"`
|
||||
InfoFile string `json:",default=info.log"`
|
||||
ErrorFile string `json:",default=error.log"`
|
||||
FatalFile string `json:",default=fatal.log"`
|
||||
MaxSize int `json:",default=100"`
|
||||
MaxBackups int `json:",default=10"`
|
||||
MaxAge int `json:",default=30"`
|
||||
ConfigID string `json:",optional"`
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package svc
|
||||
|
||||
import (
|
||||
"lone-services/pkg/utils"
|
||||
"lone-services/services/product/internal/config"
|
||||
|
||||
"gorm.io/gorm"
|
||||
@@ -16,6 +17,6 @@ func NewServiceContext(c config.Config, db *gorm.DB) *ServiceContext {
|
||||
return &ServiceContext{
|
||||
Config: c,
|
||||
DB: db,
|
||||
Prefix: c.Mysql.Prefix,
|
||||
Prefix: utils.GetConfigString("mysql.prefix"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user