mirror of
https://github.com/flipped-aurora/gin-vue-admin.git
synced 2026-10-03 00:41:10 +00:00
@@ -29,7 +29,7 @@ func CreateExaCustomer(c *gin.Context) {
|
||||
}
|
||||
customer.SysUserID = getUserID(c)
|
||||
customer.SysUserAuthorityID = getUserAuthorityId(c)
|
||||
if err := service.CreateExaCustomer(&customer); err != nil {
|
||||
if err := service.CreateExaCustomer(customer); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("创建失败", c)
|
||||
} else {
|
||||
@@ -52,7 +52,7 @@ func DeleteExaCustomer(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.DeleteExaCustomer(&customer); err != nil {
|
||||
if err := service.DeleteExaCustomer(customer); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
} else {
|
||||
|
||||
@@ -46,7 +46,7 @@ func UploadFile(c *gin.Context) {
|
||||
func DeleteFile(c *gin.Context) {
|
||||
var file model.ExaFileUploadAndDownload
|
||||
_ = c.ShouldBindJSON(&file)
|
||||
if err := service.DeleteFile(&file); err != nil {
|
||||
if err := service.DeleteFile(file); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
return
|
||||
@@ -65,7 +65,7 @@ func DeleteFile(c *gin.Context) {
|
||||
func GetFileList(c *gin.Context) {
|
||||
var pageInfo request.PageInfo
|
||||
_ = c.ShouldBindJSON(&pageInfo)
|
||||
err, list, total := service.GetFileRecordInfoList(&pageInfo)
|
||||
err, list, total := service.GetFileRecordInfoList(pageInfo)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("获取失败", c)
|
||||
@@ -75,6 +75,6 @@ func GetFileList(c *gin.Context) {
|
||||
Total: total,
|
||||
Page: pageInfo.Page,
|
||||
PageSize: pageInfo.PageSize,
|
||||
}, "获取成功", c)
|
||||
},"获取成功", c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ func SimpleUploaderUpload(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
chunk.CurrentChunkPath = chunkPath
|
||||
err = service.SaveChunk(&chunk)
|
||||
err = service.SaveChunk(chunk)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("切片创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("切片创建失败", c)
|
||||
@@ -69,7 +69,7 @@ func CheckFileMd5(c *gin.Context) {
|
||||
response.OkWithDetailed(gin.H{
|
||||
"chunks": chunks,
|
||||
"isDone": isDone,
|
||||
}, "查询成功", c)
|
||||
},"查询成功", c)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ func CreateApi(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.CreateApi(&api); err != nil {
|
||||
if err := service.CreateApi(api); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("创建失败", c)
|
||||
} else {
|
||||
@@ -49,7 +49,7 @@ func DeleteApi(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.DeleteApi(&api); err != nil {
|
||||
if err := service.DeleteApi(api); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
} else {
|
||||
@@ -72,7 +72,7 @@ func GetApiList(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, list, total := service.GetAPIInfoList(&pageInfo.SysApi, &pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc); err != nil {
|
||||
if err, list, total := service.GetAPIInfoList(pageInfo.SysApi, pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc); err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("获取失败", c)
|
||||
} else {
|
||||
@@ -124,7 +124,7 @@ func UpdateApi(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.UpdateApi(&api); err != nil {
|
||||
if err := service.UpdateApi(api); err != nil {
|
||||
global.GVA_LOG.Error("修改失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("修改失败", c)
|
||||
} else {
|
||||
|
||||
@@ -26,11 +26,11 @@ func CreateAuthority(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, authBack := service.CreateAuthority(&authority); err != nil {
|
||||
if err, authBack := service.CreateAuthority(authority); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("创建失败"+err.Error(), c)
|
||||
} else {
|
||||
response.OkWithDetailed(response.SysAuthorityResponse{Authority: *authBack}, "创建成功", c)
|
||||
response.OkWithDetailed(response.SysAuthorityResponse{Authority: authBack}, "创建成功", c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ func CopyAuthority(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, authBack := service.CopyAuthority(©Info); err != nil {
|
||||
if err, authBack := service.CopyAuthority(copyInfo); err != nil {
|
||||
global.GVA_LOG.Error("拷贝失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("拷贝失败"+err.Error(), c)
|
||||
} else {
|
||||
@@ -99,11 +99,11 @@ func UpdateAuthority(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, authority := service.UpdateAuthority(&auth); err != nil {
|
||||
if err, authority := service.UpdateAuthority(auth); err != nil {
|
||||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("更新失败"+err.Error(), c)
|
||||
} else {
|
||||
response.OkWithDetailed(response.SysAuthorityResponse{Authority: *authority}, "更新成功", c)
|
||||
response.OkWithDetailed(response.SysAuthorityResponse{Authority: authority}, "更新成功", c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ func GetAuthorityList(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, list, total := service.GetAuthorityInfoList(&pageInfo); err != nil {
|
||||
if err, list, total := service.GetAuthorityInfoList(pageInfo); err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("获取失败"+err.Error(), c)
|
||||
} else {
|
||||
@@ -150,7 +150,7 @@ func SetDataAuthority(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.SetDataAuthority(&auth); err != nil {
|
||||
if err := service.SetDataAuthority(auth); err != nil {
|
||||
global.GVA_LOG.Error("设置失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("设置失败"+err.Error(), c)
|
||||
} else {
|
||||
|
||||
@@ -37,7 +37,7 @@ func CreateTemp(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
err := service.CreateTemp(&a)
|
||||
err := service.CreateTemp(a)
|
||||
if err != nil {
|
||||
if errors.Is(err, model.AutoMoveErr) {
|
||||
c.Writer.Header().Add("success", "false")
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
func CreateSysDictionary(c *gin.Context) {
|
||||
var dictionary model.SysDictionary
|
||||
_ = c.ShouldBindJSON(&dictionary)
|
||||
if err := service.CreateSysDictionary(&dictionary); err != nil {
|
||||
if err := service.CreateSysDictionary(dictionary); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("创建失败", c)
|
||||
} else {
|
||||
@@ -41,7 +41,7 @@ func CreateSysDictionary(c *gin.Context) {
|
||||
func DeleteSysDictionary(c *gin.Context) {
|
||||
var dictionary model.SysDictionary
|
||||
_ = c.ShouldBindJSON(&dictionary)
|
||||
if err := service.DeleteSysDictionary(&dictionary); err != nil {
|
||||
if err := service.DeleteSysDictionary(dictionary); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
} else {
|
||||
@@ -102,7 +102,7 @@ func GetSysDictionaryList(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, list, total := service.GetSysDictionaryInfoList(&pageInfo); err != nil {
|
||||
if err, list, total := service.GetSysDictionaryInfoList(pageInfo); err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("获取失败", c)
|
||||
} else {
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
func CreateSysDictionaryDetail(c *gin.Context) {
|
||||
var detail model.SysDictionaryDetail
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := service.CreateSysDictionaryDetail(&detail); err != nil {
|
||||
if err := service.CreateSysDictionaryDetail(detail); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("创建失败", c)
|
||||
} else {
|
||||
@@ -41,7 +41,7 @@ func CreateSysDictionaryDetail(c *gin.Context) {
|
||||
func DeleteSysDictionaryDetail(c *gin.Context) {
|
||||
var detail model.SysDictionaryDetail
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := service.DeleteSysDictionaryDetail(&detail); err != nil {
|
||||
if err := service.DeleteSysDictionaryDetail(detail); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
} else {
|
||||
@@ -102,7 +102,7 @@ func FindSysDictionaryDetail(c *gin.Context) {
|
||||
func GetSysDictionaryDetailList(c *gin.Context) {
|
||||
var pageInfo request.SysDictionaryDetailSearch
|
||||
_ = c.ShouldBindQuery(&pageInfo)
|
||||
if err, list, total := service.GetSysDictionaryDetailInfoList(&pageInfo); err != nil {
|
||||
if err, list, total := service.GetSysDictionaryDetailInfoList(pageInfo); err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("获取失败", c)
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
func JsonInBlacklist(c *gin.Context) {
|
||||
token := c.Request.Header.Get("x-token")
|
||||
jwt := model.JwtBlacklist{Jwt: token}
|
||||
if err := service.JsonInBlacklist(&jwt); err != nil {
|
||||
if err := service.JsonInBlacklist(jwt); err != nil {
|
||||
global.GVA_LOG.Error("jwt作废失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("jwt作废失败", c)
|
||||
} else {
|
||||
|
||||
@@ -108,7 +108,7 @@ func AddBaseMenu(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.AddBaseMenu(&menu); err != nil {
|
||||
if err := service.AddBaseMenu(menu); err != nil {
|
||||
global.GVA_LOG.Error("添加失败!", zap.Any("err", err))
|
||||
|
||||
response.FailWithMessage("添加失败", c)
|
||||
@@ -159,7 +159,7 @@ func UpdateBaseMenu(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.UpdateBaseMenu(&menu); err != nil {
|
||||
if err := service.UpdateBaseMenu(menu); err != nil {
|
||||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("更新失败", c)
|
||||
} else {
|
||||
@@ -214,6 +214,6 @@ func GetMenuList(c *gin.Context) {
|
||||
Total: total,
|
||||
Page: pageInfo.Page,
|
||||
PageSize: pageInfo.PageSize,
|
||||
}, "获取成功", c)
|
||||
},"获取成功", c)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
func CreateSysOperationRecord(c *gin.Context) {
|
||||
var sysOperationRecord model.SysOperationRecord
|
||||
_ = c.ShouldBindJSON(&sysOperationRecord)
|
||||
if err := service.CreateSysOperationRecord(&sysOperationRecord); err != nil {
|
||||
if err := service.CreateSysOperationRecord(sysOperationRecord); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("创建失败", c)
|
||||
} else {
|
||||
@@ -41,7 +41,7 @@ func CreateSysOperationRecord(c *gin.Context) {
|
||||
func DeleteSysOperationRecord(c *gin.Context) {
|
||||
var sysOperationRecord model.SysOperationRecord
|
||||
_ = c.ShouldBindJSON(&sysOperationRecord)
|
||||
if err := service.DeleteSysOperationRecord(&sysOperationRecord); err != nil {
|
||||
if err := service.DeleteSysOperationRecord(sysOperationRecord); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("删除失败", c)
|
||||
} else {
|
||||
@@ -60,7 +60,7 @@ func DeleteSysOperationRecord(c *gin.Context) {
|
||||
func DeleteSysOperationRecordByIds(c *gin.Context) {
|
||||
var IDS request.IdsReq
|
||||
_ = c.ShouldBindJSON(&IDS)
|
||||
if err := service.DeleteSysOperationRecordByIds(&IDS); err != nil {
|
||||
if err := service.DeleteSysOperationRecordByIds(IDS); err != nil {
|
||||
global.GVA_LOG.Error("批量删除失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("批量删除失败", c)
|
||||
} else {
|
||||
@@ -102,7 +102,7 @@ func FindSysOperationRecord(c *gin.Context) {
|
||||
func GetSysOperationRecordList(c *gin.Context) {
|
||||
var pageInfo request.SysOperationRecordSearch
|
||||
_ = c.ShouldBindQuery(&pageInfo)
|
||||
if err, list, total := service.GetSysOperationRecordInfoList(&pageInfo); err != nil {
|
||||
if err, list, total := service.GetSysOperationRecordInfoList(pageInfo); err != nil {
|
||||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("获取失败", c)
|
||||
} else {
|
||||
|
||||
@@ -34,7 +34,7 @@ func GetSystemConfig(c *gin.Context) {
|
||||
func SetSystemConfig(c *gin.Context) {
|
||||
var sys model.System
|
||||
_ = c.ShouldBindJSON(&sys)
|
||||
if err := service.SetSystemConfig(&sys); err != nil {
|
||||
if err := service.SetSystemConfig(sys); err != nil {
|
||||
global.GVA_LOG.Error("设置失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("设置失败", c)
|
||||
} else {
|
||||
@@ -53,7 +53,7 @@ func SetSystemConfig(c *gin.Context) {
|
||||
func ReloadSystem(c *gin.Context) {
|
||||
var sys model.System
|
||||
_ = c.ShouldBindJSON(&sys)
|
||||
if err := service.SetSystemConfig(&sys); err != nil {
|
||||
if err := service.SetSystemConfig(sys); err != nil {
|
||||
global.GVA_LOG.Error("重启系统失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("重启系统失败", c)
|
||||
} else {
|
||||
|
||||
@@ -88,7 +88,7 @@ func tokenNext(c *gin.Context, user model.SysUser) {
|
||||
} else {
|
||||
var blackJWT model.JwtBlacklist
|
||||
blackJWT.Jwt = jwtStr
|
||||
if err := service.JsonInBlacklist(&blackJWT); err != nil {
|
||||
if err := service.JsonInBlacklist(blackJWT); err != nil {
|
||||
response.FailWithMessage("jwt作废失败", c)
|
||||
return
|
||||
}
|
||||
@@ -118,12 +118,12 @@ func Register(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
user := &model.SysUser{Username: R.Username, NickName: R.NickName, Password: R.Password, HeaderImg: R.HeaderImg, AuthorityId: R.AuthorityId}
|
||||
err, userReturn := service.Register(user)
|
||||
err, userReturn := service.Register(*user)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("注册失败", zap.Any("err", err))
|
||||
response.FailWithDetailed(response.SysUserResponse{User: *userReturn}, "注册失败", c)
|
||||
response.FailWithDetailed(response.SysUserResponse{User: userReturn}, "注册失败", c)
|
||||
} else {
|
||||
response.OkWithDetailed(response.SysUserResponse{User: *userReturn}, "注册成功", c)
|
||||
response.OkWithDetailed(response.SysUserResponse{User: userReturn}, "注册成功", c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ func GetUserList(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, list, total := service.GetUserInfoList(&pageInfo); err != nil {
|
||||
if err, list, total := service.GetUserInfoList(pageInfo); err != nil {
|
||||
global.GVA_LOG.Error("获取失败", zap.Any("err", err))
|
||||
response.FailWithMessage("获取失败", c)
|
||||
} else {
|
||||
@@ -244,7 +244,7 @@ func SetUserInfo(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err, ReqUser := service.SetUserInfo(&user); err != nil {
|
||||
if err, ReqUser := service.SetUserInfo(user); err != nil {
|
||||
global.GVA_LOG.Error("设置失败", zap.Any("err", err))
|
||||
response.FailWithMessage("设置失败", c)
|
||||
} else {
|
||||
|
||||
@@ -23,7 +23,7 @@ func CreateWorkFlow(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
if err := service.Create(&wk); err != nil {
|
||||
if err := service.Create(wk); err != nil {
|
||||
global.GVA_LOG.Error("注册失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("注册失败", c)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user