From c5de9ce9eb394df8d3167fee8441be4daf26907e Mon Sep 17 00:00:00 2001 From: zicla Date: Fri, 26 Apr 2019 03:08:22 +0800 Subject: [PATCH] Add tool dir. --- code/alien_controller.go | 3 ++- code/alien_service.go | 2 +- code/bean.go | 3 ++- code/cache/cache.go | 4 ++-- code/config/config.go | 2 +- code/dashboard_service.go | 2 +- code/dav_controller.go | 2 +- code/dav_service.go | 2 +- code/download/download.go | 2 +- code/footprint_service.go | 2 +- code/image_cache_dao.go | 2 +- code/image_cache_service.go | 2 +- code/install_controller.go | 2 +- code/logger/logger.go | 2 +- code/matter_dao.go | 2 +- code/matter_model.go | 2 +- code/matter_service.go | 2 +- code/preference_controller.go | 2 +- code/router.go | 2 +- code/{ => tool}/util/util_encode.go | 0 code/{ => tool}/util/util_framework.go | 0 code/{ => tool}/util/util_mime.go | 0 code/{ => tool}/util/util_network.go | 0 code/{ => tool}/util/util_path.go | 0 code/{ => tool}/util/util_string.go | 0 code/{ => tool}/util/util_time.go | 0 code/{ => tool}/util/util_validation.go | 0 code/user_controller.go | 3 +-- 28 files changed, 23 insertions(+), 22 deletions(-) rename code/{ => tool}/util/util_encode.go (100%) rename code/{ => tool}/util/util_framework.go (100%) rename code/{ => tool}/util/util_mime.go (100%) rename code/{ => tool}/util/util_network.go (100%) rename code/{ => tool}/util/util_path.go (100%) rename code/{ => tool}/util/util_string.go (100%) rename code/{ => tool}/util/util_time.go (100%) rename code/{ => tool}/util/util_validation.go (100%) diff --git a/code/alien_controller.go b/code/alien_controller.go index 25bf316..1789dd5 100644 --- a/code/alien_controller.go +++ b/code/alien_controller.go @@ -6,7 +6,8 @@ import ( "regexp" "strconv" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" + "time" ) diff --git a/code/alien_service.go b/code/alien_service.go index c4640f9..53c455a 100644 --- a/code/alien_service.go +++ b/code/alien_service.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/bean.go b/code/bean.go index 75c8599..25f4869 100644 --- a/code/bean.go +++ b/code/bean.go @@ -5,7 +5,7 @@ import ( "tank/code/config" "tank/code/logger" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" ) type IBean interface { @@ -46,6 +46,7 @@ func (this *Bean) PanicError(err error) { //能找到一个user就找到一个 func (this *Bean) findUser(writer http.ResponseWriter, request *http.Request) *User { + //验证用户是否已经登录。 //登录身份有效期以数据库中记录的为准 sessionId := util.GetSessionUuidFromRequest(request, config.COOKIE_AUTH_KEY) diff --git a/code/cache/cache.go b/code/cache/cache.go index 7b86a02..c5c4b94 100644 --- a/code/cache/cache.go +++ b/code/cache/cache.go @@ -5,7 +5,7 @@ import ( "fmt" "sort" "sync" - "tank/code/util" + "tank/code/tool/util" "time" ) @@ -388,7 +388,7 @@ func (table *CacheTable) MostAccessed(count int64) []*CacheItem { // 打印日志 func (table *CacheTable) log(format string, v ...interface{}) { - //全局日志记录 + //TODO: 全局日志记录 //LOGGER.Info(format, v...) } diff --git a/code/config/config.go b/code/config/config.go index 5ce37b0..3d43740 100644 --- a/code/config/config.go +++ b/code/config/config.go @@ -4,7 +4,7 @@ import ( "github.com/json-iterator/go" "io/ioutil" "tank/code/logger" - "tank/code/util" + "tank/code/tool/util" "time" "unsafe" ) diff --git a/code/dashboard_service.go b/code/dashboard_service.go index 6de66af..732d96b 100644 --- a/code/dashboard_service.go +++ b/code/dashboard_service.go @@ -1,7 +1,7 @@ package code import ( - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/dav_controller.go b/code/dav_controller.go index fceaaf1..9ab17d5 100644 --- a/code/dav_controller.go +++ b/code/dav_controller.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" ) /** diff --git a/code/dav_service.go b/code/dav_service.go index e4b27ab..e64d04e 100644 --- a/code/dav_service.go +++ b/code/dav_service.go @@ -10,7 +10,7 @@ import ( "tank/code/dav" "tank/code/dav/xml" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" ) /** diff --git a/code/download/download.go b/code/download/download.go index cbe2416..a53a4f0 100644 --- a/code/download/download.go +++ b/code/download/download.go @@ -12,7 +12,7 @@ import ( "strconv" "strings" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/footprint_service.go b/code/footprint_service.go index e0f359b..0b5060c 100644 --- a/code/footprint_service.go +++ b/code/footprint_service.go @@ -4,7 +4,7 @@ import ( "encoding/json" "net/http" "tank/code/config" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/image_cache_dao.go b/code/image_cache_dao.go index 504bddc..188d383 100644 --- a/code/image_cache_dao.go +++ b/code/image_cache_dao.go @@ -6,7 +6,7 @@ import ( "github.com/nu7hatch/gouuid" "os" "path/filepath" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/image_cache_service.go b/code/image_cache_service.go index 1b3a7ee..6bbf2ed 100644 --- a/code/image_cache_service.go +++ b/code/image_cache_service.go @@ -9,7 +9,7 @@ import ( "path/filepath" "strconv" "strings" - "tank/code/util" + "tank/code/tool/util" ) //@Service diff --git a/code/install_controller.go b/code/install_controller.go index c315b03..3792b46 100644 --- a/code/install_controller.go +++ b/code/install_controller.go @@ -13,7 +13,7 @@ import ( "strconv" "tank/code/config" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/logger/logger.go b/code/logger/logger.go index 77fc42c..f3de446 100644 --- a/code/logger/logger.go +++ b/code/logger/logger.go @@ -6,7 +6,7 @@ import ( "os" "runtime" "sync" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/matter_dao.go b/code/matter_dao.go index f9b3842..9d0c905 100644 --- a/code/matter_dao.go +++ b/code/matter_dao.go @@ -6,7 +6,7 @@ import ( "os" "tank/code/config" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/matter_model.go b/code/matter_model.go index a616a9e..7efe6c6 100644 --- a/code/matter_model.go +++ b/code/matter_model.go @@ -3,7 +3,7 @@ package code import ( "fmt" "tank/code/config" - "tank/code/util" + "tank/code/tool/util" ) const ( diff --git a/code/matter_service.go b/code/matter_service.go index 0eab721..999503f 100644 --- a/code/matter_service.go +++ b/code/matter_service.go @@ -8,7 +8,7 @@ import ( "strings" "tank/code/download" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" ) /** diff --git a/code/preference_controller.go b/code/preference_controller.go index b750dfc..2997a70 100644 --- a/code/preference_controller.go +++ b/code/preference_controller.go @@ -3,7 +3,7 @@ package code import ( "net/http" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" ) type PreferenceController struct { diff --git a/code/router.go b/code/router.go index c6d04d0..c60137f 100644 --- a/code/router.go +++ b/code/router.go @@ -10,7 +10,7 @@ import ( "tank/code/config" "tank/code/logger" "tank/code/result" - "tank/code/util" + "tank/code/tool/util" "time" ) diff --git a/code/util/util_encode.go b/code/tool/util/util_encode.go similarity index 100% rename from code/util/util_encode.go rename to code/tool/util/util_encode.go diff --git a/code/util/util_framework.go b/code/tool/util/util_framework.go similarity index 100% rename from code/util/util_framework.go rename to code/tool/util/util_framework.go diff --git a/code/util/util_mime.go b/code/tool/util/util_mime.go similarity index 100% rename from code/util/util_mime.go rename to code/tool/util/util_mime.go diff --git a/code/util/util_network.go b/code/tool/util/util_network.go similarity index 100% rename from code/util/util_network.go rename to code/tool/util/util_network.go diff --git a/code/util/util_path.go b/code/tool/util/util_path.go similarity index 100% rename from code/util/util_path.go rename to code/tool/util/util_path.go diff --git a/code/util/util_string.go b/code/tool/util/util_string.go similarity index 100% rename from code/util/util_string.go rename to code/tool/util/util_string.go diff --git a/code/util/util_time.go b/code/tool/util/util_time.go similarity index 100% rename from code/util/util_time.go rename to code/tool/util/util_time.go diff --git a/code/util/util_validation.go b/code/tool/util/util_validation.go similarity index 100% rename from code/util/util_validation.go rename to code/tool/util/util_validation.go diff --git a/code/user_controller.go b/code/user_controller.go index 219388b..e4de8b8 100644 --- a/code/user_controller.go +++ b/code/user_controller.go @@ -6,8 +6,7 @@ import ( "strconv" "tank/code/config" "tank/code/result" - "tank/code/util" - + "tank/code/tool/util" "time" )