Refine the structure of project.

This commit is contained in:
zicla
2019-04-26 03:15:34 +08:00
parent 16749d1fa1
commit d030a60721
24 changed files with 213 additions and 217 deletions
+5 -5
View File
@@ -2,7 +2,7 @@ package code
import (
"net/http"
"tank/code/result"
result2 "tank/code/tool/result"
"tank/code/tool/util"
)
@@ -43,7 +43,7 @@ func (this *PreferenceController) RegisterRoutes() map[string]func(writer http.R
}
//查看某个偏好设置的详情。
func (this *PreferenceController) Fetch(writer http.ResponseWriter, request *http.Request) *result.WebResult {
func (this *PreferenceController) Fetch(writer http.ResponseWriter, request *http.Request) *result2.WebResult {
preference := this.preferenceService.Fetch()
@@ -51,7 +51,7 @@ func (this *PreferenceController) Fetch(writer http.ResponseWriter, request *htt
}
//修改
func (this *PreferenceController) Edit(writer http.ResponseWriter, request *http.Request) *result.WebResult {
func (this *PreferenceController) Edit(writer http.ResponseWriter, request *http.Request) *result2.WebResult {
//验证参数。
name := request.FormValue("name")
@@ -86,13 +86,13 @@ func (this *PreferenceController) Edit(writer http.ResponseWriter, request *http
}
//清扫系统,所有数据全部丢失。一定要非常慎点,非常慎点!只在系统初始化的时候点击!
func (this *PreferenceController) SystemCleanup(writer http.ResponseWriter, request *http.Request) *result.WebResult {
func (this *PreferenceController) SystemCleanup(writer http.ResponseWriter, request *http.Request) *result2.WebResult {
user := this.checkUser(writer, request)
password := request.FormValue("password")
if !util.MatchBcrypt(password, user.Password) {
panic(result.BadRequest("密码错误,不能执行!"))
panic(result2.BadRequest("密码错误,不能执行!"))
}
for _, bean := range CONTEXT.BeanMap {