-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from potenday-project/develop
Develop
- Loading branch information
Showing
79 changed files
with
1,871 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
# swagger | ||
REPOSITORY=/home/bside/311TEN003_for_swagger | ||
|
||
# local | ||
#REPOSITORY=/Users/dongseoklee/github/311TEN003 | ||
|
||
# common | ||
PROJECT_LOCATION_FOLDER_NAME=server | ||
PROJECT_NAME=bside_311 | ||
|
||
cd $REPOSITORY/$PROJECT_LOCATION_FOLDER_NAME/ | ||
|
||
echo "> Git reset --hard" | ||
git reset --hard | ||
|
||
echo "> Git Pull" | ||
|
||
git pull | ||
|
||
echo "Release Version Updated" | ||
#grep "^Release" ./releasenote.txt | tail -1 > ./src/main/frontend/public/latestReleaseVer.txt | ||
|
||
|
||
echo "> gradlew, deploy-swagger.sh 권한 변경 " | ||
chmod 777 gradlew | ||
chmod 774 scripts/deploy-swagger.sh | ||
|
||
echo "> 프로젝트 Build 시작" | ||
./gradlew build --exclude-task test | ||
|
||
echo "> Build 파일 복사" | ||
|
||
cp ./build/libs/*.jar $REPOSITORY/ | ||
|
||
echo "> 현재 구동중인 애플리케이션 pid 확인" | ||
|
||
#CURRENT_PID=$(pgrep -f ${PROJECT_NAME}.*.jar) | ||
CURRENT_PID=$(pgrep -f "active=swagger") | ||
|
||
echo "$CURRENT_PID" | ||
|
||
if [ -z "$CURRENT_PID" ]; then | ||
echo "> 현재 구동중인 애플리케이션이 없으므로 종료하지 않습니다." | ||
else | ||
echo "> kill -2 $CURRENT_PID" | ||
kill -9 "$CURRENT_PID" | ||
sleep 10 | ||
fi | ||
|
||
echo "> 새 어플리케이션 배포" | ||
|
||
# JAR_NAME=$(ls $REPOSITORY/ |grep jar | tail -n 1) | ||
JAR_NAME=$(ls $REPOSITORY/ |grep ${PROJECT_NAME}.*.jar | tail -n 1) | ||
|
||
echo "> JAR Name: $JAR_NAME" | ||
|
||
nohup java -jar $REPOSITORY/"$JAR_NAME" --spring.profiles.active=swagger & | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.bside.bside_311; | ||
|
||
import com.bside.bside_311.entity.Post; | ||
|
||
public class PostDomain extends Post { | ||
|
||
public static PostDomain of(Post post) throws CloneNotSupportedException { | ||
return (PostDomain) Post.of(post); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
server/src/main/java/com/bside/bside_311/PostDomainMultiple.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.bside.bside_311; | ||
|
||
import com.bside.bside_311.dto.GetPostVo; | ||
import com.bside.bside_311.dto.GetPostsMvo; | ||
import com.bside.bside_311.dto.PostResponseDto; | ||
import com.bside.bside_311.entity.Post; | ||
import com.bside.bside_311.repository.PostMybatisRepository; | ||
import com.bside.bside_311.repository.PostRepository; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.List; | ||
|
||
@Builder | ||
@Setter | ||
@AllArgsConstructor | ||
public class PostDomainMultiple { | ||
private final PostRepository postRepository; | ||
private final PostMybatisRepository postMybatisRepository; | ||
List<PostDomain> postDomainList; | ||
// List<PostResponseDto> postDomainList; | ||
Long totalCount; | ||
|
||
|
||
|
||
public static PostDomainMultiple init(PostRepository postRepository, PostMybatisRepository postMybatisRepository){ | ||
return PostDomainMultiple.builder().postRepository(postRepository).postMybatisRepository(postMybatisRepository).build(); | ||
} | ||
|
||
public static PostDomainMultiple of(GetPostVo getPostVo, PostRepository postRepository, PostMybatisRepository postMybatisRepository) { | ||
PostDomainMultiple postDomainMultiple = init(postRepository, postMybatisRepository); | ||
List<GetPostsMvo> getPostsMvos = postMybatisRepository.getPosts(getPostVo); | ||
Long totalCount = postMybatisRepository.getPostsCount(getPostVo); | ||
List<Post> posts = getPostsMvos.stream().map(Post::of).toList(); | ||
List<PostDomain> list = posts.stream().map(post -> { | ||
try { | ||
return PostDomain.of(post); | ||
} catch (CloneNotSupportedException e) { | ||
throw new RuntimeException(e); | ||
} | ||
}).toList(); | ||
postDomainMultiple.setPostDomainList(list); | ||
postDomainMultiple.setTotalCount(totalCount); | ||
return postDomainMultiple; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
server/src/main/java/com/bside/bside_311/config/JpaConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.bside.bside_311.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | ||
|
||
@Profile("!test") | ||
@Configuration | ||
@EnableJpaAuditing | ||
public class JpaConfiguration { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.