Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:h-jjang/bauction into feature/#34-…
Browse files Browse the repository at this point in the history
…매물-검색-기능-구현
  • Loading branch information
GeunWooPark committed May 18, 2022
2 parents 946a0f8 + 1bfff38 commit 7e2ec31
Show file tree
Hide file tree
Showing 51 changed files with 830 additions and 409 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug Report
about: Bug Report 설명
title: "[BUG]"
labels: "bug"
assignees: ''

---

## 🤔 버그 내용
버그 내용 및 버그 발생 상황을 알려주세요!
ex) 어떤 api를 호출하였더니 오류가 생겼어요.
<br>

## 🚩 버그 발견 위치
버그 발견 예상 패키지 위치를 알려주세요!
ex)

<br>

## ⚠ 에러 캡쳐
주요 에러 stack trace를 캡쳐해주세요!

<br>


## 🙂 etc
추가적으로 하고 싶은 말! (Optional)

<br>
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature Request
about: 기능 개발 제안
title: "[FEAT]"
labels: "enhancement"
assignees: ''

---

## ✨ 제안 기능
기능에 대해 간략하게 설명해주세요!

## 🎇 제안 배경
이 기능을 추가하게 되는 배경에 대해 적어주세요!
ex) 중고 거래에 필요한 채팅 기능이 필요해서 도입한다!

<br>

## 📢 기능 설명
개발할 기능에 대해 설명해주세요.

<br>

### 📕 래퍼런스
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Pull Request
about: pr 설명
title: "[PR]"
labels: ""
assignees: ''

---


## 추가한 기능 설명

<br>


## check list
- [ ] issue number를 브랜치 앞에 추가 하였는가? <br>
- [ ] 그외의 [pr 규칙](https://github.com/h-jjang/bauction/wiki/%5BProject-Rules%5D#pr-%EA%B7%9C%EC%B9%99)을 잘 지켰는가?
- [ ] 모든 단위 테스트를 돌려보고 기존에 작동하던 테스트에 영향이 없는 것을 확인했는가?
설명
- [ ] naver code style formatting(단축키)을 했는가?
- [ ] [우테코 pr 규칙](https://github.com/woowacourse/woowacourse-docs/blob/master/cleancode/pr_checklist.md)을 준수하였는가?
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,4 @@ hs_err_pid*
/src/main/resources/application-auth.yml
/src/main/resources/application-db.yml
/src/main/resources/application-email.yml
/src/test/resources/application.yml
101 changes: 81 additions & 20 deletions backend/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
plugins {
id 'org.springframework.boot' version '2.6.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.asciidoctor.convert' version '1.5.8'
id "org.asciidoctor.jvm.convert" version "3.3.2"
id 'java'
id 'application'
id 'jacoco'
}

group = 'com.hjjang'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
asciidoctorExtensions // dependencies 에서 적용한 것 추가
compileOnly {
extendsFrom annotationProcessor
}

}

repositories {
Expand All @@ -25,60 +28,87 @@ ext {
}

dependencies {

// 모니터링 관련 의존성
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-security'

implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-websocket'
implementation 'org.flywaydb:flyway-core'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'

// 롬복 관련 의존성
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
runtimeOnly 'mysql:mysql-connector-java'

runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
//swagger-ui
implementation 'org.springdoc:springdoc-openapi-ui:1.6.8'
//jwt 관련 의존성
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'

// oauth 관련 의존성
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-security'

testImplementation 'com.h2database:h2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'com.google.guava:guava:31.1-jre'

// test를 위한 의존성
testImplementation 'org.springframework.batch:spring-batch-test'
testImplementation 'org.springframework.kafka:spring-kafka-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' //junit 4 하위 호환을 위한 라이브러리 제거
}
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'

implementation 'org.springdoc:springdoc-openapi-ui:1.6.6'
//jwt 관련 의존성
implementation 'io.jsonwebtoken:jjwt-api:0.11.2'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.2'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.2'
implementation 'org.springframework.boot:spring-boot-starter-log4j2'

// 로깅 관련 의존성
implementation "org.springframework.boot:spring-boot-starter-log4j2"
modules {
module("org.springframework.boot:spring-boot-starter-logging") {
replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "Use Log4j2 instead of Logback")
}
}
implementation 'org.apache.logging.log4j:log4j-web'

}
configurations {
all*.exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
all*.exclude group: 'org.springframework.boot', module: 'logback-classic'
}

tasks.named('compileJava') {
inputs.files(tasks.named('processResources'))
}

bootRun {
mainClassName = 'com.hjjang.backend.BackendApplication'

}

// 작성된 문서를 서버에서 접근할 수 있도록 이동
bootJar {
mainClassName = 'com.hjjang.backend.BackendApplication'
}

dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
tasks.named('test') {
outputs.dir snippetsDir
useJUnitPlatform()
Expand All @@ -88,3 +118,34 @@ tasks.named('asciidoctor') {
inputs.dir snippetsDir
dependsOn test
}

jacocoTestReport {
reports {
html.enabled true
xml.enabled false
csv.enabled true
}
finalizedBy 'jacocoTestCoverageVerification'
}

jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'CLASS'

limit {
counter = 'METHOD'
value = 'COVEREDRATIO'
minimum = 0.00
}

limit {
counter = 'INSTRUCTION'
value = 'COVEREDRATIO'
minimum = 0.00
}
excludes = ["*Dto*", "*.dto.*", "*.SvProjectApplication*", "*.config.*", "*.exceptions.*", "*.utils.*"]
}
}
}
2 changes: 2 additions & 0 deletions backend/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Post findOneById(Long id) {
public Post updateOneById(Long id, PostRequestDto postRequestDto, User user) {
Post foundPost = findOneById(id);
if (user == foundPost.getUser()) return save(foundPost.update(postRequestDto));
else throw new UserNotMatchException("사용자 정보가 일치하지 않습니다.", ErrorCode.NO_AUTHORITY);
throw new UserNotMatchException("사용자 정보가 일치하지 않습니다.", ErrorCode.NO_AUTHORITY);
}

public void deleteOneById(Long id) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.hjjang.backend.domain.user.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hjjang.backend.domain.user.dto.UserProfileDTO;
import com.hjjang.backend.domain.user.service.UserProfileService;
import com.hjjang.backend.global.dto.ApiResponse;

import com.hjjang.backend.global.response.code.SuccessCode;
import com.hjjang.backend.global.response.response.SuccessResponse;
import com.hjjang.backend.global.util.UserUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/users")
Expand All @@ -18,8 +19,10 @@ public class UserController {
private final UserProfileService userProfileService;

@GetMapping("/profile")
public ApiResponse getProfile() {
UserProfileDTO userProfile = userProfileService.getUserProfile();
return ApiResponse.success("userProfile", userProfile);
public ResponseEntity<SuccessResponse> getProfile() {
String userId = UserUtil.getLoginUserIdByToken();
UserProfileDTO userProfile = userProfileService.getUserProfile(userId);
return ResponseEntity.ok(SuccessResponse.of(SuccessCode.USER_PROFILE_SUCCESS, userProfile));
}

}

This file was deleted.

Loading

0 comments on commit 7e2ec31

Please sign in to comment.