| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- package controllers
- import (
- "git.qianqiusoft.com/qianqiusoft/light-apiengine/engine"
- "git.qianqiusoft.com/qianqiusoft/light-apiengine/entitys"
- "github.com/gin-gonic/gin"
- "github.com/xormplus/xorm"
- )
- // SystemController operations for System
- type SystemController struct {
- Ctx *gin.Context
- Db *xorm.Engine
- engine *engine.ApiEngine
- Token *entitys.Token
- }
- func NewSystemController(c *gin.Context, e *engine.ApiEngine) *SystemController {
- controller := &SystemController{c, e.OrmEngine, e, nil}
- return controller
- }
- // Login
- // @Title Login
- // @Description 用户登录
- // @Param logininfo false "登录信息"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /login [post,get,put]
- func (c *SystemController) Login() {
- //
- System_Login(c)
- }
- // Logout
- // @Title Logout
- // @Description 用户退出
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /logout [post,get]
- func (c *SystemController) Logout() {
- //
- System_Logout(c)
- }
- // GetMenuTree
- // @Title GetMenuTree
- // @Description 获取系统菜单
- // @Param user string false "用户id"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /get_menu_tree [post,get]
- func (c *SystemController) GetMenuTree() {
- //
- System_GetMenuTree(c)
- }
- // FindUserPage
- // @Title FindUserPage
- // @Description 获取用户分布数据
- // @Param page false "分页参数"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /find_user_page [post,get]
- func (c *SystemController) FindUserPage() {
- //
- System_FindUserPage(c)
- }
- // GetOrgTree
- // @Title GetOrgTree
- // @Description 获取组织架构树
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /get_org_tree [post,get]
- func (c *SystemController) GetOrgTree() {
- //
- System_GetOrgTree(c)
- }
- // FindPermissions
- // @Title FindPermissions
- // @Description 查找用户的菜单权限标识集合
- // @Param user string false "用户id"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /find_permissions [post,get,put]
- func (c *SystemController) FindPermissions() {
- //
- System_FindPermissions(c)
- }
- // AddPermission
- // @Title AddPermission
- // @Description 查找用户的菜单权限标识集合
- // @Param perms string false "权限标识"
- // @Param domain string false "域"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /add_permission [post,get,put]
- func (c *SystemController) AddPermission() {
- //
- System_AddPermission(c)
- }
|