Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -29,6 +29,16 @@ public class AdminController {
private final AdminService adminService;
private final JwtTokenProvider jwtTokenProvider;

@GetMapping("/admin/introductions")
@Operation(summary = "학회 소개 정보 조회", description = "학회 소개 페이지의 현재 저장된 정보를 조회합니다.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "500", description = "INTER SERVER ERROR", content = @Content(schema = @Schema(implementation = BaseResponse.class))),
})
public ResponseEntity<BaseResponse> getIntroduction() {
return ResponseEntity.ok(new BaseResponse(introService.getAdminIntroduction()));
}

@Hidden
@PostMapping(value = "/admin/introductions", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ResponseEntity<BaseResponse> addIntroduction(@ModelAttribute IntroRequest request) {
Expand Down
251 changes: 198 additions & 53 deletions src/main/java/com/kusitms/website/domain/introduction/IntroService.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.kusitms.website.domain.introduction.dto.request;

import com.kusitms.website.domain.introduction.entity.Activity;
import com.kusitms.website.domain.introduction.entity.Introduction;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;

@Getter
@Setter
@Schema
public class ActivityRequest {
@Schema(description = "활동명", example = "밋업데이")
private String name;

@Schema(description = "활동 이미지 1")
private MultipartFile imageFile1;

@Schema(description = "활동 이미지 2")
private MultipartFile imageFile2;

@Schema(description = "활동 설명글", example = "밋업데이는 ~입니다.")
private String description;

public static Activity from(ActivityRequest request, String imageUrl1, String imageUrl2,
Introduction introduction) {
return Activity.builder()
.name(request.getName())
.imageUrl1(imageUrl1)
.imageUrl2(imageUrl2)
.description(request.getDescription())
.introduction(introduction)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@Schema
@Schema(description = "학회 소개 요청")
public class IntroRequest {
@Schema(description = "배너 내에 삽입되는 기수", example = "27")
private Long bannerCardinal;

@Schema(description = "배너 상태 (대문자 영문 코드)", example = "CLOSE/MANAGEMENT_RECRUIT/MEMBER_RECRUIT")
@Schema(description = "배너 상태 (대문자 영문 코드)", example = "CLOSE")
private BannerStatus bannerStatus;

@Schema(description = "누적 학회원 수 ", example = "1432")
@Schema(description = "슬로건", example = "큐시즘, 함께 성장하는 IT 학회")
private String slogan;

@Schema(description = "배너 이미지 파일")
private MultipartFile bannerImageFile;

@Schema(description = "누적 학회원 수", example = "1432")
private Long memberCount;

@Schema(description = "누적 프로젝트 결과물 수", example = "322")
Expand All @@ -32,27 +37,57 @@ public class IntroRequest {
@Schema(description = "학회 소개 영상", example = "https://www.youtube.com/")
private String introYoutubeLink;

@Schema(description = "기획 이미지 파일")
private MultipartFile planningImage;

@Schema(description = "디자인 이미지 파일")
private MultipartFile designImage;

@Schema(description = "프론트 이미지 파일")
private MultipartFile frontendImage;

@Schema(description = "백엔드 이미지 파일")
private MultipartFile backendImage;

@Schema(description = "학회 운영진 소개")
private List<ManagementTeamRequest> teams = new ArrayList<>();;
private List<ManagementTeamRequest> teams;

@Schema(description = "전문가 초청 강연자 소개")
private List<ExpertLectureRequest> expertLecture = new ArrayList<>();
private List<ExpertLectureRequest> expertLecture;

@Schema(description = "OB 초청 강연자 소개")
private List<OBLectureRequest> obLecture;

@Schema(description = "파트너사 로고 이미지 파일 목록")
private List<MultipartFile> partnerLogoFiles;

@Schema(description = "밋업 이미지 파일 목록")
private List<MultipartFile> meetupImages;

@Schema(description = "ob 초청 강연자 소개")
private List<OBLectureRequest> obLecture = new ArrayList<>();
@Schema(description = "활동 소개 목록")
private List<ActivityRequest> activities;

@Schema(description = "파트너사 소개 이미지 파일")
private MultipartFile partnerLogoFile;
@Schema(description = "후원사 이미지 파일 목록")
private List<MultipartFile> sponsors;

public static Introduction from(IntroRequest request, String partnerImageUrl) {
public static Introduction from(IntroRequest request, String partnerImageUrl,
String bannerImageUrl,
String planningImageUrl, String designImageUrl,
String frontendImageUrl, String backendImageUrl) {
return Introduction.builder()
.bannerCardinal(request.getBannerCardinal())
.bannerStatus(request.getBannerStatus())
.slogan(request.getSlogan())
.bannerImageUrl(bannerImageUrl)
.memberCount(request.getMemberCount())
.projectCount(request.getProjectCount())
.universityCount(request.getUniversityCount())
.introYoutubeLink(request.getIntroYoutubeLink())
.partnerImageUrl(partnerImageUrl)
.planningImageUrl(planningImageUrl)
.designImageUrl(designImageUrl)
.frontendImageUrl(frontendImageUrl)
.backendImageUrl(backendImageUrl)
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.kusitms.website.domain.introduction.dto.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.kusitms.website.domain.introduction.entity.Activity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;

@Getter
@Builder
@Schema
public class ActivityResponse {
@Schema(description = "활동명", example = "밋업데이")
private String name;

@JsonProperty("image_url1")
@Schema(description = "활동 이미지 1 URL")
private String imageUrl1;

@JsonProperty("image_url2")
@Schema(description = "활동 이미지 2 URL")
private String imageUrl2;

@Schema(description = "활동 설명글")
private String description;

public static ActivityResponse fromEntity(Activity activity) {
return ActivityResponse.builder()
.name(activity.getName())
.imageUrl1(activity.getImageUrl1())
.imageUrl2(activity.getImageUrl2())
.description(activity.getDescription())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
package com.kusitms.website.domain.introduction.dto.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.kusitms.website.domain.introduction.entity.Introduction;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;

import java.util.List;

@Getter
@Builder
@Schema
public class AdminIntroResponse {
@JsonProperty("banner_cardinal")
@Schema(description = "배너 기수")
private Long bannerCardinal;

@JsonProperty("banner_status")
@Schema(description = "배너 상태")
private String bannerStatus;

@Schema(description = "슬로건")
private String slogan;

@JsonProperty("banner_image_url")
@Schema(description = "배너 이미지 URL")
private String bannerImageUrl;

@JsonProperty("member_count")
@Schema(description = "누적 학회원 수")
private Long memberCount;

@JsonProperty("project_count")
@Schema(description = "누적 프로젝트 수")
private Long projectCount;

@JsonProperty("university_count")
@Schema(description = "참여 대학 수")
private Long universityCount;

@JsonProperty("intro_youtube_link")
@Schema(description = "학회 소개 영상")
private String introYoutubeLink;

@JsonProperty("planning_image_url")
@Schema(description = "기획 이미지 URL")
private String planningImageUrl;

@JsonProperty("design_image_url")
@Schema(description = "디자인 이미지 URL")
private String designImageUrl;

@JsonProperty("frontend_image_url")
@Schema(description = "프론트 이미지 URL")
private String frontendImageUrl;

@JsonProperty("backend_image_url")
@Schema(description = "백엔드 이미지 URL")
private String backendImageUrl;

@JsonProperty("partner_logo_urls")
@Schema(description = "파트너사 로고 이미지 URL 목록")
private List<String> partnerLogoUrls;

@JsonProperty("meetup_image_urls")
@Schema(description = "밋업 이미지 URL 목록")
private List<String> meetupImageUrls;

@Schema(description = "활동 소개 목록")
private List<ActivityResponse> activities;

@Schema(description = "운영진 소개")
private List<ManagementTeamResponse> teams;

@JsonProperty("expert_lecture")
@Schema(description = "전문가 초청 강연자 소개")
private List<ExpertLectureResponse> expertLecture;

@JsonProperty("ob_lecture")
@Schema(description = "OB 초청 강연자 소개")
private List<OBLectureResponse> obLecture;

@JsonProperty("sponsor_image_urls")
@Schema(description = "후원사 이미지 URL 목록")
private List<String> sponsorImageUrls;

public static AdminIntroResponse fromEntity(Introduction intro,
List<String> partnerLogoUrls,
List<String> meetupImageUrls,
List<ActivityResponse> activities,
List<ManagementTeamResponse> teams,
List<ExpertLectureResponse> expertLecture,
List<OBLectureResponse> obLecture,
List<String> sponsorImageUrls) {
return AdminIntroResponse.builder()
.bannerCardinal(intro.getBannerCardinal())
.bannerStatus(intro.getBannerStatus() != null ? intro.getBannerStatus().name() : null)
.slogan(intro.getSlogan())
.bannerImageUrl(intro.getBannerImageUrl())
.memberCount(intro.getMemberCount())
.projectCount(intro.getProjectCount())
.universityCount(intro.getUniversityCount())
.introYoutubeLink(intro.getIntroYoutubeLink())
.planningImageUrl(intro.getPlanningImageUrl())
.designImageUrl(intro.getDesignImageUrl())
.frontendImageUrl(intro.getFrontendImageUrl())
.backendImageUrl(intro.getBackendImageUrl())
.partnerLogoUrls(partnerLogoUrls)
.meetupImageUrls(meetupImageUrls)
.activities(activities)
.teams(teams)
.expertLecture(expertLecture)
.obLecture(obLecture)
.sponsorImageUrls(sponsorImageUrls)
.build();
}
}
Loading
Loading