Skip to content

Commit

Permalink
#16 - 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdduuus committed Dec 1, 2023
1 parent 25936cf commit b0ed363
Show file tree
Hide file tree
Showing 189 changed files with 945 additions and 5 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules/spring.main.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified spring/.gradle/8.4/checksums/checksums.lock
Binary file not shown.
Binary file modified spring/.gradle/8.4/checksums/md5-checksums.bin
Binary file not shown.
Binary file modified spring/.gradle/8.4/checksums/sha1-checksums.bin
Binary file not shown.
Binary file modified spring/.gradle/8.4/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified spring/.gradle/8.4/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified spring/.gradle/8.4/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified spring/.gradle/8.4/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified spring/.gradle/8.4/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified spring/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified spring/.gradle/file-system.probe
Binary file not shown.
4 changes: 4 additions & 0 deletions spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.15'
implementation 'io.springfox:springfox-swagger2:2.9.2'
implementation 'io.springfox:springfox-swagger-ui:2.9.2'
implementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.mysql:mysql-connector-j'
annotationProcessor 'org.projectlombok:lombok'
Expand Down
Binary file modified spring/build/classes/java/main/umc/study/Application.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/Mission.class
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/alarm.class
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/enums/Gender.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/favor.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/member.class
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/point.class
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/qna.class
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/region.class
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/review.class
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/classes/java/main/umc/study/domain/store.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion spring/build/resources/main/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ spring:
format_sql: true
use_sql_comments: true
hbm2ddl:
auto: update
auto: create
default_batch_fetch_size: 1000
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified spring/build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public enum ErrorStatus implements BaseErrorCode {
ARTICLE_NOT_FOUND(HttpStatus.NOT_FOUND, "ARTICLE4001", "게시글이 없습니다."),

// Ror test
TEMP_EXCEPTION(HttpStatus.BAD_REQUEST, "TEMP4001", "이거는 테스트");
TEMP_EXCEPTION(HttpStatus.BAD_REQUEST, "TEMP4001", "이거는 테스트"),

FOOD_CATEGORY_NOT_FOUND(HttpStatus.NOT_FOUND, "FOOD_CATEGORY4001", "음식 카테고리가 없습니다.");

private final HttpStatus httpStatus;
private final String code;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package umc.study.apiPayload.exception.handler;

import umc.study.apiPayload.code.BaseErrorCode;
import umc.study.apiPayload.exception.GeneralException;

public class FoodCategoryHandler extends GeneralException {
public FoodCategoryHandler(BaseErrorCode errorCode) {
super(errorCode);
}
}
38 changes: 38 additions & 0 deletions spring/src/main/java/umc/study/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package umc.study.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {
@Bean
public OpenAPI UMCstudyAPI() {
Info info = new Info()
.title("UMC Server WorkBook API")
.description("UMC Server WorkBook API 명세서")
.version("1.0.0");

String jwtSchemeName = "JWT TOKEN";
// API 요청헤더에 인증정보 포함
SecurityRequirement securityRequirement = new SecurityRequirement().addList(jwtSchemeName);
// SecuritySchemes 등록
Components components = new Components()
.addSecuritySchemes(jwtSchemeName, new SecurityScheme()
.name(jwtSchemeName)
.type(SecurityScheme.Type.HTTP) // HTTP 방식
.scheme("bearer")
.bearerFormat("JWT"));

return new OpenAPI()
.addServersItem(new Server().url("/"))
.info(info)
.addSecurityItem(securityRequirement)
.components(components);
}
}
51 changes: 51 additions & 0 deletions spring/src/main/java/umc/study/converter/MemberConverter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package umc.study.converter;

import umc.study.domain.enums.Gender;
import umc.study.domain.mapping.MemberMission;
import umc.study.domain.member;
import umc.study.web.dto.MemberRequestDTO;
import umc.study.web.dto.MemberResponseDTO;

import java.time.LocalDateTime;
import java.util.ArrayList;

public class MemberConverter {

public static MemberResponseDTO.JoinResultDTO toJoinResultDTO(member member){
return MemberResponseDTO.JoinResultDTO.builder()
.memberId(member.getMemberId())
.createdAt(LocalDateTime.now())
.build();
}

public static MemberResponseDTO.challengeMissionResultDTO toChallengeMissionResultDTO(MemberMission memberMission){
return MemberResponseDTO.challengeMissionResultDTO.builder()
.MemberMissionId(memberMission.getId())
.createdAt(LocalDateTime.now())
.build();
}

public static member toMember(MemberRequestDTO.JoinDto request){

Gender gender = null;

switch (request.getGender()){
case 1:
gender = Gender.MALE;
break;
case 2:
gender = Gender.FEMALE;
break;
case 3:
gender = Gender.NONE;
break;
}

return member.builder()
.address(request.getAddress())
.gender(gender)
.name(request.getName())
.memberPreferList(new ArrayList<>())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package umc.study.converter;

import umc.study.domain.FoodCategory;
import umc.study.domain.mapping.MemberPrefer;

import java.util.List;
import java.util.stream.Collectors;

public class MemberPreferConverter {

public static List<MemberPrefer> toMemberPreferList(List<FoodCategory> foodCategoryList){

return foodCategoryList.stream()
.map(foodCategory ->
MemberPrefer.builder()
.foodCategory(foodCategory)
.build()
).collect(Collectors.toList());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package umc.study.converter;

import umc.study.domain.Mission;
import umc.study.web.dto.StoreRequestDTO;
import umc.study.web.dto.StoreResponseDTO;

import java.time.LocalDateTime;

public class StoreMissionConverter {
public static Mission toMission(StoreRequestDTO.MissionDto request){
return Mission.builder()
.point(request.getPoint())
.text(request.getText())
.build();
}

public static StoreResponseDTO.newMissionResultDto toNewMissionResultDto(Mission mission){
return StoreResponseDTO.newMissionResultDto.builder()
.missionId(mission.getMissionId())
.createdAt(LocalDateTime.now())
.build();
}
}
24 changes: 24 additions & 0 deletions spring/src/main/java/umc/study/converter/StoreReviewConverter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package umc.study.converter;

import umc.study.domain.review;
import umc.study.web.dto.StoreRequestDTO;
import umc.study.web.dto.StoreResponseDTO;

import java.time.LocalDateTime;

public class StoreReviewConverter {
public static review toReview(StoreRequestDTO.ReviewDto request){
return review.builder()
.point(request.getPoint())
.photo(request.getPhoto())
.text(request.getText())
.build();
}

public static StoreResponseDTO.newReviewResultDto toNewReviewResultDto(review review){
return StoreResponseDTO.newReviewResultDto.builder()
.reviewId(review.getReviewId())
.createdAt(LocalDateTime.now())
.build();
}
}
Loading

0 comments on commit b0ed363

Please sign in to comment.