tsk-15: Add API documentation (#17)

Closes #15

Reviewed-on: phoenix/textsender-auth#17
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-11-14 17:56:51 +00:00
committed by phoenix
parent 6f608b757c
commit 8a90448854
10 changed files with 675 additions and 1 deletions
+12
View File
@@ -29,6 +29,18 @@ func NewLoginHandler(userStore model.UserStore) *LoginHandler {
return &LoginHandler{UserStore: userStore}
}
// Login godoc
// @Summary Login
// @Description Login and be given an access token (requires JWT)
// @Tags users
// @Accept json
// @Produce json
// @Security BearerAuth
// @Param request body LoginAccount true "Data to obtain a token"
// @Success 200 {object} LoginResponse
// @Failure 400 {object} LoginResponse
// @Failure 500 {object} LoginResponse
// @Router /login [post]
func (l *LoginHandler) Login(w http.ResponseWriter, r *http.Request) {
var req LoginAccount
if err := ExtractFromRequest(r, &req); err != nil {