Skip to content

Commit

Permalink
merge: (#281) 유저 dto 관련 리팩토링 (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
khcho0125 authored Jan 14, 2023
2 parents 0bd21fc + 83c0d8a commit b71322c
Show file tree
Hide file tree
Showing 67 changed files with 455 additions and 484 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package team.comit.simtong.domain.user.dto.request

/**
*
* 관리자의 로그인 정보를 전달하는 AdminSignInData
*
* @author kimbeomjin
* @author Chokyunghyeon
* @date 2023/01/01
* @version 1.2.5
**/
data class AdminSignInData(
val employeeNumber: Int,

val password: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package team.comit.simtong.domain.user.dto.request

/**
*
* 이메일 변경 정보를 전달하는 ChangeEmailData
*
* @author Chokyunghyeon
* @date 2022/10/03
* @version 1.2.5
**/
data class ChangeEmailData(
val email: String
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package team.comit.simtong.domain.user.dto
package team.comit.simtong.domain.user.dto.request

/**
*
* 닉네임 변경 요청 정보를 전달하는 ChangeNicknameRequest
*
* @author Chokyunghyeon
* @date 2022/10/03
* @version 1.0.0
* @version 1.2.5
**/
data class ChangeNicknameRequest(
data class ChangeNicknameData(
val nickname: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package team.comit.simtong.domain.user.dto.request

/**
*
* 사용자의 비밀번호 변경 요청 정보를 전달하는 ChangePasswordData
*
* @author Chokyunghyeon
* @date 2022/10/14
* @version 1.2.5
**/
data class ChangePasswordData(
val password: String,

val newPassword: String
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package team.comit.simtong.domain.user.dto
package team.comit.simtong.domain.user.dto.request

/**
*
* 프로필 사진 변경 요청 정보를 전달하는 ChangeProfileImageRequest
* 프로필 사진 변경 요청 정보를 전달하는 ChangeProfileImageData
*
* @author Chokyunghyeon
* @date 2022/10/03
* @version 1.0.0
* @version 1.2.5
**/
data class ChangeProfileImageRequest(
data class ChangeProfileImageData(
val profileImagePath: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package team.comit.simtong.domain.user.dto.request

import java.util.UUID

/**
*
* 지점 변경 요청 정보를 전달하는 ChangeSpotData
*
* @author Chokyunghyeon
* @date 2023/01/12
* @version 1.2.5
**/
data class ChangeSpotData(
val spotId: UUID
)
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package team.comit.simtong.domain.user.dto
package team.comit.simtong.domain.user.dto.request

/**
*
* 해당 사원번호와 이메일을 가진 계정 여부 확인을 요청하는 CheckMatchedAccountRequest
* 해당 사원번호와 이메일을 가진 계정 여부 확인 요청 정보를 전달하는 CheckMatchedAccountData
*
* @author Chokyunghyeon
* @date 2022/10/15
* @version 1.0.0
* @version 1.2.5
**/
data class CheckMatchedAccountRequest(
data class CheckMatchedAccountData(
val employeeNumber: Int,

val email: String
)
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package team.comit.simtong.domain.user.dto
package team.comit.simtong.domain.user.dto.request

import java.util.*
import java.util.UUID

/**
*
* 사원 번호 찾기 정보를 전달하는 FindEmployeeNumberRequest
* 사원 번호 찾기 정보를 전달하는 FindEmployeeNumberData
*
* @author Chokyunghyeon
* @date 2022/09/11
* @version 1.0.0
* @version 1.2.5
**/
data class FindEmployeeNumberRequest(
data class FindEmployeeNumberData(
val name: String,

val spotId: UUID,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package team.comit.simtong.domain.user.dto.request

/**
*
* 비밀번호 초기화 요청 정보를 전달하는 ResetPasswordData
*
* @author Chokyunghyeon
* @date 2022/09/27
* @version 1.2.5
**/
data class ResetPasswordData(
val email: String,

val employeeNumber: Int,

val newPassword: String
)
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package team.comit.simtong.domain.user.dto
package team.comit.simtong.domain.user.dto.request

/**
*
* 회원 가입 정보를 전달하는 SignUpRequest
* 회원 가입 정보를 전달하는 SignUpData
*
* @author Chokyunghyeon
* @author kimbeomjin
* @date 2022/09/04
* @version 1.2.1
* @version 1.2.5
**/
data class SignUpRequest(
data class SignUpData(
val name: String,

val email: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package team.comit.simtong.domain.user.dto.request

/**
*
* 일반 사용자의 로그인 정보를 전달하는 UserSignInData
*
* @author kimbeomjin
* @date 2022/09/08
* @version 1.2.5
**/
data class UserSignInData(
val employeeNumber: Int,

val password: String,

val deviceToken: String
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package team.comit.simtong.domain.user.dto
package team.comit.simtong.domain.user.dto.response

import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package team.comit.simtong.domain.user.dto
package team.comit.simtong.domain.user.dto.response

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package team.comit.simtong.domain.user.usecase

import team.comit.simtong.domain.auth.dto.TokenResponse
import team.comit.simtong.domain.user.dto.AdminSignInRequest
import team.comit.simtong.domain.user.dto.request.AdminSignInData
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.model.Authority
import team.comit.simtong.domain.user.spi.QueryUserPort
Expand All @@ -25,7 +25,7 @@ class AdminSignInUseCase(
private val securityPort: UserSecurityPort
) {

fun execute(request: AdminSignInRequest): TokenResponse {
fun execute(request: AdminSignInData): TokenResponse {
val admin = queryUserPort.queryUserByEmployeeNumber(request.employeeNumber)
?.apply { this.checkAuthority(Authority.ROLE_ADMIN) }
?: throw UserExceptions.NotFound("관리자가 존재하지 않습니다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package team.comit.simtong.domain.user.usecase

import team.comit.simtong.domain.auth.exception.AuthExceptions
import team.comit.simtong.domain.auth.spi.QueryAuthCodeLimitPort
import team.comit.simtong.domain.user.dto.ChangeEmailRequest
import team.comit.simtong.domain.user.dto.request.ChangeEmailData
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.spi.CommandUserPort
import team.comit.simtong.domain.user.spi.QueryUserPort
Expand All @@ -25,7 +25,7 @@ class ChangeEmailUseCase(
private val commandUserPort: CommandUserPort
) {

fun execute(request: ChangeEmailRequest) {
fun execute(request: ChangeEmailData) {
if (queryUserPort.existsUserByEmail(request.email)) {
throw AuthExceptions.AlreadyUsedEmail()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package team.comit.simtong.domain.user.usecase

import team.comit.simtong.domain.user.dto.ChangeNicknameRequest
import team.comit.simtong.domain.user.dto.request.ChangeNicknameData
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.spi.CommandUserPort
import team.comit.simtong.domain.user.spi.QueryUserPort
Expand All @@ -22,7 +22,7 @@ class ChangeNicknameUseCase(
private val commandUserPort: CommandUserPort
) {

fun execute(request: ChangeNicknameRequest) {
fun execute(request: ChangeNicknameData) {
if (queryUserPort.existsUserByNickname(request.nickname)) {
throw UserExceptions.AlreadyUsedNickname()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package team.comit.simtong.domain.user.usecase

import team.comit.simtong.domain.user.dto.ChangePasswordRequest
import team.comit.simtong.domain.user.dto.request.ChangePasswordData
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.spi.CommandUserPort
import team.comit.simtong.domain.user.spi.QueryUserPort
Expand All @@ -22,8 +22,9 @@ class ChangePasswordUseCase(
private val commandUserPort: CommandUserPort
) {

fun execute(request: ChangePasswordRequest) {
fun execute(request: ChangePasswordData) {
val currentUserId = securityPort.getCurrentUserId()

val user = queryUserPort.queryUserById(currentUserId) ?: throw UserExceptions.NotFound()

if (!securityPort.compare(request.password, user.password.value)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package team.comit.simtong.domain.user.usecase

import team.comit.simtong.domain.file.exception.FileExceptions
import team.comit.simtong.domain.file.spi.CheckFilePort
import team.comit.simtong.domain.user.dto.ChangeProfileImageRequest
import team.comit.simtong.domain.user.dto.request.ChangeProfileImageData
import team.comit.simtong.domain.user.exception.UserExceptions
import team.comit.simtong.domain.user.spi.CommandUserPort
import team.comit.simtong.domain.user.spi.QueryUserPort
Expand All @@ -25,7 +25,7 @@ class ChangeProfileImageUseCase(
private val checkFilePort: CheckFilePort
) {

fun execute(request: ChangeProfileImageRequest) {
fun execute(request: ChangeProfileImageData) {
if (!checkFilePort.existsPath(request.profileImagePath)) {
throw FileExceptions.PathNotFound()
}
Expand Down
Loading

0 comments on commit b71322c

Please sign in to comment.