Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] 공유 url 조회하는 api 수정 #70

Merged
merged 36 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b91a85f
infra: 빌드 테스트 yml 작성
DrRivaski Aug 4, 2024
ffd6afb
Merge branch 'refs/heads/develop' into feature/33
DrRivaski Aug 5, 2024
4c6ae62
infra: DB 정보 추가
DrRivaski Aug 5, 2024
ad7d92e
infra: ssh-agent 버전 변경
DrRivaski Aug 5, 2024
14d1887
infra: known_hosts 추가
DrRivaski Aug 5, 2024
31f31a8
infra: db port 변경
DrRivaski Aug 5, 2024
da5c7dc
infra: database test 설정 변경
DrRivaski Aug 5, 2024
05054ab
infra: DB 환경변수 설정 및 application.yml 생성
DrRivaski Aug 5, 2024
372f84c
infra: application.yml 동적 생성 스크립트 수정
DrRivaski Aug 5, 2024
57b7bd1
infra: 레디스 설정 추가
DrRivaski Aug 6, 2024
efb92c9
infra: redis test 추가
DrRivaski Aug 6, 2024
babd1a8
infra: redis 버전 변경
DrRivaski Aug 6, 2024
be93408
infra: redis cli 설치
DrRivaski Aug 6, 2024
212a34c
infra: application.yml 위치 및 내용 확인
DrRivaski Aug 6, 2024
db65184
infra: Github Actions 환경변수에 REDIS_HOST, REDIS_PORT 추가
DrRivaski Aug 6, 2024
4658edd
infra: 환경변수 확인 추가
DrRivaski Aug 6, 2024
bcfb880
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 6, 2024
1706d79
feat: draw_rank column 이름 수정
DrRivaski Aug 6, 2024
8d5e4c8
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 6, 2024
55edd9c
infra: pull_request시 Github Actions 동작하도록 수정
DrRivaski Aug 6, 2024
f1ebddf
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 6, 2024
89b5c0f
cicd test (#54)
hyeokson Aug 6, 2024
409fcd1
[Feat] 기대평 기능 구현 (#57)
hyeokson Aug 8, 2024
d42d605
cicd test (#58)
hyeokson Aug 9, 2024
72ee18b
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 9, 2024
3122173
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 9, 2024
5ef341c
refactor: 공유 url 조회하는 레포지토리 변경
DrRivaski Aug 11, 2024
6a5bd87
refactor: 잘못 작성된 메서드 삭제
DrRivaski Aug 11, 2024
3f71fac
refactor: 사용되지 않는 shareInfoRepository 삭제
DrRivaski Aug 11, 2024
f299e93
refactor: 변수명 변경
DrRivaski Aug 11, 2024
0e2f44d
[Feat] 성공, 실패 상태 코드 수정하기 (#65)
hyeokson Aug 10, 2024
d27eb9d
[Feat]Admin Api 구현 (#67)
hyeokson Aug 10, 2024
9faa347
infra: 레디스 설정 추가
DrRivaski Aug 6, 2024
6fbc9c8
[Feat] 기대평 기능 구현 (#57)
hyeokson Aug 8, 2024
901f61f
Merge branch 'refs/heads/develop' into feature/69
DrRivaski Aug 11, 2024
5a55ba8
Merge branch 'develop' into feature/69
DrRivaski Aug 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ dependencies {
//DatatypeConverter
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.1'

// Google Simple JSON
implementation "com.googlecode.json-simple:json-simple:1.1.1"

//DatatypeConverter
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.1'

// JPA 설정
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
@Service
@RequiredArgsConstructor
public class DrawService {
private final DrawRepository drawRepository;
// private final DrawRepository drawRepository;
private final DrawParticipationInfoRepository drawParticipationInfoRepository;
private final ShareInfoRepository shareInfoRepository;
private final ShareUrlInfoRepository shareUrlInfoRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@

@Repository
public interface ShareInfoRepository extends JpaRepository<ShareInfo, Integer> {
Optional<String> findSharedUrlByUserId(Integer userId);
Optional<ShareInfo> findShareInfoByUserId(Integer userId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.softeer.backend.fo_domain.share.dto.ShareUrlResponseDto;
import com.softeer.backend.fo_domain.share.exception.ShareInfoException;
import com.softeer.backend.fo_domain.share.repository.ShareInfoRepository;
import com.softeer.backend.fo_domain.share.repository.ShareUrlInfoRepository;
import com.softeer.backend.global.common.code.status.ErrorStatus;
import com.softeer.backend.global.common.response.ResponseDto;
import lombok.RequiredArgsConstructor;
Expand All @@ -11,16 +12,16 @@
@Service
@RequiredArgsConstructor
public class ShareInfoService {
private final ShareInfoRepository shareInfoRepository;
private final ShareUrlInfoRepository shareUrlInfoRepository;

public ResponseDto<ShareUrlResponseDto> getShortenShareUrl(Integer userId) {
String sharedUrl = shareInfoRepository.findSharedUrlByUserId(userId).orElseThrow(
String shareUrl = shareUrlInfoRepository.findShareUrlByUserId(userId).orElseThrow(
() -> new ShareInfoException(ErrorStatus._NOT_FOUND)
);

// 만약 DB에 이미 생성된 단축 url이 있다면 반환
// DB에 이미 생성된 단축 url 반환
return ResponseDto.onSuccess(ShareUrlResponseDto.builder()
.shareUrl(sharedUrl)
.shareUrl(shareUrl)
.build());
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.softeer.backend.fo_domain.user.dto;



import com.softeer.backend.global.common.constant.ValidationConstant;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
Expand Down
Loading