实现swagger

This commit is contained in:
2025-09-12 17:43:42 +08:00
parent fe9b0db985
commit 9e9bf7b8a0
6 changed files with 745 additions and 197 deletions

View File

@@ -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) {