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

[Feat] 공유 url 반환 api 구현 #94

Merged
merged 54 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 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
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
a63f49a
[Refactor] 공유 url 조회하는 api 수정 (#70)
DrRivaski Aug 11, 2024
402432f
[Refactor] 공유 url 조회하는 api 수정 (#70)
DrRivaski Aug 11, 2024
a88eed7
[Feature] static text를 관리하는 enum 구현 (#71)
hyeokson Aug 11, 2024
cf8557f
[Refactor] MainPageController 클래스명 변경 (#72)
hyeokson Aug 11, 2024
f26769f
[Feature] 메인 페이지 GET API 구현하기 (#73)
hyeokson Aug 11, 2024
298efef
[Feature] 어드민 회원가입 기능 구현 (#75)
hyeokson Aug 11, 2024
315b0a6
[Feature] 특정 url에 대해 인가 검사 하지 않도록 구현 (#76)
hyeokson Aug 11, 2024
8675b99
[Refactor] 공유 url 조회하는 api 수정 (#70)
DrRivaski Aug 11, 2024
7c2c6e6
[Refactor] 사용자 생성 시 추첨 참여 정보, 공유 링크 정보, 공유 정보 생성 (#78)
DrRivaski Aug 12, 2024
9c59a7d
[Refactor] 공유 url 조회하는 api 수정 (#70)
DrRivaski Aug 11, 2024
193b559
[Refactor] 사용자 생성 시 추첨 참여 정보, 공유 링크 정보, 공유 정보 생성 (#78)
DrRivaski Aug 12, 2024
21e3305
[Refactor] MainPageCarResponseDto 필드 변경 (#79)
hyeokson Aug 12, 2024
d870037
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 12, 2024
d9d5e5e
Merge branch 'develop' of https://github.com/softeerbootcamp4th/Team2…
DrRivaski Aug 12, 2024
f3f7d76
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 12, 2024
77d7037
Merge remote-tracking branch 'upstream/develop' into develop
DrRivaski Aug 12, 2024
e51e5b6
refactor: 사용하지 않는 import문 제거
DrRivaski Aug 12, 2024
548d508
refactor: 클래스명 변경
DrRivaski Aug 12, 2024
9dfe115
refactor: 클래스명 변경
DrRivaski Aug 12, 2024
c1ea8bb
refactor: 클래스명 변경
DrRivaski Aug 12, 2024
7e7743b
feat: optionalAuthUrls에 공유 url 반환하는 링크 추가
DrRivaski Aug 12, 2024
af9b50f
feat: StaticText에 공유 url 추가
DrRivaski Aug 12, 2024
5f7d55a
feat: 로그인 여부에 따른 공유 url 반환 로직 구현
DrRivaski Aug 12, 2024
f7a5161
refactor: 메인 페이지 url 수정
DrRivaski Aug 12, 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.softeer.backend.fo_domain.share.controller;

import com.softeer.backend.fo_domain.share.dto.ShareUrlResponseDto;
import com.softeer.backend.fo_domain.share.service.ShareInfoService;
import com.softeer.backend.fo_domain.share.dto.ShareUrlInfoResponseDto;
import com.softeer.backend.fo_domain.share.service.ShareUrlInfoService;
import com.softeer.backend.global.annotation.AuthInfo;
import com.softeer.backend.global.common.response.ResponseDto;
import lombok.RequiredArgsConstructor;
Expand All @@ -10,11 +10,11 @@

@RestController
@RequiredArgsConstructor
public class ShareInfoController {
private final ShareInfoService shareInfoService;
public class ShareController {
private final ShareUrlInfoService shareUrlInfoService;

@GetMapping("/share-shorten-url")
public ResponseDto<ShareUrlResponseDto> getShortenShareUrl(@AuthInfo Integer userId) {
return shareInfoService.getShortenShareUrl(userId);
public ResponseDto<ShareUrlInfoResponseDto> getShortenShareUrl(@AuthInfo Integer userId) {
return shareUrlInfoService.getShortenShareUrl(userId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.softeer.backend.fo_domain.share.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ShareUrlInfoResponseDto {
private String shareUrl;
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.softeer.backend.fo_domain.share.service;

import com.softeer.backend.fo_domain.share.dto.ShareUrlInfoResponseDto;
import com.softeer.backend.fo_domain.share.exception.ShareInfoException;
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 com.softeer.backend.global.staticresources.util.StaticResourcesUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class ShareUrlInfoService {
private final ShareUrlInfoRepository shareUrlInfoRepository;
private final StaticResourcesUtil staticResourcesUtil;

public ResponseDto<ShareUrlInfoResponseDto> getShortenShareUrl(Integer userId) {
if (userId == null) {
// 로그인하지 않은 사용자
return ResponseDto.onSuccess(ShareUrlInfoResponseDto.builder()
.shareUrl(staticResourcesUtil.getData("NON_USER_SHARE_URL"))
.build());
} else {
// 로그인한 사용자
String shareUrl = shareUrlInfoRepository.findShareUrlByUserId(userId).orElseThrow(
() -> new ShareInfoException(ErrorStatus._NOT_FOUND)
);

// DB에 이미 생성된 단축 url 반환
return ResponseDto.onSuccess(ShareUrlInfoResponseDto.builder()
.shareUrl(staticResourcesUtil.getData("BASE_URL") + shareUrl)
.build());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {

// Access Token이 header에 있으면 인증하고 없으면 인증하지 않는 url 설정
private final String[] optionalAuthUrls = {
"/comment"
"/comment",
"/share-shorten-url"
};

private final JwtUtil jwtUtil;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ public enum StaticText {
FULL_ATTEND_MODAL_SUBTITLE("등록된 번호로 스타벅스 기프티콘을 보내드려요."),
FULL_ATTEND_MODAL_DESCRIPTION("본 이벤트는 The new IONIQ 5 출시 이벤트 기간 내 한 회선당 1회만 참여 가능합니다.\n" +
"이벤트 경품 수령을 위해 등록된 전화번호로 영업일 기준 3~5일 내 개별 안내가 진행될 예정입니다.\n" +
"이벤트 당첨 이후 개인정보 제공을 거부하거나 개별 안내를 거부하는 경우, 당첨이 취소될 수 있습니다.\n");
"이벤트 당첨 이후 개인정보 제공을 거부하거나 개별 안내를 거부하는 경우, 당첨이 취소될 수 있습니다.\n"),

// 공유 url
BASE_URL("https://softeer.shop/"),
NON_USER_SHARE_URL("https://softeer.site");


private final String text;
Expand Down
Loading