controllers

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthController

type AuthController struct {
	// contains filtered or unexported fields
}

func NewAuthController

func NewAuthController(
	loginUseCase *usecases.LoginUseCase,
	secretLoginUseCase *usecases.SecretLoginUseCase,
	getSecretQuestionUseCase *usecases.GetSecretQuestionUseCase,
	presenter presenters.AuthPresenter,
	getUserInfoUseCase *usecases.GetUserInfoUseCase,
) *AuthController

func (*AuthController) GetSecretQuestion

func (c *AuthController) GetSecretQuestion(ctx *gin.Context)

@Summary 秘密の質問の取得 @Description ユーザーIDに対応する秘密の質問を取得します @Tags auth @Accept json @Produce json @Param user_id query string true "ユーザーID" @Success 200 {object} presenters.SecretQuestionResponse "秘密の質問" @Failure 400 {object} response.ErrorResponse "リクエストの形式が不正" @Failure 404 {object} response.ErrorResponse "ユーザーが見つからない" @Failure 500 {object} response.ErrorResponse "サーバー内部エラー" @Router /secret-question [get] .

func (*AuthController) Login

func (c *AuthController) Login(ctx *gin.Context)

@Summary ユーザーログイン @Description ユーザー名とパスワードを使用してログイン認証を行います @Tags auth @Accept json @Produce json @Param request body validators.LoginRequest true "ログイン情報" @Success 200 {object} presenters.LoginResponse "ログイン成功時のレスポンス" @Failure 400 {object} response.ErrorResponse "リクエストの形式が不正" @Failure 401 {object} response.ErrorResponse "パスワードが一致しない" @Failure 500 {object} response.ErrorResponse "サーバー内部エラー" @Router /login [post] .

func (*AuthController) SecretLogin

func (c *AuthController) SecretLogin(ctx *gin.Context)

@Summary 秘密の質問によるログイン @Description 秘密の質問の回答を使用してログイン認証を行います @Tags auth @Accept json @Produce json @Param request body validators.SecretLoginRequest true "秘密の質問の回答情報" @Success 200 {object} presenters.LoginResponse "ログイン成功時のレスポンス" @Failure 400 {object} response.ErrorResponse "リクエストの形式が不正" @Failure 401 {object} response.ErrorResponse "秘密の質問の回答が一致しない" @Failure 500 {object} response.ErrorResponse "サーバー内部エラー" @Router /secret-login [post] .

type PlanController

type PlanController struct {
	// contains filtered or unexported fields
}

func NewPlanController

func NewPlanController(
	getPlansUseCase *usecases.GetPlansUseCase,
	presenter presenters.PlanPresenter,
) *PlanController

func (*PlanController) GetPlans

func (pc *PlanController) GetPlans(c *gin.Context)

GetPlans プラン一覧を取得します @Summary プラン一覧取得API @Description ユーザーの権限に基づいて、指定された検索条件に一致するプラン一覧を取得します @Tags plans @Accept json @Produce json @Security Bearer @Param startDate query string false "開始日 (YYYY-MM-DD形式)" @Param endDate query string false "終了日 (YYYY-MM-DD形式)" @Param status query string false "プランのステータス (reserved/canceled/confirmed/pending)" @Success 200 {object} presenters.PlansResponse "プラン一覧の取得に成功" @Failure 400 {object} response.ErrorResponse "不正なリクエストパラメータ" @Failure 401 {object} response.ErrorResponse "認証エラー" @Failure 500 {object} response.ErrorResponse "サーバー内部エラー" @Router /plans [get] .

type ReservationController

type ReservationController struct {
	// contains filtered or unexported fields
}

func NewReservationController

func NewReservationController(
	getUserReservationsUseCase *usecases.GetUserReservationsUseCase,
	createReservationUseCase *usecases.CreateReservationUseCase,
	presenter presenters.ReservationPresenter,
) *ReservationController

func (*ReservationController) CreateReservation

func (rc *ReservationController) CreateReservation(c *gin.Context)

CreateReservation 新しい予約を作成 @Summary 新しい予約を作成 @Description ユーザーの新しい予約を作成します @Tags reservations @Accept json @Produce json @Security Bearer @Param request body validators.CreateReservationRequest true "予約情報" @Success 201 {object} presenters.ReservationResponse @Failure 400 {object} response.ErrorResponse @Failure 401 {object} response.ErrorResponse @Failure 500 {object} response.ErrorResponse @Router /reservations [post] .

func (*ReservationController) GetUserReservations

func (rc *ReservationController) GetUserReservations(c *gin.Context)

GetUserReservations ユーザーの予約一覧を取得 @Summary ユーザーの予約一覧を取得 @Description 指定されたユーザーIDに紐づく予約の一覧を取得します @Tags reservations @Accept json @Produce json @Security Bearer @Param user_id query string true "ユーザーID" minlength(3) maxlength(50) @Success 200 {object} presenters.ReservationsResponse @Failure 400 {object} response.ErrorResponse @Failure 500 {object} response.ErrorResponse @Router /reservations [get] .

type UserController added in v1.0.0

type UserController struct {
	// contains filtered or unexported fields
}

func NewUserController added in v1.0.0

func NewUserController(
	presenter presenters.UserPresenter,
	getUserInfoUseCase *usecases.GetUserInfoUseCase,
	getUsersUseCase *usecases.GetUsersUseCase,
) *UserController

func (*UserController) GetMe added in v1.0.0

func (uc *UserController) GetMe(c *gin.Context)

GetMe ログイン中のユーザー情報を取得します @Summary ログインユーザー情報取得 @Description ログイン中のユーザー情報を取得します @Tags users @Accept json @Produce json @Security Bearer @Success 200 {object} presenters.UserResponse @Failure 401 {object} response.ErrorResponse @Router /users/me [get] .

func (*UserController) GetUsers added in v1.0.0

func (uc *UserController) GetUsers(c *gin.Context)

GetUsers 全ユーザー情報を取得します @Summary ユーザー一覧取得 @Description 全ユーザーの情報を取得します(管理者のみ) @Tags users @Accept json @Produce json @Security Bearer @Success 200 {array} presenters.UserResponse @Failure 401 {object} response.ErrorResponse @Failure 403 {object} response.ErrorResponse @Router /users [get] .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL