Skip to content

Commit

Permalink
fix: date 에러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaisqls committed Oct 25, 2023
1 parent 4b508c9 commit 64d7521
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/kr/hs/dsm/inq/domain/user/persistence/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package kr.hs.dsm.inq.domain.user.persistence

import kr.hs.dsm.inq.domain.user.presentation.dto.UpdateUserInfoRequest
import java.time.LocalDate
import java.time.LocalDateTime
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.GeneratedValue
Expand Down Expand Up @@ -32,8 +33,8 @@ data class User(
@Column(nullable = false)
var password: String,

@Column(nullable = false)
val joinDate: LocalDate,
@Column(columnDefinition = "TIMESTAMP")
val joinDate: LocalDateTime,

@Column(columnDefinition = "INT", nullable = false)
var coin: Int = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package kr.hs.dsm.inq.domain.user.persistence.repository
import kr.hs.dsm.inq.domain.user.persistence.User
import org.springframework.data.repository.CrudRepository

interface UserRepository: CrudRepository<User, Long> {
interface UserRepository : CrudRepository<User, Long> {

fun existsByAccountId(accountId: String): Boolean

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ package kr.hs.dsm.inq.domain.user.service

import kr.hs.dsm.inq.common.dto.TokenResponse
import kr.hs.dsm.inq.common.util.SecurityUtil
import kr.hs.dsm.inq.domain.user.exception.AttendanceNotFound
import kr.hs.dsm.inq.domain.user.exception.PasswordMismatchException
import kr.hs.dsm.inq.domain.user.exception.UserAlreadyExist
import kr.hs.dsm.inq.domain.user.exception.UserNotFound
import kr.hs.dsm.inq.domain.user.persistence.User
import kr.hs.dsm.inq.domain.user.persistence.repository.AttendanceRepository
import kr.hs.dsm.inq.domain.user.persistence.repository.UserRepository
import kr.hs.dsm.inq.domain.user.presentation.dto.*
import kr.hs.dsm.inq.global.security.token.JwtGenerator
import org.springframework.security.crypto.password.PasswordEncoder
import org.springframework.stereotype.Service
import java.time.LocalDate
import java.time.LocalDateTime
import javax.transaction.Transactional
import kr.hs.dsm.inq.domain.user.persistence.repository.UserRepository

@Service
class UserService(
Expand Down Expand Up @@ -48,7 +48,7 @@ class UserService(
jobDuration = request.jobDuration,
accountId = request.accountId,
password = passwordEncoder.encode(request.password),
joinDate = LocalDate.now()
joinDate = LocalDateTime.now()
)
)
}
Expand All @@ -59,7 +59,7 @@ class UserService(

return UserInfoResponse(
username = user.username,
joinDate = user.joinDate,
joinDate = user.joinDate.toLocalDate(),
coin = user.coin,
job = user.job,
jobDuration = user.jobDuration
Expand Down

0 comments on commit 64d7521

Please sign in to comment.