模块化变更
This commit is contained in:
@@ -2,7 +2,7 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/example/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/example"
|
||||
"gin-vue-admin/model/example/request"
|
||||
"gin-vue-admin/model/example/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /customer/customer [post]
|
||||
func CreateExaCustomer(c *gin.Context) {
|
||||
var customer model.ExaCustomer
|
||||
var customer example.ExaCustomer
|
||||
_ = c.ShouldBindJSON(&customer)
|
||||
if err := utils.Verify(customer, utils.CustomerVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -45,7 +45,7 @@ func CreateExaCustomer(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /customer/customer [delete]
|
||||
func DeleteExaCustomer(c *gin.Context) {
|
||||
var customer model.ExaCustomer
|
||||
var customer example.ExaCustomer
|
||||
_ = c.ShouldBindJSON(&customer)
|
||||
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -68,7 +68,7 @@ func DeleteExaCustomer(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
// @Router /customer/customer [put]
|
||||
func UpdateExaCustomer(c *gin.Context) {
|
||||
var customer model.ExaCustomer
|
||||
var customer example.ExaCustomer
|
||||
_ = c.ShouldBindJSON(&customer)
|
||||
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -95,7 +95,7 @@ func UpdateExaCustomer(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
// @Router /customer/customer [get]
|
||||
func GetExaCustomer(c *gin.Context) {
|
||||
var customer model.ExaCustomer
|
||||
var customer example.ExaCustomer
|
||||
_ = c.ShouldBindQuery(&customer)
|
||||
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
|
@@ -2,7 +2,7 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/example"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
// @Success 200
|
||||
// @Router /excel/exportExcel [post]
|
||||
func ExportExcel(c *gin.Context) {
|
||||
var excelInfo model.ExcelInfo
|
||||
var excelInfo example.ExcelInfo
|
||||
_ = c.ShouldBindJSON(&excelInfo)
|
||||
filePath := global.GVA_CONFIG.Excel.Dir + excelInfo.FileName
|
||||
err := service.ParseInfoList2Excel(excelInfo.InfoList, filePath)
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/example"
|
||||
"gin-vue-admin/model/example/request"
|
||||
"gin-vue-admin/model/example/response"
|
||||
"gin-vue-admin/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.uber.org/zap"
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}"
|
||||
// @Router /fileUploadAndDownload/upload [post]
|
||||
func UploadFile(c *gin.Context) {
|
||||
var file model.ExaFileUploadAndDownload
|
||||
var file example.ExaFileUploadAndDownload
|
||||
noSave := c.DefaultQuery("noSave", "0")
|
||||
_, header, err := c.Request.FormFile("file")
|
||||
if err != nil {
|
||||
@@ -44,7 +44,7 @@ func UploadFile(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /fileUploadAndDownload/deleteFile [post]
|
||||
func DeleteFile(c *gin.Context) {
|
||||
var file model.ExaFileUploadAndDownload
|
||||
var file example.ExaFileUploadAndDownload
|
||||
_ = c.ShouldBindJSON(&file)
|
||||
if err := service.DeleteFile(file); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
|
@@ -2,7 +2,7 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/example"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
@@ -19,7 +19,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"切片创建成功"}"
|
||||
// @Router /simpleUploader/upload [post]
|
||||
func SimpleUploaderUpload(c *gin.Context) {
|
||||
var chunk model.ExaSimpleUploader
|
||||
var chunk example.ExaSimpleUploader
|
||||
_, header, err := c.Request.FormFile("file")
|
||||
chunk.Filename = c.PostForm("filename")
|
||||
chunk.ChunkNumber = c.PostForm("chunkNumber")
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /api/createApi [post]
|
||||
func CreateApi(c *gin.Context) {
|
||||
var api model.SysApi
|
||||
var api system.SysApi
|
||||
_ = c.ShouldBindJSON(&api)
|
||||
if err := utils.Verify(api, utils.ApiVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -44,7 +44,7 @@ func CreateApi(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /api/deleteApi [post]
|
||||
func DeleteApi(c *gin.Context) {
|
||||
var api model.SysApi
|
||||
var api system.SysApi
|
||||
_ = c.ShouldBindJSON(&api)
|
||||
if err := utils.Verify(api.GVA_MODEL, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -119,7 +119,7 @@ func GetApiById(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
|
||||
// @Router /api/updateApi [post]
|
||||
func UpdateApi(c *gin.Context) {
|
||||
var api model.SysApi
|
||||
var api system.SysApi
|
||||
_ = c.ShouldBindJSON(&api)
|
||||
if err := utils.Verify(api, utils.ApiVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /authority/createAuthority [post]
|
||||
func CreateAuthority(c *gin.Context) {
|
||||
var authority model.SysAuthority
|
||||
var authority system.SysAuthority
|
||||
_ = c.ShouldBindJSON(&authority)
|
||||
if err := utils.Verify(authority, utils.AuthorityVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -72,7 +72,7 @@ func CopyAuthority(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /authority/deleteAuthority [post]
|
||||
func DeleteAuthority(c *gin.Context) {
|
||||
var authority model.SysAuthority
|
||||
var authority system.SysAuthority
|
||||
_ = c.ShouldBindJSON(&authority)
|
||||
if err := utils.Verify(authority, utils.AuthorityIdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -95,7 +95,7 @@ func DeleteAuthority(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
// @Router /authority/updateAuthority [post]
|
||||
func UpdateAuthority(c *gin.Context) {
|
||||
var auth model.SysAuthority
|
||||
var auth system.SysAuthority
|
||||
_ = c.ShouldBindJSON(&auth)
|
||||
if err := utils.Verify(auth, utils.AuthorityVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -146,7 +146,7 @@ func GetAuthorityList(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
|
||||
// @Router /authority/setDataAuthority [post]
|
||||
func SetDataAuthority(c *gin.Context) {
|
||||
var auth model.SysAuthority
|
||||
var auth system.SysAuthority
|
||||
_ = c.ShouldBindJSON(&auth)
|
||||
if err := utils.Verify(auth, utils.AuthorityIdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
|
@@ -4,9 +4,9 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"net/url"
|
||||
@@ -108,7 +108,7 @@ func GetMeta(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /autoCode/preview [post]
|
||||
func PreviewTemp(c *gin.Context) {
|
||||
var a model.AutoCodeStruct
|
||||
var a system.AutoCodeStruct
|
||||
_ = c.ShouldBindJSON(&a)
|
||||
if err := utils.Verify(a, utils.AutoCodeVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -132,7 +132,7 @@ func PreviewTemp(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /autoCode/createTemp [post]
|
||||
func CreateTemp(c *gin.Context) {
|
||||
var a model.AutoCodeStruct
|
||||
var a system.AutoCodeStruct
|
||||
_ = c.ShouldBindJSON(&a)
|
||||
if err := utils.Verify(a, utils.AutoCodeVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -151,7 +151,7 @@ func CreateTemp(c *gin.Context) {
|
||||
}
|
||||
err := service.CreateTemp(a, apiIds...)
|
||||
if err != nil {
|
||||
if errors.Is(err, model.AutoMoveErr) {
|
||||
if errors.Is(err, system.AutoMoveErr) {
|
||||
c.Writer.Header().Add("success", "false")
|
||||
c.Writer.Header().Add("msgtype", "success")
|
||||
c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
|
||||
|
@@ -2,7 +2,7 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/mojocn/base64Captcha"
|
||||
"go.uber.org/zap"
|
||||
|
@@ -2,8 +2,8 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /sysDictionary/createSysDictionary [post]
|
||||
func CreateSysDictionary(c *gin.Context) {
|
||||
var dictionary model.SysDictionary
|
||||
var dictionary system.SysDictionary
|
||||
_ = c.ShouldBindJSON(&dictionary)
|
||||
if err := service.CreateSysDictionary(dictionary); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
@@ -39,7 +39,7 @@ func CreateSysDictionary(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /sysDictionary/deleteSysDictionary [delete]
|
||||
func DeleteSysDictionary(c *gin.Context) {
|
||||
var dictionary model.SysDictionary
|
||||
var dictionary system.SysDictionary
|
||||
_ = c.ShouldBindJSON(&dictionary)
|
||||
if err := service.DeleteSysDictionary(dictionary); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
@@ -58,7 +58,7 @@ func DeleteSysDictionary(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
// @Router /sysDictionary/updateSysDictionary [put]
|
||||
func UpdateSysDictionary(c *gin.Context) {
|
||||
var dictionary model.SysDictionary
|
||||
var dictionary system.SysDictionary
|
||||
_ = c.ShouldBindJSON(&dictionary)
|
||||
if err := service.UpdateSysDictionary(&dictionary); err != nil {
|
||||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
|
||||
@@ -77,7 +77,7 @@ func UpdateSysDictionary(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
|
||||
// @Router /sysDictionary/findSysDictionary [get]
|
||||
func FindSysDictionary(c *gin.Context) {
|
||||
var dictionary model.SysDictionary
|
||||
var dictionary system.SysDictionary
|
||||
_ = c.ShouldBindQuery(&dictionary)
|
||||
if err, sysDictionary := service.GetSysDictionary(dictionary.Type, dictionary.ID); err != nil {
|
||||
global.GVA_LOG.Error("查询失败!", zap.Any("err", err))
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
||||
// @Router /sysDictionaryDetail/createSysDictionaryDetail [post]
|
||||
func CreateSysDictionaryDetail(c *gin.Context) {
|
||||
var detail model.SysDictionaryDetail
|
||||
var detail system.SysDictionaryDetail
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := service.CreateSysDictionaryDetail(detail); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
@@ -39,7 +39,7 @@ func CreateSysDictionaryDetail(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /sysDictionaryDetail/deleteSysDictionaryDetail [delete]
|
||||
func DeleteSysDictionaryDetail(c *gin.Context) {
|
||||
var detail model.SysDictionaryDetail
|
||||
var detail system.SysDictionaryDetail
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := service.DeleteSysDictionaryDetail(detail); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
@@ -58,7 +58,7 @@ func DeleteSysDictionaryDetail(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
// @Router /sysDictionaryDetail/updateSysDictionaryDetail [put]
|
||||
func UpdateSysDictionaryDetail(c *gin.Context) {
|
||||
var detail model.SysDictionaryDetail
|
||||
var detail system.SysDictionaryDetail
|
||||
_ = c.ShouldBindJSON(&detail)
|
||||
if err := service.UpdateSysDictionaryDetail(&detail); err != nil {
|
||||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
|
||||
@@ -77,7 +77,7 @@ func UpdateSysDictionaryDetail(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
|
||||
// @Router /sysDictionaryDetail/findSysDictionaryDetail [get]
|
||||
func FindSysDictionaryDetail(c *gin.Context) {
|
||||
var detail model.SysDictionaryDetail
|
||||
var detail system.SysDictionaryDetail
|
||||
_ = c.ShouldBindQuery(&detail)
|
||||
if err := utils.Verify(detail, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
|
@@ -2,8 +2,8 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
@@ -2,8 +2,8 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.uber.org/zap"
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
// @Router /jwt/jsonInBlacklist [post]
|
||||
func JsonInBlacklist(c *gin.Context) {
|
||||
token := c.Request.Header.Get("x-token")
|
||||
jwt := model.JwtBlacklist{Jwt: token}
|
||||
jwt := system.JwtBlacklist{Jwt: token}
|
||||
if err := service.JsonInBlacklist(jwt); err != nil {
|
||||
global.GVA_LOG.Error("jwt作废失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("jwt作废失败", c)
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
|
||||
@@ -25,7 +25,7 @@ func GetMenu(c *gin.Context) {
|
||||
response.FailWithMessage("获取失败", c)
|
||||
} else {
|
||||
if menus == nil {
|
||||
menus = []model.SysMenu{}
|
||||
menus = []system.SysMenu{}
|
||||
}
|
||||
response.OkWithDetailed(response.SysMenusResponse{Menus: menus}, "获取成功", c)
|
||||
}
|
||||
@@ -102,7 +102,7 @@ func GetMenuAuthority(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"添加成功"}"
|
||||
// @Router /menu/addBaseMenu [post]
|
||||
func AddBaseMenu(c *gin.Context) {
|
||||
var menu model.SysBaseMenu
|
||||
var menu system.SysBaseMenu
|
||||
_ = c.ShouldBindJSON(&menu)
|
||||
if err := utils.Verify(menu, utils.MenuVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
@@ -153,7 +153,7 @@ func DeleteBaseMenu(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
|
||||
// @Router /menu/updateBaseMenu [post]
|
||||
func UpdateBaseMenu(c *gin.Context) {
|
||||
var menu model.SysBaseMenu
|
||||
var menu system.SysBaseMenu
|
||||
_ = c.ShouldBindJSON(&menu)
|
||||
if err := utils.Verify(menu, utils.MenuVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
|
@@ -2,9 +2,9 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
||||
// @Router /sysOperationRecord/createSysOperationRecord [post]
|
||||
func CreateSysOperationRecord(c *gin.Context) {
|
||||
var sysOperationRecord model.SysOperationRecord
|
||||
var sysOperationRecord system.SysOperationRecord
|
||||
_ = c.ShouldBindJSON(&sysOperationRecord)
|
||||
if err := service.CreateSysOperationRecord(sysOperationRecord); err != nil {
|
||||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
|
||||
@@ -39,7 +39,7 @@ func CreateSysOperationRecord(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
||||
// @Router /sysOperationRecord/deleteSysOperationRecord [delete]
|
||||
func DeleteSysOperationRecord(c *gin.Context) {
|
||||
var sysOperationRecord model.SysOperationRecord
|
||||
var sysOperationRecord system.SysOperationRecord
|
||||
_ = c.ShouldBindJSON(&sysOperationRecord)
|
||||
if err := service.DeleteSysOperationRecord(sysOperationRecord); err != nil {
|
||||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
|
||||
@@ -77,7 +77,7 @@ func DeleteSysOperationRecordByIds(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
|
||||
// @Router /sysOperationRecord/findSysOperationRecord [get]
|
||||
func FindSysOperationRecord(c *gin.Context) {
|
||||
var sysOperationRecord model.SysOperationRecord
|
||||
var sysOperationRecord system.SysOperationRecord
|
||||
_ = c.ShouldBindQuery(&sysOperationRecord)
|
||||
if err := utils.Verify(sysOperationRecord, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
|
@@ -2,8 +2,8 @@ package v1
|
||||
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
|
||||
@@ -34,7 +34,7 @@ func GetSystemConfig(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
|
||||
// @Router /system/setSystemConfig [post]
|
||||
func SetSystemConfig(c *gin.Context) {
|
||||
var sys model.System
|
||||
var sys system.System
|
||||
_ = c.ShouldBindJSON(&sys)
|
||||
if err := service.SetSystemConfig(sys); err != nil {
|
||||
global.GVA_LOG.Error("设置失败!", zap.Any("err", err))
|
||||
|
@@ -3,9 +3,9 @@ package v1
|
||||
import (
|
||||
"gin-vue-admin/global"
|
||||
"gin-vue-admin/middleware"
|
||||
"gin-vue-admin/model"
|
||||
"gin-vue-admin/model/request"
|
||||
"gin-vue-admin/model/response"
|
||||
"gin-vue-admin/model/system"
|
||||
"gin-vue-admin/model/system/request"
|
||||
"gin-vue-admin/model/system/response"
|
||||
"gin-vue-admin/service"
|
||||
"gin-vue-admin/utils"
|
||||
"time"
|
||||
@@ -30,7 +30,7 @@ func Login(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
if store.Verify(l.CaptchaId, l.Captcha, true) {
|
||||
u := &model.SysUser{Username: l.Username, Password: l.Password}
|
||||
u := &system.SysUser{Username: l.Username, Password: l.Password}
|
||||
if err, user := service.Login(u); err != nil {
|
||||
global.GVA_LOG.Error("登陆失败! 用户名不存在或者密码错误!", zap.Any("err", err))
|
||||
response.FailWithMessage("用户名不存在或者密码错误", c)
|
||||
@@ -43,7 +43,7 @@ func Login(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 登录以后签发jwt
|
||||
func tokenNext(c *gin.Context, user model.SysUser) {
|
||||
func tokenNext(c *gin.Context, user system.SysUser) {
|
||||
j := &middleware.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
|
||||
claims := request.CustomClaims{
|
||||
UUID: user.UUID,
|
||||
@@ -87,7 +87,7 @@ func tokenNext(c *gin.Context, user model.SysUser) {
|
||||
global.GVA_LOG.Error("设置登录状态失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("设置登录状态失败", c)
|
||||
} else {
|
||||
var blackJWT model.JwtBlacklist
|
||||
var blackJWT system.JwtBlacklist
|
||||
blackJWT.Jwt = jwtStr
|
||||
if err := service.JsonInBlacklist(blackJWT); err != nil {
|
||||
response.FailWithMessage("jwt作废失败", c)
|
||||
@@ -118,7 +118,7 @@ func Register(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
user := &model.SysUser{Username: r.Username, NickName: r.NickName, Password: r.Password, HeaderImg: r.HeaderImg, AuthorityId: r.AuthorityId}
|
||||
user := &system.SysUser{Username: r.Username, NickName: r.NickName, Password: r.Password, HeaderImg: r.HeaderImg, AuthorityId: r.AuthorityId}
|
||||
err, userReturn := service.Register(*user)
|
||||
if err != nil {
|
||||
global.GVA_LOG.Error("注册失败!", zap.Any("err", err))
|
||||
@@ -142,7 +142,7 @@ func ChangePassword(c *gin.Context) {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
return
|
||||
}
|
||||
u := &model.SysUser{Username: user.Username, Password: user.Password}
|
||||
u := &system.SysUser{Username: user.Username, Password: user.Password}
|
||||
if err, _ := service.ChangePassword(u, user.NewPassword); err != nil {
|
||||
global.GVA_LOG.Error("修改失败!", zap.Any("err", err))
|
||||
response.FailWithMessage("修改失败,原密码与当前账户不符", c)
|
||||
@@ -239,7 +239,7 @@ func DeleteUser(c *gin.Context) {
|
||||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
|
||||
// @Router /user/setUserInfo [put]
|
||||
func SetUserInfo(c *gin.Context) {
|
||||
var user model.SysUser
|
||||
var user system.SysUser
|
||||
_ = c.ShouldBindJSON(&user)
|
||||
if err := utils.Verify(user, utils.IdVerify); err != nil {
|
||||
response.FailWithMessage(err.Error(), c)
|
||||
|
Reference in New Issue
Block a user