From 7bcfa54eeeb1816a72488ec0b41f38f5c26d1a6f Mon Sep 17 00:00:00 2001 From: 12OneTwo12 Date: Sun, 18 Aug 2024 22:56:09 +0900 Subject: [PATCH] add user profile image --- .../myfit/adapter/in/event/dto/UserCreateMessageDto.kt | 1 + .../myfit/adapter/in/event/mapper/UserForReadMapper.kt | 1 + .../adapter/out/persistence/entity/UserForReadEntity.kt | 2 ++ .../port/in/user/command/CreateUserForReadCommand.kt | 1 + .../myfit/application/service/dto/UserInfoResponseDto.kt | 1 + src/main/kotlin/com/fitmate/myfit/domain/UserForRead.kt | 5 +++++ src/main/resources/slack-properties.yml | 1 + 7 files changed, 12 insertions(+) create mode 100644 src/main/resources/slack-properties.yml diff --git a/src/main/kotlin/com/fitmate/myfit/adapter/in/event/dto/UserCreateMessageDto.kt b/src/main/kotlin/com/fitmate/myfit/adapter/in/event/dto/UserCreateMessageDto.kt index e4d1b54..cfab2bc 100644 --- a/src/main/kotlin/com/fitmate/myfit/adapter/in/event/dto/UserCreateMessageDto.kt +++ b/src/main/kotlin/com/fitmate/myfit/adapter/in/event/dto/UserCreateMessageDto.kt @@ -4,6 +4,7 @@ data class UserCreateMessageDto( val userId: Int, val nickname: String, val state: Boolean, + val imageUrl: String, val createdAt: String, val updatedAt: String ) diff --git a/src/main/kotlin/com/fitmate/myfit/adapter/in/event/mapper/UserForReadMapper.kt b/src/main/kotlin/com/fitmate/myfit/adapter/in/event/mapper/UserForReadMapper.kt index 1264ee4..5305cf1 100644 --- a/src/main/kotlin/com/fitmate/myfit/adapter/in/event/mapper/UserForReadMapper.kt +++ b/src/main/kotlin/com/fitmate/myfit/adapter/in/event/mapper/UserForReadMapper.kt @@ -54,6 +54,7 @@ class UserForReadMapper { userCreateMessageDto.userId, userCreateMessageDto.nickname, userCreateMessageDto.state, + userCreateMessageDto.imageUrl, eventPublisher ) diff --git a/src/main/kotlin/com/fitmate/myfit/adapter/out/persistence/entity/UserForReadEntity.kt b/src/main/kotlin/com/fitmate/myfit/adapter/out/persistence/entity/UserForReadEntity.kt index 2db0c79..15304e4 100644 --- a/src/main/kotlin/com/fitmate/myfit/adapter/out/persistence/entity/UserForReadEntity.kt +++ b/src/main/kotlin/com/fitmate/myfit/adapter/out/persistence/entity/UserForReadEntity.kt @@ -9,6 +9,7 @@ import java.time.Instant class UserForReadEntity( @Column(nullable = false) val userId: Int, @Column(nullable = false) var nickname: String, + @Column(nullable = true) var imageUrl: String, createUser: String ) : BaseEntity(GlobalStatus.PERSISTENCE_NOT_DELETED, Instant.now(), createUser) { @@ -22,6 +23,7 @@ class UserForReadEntity( val userForReadEntity = UserForReadEntity( domain.userId, domain.nickname, + domain.imageUrl, domain.createUser ) diff --git a/src/main/kotlin/com/fitmate/myfit/application/port/in/user/command/CreateUserForReadCommand.kt b/src/main/kotlin/com/fitmate/myfit/application/port/in/user/command/CreateUserForReadCommand.kt index 38c8d44..6bb19de 100644 --- a/src/main/kotlin/com/fitmate/myfit/application/port/in/user/command/CreateUserForReadCommand.kt +++ b/src/main/kotlin/com/fitmate/myfit/application/port/in/user/command/CreateUserForReadCommand.kt @@ -7,6 +7,7 @@ data class CreateUserForReadCommand( val userId: Int, val nickname: String, val state: Boolean, + val imageUrl: String, @field:NotEmpty val eventPublisher: String ) : SelfValidating() { } \ No newline at end of file diff --git a/src/main/kotlin/com/fitmate/myfit/application/service/dto/UserInfoResponseDto.kt b/src/main/kotlin/com/fitmate/myfit/application/service/dto/UserInfoResponseDto.kt index b29244d..1d57f3a 100644 --- a/src/main/kotlin/com/fitmate/myfit/application/service/dto/UserInfoResponseDto.kt +++ b/src/main/kotlin/com/fitmate/myfit/application/service/dto/UserInfoResponseDto.kt @@ -6,6 +6,7 @@ data class UserInfoResponseDto( val userId: Int, val nickname: String, val state: Boolean, + val imageUrl: String, val createdAt: Instant, val updatedAt: Instant ) diff --git a/src/main/kotlin/com/fitmate/myfit/domain/UserForRead.kt b/src/main/kotlin/com/fitmate/myfit/domain/UserForRead.kt index 27f0bf7..c7db2ce 100644 --- a/src/main/kotlin/com/fitmate/myfit/domain/UserForRead.kt +++ b/src/main/kotlin/com/fitmate/myfit/domain/UserForRead.kt @@ -11,6 +11,7 @@ class UserForRead( val id: Long?, val userId: Int, var nickname: String, + var imageUrl: String, createUser: String ) : BaseDomain(GlobalStatus.PERSISTENCE_NOT_DELETED, createdAt = Instant.now(), createUser = userId.toString()) { fun updateByUserInfo(userInfo: UserInfoResponseDto, saveUserForReadCommand: SaveUserForReadCommand) { @@ -23,6 +24,7 @@ class UserForRead( fun updateByUserCommand(createUserForReadCommand: CreateUserForReadCommand) { this.nickname = createUserForReadCommand.nickname this.state = createUserForReadCommand.state + this.imageUrl = createUserForReadCommand.imageUrl this.updatedAt = Instant.now() this.updateUser = createUserForReadCommand.eventPublisher } @@ -34,6 +36,7 @@ class UserForRead( entity.id, entity.userId, entity.nickname, + entity.imageUrl, entity.createUser ) @@ -50,6 +53,7 @@ class UserForRead( null, userInfo.userId, userInfo.nickname, + userInfo.imageUrl, saveUserForReadCommand.eventPublisher ) @@ -63,6 +67,7 @@ class UserForRead( null, command.userId, command.nickname, + command.imageUrl, command.eventPublisher ) diff --git a/src/main/resources/slack-properties.yml b/src/main/resources/slack-properties.yml new file mode 100644 index 0000000..841888e --- /dev/null +++ b/src/main/resources/slack-properties.yml @@ -0,0 +1 @@ +token: null \ No newline at end of file