diff --git a/README.md b/README.md index 27d10a6..038055f 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,10 @@ CuteGo是一套全部开源的快速开发平台,毫无保留给个人及企 # 后执行 $env:GOPROXY = "https://goproxy.io,direct" ``` - -- 3、将docs下的configs目录移动到cutego目录下 - ![Configs](docs/images/ConfigFile.png) - -- 4、idea配置如下 +- 3、idea配置如下 ![Edit Configurations...](docs/images/RunConfig.png) -- 5、下载依赖 go mod tidy +- 4、下载依赖 go mod tidy ![Download Mod](docs/images/DownloadMod.png) #### 使用说明 diff --git a/core/service/login_info_service.go b/core/service/login_info_service.go index c34b817..917466b 100644 --- a/core/service/login_info_service.go +++ b/core/service/login_info_service.go @@ -39,8 +39,8 @@ func (s LoginInfoService) GetRequestClientIp(c *gin.Context) string { return reqIP } -// 纯真数据库获取ip地址 -// @return {"Ip": "180.89.94.90","Country": "北京市","City": "鹏博士宽带"} +// GetLocationByIp 纯真数据库获取ip地址 +// @return {"Ip": "IP地址","Country": "国家","City": "城市"} func (s LoginInfoService) GetLocationByIp(ipAddr string) *qqwry.QQwry { address := net.ParseIP(ipAddr) if ipAddr == "" || address == nil { diff --git a/docs/idea_config.jpg b/docs/idea_config.jpg new file mode 100644 index 0000000..2033144 Binary files /dev/null and b/docs/idea_config.jpg differ diff --git a/docs/images/ConfigFile.png b/docs/images/ConfigFile.png deleted file mode 100644 index 7d36bc9..0000000 Binary files a/docs/images/ConfigFile.png and /dev/null differ diff --git a/go.mod b/go.mod index 961dcf0..a2acb77 100644 --- a/go.mod +++ b/go.mod @@ -6,18 +6,17 @@ require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/druidcaesa/gotool v0.0.0-20210722000450-b972ac6f3771 github.com/gin-gonic/gin v1.7.3 - github.com/go-basic/uuid v1.0.0 // indirect + github.com/go-basic/uuid v1.0.0 github.com/go-sql-driver/mysql v1.6.0 github.com/go-xorm/xorm v0.7.9 github.com/gomodule/redigo v1.8.5 - github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 // indirect github.com/gorilla/websocket v1.5.0 github.com/jonboulle/clockwork v0.2.2 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible github.com/lestrrat-go/strftime v1.0.5 // indirect github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 - github.com/robfig/cron v1.2.0 // indirect + github.com/robfig/cron v1.2.0 github.com/sirupsen/logrus v1.8.1 github.com/xuri/excelize/v2 v2.4.1 github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc // indirect diff --git a/go.sum b/go.sum index 28e3387..17ea3f8 100644 --- a/go.sum +++ b/go.sum @@ -73,8 +73,6 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= -github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= diff --git a/pkg/config/index.go b/pkg/config/index.go index f6c106e..e3a9331 100644 --- a/pkg/config/index.go +++ b/pkg/config/index.go @@ -53,11 +53,10 @@ func LoadYamlFile(filename string, v interface{}) { } } -// 配置文件所在路径 -const BaseConfigDirPath = "configs" +// BaseConfigDirPath 配置文件所在路径 +const BaseConfigDirPath = "resources" func readAppYmlFile(resourcePath string) { - // 读取主配置文件 applicationCoreFileName := BaseConfigDirPath + "/application.yml" applicationCoreFilePath := resourcePath + GetPathSeparator() + applicationCoreFileName diff --git a/docs/configs/application-dev.yml b/resources/application-dev.yml similarity index 100% rename from docs/configs/application-dev.yml rename to resources/application-dev.yml diff --git a/docs/configs/application.yml b/resources/application.yml similarity index 100% rename from docs/configs/application.yml rename to resources/application.yml diff --git a/docs/configs/scanip/qqwry.dat b/resources/scanip/qqwry.dat similarity index 100% rename from docs/configs/scanip/qqwry.dat rename to resources/scanip/qqwry.dat