Add mysqlCharset prop. Fix some dav bug.

This commit is contained in:
lishuang
2020-05-05 19:33:22 +08:00
parent 4bfae38176
commit a314d4dc54
6 changed files with 74 additions and 14 deletions

View File

@ -40,6 +40,8 @@ type ConfigItem struct {
MysqlUsername string
//mysql password
MysqlPassword string
//mysql charset
MysqlCharset string
}
//validate whether the config file is ok
@ -74,6 +76,10 @@ func (this *ConfigItem) validate() bool {
core.LOGGER.Error("MysqlSchema is not configured")
return false
}
if this.MysqlCharset == "" {
core.LOGGER.Error("MysqlCharset is not configured")
return false
}
return true
@ -144,7 +150,7 @@ func (this *TankConfig) ReadFromConfigFile() {
}
util.MakeDirAll(this.matterPath)
this.mysqlUrl = util.GetMysqlUrl(this.item.MysqlPort, this.item.MysqlHost, this.item.MysqlSchema, this.item.MysqlUsername, this.item.MysqlPassword)
this.mysqlUrl = util.GetMysqlUrl(this.item.MysqlPort, this.item.MysqlHost, this.item.MysqlSchema, this.item.MysqlUsername, this.item.MysqlPassword, this.item.MysqlCharset)
this.installed = true
core.LOGGER.Info("use config file: %s", filePath)
@ -173,7 +179,7 @@ func (this *TankConfig) MatterPath() string {
}
//Finish the installation. Write config to tank.json
func (this *TankConfig) FinishInstall(mysqlPort int, mysqlHost string, mysqlSchema string, mysqlUsername string, mysqlPassword string) {
func (this *TankConfig) FinishInstall(mysqlPort int, mysqlHost string, mysqlSchema string, mysqlUsername string, mysqlPassword string, mysqlCharset string) {
var configItem = &ConfigItem{
//server port
@ -185,6 +191,7 @@ func (this *TankConfig) FinishInstall(mysqlPort int, mysqlHost string, mysqlSche
MysqlSchema: mysqlSchema,
MysqlUsername: mysqlUsername,
MysqlPassword: mysqlPassword,
MysqlCharset: mysqlCharset,
}
//pretty json.