Skip to content

Commit

Permalink
Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aur…
Browse files Browse the repository at this point in the history
…ora/gin-vue-admin into gin-vue-admin_v2_dev
  • Loading branch information
granty1 committed Apr 17, 2020
2 parents b2cf789 + 8e8bdc5 commit 75533a8
Show file tree
Hide file tree
Showing 42 changed files with 1,790 additions and 934 deletions.
2 changes: 1 addition & 1 deletion server/api/v1/exa_customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func GetExaCustomer(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.PageInfo true "获取权限客户列表"
// @Param data body request.PageInfo true "获取权限客户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/customerList [get]
func GetExaCustomerList(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion server/api/v1/exa_file_upload_download.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func DeleteFile(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.PageInfo true "分页获取文件户列表"
// @Param data body request.PageInfo true "分页获取文件户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /fileUploadAndDownload/getFileList [post]
func GetFileList(c *gin.Context) {
Expand Down
4 changes: 2 additions & 2 deletions server/api/v1/sys_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func DeleteApi(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SearchApiParams true "分页获取API列表"
// @Param data body request.SearchApiParams true "分页获取API列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getApiList [post]
func GetApiList(c *gin.Context) {
Expand All @@ -80,7 +80,7 @@ func GetApiList(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.GetById true "根据id获取api"
// @Param data body request.GetById true "根据id获取api"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getApiById [post]
func GetApiById(c *gin.Context) {
Expand Down
21 changes: 20 additions & 1 deletion server/api/v1/sys_authority.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,31 @@ func DeleteAuthority(c *gin.Context) {
}
}

// @Tags authority
// @Summary 设置角色资源权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysAuthority true "设置角色资源权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
// @Router /authority/updateAuthority [post]
func UpdateAuthority(c *gin.Context) {
var auth model.SysAuthority
_ = c.ShouldBindJSON(&auth)
err, authority := service.UpdateAuthority(auth)
if err != nil {
response.FailWithMessage(fmt.Sprintf("更新失败,%v", err), c)
} else {
response.OkWithData(resp.SysAuthorityResponse{authority}, c)
}
}

// @Tags authority
// @Summary 分页获取角色列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.PageInfo true "分页获取用户列表"
// @Param data body request.PageInfo true "分页获取用户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /authority/getAuthorityList [post]
func GetAuthorityList(c *gin.Context) {
Expand Down
6 changes: 3 additions & 3 deletions server/api/v1/sys_casbin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.CasbinInReceive true "更改角色api权限"
// @Param data body request.CasbinInReceive true "更改角色api权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/UpdateCasbin [post]
func UpdateCasbin(c *gin.Context) {
Expand All @@ -33,7 +33,7 @@ func UpdateCasbin(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.CasbinInReceive true "获取权限列表"
// @Param data body request.CasbinInReceive true "获取权限列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/getPolicyPathByAuthorityId [post]
func GetPolicyPathByAuthorityId(c *gin.Context) {
Expand All @@ -48,7 +48,7 @@ func GetPolicyPathByAuthorityId(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.CasbinInReceive true "获取权限列表"
// @Param data body request.CasbinInReceive true "获取权限列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/CasbinTest [get]
func CasbinTest(c *gin.Context) {
Expand Down
15 changes: 7 additions & 8 deletions server/api/v1/sys_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// @Summary 获取用户动态路由
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body api.RegisterAndLoginStruct true "可以什么都不填"
// @Param data body request.RegisterAndLoginStruct true "可以什么都不填"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /menu/getMenu [post]
func GetMenu(c *gin.Context) {
Expand All @@ -33,7 +33,7 @@ func GetMenu(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.PageInfo true "分页获取基础menu列表"
// @Param data body request.PageInfo true "分页获取基础menu列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/getMenuList [post]
func GetMenuList(c *gin.Context) {
Expand Down Expand Up @@ -75,7 +75,7 @@ func AddBaseMenu(c *gin.Context) {
// @Summary 获取用户动态路由
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body api.RegisterAndLoginStruct true "可以什么都不填"
// @Param data body request.RegisterAndLoginStruct true "可以什么都不填"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /menu/getBaseMenuTree [post]
func GetBaseMenuTree(c *gin.Context) {
Expand All @@ -84,7 +84,6 @@ func GetBaseMenuTree(c *gin.Context) {
response.FailWithMessage(fmt.Sprintf("获取失败,%v", err), c)
} else {
response.OkWithData(resp.SysBaseMenusResponse{Menus: menus}, c)

}
}

Expand All @@ -93,7 +92,7 @@ func GetBaseMenuTree(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.AddMenuAuthorityInfo true "增加menu和角色关联关系"
// @Param data body request.AddMenuAuthorityInfo true "增加menu和角色关联关系"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/addMenuAuthority [post]
func AddMenuAuthority(c *gin.Context) {
Expand All @@ -113,7 +112,7 @@ func AddMenuAuthority(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.AuthorityIdInfo true "增加menu和角色关联关系"
// @Param data body request.AuthorityIdInfo true "增加menu和角色关联关系"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/GetMenuAuthority [post]
func GetMenuAuthority(c *gin.Context) {
Expand All @@ -132,7 +131,7 @@ func GetMenuAuthority(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.GetById true "删除菜单"
// @Param data body request.GetById true "删除菜单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/deleteBaseMenu [post]
func DeleteBaseMenu(c *gin.Context) {
Expand Down Expand Up @@ -171,7 +170,7 @@ func UpdateBaseMenu(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.GetById true "根据id获取菜单"
// @Param data body request.GetById true "根据id获取菜单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/getBaseMenuById [post]
func GetBaseMenuById(c *gin.Context) {
Expand Down
27 changes: 23 additions & 4 deletions server/api/v1/sys_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Register(c *gin.Context) {
// @Tags Base
// @Summary 用户登录
// @Produce application/json
// @Param data body model.RegisterAndLoginStruct true "用户登录接口"
// @Param data body request.RegisterAndLoginStruct true "用户登录接口"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
// @Router /base/login [post]
func Login(c *gin.Context) {
Expand Down Expand Up @@ -133,7 +133,7 @@ func tokenNext(c *gin.Context, user model.SysUser) {
// @Summary 用户修改密码
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body model.ChangePasswordStutrc true "用户修改密码"
// @Param data body request.ChangePasswordStruct true "用户修改密码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/changePassword [put]
func ChangePassword(c *gin.Context) {
Expand Down Expand Up @@ -192,7 +192,7 @@ func UploadHeaderImg(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.PageInfo true "分页获取用户列表"
// @Param data body request.PageInfo true "分页获取用户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /user/getUserList [post]
func GetUserList(c *gin.Context) {
Expand All @@ -216,7 +216,7 @@ func GetUserList(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SetUserAuth true "设置用户权限"
// @Param data body request.SetUserAuth true "设置用户权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/setUserAuthority [post]
func SetUserAuthority(c *gin.Context) {
Expand All @@ -229,3 +229,22 @@ func SetUserAuthority(c *gin.Context) {
response.OkWithMessage("修改成功", c)
}
}

// @Tags SysUser
// @Summary 删除用户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SetUserAuth true "删除用户"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/deleteUser [delete]
func DeleteUser(c *gin.Context) {
var reqId request.GetById
_ = c.ShouldBindJSON(&reqId)
err := service.DeleteUser(reqId.Id)
if err != nil {
response.FailWithMessage(fmt.Sprintf("删除失败,%v", err), c)
} else {
response.OkWithMessage("删除成功", c)
}
}
2 changes: 1 addition & 1 deletion server/api/v1/sys_work_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// @Tags workflow
// @Summary 注册工作流
// @Produce application/json
// @Param data body sysModel.SysWorkflow true "注册工作流接口"
// @Param data body model.SysWorkflow true "注册工作流接口"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}"
// @Router /workflow/createWorkFlow [post]
func CreateWorkFlow(c *gin.Context) {
Expand Down
Loading

0 comments on commit 75533a8

Please sign in to comment.