Skip to content

Commit 35f2d39

Browse files
authored
chore: update api v1 docs (usememos#2117)
* chore: update apiv1 docs * chore: update
1 parent 4491c75 commit 35f2d39

30 files changed

Lines changed: 351 additions & 1150 deletions

api/v1/auth.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ type SignUp struct {
3232
}
3333

3434
func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
35-
g.POST("/auth/signin", s.signIn)
36-
g.POST("/auth/signin/sso", s.signInSSO)
37-
g.POST("/auth/signout", s.signOut)
38-
g.POST("/auth/signup", s.signUp)
35+
g.POST("/auth/signin", s.SignIn)
36+
g.POST("/auth/signin/sso", s.SignInSSO)
37+
g.POST("/auth/signout", s.SignOut)
38+
g.POST("/auth/signup", s.SignUp)
3939
}
4040

41-
// signIn godoc
41+
// SignIn godoc
4242
//
4343
// @Summary Sign-in to memos.
4444
// @Tags auth
@@ -51,7 +51,7 @@ func (s *APIV1Service) registerAuthRoutes(g *echo.Group) {
5151
// @Failure 403 {object} nil "User has been archived with username %s"
5252
// @Failure 500 {object} nil "Failed to find system setting | Failed to unmarshal system setting | Incorrect login credentials, please try again | Failed to generate tokens | Failed to create activity"
5353
// @Router /api/v1/auth/signin [POST]
54-
func (s *APIV1Service) signIn(c echo.Context) error {
54+
func (s *APIV1Service) SignIn(c echo.Context) error {
5555
ctx := c.Request().Context()
5656
signin := &SignIn{}
5757

@@ -104,7 +104,7 @@ func (s *APIV1Service) signIn(c echo.Context) error {
104104
return c.JSON(http.StatusOK, userMessage)
105105
}
106106

107-
// signInSSO godoc
107+
// SignInSSO godoc
108108
//
109109
// @Summary Sign-in to memos using SSO.
110110
// @Tags auth
@@ -118,7 +118,7 @@ func (s *APIV1Service) signIn(c echo.Context) error {
118118
// @Failure 404 {object} nil "Identity provider not found"
119119
// @Failure 500 {object} nil "Failed to find identity provider | Failed to create identity provider instance | Failed to exchange token | Failed to get user info | Failed to compile identifier filter | Incorrect login credentials, please try again | Failed to generate random password | Failed to generate password hash | Failed to create user | Failed to generate tokens | Failed to create activity"
120120
// @Router /api/v1/auth/signin/sso [POST]
121-
func (s *APIV1Service) signInSSO(c echo.Context) error {
121+
func (s *APIV1Service) SignInSSO(c echo.Context) error {
122122
ctx := c.Request().Context()
123123
signin := &SSOSignIn{}
124124
if err := json.NewDecoder(c.Request().Body).Decode(signin); err != nil {
@@ -205,19 +205,19 @@ func (s *APIV1Service) signInSSO(c echo.Context) error {
205205
return c.JSON(http.StatusOK, userMessage)
206206
}
207207

208-
// signOut godoc
208+
// SignOut godoc
209209
//
210210
// @Summary Sign-out from memos.
211211
// @Tags auth
212212
// @Produce json
213213
// @Success 200 {boolean} true "Sign-out success"
214214
// @Router /api/v1/auth/signout [POST]
215-
func (*APIV1Service) signOut(c echo.Context) error {
215+
func (*APIV1Service) SignOut(c echo.Context) error {
216216
RemoveTokensAndCookies(c)
217217
return c.JSON(http.StatusOK, true)
218218
}
219219

220-
// signUp godoc
220+
// SignUp godoc
221221
//
222222
// @Summary Sign-up to memos.
223223
// @Tags auth
@@ -231,7 +231,7 @@ func (*APIV1Service) signOut(c echo.Context) error {
231231
// @Failure 404 {object} nil "Not found"
232232
// @Failure 500 {object} nil "Failed to find system setting | Failed to unmarshal system setting allow signup | Failed to generate password hash | Failed to create user | Failed to generate tokens | Failed to create activity"
233233
// @Router /api/v1/auth/signup [POST]
234-
func (s *APIV1Service) signUp(c echo.Context) error {
234+
func (s *APIV1Service) SignUp(c echo.Context) error {
235235
ctx := c.Request().Context()
236236
signup := &SignUp{}
237237
if err := json.NewDecoder(c.Request().Body).Decode(signup); err != nil {

api/docs.go renamed to api/v1/docs.go

Lines changed: 95 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)