fix: import cycle
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"cutego/modules/core/api/v1/response"
|
||||
"cutego/modules/core/dataobject"
|
||||
"cutego/modules/core/service"
|
||||
"cutego/pkg/common"
|
||||
"cutego/pkg/cronjob"
|
||||
"cutego/pkg/resp"
|
||||
"cutego/pkg/util"
|
||||
@@ -36,7 +35,7 @@ func (a CronJobApi) List(c *gin.Context) {
|
||||
// GetById 根据id获取任务详情
|
||||
func (a CronJobApi) GetById(c *gin.Context) {
|
||||
jobId := c.Param("jobId")
|
||||
info := a.cronJobService.GetInfo(common.StringToInt64(jobId))
|
||||
info := a.cronJobService.GetInfo(util.StringToInt64(jobId))
|
||||
resp.OK(c, util.DeepCopy(info, &response.CronJobResponse{}))
|
||||
}
|
||||
|
||||
@@ -73,7 +72,7 @@ func (a CronJobApi) Add(c *gin.Context) {
|
||||
|
||||
// Remove 删除定时任务
|
||||
func (a CronJobApi) Remove(c *gin.Context) {
|
||||
jobId := common.StringToInt64(c.Param("jobId"))
|
||||
jobId := util.StringToInt64(c.Param("jobId"))
|
||||
funcAlias := c.Param("funcAlias")
|
||||
|
||||
if a.cronJobService.GetInfo(jobId).Status == "1" {
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
cache2 "cutego/modules/core/cache"
|
||||
"cutego/modules/core/dataobject"
|
||||
"cutego/modules/core/service"
|
||||
"cutego/pkg/common"
|
||||
"cutego/pkg/page"
|
||||
"cutego/pkg/resp"
|
||||
"cutego/pkg/tree/tree_menu"
|
||||
@@ -46,7 +45,7 @@ func (a LoginApi) Login(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (a LoginApi) handleLoginInfo(c *gin.Context, body request2.LoginBody, loginStatus bool) {
|
||||
status := common.If(loginStatus, "1", "0")
|
||||
status := util.IF(loginStatus, "1", "0")
|
||||
|
||||
clientIp := a.loginInfoService.GetRequestClientIp(c)
|
||||
var location string
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"cutego/modules/core/api/v1/response"
|
||||
"cutego/modules/core/dataobject"
|
||||
"cutego/modules/core/service"
|
||||
"cutego/pkg/common"
|
||||
"cutego/pkg/config"
|
||||
"cutego/pkg/excels"
|
||||
"cutego/pkg/logging"
|
||||
"cutego/pkg/page"
|
||||
@@ -287,7 +287,7 @@ func (a UserApi) UpdatePwd(c *gin.Context) {
|
||||
|
||||
// Avatar 修改头像
|
||||
func (a UserApi) Avatar(c *gin.Context) {
|
||||
dirPath := common.GetDirPath("avatar")
|
||||
dirPath := config.GetDirPath("avatar")
|
||||
file, _, err := c.Request.FormFile("avatarFile")
|
||||
fileName := gotool.IdUtils.IdUUIDToRan(true) + ".jpg"
|
||||
filePath := dirPath + fileName
|
||||
|
||||
Vendored
+2
-3
@@ -3,7 +3,6 @@ package cache
|
||||
import (
|
||||
models2 "cutego/modules/core/dataobject"
|
||||
"cutego/pkg/cache"
|
||||
"cutego/pkg/common"
|
||||
"cutego/pkg/constant"
|
||||
)
|
||||
|
||||
@@ -13,13 +12,13 @@ import (
|
||||
func GetRedisConfig(key string) *models2.SysConfig {
|
||||
val := cache.GetCache(constant.RedisConst{}.GetRedisConfigKey() + key)
|
||||
s := new(models2.SysConfig)
|
||||
return common.JsonToStruct(val, s).(*models2.SysConfig)
|
||||
return cache.JsonToStruct(val, s).(*models2.SysConfig)
|
||||
}
|
||||
|
||||
// SetRedisConfig 将配置存入缓存
|
||||
// @Param config models2.SysConfig
|
||||
func SetRedisConfig(config models2.SysConfig) {
|
||||
cache.SetCache(config.ConfigKey, common.StructToJson(config))
|
||||
cache.SetCache(config.ConfigKey, cache.StructToJson(config))
|
||||
}
|
||||
|
||||
// RemoveRedisConfig 从缓存中删除配置
|
||||
|
||||
Vendored
+1
-2
@@ -3,7 +3,6 @@ package cache
|
||||
import (
|
||||
models2 "cutego/modules/core/dataobject"
|
||||
"cutego/pkg/cache"
|
||||
"cutego/pkg/common"
|
||||
"cutego/pkg/constant"
|
||||
)
|
||||
|
||||
@@ -13,7 +12,7 @@ import (
|
||||
func GetRedisDict(key string) interface{} {
|
||||
val := cache.GetCache(key)
|
||||
s := make([]interface{}, 0)
|
||||
return common.JsonToStruct(val, s)
|
||||
return cache.JsonToStruct(val, s)
|
||||
}
|
||||
|
||||
// SetRedisDict 保存字典数据
|
||||
|
||||
@@ -3,7 +3,7 @@ package dao
|
||||
import (
|
||||
"cutego/modules/core/api/v1/request"
|
||||
"cutego/modules/core/dataobject"
|
||||
"cutego/pkg/common"
|
||||
"cutego/pkg/cache"
|
||||
"cutego/pkg/constant"
|
||||
"cutego/pkg/logging"
|
||||
"cutego/pkg/page"
|
||||
@@ -160,7 +160,7 @@ func init() {
|
||||
return
|
||||
}
|
||||
for _, sysConfig := range configs {
|
||||
refs.RedisDB.SET(constant.RedisConst{}.GetRedisConfigKey()+sysConfig.ConfigKey, common.StructToJson(map[string]interface{}{
|
||||
refs.RedisDB.SET(constant.RedisConst{}.GetRedisConfigKey()+sysConfig.ConfigKey, cache.StructToJson(map[string]interface{}{
|
||||
"configId": sysConfig.ConfigId,
|
||||
"configName": sysConfig.ConfigName,
|
||||
"configKey": sysConfig.ConfigKey,
|
||||
|
||||
@@ -3,7 +3,7 @@ package dao
|
||||
import (
|
||||
"cutego/modules/core/api/v1/request"
|
||||
"cutego/modules/core/dataobject"
|
||||
"cutego/pkg/common"
|
||||
"cutego/pkg/cache"
|
||||
"cutego/pkg/constant"
|
||||
"cutego/pkg/logging"
|
||||
"cutego/pkg/page"
|
||||
@@ -152,6 +152,6 @@ func init() {
|
||||
})
|
||||
}
|
||||
}
|
||||
refs.RedisDB.SET(constant.RedisConst{}.GetRedisDictKey()+dictType.DictType, common.StructToJson(dictData))
|
||||
refs.RedisDB.SET(constant.RedisConst{}.GetRedisDictKey()+dictType.DictType, cache.StructToJson(dictData))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user