Skip to content

Commit

Permalink
Merge pull request #14 from Ha-dam/feat/13-CICD
Browse files Browse the repository at this point in the history
feat: create Dockerfile
  • Loading branch information
ziiyouth authored Dec 8, 2023
2 parents b5bd877 + 381264f commit de0e73b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM openjdk:17
COPY ./build/libs/hadam-0.0.1-SNAPSHOT.jar app.jar
ENTRYPOINT ["java", "-jar", "app.jar"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CheckController {

@GetMapping("/api/check")
public String check() {
return "Ok!";
return "Hadam Ok!";
}

}
4 changes: 2 additions & 2 deletions src/main/java/com/hadam/hadam/repository/DiaryRepository.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.hadam.hadam.repository;

import com.hadam.hadam.domain.Diary;
import com.hadam.hadam.global.error.exception.EntityNotFoundException;
import com.hadam.hadam.global.error.exception.ErrorCode;
import jakarta.persistence.EntityNotFoundException;
import org.springframework.data.jpa.repository.JpaRepository;

public interface DiaryRepository extends JpaRepository<Diary, Long> {

default Diary findByIdOrThrow(Long diaryId){
return findById(diaryId)
.orElseThrow(()-> new EntityNotFoundException(String.valueOf(ErrorCode.ENTITY_NOT_FOUND)));
.orElseThrow(()-> new EntityNotFoundException(ErrorCode.ENTITY_NOT_FOUND));
}
}

0 comments on commit de0e73b

Please sign in to comment.