59 lines
1.4 KiB
Go
59 lines
1.4 KiB
Go
package api
|
|
|
|
import (
|
|
"SciencesServer/app/api/controller/auth"
|
|
"SciencesServer/app/service"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Auth struct{}
|
|
|
|
/**
|
|
* @apiDefine Auth 权限管理
|
|
*/
|
|
|
|
/**
|
|
* @api {get} /api/auth/list 权限列表
|
|
* @apiVersion 1.0.0
|
|
* @apiName AuthList
|
|
* @apiGroup Auth
|
|
*
|
|
* @apiHeader {string} x-token token
|
|
*
|
|
* @apiSuccess (200) {Number} code 成功响应状态码!
|
|
* @apiSuccess (200) {String} msg 成功提示
|
|
* @apiSuccess (200) {Array} data 具体信息
|
|
* @apiSuccess (200) {Number} data.id ID
|
|
* @apiSuccess (200) {Number} data.kind_title 权限类型名称
|
|
* @apiSuccess (200) {String} data.kind 权限类型
|
|
* @apiSuccess (200) {String} data.name 权限名称
|
|
* @apiSuccess (200) {String} data.auth 权限信息
|
|
* @apiSuccess (200) {String} data.remark 备注信息
|
|
* @apiSuccess (200) {Array} data.children 子集
|
|
*
|
|
* @apiSuccessExample {json} Success response:
|
|
* HTTPS 200 OK
|
|
* {
|
|
* "code": 200
|
|
* "msg": "ok"
|
|
* "data": {
|
|
* {
|
|
* "id": 1,
|
|
* "kind": 1,
|
|
* "name": "测试",
|
|
* "auth": "",
|
|
* "remark": "",
|
|
* "created_at": "2021-09-15T13:59:35+08:00",
|
|
* "updated_at": "2021-09-15T13:59:35+08:00",
|
|
* "kind_title": "模块",
|
|
* "children": []
|
|
* }
|
|
* }
|
|
* }
|
|
*/
|
|
func (a *Auth) List(c *gin.Context) {
|
|
data, err := auth.NewInstance()(getSession()(c).(*service.Session)).List()
|
|
APIResponse(err, data)(c)
|
|
}
|