MSP-1070 rename auth struct to login struct
This commit is contained in:
1 parent
bb4c8cd8ad
commit
ece61a0e87
4 files changed
+28
-28
No files matched your search
+8
-8
@@ -11,8 +11,8 @@ import (
|
||||
)
|
||||
|
||||
type authService interface {
|
||||
Login(ctx context.Context, authRequest domain.AuthRequest) (*domain.Auth, error)
|
||||
LoginWithSudir(ctx context.Context, request domain.SudirAuthRequest) (*domain.Auth, error)
|
||||
Login(ctx context.Context, request domain.LoginRequest) (*domain.LoginResponse, error)
|
||||
LoginWithSudir(ctx context.Context, request domain.LoginSudirRequest) (*domain.LoginResponse, error)
|
||||
}
|
||||
|
||||
type Auth struct {
|
||||
@@ -48,13 +48,13 @@ func (a Auth) Logout() error {
|
||||
// @Description Авторизация с получением токена администратора
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.AuthRequest true "Тело запроса"
|
||||
// @Success 200 {object} domain.Auth
|
||||
// @Param body body domain.LoginRequest true "Тело запроса"
|
||||
// @Success 200 {object} domain.LoginResponse
|
||||
// @Failure 400 {object} domain.GrpcError
|
||||
// @Failure 401 {object} domain.GrpcError "Данные для авторизации не верны"
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /auth/login [POST]
|
||||
func (a Auth) Login(ctx context.Context, authRequest domain.AuthRequest) (*domain.Auth, error) {
|
||||
func (a Auth) Login(ctx context.Context, authRequest domain.LoginRequest) (*domain.LoginResponse, error) {
|
||||
auth, err := a.authService.Login(ctx, authRequest)
|
||||
|
||||
switch {
|
||||
@@ -76,13 +76,13 @@ func (a Auth) Login(ctx context.Context, authRequest domain.AuthRequest) (*domai
|
||||
// @Description Авторизация с получением токена администратора
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param body body domain.SudirAuthRequest true "Тело запроса"
|
||||
// @Success 200 {object} domain.Auth
|
||||
// @Param body body domain.LoginSudirRequest true "Тело запроса"
|
||||
// @Success 200 {object} domain.LoginResponse
|
||||
// @Failure 401 {object} domain.GrpcError "Некорректный код для авторизации"
|
||||
// @Failure 412 {object} domain.GrpcError "Авторизация СУДИР не настроена на сервере"
|
||||
// @Failure 500 {object} domain.GrpcError
|
||||
// @Router /auth/login_with_sudir [POST]
|
||||
func (a Auth) LoginWithSudir(ctx context.Context, request domain.SudirAuthRequest) (*domain.Auth, error) {
|
||||
func (a Auth) LoginWithSudir(ctx context.Context, request domain.LoginSudirRequest) (*domain.LoginResponse, error) {
|
||||
auth, err := a.authService.LoginWithSudir(ctx, request)
|
||||
|
||||
switch {
|
||||
|
||||
Reference in new issue
Block a user