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

API - v0.1.0 #112

Merged
merged 34 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bc09334
[feat] archiving 정보 보여주기 기능 구현 (#58)
wjdtkdgns Jul 24, 2023
d1f7327
[refac] user 리팩토링 (#60)
wjdtkdgns Jul 24, 2023
bed7795
[refac] 검색 리팩토링 및 최근 검색어 삭제 기능 추가 (#62)
wjdtkdgns Jul 26, 2023
42c73df
[feat] 태그 검색 기능 추가 및 validation 추가 (#64)
wjdtkdgns Jul 26, 2023
8f190f3
[fix] 빈 파람값 validation 추가 (#67)
wjdtkdgns Jul 27, 2023
9b1b87c
[refac] oauth 탈퇴 provider 로직 수정, 애플 로그인 변수 적용 및 로직 변경 (#69)
wjdtkdgns Jul 27, 2023
f256d45
[feat] 유저 회원가입시 유저 정보 가져오기 구현 (#70)
wjdtkdgns Jul 28, 2023
c0fc12e
[fix] security 허용 변경
wjdtkdgns Jul 31, 2023
7da69d3
[refac] recycle 리팩토링 및 s3 object 삭제 추가 (#73)
wjdtkdgns Jul 31, 2023
ec87e9e
[refac] report, block 리팩토링 (#75)
wjdtkdgns Aug 1, 2023
a4ab7a6
[fix] 아카이빙 스크랩 안되는 오류 해결 (#77)
wjdtkdgns Aug 1, 2023
17362d4
[feat] swagger 비밀번호 설정 (#79)
wjdtkdgns Aug 2, 2023
4bd3861
[fix] 컨텐츠 개수 구하기 로직 수정 (#81)
wjdtkdgns Aug 2, 2023
7d24195
[fix] user 정보 불러오기 count 오류 해결 (#83)
wjdtkdgns Aug 2, 2023
b889861
[refac] validation 수정 (#85)
wjdtkdgns Aug 2, 2023
56a2cc1
[feat] 컨텐츠 정보 수정시 사용할 정보 가져오기 기능 추가 (#87)
wjdtkdgns Aug 3, 2023
971da20
[refac] exception 세분화 및 validation 정리 (#89)
wjdtkdgns Aug 4, 2023
ba759cb
[fix] 컨텐츠 수정시 아카이빙 count 개수 안변함 (#91)
wjdtkdgns Aug 4, 2023
d18b1f4
[fix] 유저 presigned url 로직 수정
wjdtkdgns Aug 4, 2023
718b962
[fix] asset url return 로직 수정
wjdtkdgns Aug 7, 2023
f9b8bc2
[fix] 컨텐츠 업데이트 로직 변경 #92
wjdtkdgns Aug 8, 2023
987630e
[chore] spotless 적용 #92
wjdtkdgns Aug 8, 2023
8a0bd2a
[fix] 아카이빙 컨텐츠 개수 에러 (#94)
wjdtkdgns Aug 13, 2023
9127ceb
[refac] 검색하기 로직 수정 (#98)
wjdtkdgns Aug 13, 2023
6893c31
[feat] 인기 아카이빙 리스트 불러오기 (#99)
wjdtkdgns Aug 14, 2023
cb6d6b2
[fix] apple 토큰 오류 해결 (#100)
wjdtkdgns Aug 14, 2023
5a46fc1
[fix] apple 토큰 오류 해결 (#101)
wjdtkdgns Aug 14, 2023
caee094
[add] 에러 확인용 log 추가 #97
wjdtkdgns Aug 14, 2023
59e5e14
[fix] archiving response 스크랩 여부 포함하기 (#103)
wjdtkdgns Aug 15, 2023
26be511
[feat] 애플 로그인 탈퇴 구현 (#105)
wjdtkdgns Aug 15, 2023
1c2783f
[feat] 검색 결과 response에 총 검색 결과 개수 추가 (#107)
wjdtkdgns Aug 16, 2023
7797de4
[feat] 검색 로직 수정 (#109)
wjdtkdgns Aug 17, 2023
43221cc
[feat] archiving content response dateFormating 추가
wjdtkdgns Aug 17, 2023
70ca231
[feat] 회원가입시 유저 마케팅, 알람 동의 여부 포함 (#111)
wjdtkdgns Aug 18, 2023
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ out/
.env.*


Domain/src/main/generated/**/*.java
Domain/src/main/generated/**/*.java
Core/src/main/resources/static/apple/**.p8
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import allchive.server.api.archiving.model.dto.response.ArchivingContentsResponse;
import allchive.server.api.archiving.model.dto.response.ArchivingResponse;
import allchive.server.api.archiving.model.dto.response.ArchivingTitleResponse;
import allchive.server.api.archiving.model.dto.response.ArchivingsResponse;
import allchive.server.api.archiving.service.*;
import allchive.server.api.common.slice.SliceResponse;
import allchive.server.domain.domains.archiving.domain.enums.Category;
Expand All @@ -26,6 +27,7 @@
public class ArchivingController {
private final CreateArchivingUseCase createArchivingUseCase;
private final UpdateArchivingUseCase updateArchivingUseCase;
private final GetArchivingInfoUseCase getArchivingInfoUseCase;
private final DeleteArchivingUseCase deleteArchivingUseCase;
private final GetArchivingUseCase getArchivingUseCase;
private final GetArchivedArchivingUseCase getArchivedArchivingUseCase;
Expand All @@ -34,13 +36,20 @@ public class ArchivingController {
private final GetArchivingContentsUseCase getArchivingContentsUseCase;
private final UpdateArchivingScrapUseCase updateArchivingScrapUseCase;
private final UpdateArchivingPinUseCase updateArchivingPinUseCase;
private final GetPopularArchivingUseCase getPopularArchivingUseCase;

@Operation(summary = "아카이빙을 생성합니다.")
@PostMapping()
public void createArchiving(@RequestBody CreateArchivingRequest createArchivingRequest) {
createArchivingUseCase.execute(createArchivingRequest);
}

@Operation(summary = "아카이빙 정보 수정시 보여줄 정보를 가져옵니다.")
@GetMapping(value = "/{archivingId}")
public ArchivingResponse getArchiving(@PathVariable("archivingId") Long archivingId) {
return getArchivingInfoUseCase.execute(archivingId);
}

@Operation(summary = "아카이빙을 수정합니다.")
@PatchMapping(value = "/{archivingId}")
public void updateArchiving(
Expand Down Expand Up @@ -91,6 +100,12 @@ public ArchivingTitleResponse getScrapArchiving() {
return getArchivingTitleUseCase.execute();
}

@Operation(summary = "인기있는 아카이빙 5개를 가져옵니다")
@GetMapping(value = "/popular")
public ArchivingsResponse getPopularArchiving() {
return getPopularArchivingUseCase.execute();
}

@Operation(summary = "아카이빙별 컨텐츠 리스트를 가져옵니다.")
@GetMapping(value = "/{archivingId}/contents")
public ArchivingContentsResponse getArchivingContents(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

import allchive.server.api.common.slice.SliceResponse;
import allchive.server.api.content.model.dto.response.ContentResponse;
import allchive.server.core.annotation.DateFormat;
import allchive.server.domain.domains.archiving.domain.Archiving;
import allchive.server.domain.domains.archiving.domain.enums.Category;
import allchive.server.domain.domains.user.domain.User;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -15,39 +19,78 @@ public class ArchivingContentsResponse {
@Schema(description = "아카이빙 제목")
private String archivingTitle;

@Schema(description = "아카이빙 카테고리")
private Category category;

@Schema(description = "아카이빙 고유번호")
private Long archivingId;

@DateFormat
@Schema(description = "아카이빙 생성일")
private LocalDateTime createdAt;

@Schema(description = "아카이빙의 총 컨텐츠 개수")
private Long totalContentsCount;

@Schema(description = "아카이빙 소유자 고유번호")
private Long ownerId;

@Schema(description = "아카이빙 소유자 닉네임")
private String ownerNickname;

@Schema(description = "아카이빙 소유자 프로픨 이미지")
private String ownerProfileImgUrl;

@Schema(description = "유저 소유 여부")
private Boolean isMine;

@Schema(description = "아카이빙 스크랩 여부")
private Boolean isScrap;

@Builder
private ArchivingContentsResponse(
SliceResponse<ContentResponse> contents,
String archivingTitle,
Category category,
Long archivingId,
LocalDateTime createdAt,
Long totalContentsCount,
Boolean isMine) {
Long ownerId,
String ownerNickname,
String ownerProfileImgUrl,
Boolean isMine,
Boolean isScrap) {
this.contents = contents;
this.archivingTitle = archivingTitle;
this.category = category;
this.archivingId = archivingId;
this.createdAt = createdAt;
this.totalContentsCount = totalContentsCount;
this.ownerId = ownerId;
this.ownerNickname = ownerNickname;
this.ownerProfileImgUrl = ownerProfileImgUrl;
this.isMine = isMine;
this.isScrap = isScrap;
}

public static ArchivingContentsResponse of(
SliceResponse<ContentResponse> contentResponseSlice,
Archiving archiving,
Boolean isMine) {
User user,
Boolean isMine,
Boolean isScrap) {
return ArchivingContentsResponse.builder()
.archivingId(archiving.getId())
.createdAt(archiving.getCreatedAt())
.archivingTitle(archiving.getTitle())
.totalContentsCount(archiving.getScrapCnt() + archiving.getImgCnt())
.category(archiving.getCategory())
.totalContentsCount(archiving.getLinkCnt() + archiving.getImgCnt())
.contents(contentResponseSlice)
.ownerId(user.getId())
.ownerNickname(user.getNickname())
.ownerProfileImgUrl(user.getProfileImgUrl())
.isMine(isMine)
.isScrap(isScrap)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class ArchivingResponse {
@Schema(description = "아카이빙 스크랩/고정 여부, true == 스크랩/고정됨")
private boolean markStatus;

@Schema(description = "아카이빙 공개 여부")
private boolean publicStatus;

@Builder
private ArchivingResponse(
Long archivingId,
Expand All @@ -54,7 +57,8 @@ private ArchivingResponse(
Long imgCnt,
Long linkCnt,
Long scrapCnt,
boolean markStatus) {
boolean markStatus,
boolean publicStatus) {
this.archivingId = archivingId;
this.title = title;
this.imageUrl = imageUrl;
Expand All @@ -64,6 +68,7 @@ private ArchivingResponse(
this.linkCnt = linkCnt;
this.scrapCnt = scrapCnt;
this.markStatus = markStatus;
this.publicStatus = publicStatus;
}

public static ArchivingResponse of(Archiving archiving, boolean markStatus) {
Expand All @@ -77,6 +82,7 @@ public static ArchivingResponse of(Archiving archiving, boolean markStatus) {
.linkCnt(archiving.getLinkCnt())
.scrapCnt(archiving.getScrapCnt())
.markStatus(markStatus)
.publicStatus(archiving.getPublicStatus())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,95 @@


import allchive.server.api.archiving.model.vo.TitleContentCntVo;
import allchive.server.api.common.json.naming.UpperCaseStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import java.util.ArrayList;
import java.util.List;
import lombok.Builder;
import lombok.Getter;

@Getter
@JsonNaming(UpperCaseStrategy.class)
public class ArchivingTitleResponse {
private List<TitleContentCntVo> food;
private List<TitleContentCntVo> life;
private List<TitleContentCntVo> homeLiving;
private List<TitleContentCntVo> shopping;
private List<TitleContentCntVo> sport;
private List<TitleContentCntVo> selfImprovement;
private List<TitleContentCntVo> tech;
private List<TitleContentCntVo> design;
private List<TitleContentCntVo> trend;
private List<TitleContentCntVo> FOOD;
private List<TitleContentCntVo> LIFE;
private List<TitleContentCntVo> HOME_LIVING;
private List<TitleContentCntVo> SHOPPING;
private List<TitleContentCntVo> SPORT;
private List<TitleContentCntVo> SELF_IMPROVEMENT;
private List<TitleContentCntVo> TECH;
private List<TitleContentCntVo> DESIGN;
private List<TitleContentCntVo> TREND;

@Builder
private ArchivingTitleResponse(
List<TitleContentCntVo> food,
List<TitleContentCntVo> life,
List<TitleContentCntVo> homeLiving,
List<TitleContentCntVo> shopping,
List<TitleContentCntVo> sport,
List<TitleContentCntVo> selfImprovement,
List<TitleContentCntVo> tech,
List<TitleContentCntVo> design,
List<TitleContentCntVo> trend) {
this.food = food;
this.life = life;
this.homeLiving = homeLiving;
this.shopping = shopping;
this.sport = sport;
this.selfImprovement = selfImprovement;
this.tech = tech;
this.design = design;
this.trend = trend;
List<TitleContentCntVo> FOOD,
List<TitleContentCntVo> LIFE,
List<TitleContentCntVo> HOME_LIVING,
List<TitleContentCntVo> SHOPPING,
List<TitleContentCntVo> SPORT,
List<TitleContentCntVo> SELF_IMPROVEMENT,
List<TitleContentCntVo> TECH,
List<TitleContentCntVo> DESIGN,
List<TitleContentCntVo> TREND) {
this.FOOD = FOOD;
this.LIFE = LIFE;
this.HOME_LIVING = HOME_LIVING;
this.SHOPPING = SHOPPING;
this.SPORT = SPORT;
this.SELF_IMPROVEMENT = SELF_IMPROVEMENT;
this.TECH = TECH;
this.DESIGN = DESIGN;
this.TREND = TREND;
}

public static ArchivingTitleResponse init() {
return ArchivingTitleResponse.builder()
.food(new ArrayList<>())
.life(new ArrayList<>())
.homeLiving(new ArrayList<>())
.shopping(new ArrayList<>())
.sport(new ArrayList<>())
.selfImprovement(new ArrayList<>())
.tech(new ArrayList<>())
.design(new ArrayList<>())
.trend(new ArrayList<>())
.FOOD(new ArrayList<>())
.LIFE(new ArrayList<>())
.HOME_LIVING(new ArrayList<>())
.SHOPPING(new ArrayList<>())
.SPORT(new ArrayList<>())
.SELF_IMPROVEMENT(new ArrayList<>())
.TECH(new ArrayList<>())
.DESIGN(new ArrayList<>())
.TREND(new ArrayList<>())
.build();
}

public void addFood(TitleContentCntVo vo) {
this.food.add(vo);
this.FOOD.add(vo);
}

public void addLife(TitleContentCntVo vo) {
this.life.add(vo);
this.LIFE.add(vo);
}

public void addHomeLiving(TitleContentCntVo vo) {
this.homeLiving.add(vo);
this.HOME_LIVING.add(vo);
}

public void addShopping(TitleContentCntVo vo) {
this.shopping.add(vo);
this.SHOPPING.add(vo);
}

public void addSport(TitleContentCntVo vo) {
this.sport.add(vo);
this.SPORT.add(vo);
}

public void addSelfImprovement(TitleContentCntVo vo) {
this.selfImprovement.add(vo);
this.SELF_IMPROVEMENT.add(vo);
}

public void addTech(TitleContentCntVo vo) {
this.tech.add(vo);
this.TECH.add(vo);
}

public void addDesign(TitleContentCntVo vo) {
this.design.add(vo);
this.DESIGN.add(vo);
}

public void addTrend(TitleContentCntVo vo) {
this.trend.add(vo);
this.TREND.add(vo);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package allchive.server.api.archiving.model.dto.response;


import java.util.List;
import lombok.Builder;
import lombok.Getter;

@Getter
public class ArchivingsResponse {
List<ArchivingResponse> archivings;

@Builder
private ArchivingsResponse(List<ArchivingResponse> archivings) {
this.archivings = archivings;
}

public static ArchivingsResponse of(List<ArchivingResponse> archivings) {
return ArchivingsResponse.builder().archivings(archivings).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@

@Getter
public class TitleContentCntVo {
@Schema(description = "아카이빙 고유 아이디")
private Long archivingId;

@Schema(defaultValue = "아카이빙 제목", description = "아카이빙 제목")
private String title;

@Schema(defaultValue = "1", description = "아카이빙에 속한 컨텐츠 총 개수")
private Long contentCnt;

@Builder
private TitleContentCntVo(String title, Long contentCnt) {
private TitleContentCntVo(Long archivingId, String title, Long contentCnt) {
this.archivingId = archivingId;
this.title = title;
this.contentCnt = contentCnt;
}

public static TitleContentCntVo from(Archiving archiving) {
return TitleContentCntVo.builder()
.contentCnt(archiving.getImgCnt() + archiving.getScrapCnt())
.archivingId(archiving.getId())
.contentCnt(archiving.getImgCnt() + archiving.getLinkCnt())
.title(archiving.getTitle())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ public void execute(Long archivingId) {

private void validateExecution(Long archivingId, Long userId) {
archivingValidator.verifyUser(userId, archivingId);
archivingValidator.validateNotDeleted(archivingId);
}
}
Loading
Loading