实现swagger
This commit is contained in:
@@ -60,7 +60,7 @@ type LoginResponse struct {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param user body CreateUserRequest true "用户信息"
|
||||
// @Success 200 {object} controller.Response{data=CreateUserResponse} "业务码为201代表创建成功"
|
||||
// @Success 200 {object} controller.Response{data=user.CreateUserResponse} "业务码为201代表创建成功"
|
||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 409, 500)"
|
||||
// @Router /users [post]
|
||||
func (c *Controller) CreateUser(ctx *gin.Context) {
|
||||
@@ -104,7 +104,7 @@ func (c *Controller) CreateUser(ctx *gin.Context) {
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param credentials body LoginRequest true "登录凭证"
|
||||
// @Success 200 {object} controller.Response{data=LoginResponse} "业务码为200代表登录成功"
|
||||
// @Success 200 {object} controller.Response{data=user.LoginResponse} "业务码为200代表登录成功"
|
||||
// @Failure 200 {object} controller.Response "业务失败,具体错误码和信息见响应体(例如400, 401, 500)"
|
||||
// @Router /users/login [post]
|
||||
func (c *Controller) Login(ctx *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user