➕ add swagger
This commit is contained in:
11
api/api.go
Normal file
11
api/api.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package api
|
||||
|
||||
import "schisandra-cloud-album/api/auth_api"
|
||||
|
||||
// Apis 统一导出的api
|
||||
type Apis struct {
|
||||
AuthApi auth_api.AuthAPI
|
||||
}
|
||||
|
||||
// Api new函数实例化,实例化完成后会返回结构体地指针类型
|
||||
var Api = new(Apis)
|
19
api/auth_api/auth_api.go
Normal file
19
api/auth_api/auth_api.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package auth_api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"schisandra-cloud-album/common/result"
|
||||
"schisandra-cloud-album/service"
|
||||
)
|
||||
|
||||
var authService = service.Service.AuthService
|
||||
|
||||
// GetUserList
|
||||
// @Summary 获取所有用户列表
|
||||
// @Tags 鉴权模块
|
||||
// @Success 200 {string} json
|
||||
// @Router /api/auth/user/List [get]
|
||||
func (AuthAPI) GetUserList(c *gin.Context) {
|
||||
userList := authService.GetUserList()
|
||||
result.OkWithData(userList, c)
|
||||
}
|
3
api/auth_api/enter.go
Normal file
3
api/auth_api/enter.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package auth_api
|
||||
|
||||
type AuthAPI struct{}
|
Reference in New Issue
Block a user