Refine the directory structure of this project.

This commit is contained in:
zicla
2019-04-24 19:36:10 +08:00
parent a353ff1303
commit daa5847859
22 changed files with 517 additions and 415 deletions

View File

@ -11,6 +11,7 @@ import (
"os"
"regexp"
"strconv"
"tank/rest/result"
"time"
)
@ -226,7 +227,7 @@ func (this *InstallController) validateTableMetaList(tableInfoList []*InstallTab
}
//验证数据库连接
func (this *InstallController) Verify(writer http.ResponseWriter, request *http.Request) *WebResult {
func (this *InstallController) Verify(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
defer this.closeDbConnection(db)
@ -239,7 +240,7 @@ func (this *InstallController) Verify(writer http.ResponseWriter, request *http.
}
//获取需要安装的数据库表
func (this *InstallController) TableInfoList(writer http.ResponseWriter, request *http.Request) *WebResult {
func (this *InstallController) TableInfoList(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
defer this.closeDbConnection(db)
@ -248,7 +249,7 @@ func (this *InstallController) TableInfoList(writer http.ResponseWriter, request
}
//创建缺失数据库和表
func (this *InstallController) CreateTable(writer http.ResponseWriter, request *http.Request) *WebResult {
func (this *InstallController) CreateTable(writer http.ResponseWriter, request *http.Request) *result.WebResult {
var tableNames = []IBase{&Dashboard{}, &DownloadToken{}, &Footprint{}, &ImageCache{}, &Matter{}, &Preference{}, &Session{}, &UploadToken{}, &User{}}
var installTableInfos []*InstallTableInfo
@ -277,7 +278,7 @@ func (this *InstallController) CreateTable(writer http.ResponseWriter, request *
}
//获取管理员列表(10条记录)
func (this *InstallController) AdminList(writer http.ResponseWriter, request *http.Request) *WebResult {
func (this *InstallController) AdminList(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
defer this.closeDbConnection(db)
@ -295,7 +296,7 @@ func (this *InstallController) AdminList(writer http.ResponseWriter, request *ht
}
//创建管理员
func (this *InstallController) CreateAdmin(writer http.ResponseWriter, request *http.Request) *WebResult {
func (this *InstallController) CreateAdmin(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
defer this.closeDbConnection(db)
@ -356,7 +357,7 @@ func (this *InstallController) CreateAdmin(writer http.ResponseWriter, request *
}
//(如果数据库中本身存在管理员了)验证管理员
func (this *InstallController) ValidateAdmin(writer http.ResponseWriter, request *http.Request) *WebResult {
func (this *InstallController) ValidateAdmin(writer http.ResponseWriter, request *http.Request) *result.WebResult {
db := this.openDbConnection(writer, request)
defer this.closeDbConnection(db)
@ -391,7 +392,7 @@ func (this *InstallController) ValidateAdmin(writer http.ResponseWriter, request
}
//完成系统安装
func (this *InstallController) Finish(writer http.ResponseWriter, request *http.Request) *WebResult {
func (this *InstallController) Finish(writer http.ResponseWriter, request *http.Request) *result.WebResult {
mysqlPortStr := request.FormValue("mysqlPort")
mysqlHost := request.FormValue("mysqlHost")