兼容casbin2.24.0版本log
迁移脚本编译时不打包
This commit is contained in:
1 parent
48f0cb46ec
commit
39dd1ee6f8
56 files changed
+320
-454
No files matched your search
@@ -30,10 +30,9 @@ type SysDictData struct {
|
||||
// @Security Bearer
|
||||
func (e *SysDictData) GetSysDictDataList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -71,10 +70,9 @@ func (e *SysDictData) GetSysDictDataList(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysDictData) GetSysDictData(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -113,10 +111,9 @@ func (e *SysDictData) GetSysDictData(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysDictData) InsertSysDictData(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -157,10 +154,9 @@ func (e *SysDictData) InsertSysDictData(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysDictData) UpdateSysDictData(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -196,10 +192,9 @@ func (e *SysDictData) UpdateSysDictData(c *gin.Context) {
|
||||
// @Router /api/v1/dict/data/{dictCode} [delete]
|
||||
func (e *SysDictData) DeleteSysDictData(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -236,10 +231,9 @@ func (e *SysDictData) DeleteSysDictData(c *gin.Context) {
|
||||
|
||||
func (e *SysDictData) GetSysDictDataAll(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,9 @@ type SysDictType struct {
|
||||
// @Security Bearer
|
||||
func (e *SysDictType) GetSysDictTypeList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -69,10 +68,9 @@ func (e *SysDictType) GetSysDictTypeList(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysDictType) GetSysDictType(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -109,10 +107,9 @@ func (e *SysDictType) GetSysDictType(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysDictType) InsertSysDictType(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -152,10 +149,9 @@ func (e *SysDictType) InsertSysDictType(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysDictType) UpdateSysDictType(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -189,10 +185,9 @@ func (e *SysDictType) UpdateSysDictType(c *gin.Context) {
|
||||
// @Router /api/v1/dict/type/{dictId} [delete]
|
||||
func (e *SysDictType) DeleteSysDictType(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -236,10 +231,9 @@ func (e *SysDictType) DeleteSysDictType(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysDictType) GetSysDictTypeAll(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import (
|
||||
"go-admin/app/admin/service"
|
||||
"go-admin/app/admin/service/dto"
|
||||
"go-admin/common/apis"
|
||||
"go-admin/tools"
|
||||
)
|
||||
|
||||
type SysSetting struct {
|
||||
@@ -26,10 +25,9 @@ type SysSetting struct {
|
||||
// @Router /api/v1/setting [get]
|
||||
func (e *SysSetting) GetSetting(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -62,10 +60,9 @@ func (e *SysSetting) GetSetting(c *gin.Context) {
|
||||
func (e *SysSetting) CreateOrUpdateSetting(c *gin.Context) {
|
||||
control := new(dto.SysSettingControl)
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@ type SysConfig struct {
|
||||
func (e *SysConfig) GetSysConfigList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysConfigSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("Orm获取失败, error:%s", err)
|
||||
app.Error(c, 500, err, "Orm获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -51,11 +50,9 @@ func (e *SysConfig) GetSysConfigList(c *gin.Context) {
|
||||
func (e *SysConfig) GetSysConfig(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysConfigById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
e.Error(c, http.StatusUnprocessableEntity, err, "Orm获取失败")
|
||||
log.Errorf("Orm获取失败, error:%s", err)
|
||||
app.Error(c, 500, err, "Orm获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
//查看详情
|
||||
@@ -85,11 +82,9 @@ func (e *SysConfig) GetSysConfig(c *gin.Context) {
|
||||
func (e *SysConfig) InsertSysConfig(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysConfigControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
e.Error(c, http.StatusUnprocessableEntity, err, "Orm获取失败")
|
||||
log.Errorf("Orm获取失败, error:%s", err)
|
||||
app.Error(c, 500, err, "Orm获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -129,11 +124,9 @@ func (e *SysConfig) InsertSysConfig(c *gin.Context) {
|
||||
func (e *SysConfig) UpdateSysConfig(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysConfigControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
e.Error(c, http.StatusUnprocessableEntity, err, "Orm获取失败")
|
||||
log.Errorf("Orm获取失败, error:%s", err)
|
||||
app.Error(c, 500, err, "Orm获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -171,11 +164,9 @@ func (e *SysConfig) UpdateSysConfig(c *gin.Context) {
|
||||
func (e *SysConfig) DeleteSysConfig(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysConfigById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
e.Error(c, http.StatusUnprocessableEntity, err, "Orm获取失败")
|
||||
log.Errorf("Orm获取失败, error:%s", err)
|
||||
app.Error(c, 500, err, "Orm获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -217,8 +208,7 @@ func (e *SysConfig) GetSysConfigByKEYForService(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("error:%s", err)
|
||||
app.Error(c, 500, err, "")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
var v dto.SysConfigControl
|
||||
|
||||
@@ -28,10 +28,9 @@ type SysDept struct {
|
||||
func (e *SysDept) GetSysDeptList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysDeptSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -66,10 +65,9 @@ func (e *SysDept) GetSysDeptList(c *gin.Context) {
|
||||
func (e *SysDept) GetSysDept(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysDeptById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -106,10 +104,9 @@ func (e *SysDept) GetSysDept(c *gin.Context) {
|
||||
func (e *SysDept) InsertSysDept(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysDeptControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -154,10 +151,9 @@ func (e *SysDept) InsertSysDept(c *gin.Context) {
|
||||
func (e *SysDept) UpdateSysDept(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysDeptControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -195,10 +191,9 @@ func (e *SysDept) UpdateSysDept(c *gin.Context) {
|
||||
func (e *SysDept) DeleteSysDept(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysDeptById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -226,10 +221,9 @@ func (e *SysDept) DeleteSysDept(c *gin.Context) {
|
||||
func (e *SysDept) GetDeptTree(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysDeptSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@ type SysLoginLog struct {
|
||||
func (e *SysLoginLog) GetSysLoginLogList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysLoginLogSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -50,10 +49,9 @@ func (e *SysLoginLog) GetSysLoginLogList(c *gin.Context) {
|
||||
func (e *SysLoginLog) GetSysLoginLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysLoginLogById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -80,10 +78,9 @@ func (e *SysLoginLog) GetSysLoginLog(c *gin.Context) {
|
||||
func (e *SysLoginLog) InsertSysLoginLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysLoginLogControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -117,10 +114,9 @@ func (e *SysLoginLog) InsertSysLoginLog(c *gin.Context) {
|
||||
func (e *SysLoginLog) UpdateSysLoginLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysLoginLogControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -152,10 +148,9 @@ func (e *SysLoginLog) UpdateSysLoginLog(c *gin.Context) {
|
||||
func (e *SysLoginLog) DeleteSysLoginLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysLoginLogById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,9 @@ type SysMenu struct {
|
||||
func (e *SysMenu) GetSysMenuList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysMenuSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -68,10 +67,9 @@ func (e *SysMenu) GetSysMenu(c *gin.Context) {
|
||||
|
||||
log := e.GetLogger(c)
|
||||
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -115,10 +113,9 @@ func (e *SysMenu) InsertSysMenu(c *gin.Context) {
|
||||
|
||||
log := e.GetLogger(c)
|
||||
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -165,10 +162,9 @@ func (e *SysMenu) UpdateSysMenu(c *gin.Context) {
|
||||
|
||||
log := e.GetLogger(c)
|
||||
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -208,10 +204,9 @@ func (e *SysMenu) DeleteSysMenu(c *gin.Context) {
|
||||
|
||||
log := e.GetLogger(c)
|
||||
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -245,10 +240,9 @@ func (e *SysMenu) DeleteSysMenu(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysMenu) GetMenuRole(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -275,10 +269,9 @@ func (e *SysMenu) GetMenuRole(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysMenu) GetMenuIDS(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
var data models.RoleMenu
|
||||
@@ -331,10 +324,9 @@ func (e *SysMenu) GetMenuIDS(c *gin.Context) {
|
||||
// @Security Bearer
|
||||
func (e *SysMenu) GetMenuTreeSelect(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@ type SysOperaLog struct {
|
||||
func (e *SysOperaLog) GetSysOperaLogList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysOperaLogSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -50,10 +49,9 @@ func (e *SysOperaLog) GetSysOperaLogList(c *gin.Context) {
|
||||
func (e *SysOperaLog) GetSysOperaLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysOperaLogById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -80,10 +78,9 @@ func (e *SysOperaLog) GetSysOperaLog(c *gin.Context) {
|
||||
func (e *SysOperaLog) InsertSysOperaLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysOperaLogControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -117,10 +114,9 @@ func (e *SysOperaLog) InsertSysOperaLog(c *gin.Context) {
|
||||
func (e *SysOperaLog) UpdateSysOperaLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysOperaLogControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -151,10 +147,9 @@ func (e *SysOperaLog) UpdateSysOperaLog(c *gin.Context) {
|
||||
func (e *SysOperaLog) DeleteSysOperaLog(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysOperaLogById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -29,10 +29,9 @@ type SysPost struct {
|
||||
func (e *SysPost) GetSysPostList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysPostSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -67,10 +66,9 @@ func (e *SysPost) GetSysPostList(c *gin.Context) {
|
||||
func (e *SysPost) GetSysPost(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysPostById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -107,10 +105,9 @@ func (e *SysPost) GetSysPost(c *gin.Context) {
|
||||
func (e *SysPost) InsertSysPost(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysPostControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -154,10 +151,9 @@ func (e *SysPost) InsertSysPost(c *gin.Context) {
|
||||
func (e *SysPost) UpdateSysPost(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysPostControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -195,10 +191,9 @@ func (e *SysPost) UpdateSysPost(c *gin.Context) {
|
||||
func (e *SysPost) DeleteSysPost(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysPostById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,9 @@ type SysRole struct {
|
||||
func (e *SysRole) GetSysRoleList(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
d := new(dto.SysRoleSearch)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -70,10 +69,9 @@ func (e *SysRole) GetSysRoleList(c *gin.Context) {
|
||||
func (e *SysRole) GetSysRole(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysRoleById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -110,10 +108,9 @@ func (e *SysRole) GetSysRole(c *gin.Context) {
|
||||
func (e *SysRole) InsertSysRole(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysRoleControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -164,10 +161,9 @@ func (e *SysRole) InsertSysRole(c *gin.Context) {
|
||||
func (e *SysRole) UpdateSysRole(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysRoleControl)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -211,10 +207,9 @@ func (e *SysRole) UpdateSysRole(c *gin.Context) {
|
||||
func (e *SysRole) DeleteSysRole(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.SysRoleById)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -246,10 +241,9 @@ func (e *SysRole) DeleteSysRole(c *gin.Context) {
|
||||
func (e *SysRole) UpdateRoleDataScope(c *gin.Context) {
|
||||
log := e.GetLogger(c)
|
||||
control := new(dto.RoleDataScopeReq)
|
||||
db, err := tools.GetOrm(c)
|
||||
db, err := e.GetOrm(c)
|
||||
if err != nil {
|
||||
log.Errorf("get db connection error, %s", err.Error())
|
||||
e.Error(c, http.StatusInternalServerError, err, "数据库连接获取失败")
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user