Skip to content

Commit

Permalink
Merge branch 'release/20240608'
Browse files Browse the repository at this point in the history
  • Loading branch information
dragontaek-lee committed Jun 8, 2024
2 parents 6da6853 + a3df2f5 commit 9912481
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 16 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/cd-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@ jobs:
run: cp ./scripts/*.sh ./deploy

- name: Make zip file
run: zip -r ./gam-dev-server.zip ./deploy
run: zip -r ./$GITHUB_SHA.zip ./deploy
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-access-key-id: ${{ secrets.AWS_CONFIG_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_CONFIG_SECRET_KEY }}
aws-region: ap-northeast-2

- name: Upload to S3
run: aws s3 cp --region ap-northeast-2 ./gam-dev-server.zip s3://$S3_BUCKET_NAME/
run: aws s3 cp --region ap-northeast-2 ./$GITHUB_SHA.zip s3://${{ secrets.AWS_S3_BUCKET_NAME }}/dev/$GITHUB_SHA.zip

# Deploy
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CONFIG_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CONFIG_SECRET_KEY }}
run:
aws deploy create-deployment
--application-name gam-dev-codedeploy
--deployment-group-name gam-dev-server-codedeploy-group
--file-exists-behavior OVERWRITE
--s3-location bucket=gam-dev-deploy,bundleType=zip,key=gam-dev-server.zip
--application-name gam-codeDeploy
--deployment-group-name dev
--file-exists-behavior OVERWRITE
--s3-location bucket=${{ secrets.AWS_S3_BUCKET_NAME }},bundleType=zip,key=dev/$GITHUB_SHA.zip
--region ap-northeast-2
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## ❤️ 기획 배경
<b> 디자이너들의 '감'잡는 커뮤니티 플렛폼 `"GAM"`입니다. </b> <br>
디자이너들이 모여, 크리에이티브한 <b> 작업물을 공유하고 소통하는 플렛폼 구축</b> 을 목표로 하고 있습니다. <br>
디자이너 내 <b>`'공유 문화'`</b>를 확산하여, 디자인 커뮤니티의 성장과 발전을 촉진하며, 디자이너들의 위상과 가치를 높이고자 합니다. <br>

![image](https://github.com/Gam-develop/gam-server/assets/77230391/09393866-3c65-450b-ad8e-53e2ac486e5e)

<br>

### ❕ 현재 진행상황
2024년 6월 1차 릴리즈 준비중!
<br> <br>




## ⚒️ Backend Introduction
### 📁 프로젝트 구조
![KakaoTalk_20240605_104511643](https://github.com/Gam-develop/gam-server/assets/77871898/57b3e927-d73a-41dd-8c72-970b012147c7)

<br>

### 📄 프로젝트 ERD
![GAM_Erd](https://github.com/Gam-develop/gam-server/assets/77230391/a4c9f8ca-37ad-46f6-a722-8cab2be3a5bd)
<br>

<br>

### ⚒️ 사용 기술 스택
- Spring, Spring JPA, Spring Security, PostgreSQL,
- AWS - EC2, S3, RDS, Code Deploy, Presigned URL, ALB, WAF
- Nginx, Github Action, Swagger

<br>

### 👨‍👦 백엔드 팀원
<table>
<tr>
<td align="center">
<a href="https://github.com/GaHee99](https://github.com/dragontaek-lee">
<img
src="https://github.com/Gam-develop/gam-server/assets/77230391/7d656b32-d1b0-4981-b6a1-3d060315cc0b"
width="100px;"/>
<br />이용택(BE)</a><br />
</td>
<td align="center">
<a href="https://github.com/GaHee99">
<img
src="https://github-production-user-asset-6210df.s3.amazonaws.com/77230391/335972318-4606bc8c-4d8e-466b-9b57-1e8bd78ffcb7.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240603%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240603T071717Z&X-Amz-Expires=300&X-Amz-Signature=a20308d1c85dca65f200d38ae4e5f814e4293b93097383d1f613f431f9565f59&X-Amz-SignedHeaders=host&actor_id=77230391&key_id=0&repo_id=802793179"
width="100px;"
/><br />최가희(BE)</a><br />
</td>
<td align="center">
<a href="https://github.com/kjy-asl">
<img
src="https://github.com/Wagu-Wagu/Waffle-party-BE/assets/77230391/acfc7443-54ae-4be9-aa34-5c2d2752b4e8"
width="100px;"
/><br />김주영(BE)</a><br />
</td>
</tr>
</table>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public interface MagazineRepository extends JpaRepository<Magazine, Long> {
Optional<Magazine> getMagazineById(Long magazineId);
List<Magazine> findMagazinesByOrderByViewCountDesc();
List<Magazine> findMagazinesByOrderByCreatedAtDesc();
List<Magazine> findTop3ByOrderByViewCountDesc();
List<Magazine> findAllByOrderByModifiedAtDescCreatedAtDesc();
@Query("SELECT m FROM Magazine m WHERE LOWER(m.interviewPerson) LIKE LOWER(CONCAT('%', :interviewPersonKeyword, '%')) OR LOWER(m.magazineTitle) LIKE LOWER(CONCAT('%', :magazineTitleKeyword, '%')) ORDER BY m.createdAt DESC")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class MagazineServiceImpl implements MagazineService {
public MagazineResponseDTO getMagazines(Long userId) {
val user = findUser(userId);
val magazineScrapList = getMagazineScrapList(user);
val magazineList = magazineRepository.findMagazinesByOrderByViewCountDesc();
val magazineList = magazineRepository.findMagazinesByOrderByCreatedAtDesc();

return MagazineResponseDTO.of(magazineList, magazineScrapList, gamConfig.getMagaineBaseUrl());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private SocialLoginResponseDTO SignUpAndLogin(
) {
val user = userRepository.save(User.builder()
.role(Role.USER)
.userStatus(UserStatus.PERMITTED)
.userStatus(UserStatus.NOT_PERMITTED)
.build());

val userId = user.getId();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/gam/api/domain/user/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public class User extends TimeStamped {
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
List<MagazineScrap> magazineScraps = new ArrayList<>();

@Where(clause = "is_active = true")
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL)
List<Work> works = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ public void onboardUser(Long userId, UserOnboardRequestDTO userOnboardRequestDTO

createUserTags(tags, user);
user.onboardUser(userName, info, tags);
user.setUserStatus(UserStatus.PERMITTED);
}

@Override
Expand Down Expand Up @@ -251,7 +252,7 @@ public List<UserResponseDTO> getPopularDesigners(Long userId) { //TODO - 쿼리
return UserResponseDTO.of(user, userScrap.isStatus());
}
return UserResponseDTO.of(user, false);
}).collect(Collectors.toList());
}).collect(Collectors.toList());
}

@Override
Expand Down Expand Up @@ -290,6 +291,7 @@ public List<UserDiscoveryResponseDTO> getDiscoveryUsers(Long userId, int[] tags)
users = userRepository.findAllDiscoveryUserWithTag(userId, tags);
}


return users.stream().map((dto) -> {
val firstWorkId = dto.user().getFirstWorkId();
Work firstWork;
Expand All @@ -309,7 +311,6 @@ public List<UserDiscoveryResponseDTO> getDiscoveryUsers(Long userId, int[] tags)
.filter(work -> dto.user().getFirstWorkId().equals(work.getId()))
.findFirst().get();
}

val userScrap = dto.scrapStatus();
if (Objects.isNull(userScrap)) {
return UserDiscoveryResponseDTO.of(dto.user(), false, firstWork);
Expand Down Expand Up @@ -338,7 +339,7 @@ public void deleteUserAccount(Long userId, UserDeleteAccountRequestDTO userDelet
public UserStatusResponseDTO getUserStatus(Long userId) {
val user = findUser(userId);
return UserStatusResponseDTO.of(user);
}
}

@Transactional
@Override
Expand Down

0 comments on commit 9912481

Please sign in to comment.