| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- package controllers
- import (
- "github.com/gin-gonic/gin"
- "github.com/xormplus/xorm"
- "git.qianqiusoft.com/qianqiusoft/light-apiengine/engine"
- )
- // SystemController operations for System
- type SystemController struct {
- Ctx *gin.Context
- Db *xorm.Engine
- engine *engine.ApiEngine
- }
- func NewSystemController(c *gin.Context, e *engine.ApiEngine) *SystemController {
- controller := &SystemController{c,e.OrmEngine,e}
- 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)
- }
- // GetNavTree
- // @Title GetNavTree
- // @Description 获取导航菜单
- // @Param user string false "用户id"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /get_nav_tree [post,get]
- func (c *SystemController) GetNavTree() {
- //
- System_GetNavTree(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)
- }
- // AddUser
- // @Title AddUser
- // @Description 添加用户
- // @Param login_id string false "登录ID"
- // @Param password string false "密码"
- // @Param org_id string false "组织ID"
- // @Param email string false "邮箱"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /add_user [post,get,put]
- func (c *SystemController) AddUser() {
- //
- System_AddUser(c)
- }
- // DelUser
- // @Title DelUser
- // @Description 删除用户
- // @Param id string false "用户ID"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /del_user [post,get,put]
- func (c *SystemController) DelUser() {
- //
- System_DelUser(c)
- }
- // UpdateUser
- // @Title UpdateUser
- // @Description 修改用户
- // @Param login_id string false "登录ID"
- // @Param password string false "密码"
- // @Param org_id string false "组织ID"
- // @Param email string false "邮箱"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /update_user [post,get,put]
- func (c *SystemController) UpdateUser() {
- //
- System_UpdateUser(c)
- }
- // AddRole
- // @Title AddRole
- // @Description 添加角色
- // @Param name string false "角色名称"
- // @Param remark string false "备注"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /add_role [post,get,put]
- func (c *SystemController) AddRole() {
- //
- System_AddRole(c)
- }
- // DelRole
- // @Title DelRole
- // @Description 添加角色
- // @Param id string false "角色ID"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /del_role [post,get,put]
- func (c *SystemController) DelRole() {
- //
- System_DelRole(c)
- }
- // UpdateRole
- // @Title UpdateRole
- // @Description 修改角色
- // @Param id string false "角色ID"
- // @Param name string false "角色名称"
- // @Param remark string false "备注"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /update_role [post,get,put]
- func (c *SystemController) UpdateRole() {
- //
- System_UpdateRole(c)
- }
- // FindRolePage
- // @Title FindRolePage
- // @Description 角色分页
- // @Param page false "分页参数"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /find_role_page [post,get,put]
- func (c *SystemController) FindRolePage() {
- //
- System_FindRolePage(c)
- }
- // FindRoleMenu
- // @Title FindRoleMenu
- // @Description 查找角色权限
- // @Param role_id string false "角色id"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /find_role_menu [post,get,put]
- func (c *SystemController) FindRoleMenu() {
- //
- System_FindRoleMenu(c)
- }
- // SaveRoleMenu
- // @Title SaveRoleMenu
- // @Description 保存角色权限
- // @Param role_menu string false "角色权限"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /save_role_menu [post,get,put]
- func (c *SystemController) SaveRoleMenu() {
- //
- System_SaveRoleMenu(c)
- }
- // RoleAll
- // @Title RoleAll
- // @Description 查找所有角色
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /role_all [post,get,put]
- func (c *SystemController) RoleAll() {
- //
- System_RoleAll(c)
- }
- // FindPermissions
- // @Title FindPermissions
- // @Description 查找用户权限
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /find_permissions [post,get,put]
- func (c *SystemController) FindPermissions() {
- //
- System_FindPermissions(c)
- }
- // AddMenu
- // @Title AddMenu
- // @Description 添加菜单
- // @Param string false "菜单"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /add_menu [post,get,put]
- func (c *SystemController) AddMenu() {
- //
- System_AddMenu(c)
- }
- // DelMenu
- // @Title DelMenu
- // @Description 删除菜单
- // @Param id string false "菜单ID"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /del_menu [post,get,put]
- func (c *SystemController) DelMenu() {
- //
- System_DelMenu(c)
- }
- // UpdateMenu
- // @Title UpdateMenu
- // @Description 更新菜单
- // @Param string false "菜单"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /update_menu [post,get,put]
- func (c *SystemController) UpdateMenu() {
- //
- System_UpdateMenu(c)
- }
- // AddOrg
- // @Title AddOrg
- // @Description 添加组织
- // @Param string false "组织"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /add_org [post,get,put]
- func (c *SystemController) AddOrg() {
- //
- System_AddOrg(c)
- }
- // DelOrg
- // @Title DelOrg
- // @Description 删除组织
- // @Param id string false "组织ID"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /del_org [post,get,put]
- func (c *SystemController) DelOrg() {
- //
- System_DelOrg(c)
- }
- // UpdateOrg
- // @Title UpdateOrg
- // @Description 更新组织
- // @Param string false "组织"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /update_org [post,get,put]
- func (c *SystemController) UpdateOrg() {
- //
- System_UpdateOrg(c)
- }
- // GetOrg
- // @Title GetOrg
- // @Description 根据ID获取组织
- // @Param string false "组织"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /get_org [post,get,put]
- func (c *SystemController) GetOrg() {
- //
- System_GetOrg(c)
- }
- // UpdateOrg
- // @Title UpdateOrg
- // @Description 更新组织
- // @Param string false "组织"
- // @Success 200 {object} models.Account
- // @Failure 403 :id is empty
- // @router /page_org [post,get,put]
- func (c *SystemController) PageOrg() {
- //
- System_PageOrg(c)
- }
|