diff --git a/src/main/kotlin/com/example/onui/domain/mission/entity/Mission.kt b/src/main/kotlin/com/example/onui/domain/mission/entity/Mission.kt index bc76092..1c8d824 100644 --- a/src/main/kotlin/com/example/onui/domain/mission/entity/Mission.kt +++ b/src/main/kotlin/com/example/onui/domain/mission/entity/Mission.kt @@ -26,7 +26,7 @@ class Mission( var goal: String = goal protected set - @Column(name = "message", nullable = false, unique = true) + @Column(name = "message", nullable = false) var message: String = message protected set diff --git a/src/main/kotlin/com/example/onui/domain/mission/repository/MissionRepository.kt b/src/main/kotlin/com/example/onui/domain/mission/repository/MissionRepository.kt index 095797c..ed4b2b6 100644 --- a/src/main/kotlin/com/example/onui/domain/mission/repository/MissionRepository.kt +++ b/src/main/kotlin/com/example/onui/domain/mission/repository/MissionRepository.kt @@ -9,7 +9,5 @@ import java.util.* @Repository interface MissionRepository : JpaRepository { - fun existsByMessage(message: String): Boolean - fun findAllByMissionType(missionType: MissionType): MutableList } \ No newline at end of file diff --git a/src/main/kotlin/com/example/onui/domain/mission/service/MissionServiceImpl.kt b/src/main/kotlin/com/example/onui/domain/mission/service/MissionServiceImpl.kt index 3d0fd80..780b9b7 100644 --- a/src/main/kotlin/com/example/onui/domain/mission/service/MissionServiceImpl.kt +++ b/src/main/kotlin/com/example/onui/domain/mission/service/MissionServiceImpl.kt @@ -3,7 +3,6 @@ import com.example.onui.domain.mission.entity.AssignMission import com.example.onui.domain.mission.entity.Mission import com.example.onui.domain.mission.entity.MissionType -import com.example.onui.domain.mission.exception.AlreadyCreatedMissionException import com.example.onui.domain.mission.exception.TypeCoastMissMatchedMissionException import com.example.onui.domain.mission.presentation.dto.request.CreateMissionRequest import com.example.onui.domain.mission.presentation.dto.response.MissionListResponse @@ -30,13 +29,12 @@ class MissionServiceImpl( userFacade.getAdmin() if (req.missionType!! == MissionType.ASSIGN && req.coast == null) throw TypeCoastMissMatchedMissionException - if (missionRepository.existsByMessage(req.message!!)) throw AlreadyCreatedMissionException val mission = missionRepository.save( Mission( req.name!!, req.goal!!, - req.message, + req.message!!, req.missionType ) )