Skip to content

Commit

Permalink
Merge branch 'develop' into feature/68
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeokson authored Aug 11, 2024
2 parents 81da874 + be6c128 commit 2898fa8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
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

0 comments on commit 2898fa8

Please sign in to comment.