Skip to content
Open
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
Binary file modified .gradle/6.8.2/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/6.8.2/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/6.8.2/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/6.8.2/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/6.8.2/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
420 changes: 0 additions & 420 deletions .idea/workspace.xml

This file was deleted.

116 changes: 57 additions & 59 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,6 @@ plugins {
id 'jacoco'
}

test {
finalizedBy 'jacocoTestReport'
}

jacoco {
toolVersion = "0.8.5"
}

jacocoTestReport {
reports {
html.enabled true
csv.enabled true
xml.enabled false
}

afterEvaluate {
getClassDirectories().setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/Q*'])
}))
}

finalizedBy 'jacocoTestCoverageVerification'
}

jacocoTestCoverageVerification {
afterEvaluate {
getClassDirectories().setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/Q*', '**/Q*.class'])
}))
}

violationRules {
rule {
enabled = true
element = 'CLASS'
// includes = []

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

excludes = ['*.TechNewsController.*','*.Q.*','*.CrawlingTest.*','*.Q*','**/Q*.class']
}

rule {
}

}
}

group = 'com.project'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
Expand Down Expand Up @@ -131,11 +78,6 @@ dependencies {
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
// //https://mvnrepository.com/artifact/de.flapdoodle.embed/de.flapdoodle.embed.mongo
// testImplementation group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '2.2.0'
// https://mvnrepository.com/artifact/cz.jirutka.spring/embedmongo-spring
// testImplementation group: 'cz.jirutka.spring', name: 'embedmongo-spring', version: '1.1'
implementation platform('com.google.cloud:libraries-bom:19.0.0')
compile 'com.google.cloud:google-cloud-language'

}

def generated='src/main/generated'
Expand All @@ -150,11 +92,67 @@ tasks.withType(JavaCompile) {
clean.doLast {
file(generated).deleteDir()
}

test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

jacocoTestReport {
dependsOn test
}

jacoco {
toolVersion = "0.8.6"
}

jacocoTestReport {
reports {
html.enabled true
csv.enabled true
xml.enabled false
}

afterEvaluate {
getClassDirectories().setFrom(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ['**/Q*'])
}))
}

finalizedBy 'jacocoTestCoverageVerification'
}

jacocoTestCoverageVerification {
afterEvaluate {
getClassDirectories().setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/Q*', '**/Q*.class'])
}))
}

violationRules {
rule {
enabled = true
element = 'CLASS'
// includes = []

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

excludes = ['*.TechNewsController.*','*.Q.*','*.CrawlingTest.*','*.Q*','**/Q*.class']
}

rule {
}

}
}

dependencyManagement {
imports {
mavenBom "com.vaadin:vaadin-bom:8.1.0"
}
}
}
569 changes: 0 additions & 569 deletions build/tmp/compileJava/source-classes-mapping.txt

This file was deleted.

1 change: 0 additions & 1 deletion lombok.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
#config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.project.devidea.infra.config.security;


import com.project.devidea.modules.account.Account;
import com.project.devidea.modules.account.domains.Account;
import com.project.devidea.modules.account.repository.AccountRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.userdetails.UserDetails;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.project.devidea.infra.config.security;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.project.devidea.modules.account.Account;
import com.project.devidea.modules.account.domains.Account;
import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package com.project.devidea.infra.config.security.oauth;

import com.project.devidea.modules.account.Account;
import com.project.devidea.modules.account.domains.Account;
import com.project.devidea.modules.account.dto.Login;
import com.project.devidea.modules.account.dto.SignUp;

import java.security.NoSuchAlgorithmException;
import java.util.Map;
// todo : 구조 리팩토링

public interface OAuthService {

SignUp.Response signUpOAuth(SignUp.OAuthRequest request);
Expand Down
37 changes: 35 additions & 2 deletions src/main/java/com/project/devidea/modules/InitService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.project.devidea.modules.environment.Environment;
import com.project.devidea.modules.environment.EnvironmentRepository;
import com.project.devidea.infra.config.security.SHA256;
import com.project.devidea.modules.account.Account;
import com.project.devidea.modules.account.domains.Account;
import com.project.devidea.modules.account.repository.AccountRepository;
import com.project.devidea.modules.content.mentoring.Mentee;
import com.project.devidea.modules.content.mentoring.MenteeRepository;
Expand Down Expand Up @@ -130,8 +130,41 @@ void Setting(){
.quit(true)
.build();

Account quitTestAccount = Account.builder()
.nickname("탈퇴테스트회원")
.email("out@out.com")
.emailCheckToken("abcdefghijklmn")
.bio("bio")
.gender("남성")
.roles("ROLE_USER")
.name("고범석")
.password("{bcrypt}" + bCryptPasswordEncoder.encode(SHA256.encrypt("1234")))
.joinedAt(LocalDateTime.now())
.modifiedAt(LocalDateTime.now())
.interests(new HashSet<>())
.mainActivityZones(new HashSet<>())
.quit(false)
.build();

Account updateTestAccount = Account.builder()
.nickname("업뎃테스트")
.email("update@update.com")
.emailCheckToken("token123")
.bio("bio")
.gender("남성")
.roles("ROLE_USER")
.name("고범석")
.password("{bcrypt}" + bCryptPasswordEncoder.encode(SHA256.encrypt("1234")))
.joinedAt(LocalDateTime.now())
.modifiedAt(LocalDateTime.now())
.interests(new HashSet<>())
.mainActivityZones(new HashSet<>())
.quit(false)
.build();

studyRepository.saveAll(studySampleGenerator.generateDumy(30));
accountRepository.saveAll(Arrays.asList(account,account2,account3, quitAccount));
accountRepository.saveAll(Arrays.asList(account,account2,account3, quitAccount, quitTestAccount,
updateTestAccount));
studyRepository.findAll().stream().forEach(study -> {
studyService.addMember(account,study, StudyRole.팀장);
studyService.addMember(account2,study, StudyRole.회원);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import com.project.devidea.infra.error.GlobalResponse;
import com.project.devidea.modules.account.dto.SignUp;
import com.project.devidea.modules.account.services.signUp.SignUpAndAuthenticationEmailService;
import com.project.devidea.modules.account.services.signUp.AuthenticationEmailService;
import com.project.devidea.modules.account.services.signUp.SignUpService;
import com.project.devidea.modules.account.validator.SignUpRequestValidator;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.WebDataBinder;
Expand All @@ -15,14 +17,13 @@
import javax.validation.Valid;
import java.io.IOException;

/**
* 일반 회원가입, 메일인증, 회원탈퇴 로직
*/
@RestController
@RequiredArgsConstructor
public class CommonSignUpController {

private final SignUpAndAuthenticationEmailService signUpService;
@Qualifier("commonSignUpService")
private final SignUpService signUpService;
private final AuthenticationEmailService authenticationEmailService;
private final SignUpRequestValidator signUpRequestValidator;

@InitBinder("commonRequest")
Expand All @@ -41,7 +42,7 @@ public ResponseEntity<?> signUp(@Valid @RequestBody SignUp.CommonRequest commonR
@ApiOperation("일반 회원가입 메일 인증")
public void authenticateEmailToken(String email, String token, HttpServletResponse response) throws IOException {

String url = signUpService.authenticateEmailToken(email, token);
String url = authenticationEmailService.authenticateEmailToken(email, token);
response.sendRedirect(url + "/sign-up/detail?token=" + token);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.project.devidea.modules.account.controllers;

import com.project.devidea.infra.config.security.LoginUser;
import com.project.devidea.infra.error.GlobalResponse;
import com.project.devidea.modules.account.dto.Update;
import com.project.devidea.modules.account.services.info.GetAccountInfoService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequiredArgsConstructor
@RequestMapping("/account/settings")
public class GetAccountInfoController {

private final GetAccountInfoService getAccountInfoService;

@GetMapping("/profile")
@ApiOperation("프로필 조회")
public ResponseEntity<?> getProfile(@AuthenticationPrincipal LoginUser loginUser) {

return new ResponseEntity<>(GlobalResponse.of(getAccountInfoService.profile(loginUser)), HttpStatus.OK);
}

@GetMapping("/interests")
@ApiOperation("관심기술 조회")
public ResponseEntity<?> getInterests(@AuthenticationPrincipal LoginUser loginUser) {

return new ResponseEntity<>(GlobalResponse.of(getAccountInfoService.interests(loginUser)), HttpStatus.OK);
}

@GetMapping("/mainactivityzones")
@ApiOperation("활동지역 조회")
public ResponseEntity<?> getMainActivityZones(@AuthenticationPrincipal LoginUser loginUser) {

return new ResponseEntity<>(GlobalResponse.of(getAccountInfoService.mainActivityZones(loginUser)), HttpStatus.OK);
}

@GetMapping("/nickname")
@ApiOperation("닉네임 조회")
public ResponseEntity<?> getAccountNickname(@AuthenticationPrincipal LoginUser loginUser) {

Map<String, String> map = getAccountInfoService.nickname(loginUser);
return new ResponseEntity<>(GlobalResponse.of(map), HttpStatus.OK);
}

@GetMapping("/notifications")
@ApiOperation("알림설정 조회")
public ResponseEntity<?> getAccountNotifications(@AuthenticationPrincipal LoginUser loginUser) {

Update.Notification response = getAccountInfoService.notification(loginUser);
return new ResponseEntity<>(GlobalResponse.of(response), HttpStatus.OK);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class LoginController {
private final LoginService loginService;
private final LoginResponseUtil loginResponseUtil;

@PostMapping("/")
@PostMapping
@ApiOperation("로그인")
public ResponseEntity<?> login(@Valid @RequestBody Login.Common login) throws Exception {
Map<String, String> response = loginService.login(login);
Expand Down
Loading