Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
모듈 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Mar 18, 2024
1 parent 3a0313f commit 9699e20
Show file tree
Hide file tree
Showing 148 changed files with 807 additions and 746 deletions.
70 changes: 28 additions & 42 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,57 +1,43 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.2.2'
id 'org.springframework.boot' version '3.2.3'
id 'io.spring.dependency-management' version '1.1.4'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'
allprojects {
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

java {
sourceCompatibility = "21"
}
group = 'org.daemawiki'
version = '0.0.1-SNAPSHOT'

configurations {
compileOnly {
extendsFrom annotationProcessor
java {
sourceCompatibility = '21'
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'

implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-webflux'

implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'javax.xml.bind:jaxb-api:2.3.1'

implementation 'org.eclipse.collections:eclipse-collections-api:11.1.0'
implementation 'org.eclipse.collections:eclipse-collections:11.1.0'

implementation 'org.apache.commons:commons-collections4:4.4'

implementation 'software.amazon.awssdk:s3:2.17.43'
implementation 'software.amazon.awssdk:netty-nio-client:2.17.43'
repositories {
mavenCentral()
}

implementation 'org.springframework.boot:spring-boot-starter-mail'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'

implementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.security:spring-security-test'
}

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testImplementation 'org.springframework.security:spring-security-test'
}
test {
useJUnitPlatform()
}

tasks.named('test') {
useJUnitPlatform()
}
targetCompatibility = JavaVersion.VERSION_21
19 changes: 19 additions & 0 deletions daemawiki-api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
dependencies {
implementation project(':daemawiki-auth')
implementation project(':daemawiki-domain')
implementation project(':daemawiki-common')

implementation 'org.springframework.boot:spring-boot-starter-data-mongodb-reactive'
implementation 'org.springframework.boot:spring-boot-starter-data-redis-reactive'

implementation 'org.eclipse.collections:eclipse-collections-api:11.1.0'
implementation 'org.eclipse.collections:eclipse-collections:11.1.0'

implementation 'software.amazon.awssdk:s3:2.17.43'
implementation 'software.amazon.awssdk:netty-nio-client:2.17.43'

implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-mail'

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.example.daemawiki;
package org.daemawiki;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
public class DaemawikiApplication {
Expand Down
16 changes: 16 additions & 0 deletions daemawiki-api/src/main/java/org/daemawiki/TestController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.daemawiki;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@RestController
public class TestController {

@GetMapping("/test/{t}")
public Mono<String> e(@PathVariable String t) {
return Mono.just(t);
}

}
16 changes: 16 additions & 0 deletions daemawiki-api/src/main/java/org/daemawiki/config/AppConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.daemawiki.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import reactor.core.scheduler.Scheduler;
import reactor.core.scheduler.Schedulers;

@Configuration
public class AppConfig {

@Bean
public Scheduler scheduler() {
return Schedulers.boundedElastic();
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.daemawiki.global.config;
package org.daemawiki.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.example.daemawiki.domain.auth.api;
package org.daemawiki.domain.auth.api;

import com.example.daemawiki.domain.auth.dto.request.LoginRequest;
import com.example.daemawiki.domain.auth.dto.request.ReissueRequest;
import com.example.daemawiki.domain.auth.dto.response.TokenResponse;
import com.example.daemawiki.domain.auth.dto.request.SignupRequest;
import com.example.daemawiki.domain.auth.service.Login;
import com.example.daemawiki.domain.auth.service.Reissue;
import com.example.daemawiki.domain.auth.service.Signup;
import org.daemawiki.domain.auth.dto.request.LoginRequest;
import org.daemawiki.domain.auth.dto.request.ReissueRequest;
import org.daemawiki.domain.auth.dto.response.TokenResponse;
import org.daemawiki.domain.auth.dto.request.SignupRequest;
import org.daemawiki.domain.auth.service.Login;
import org.daemawiki.domain.auth.service.Reissue;
import org.daemawiki.domain.auth.service.Signup;
import jakarta.validation.Valid;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.example.daemawiki.domain.document.model.mapper;
package org.daemawiki.domain.auth.mapper;

import com.example.daemawiki.domain.document.dto.response.GetDocumentResponse;
import com.example.daemawiki.domain.document.dto.response.SimpleDocumentResponse;
import com.example.daemawiki.domain.document.model.DefaultDocument;
import org.daemawiki.domain.document.dto.response.GetDocumentResponse;
import org.daemawiki.domain.document.dto.response.SimpleDocumentResponse;
import org.daemawiki.domain.document.model.DefaultDocument;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.example.daemawiki.domain.auth.service;
package org.daemawiki.domain.auth.service;

import com.example.daemawiki.domain.auth.dto.request.LoginRequest;
import com.example.daemawiki.domain.auth.dto.response.TokenResponse;
import com.example.daemawiki.domain.user.model.User;
import com.example.daemawiki.domain.user.repository.UserRepository;
import com.example.daemawiki.global.exception.h401.PasswordMismatchException;
import com.example.daemawiki.global.exception.h404.UserNotFoundException;
import com.example.daemawiki.global.security.Tokenizer;
import org.daemawiki.domain.auth.dto.request.LoginRequest;
import org.daemawiki.domain.auth.dto.response.TokenResponse;
import org.daemawiki.domain.user.model.User;
import org.daemawiki.domain.user.repository.UserRepository;
import org.daemawiki.exception.h401.PasswordMismatchException;
import org.daemawiki.exception.h404.UserNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
import org.daemawiki.security.Tokenizer;

@Service
public class Login {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.example.daemawiki.domain.auth.service;
package org.daemawiki.domain.auth.service;

import com.example.daemawiki.domain.auth.dto.request.ReissueRequest;
import com.example.daemawiki.domain.auth.dto.response.TokenResponse;
import com.example.daemawiki.global.exception.h500.TokenReissueFailedException;
import com.example.daemawiki.global.security.Tokenizer;
import org.daemawiki.domain.auth.dto.request.ReissueRequest;
import org.daemawiki.domain.auth.dto.response.TokenResponse;
import org.daemawiki.exception.h500.TokenReissueFailedException;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
import org.daemawiki.security.Tokenizer;

@Service
public class Reissue {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.example.daemawiki.domain.auth.service;
package org.daemawiki.domain.auth.service;

import com.example.daemawiki.domain.auth.dto.request.SignupRequest;
import com.example.daemawiki.domain.document.component.CreateDocumentByUser;
import com.example.daemawiki.domain.file.model.DefaultProfile;
import com.example.daemawiki.domain.mail.repository.AuthMailRepository;
import com.example.daemawiki.domain.user.model.User;
import com.example.daemawiki.domain.user.model.UserDetail;
import com.example.daemawiki.domain.user.model.type.major.component.GetMajorType;
import com.example.daemawiki.domain.user.repository.UserRepository;
import com.example.daemawiki.global.exception.h403.UnVerifiedEmailException;
import com.example.daemawiki.global.exception.h409.EmailAlreadyExistsException;
import com.example.daemawiki.global.exception.h500.ExecuteFailedException;
import org.daemawiki.domain.auth.dto.request.SignupRequest;
import org.daemawiki.domain.document.component.CreateDocumentByUser;
import org.daemawiki.domain.document.DefaultProfile;
import org.daemawiki.domain.mail.repository.AuthMailRepository;
import org.daemawiki.domain.user.model.User;
import org.daemawiki.domain.user.model.UserDetail;
import org.daemawiki.domain.user.repository.UserRepository;
import org.daemawiki.domain.user.type.major.component.GetMajorType;
import org.daemawiki.exception.h403.UnVerifiedEmailException;
import org.daemawiki.exception.h409.EmailAlreadyExistsException;
import org.daemawiki.exception.h500.ExecuteFailedException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.example.daemawiki.domain.document.model.type.service;
package org.daemawiki.domain.auth.type;

import com.example.daemawiki.domain.document.model.type.DocumentType;
import org.daemawiki.domain.document.model.type.DocumentType;
import org.springframework.stereotype.Component;

@Component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.example.daemawiki.domain.common;
package org.daemawiki.domain.common;

import com.example.daemawiki.domain.document.model.DefaultDocument;
import com.example.daemawiki.domain.user.model.User;
import com.example.daemawiki.global.exception.h400.VersionMismatchException;
import com.example.daemawiki.global.exception.h403.NoEditPermissionUserException;
import org.daemawiki.domain.document.model.DefaultDocument;
import org.daemawiki.domain.user.model.User;
import org.daemawiki.exception.h400.VersionMismatchException;
import org.daemawiki.exception.h403.NoEditPermissionUserException;
import org.springframework.stereotype.Component;

import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.example.daemawiki.domain.content.api;

import com.example.daemawiki.domain.content.dto.AddContentRequest;
import com.example.daemawiki.domain.content.dto.DeleteContentRequest;
import com.example.daemawiki.domain.content.dto.EditContentTableTitleRequest;
import com.example.daemawiki.domain.content.dto.WriteContentRequest;
import com.example.daemawiki.domain.content.service.AddContentTable;
import com.example.daemawiki.domain.content.service.DeleteContentTable;
import com.example.daemawiki.domain.content.service.EditContentTableTitle;
import com.example.daemawiki.domain.content.service.WriteContent;
package org.daemawiki.domain.content.api;

import org.daemawiki.domain.content.dto.AddContentRequest;
import org.daemawiki.domain.content.dto.DeleteContentRequest;
import org.daemawiki.domain.content.dto.EditContentTableTitleRequest;
import org.daemawiki.domain.content.dto.WriteContentRequest;
import org.daemawiki.domain.content.service.AddContentTable;
import org.daemawiki.domain.content.service.DeleteContentTable;
import org.daemawiki.domain.content.service.EditContentTableTitle;
import org.daemawiki.domain.content.service.WriteContent;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import org.springframework.http.HttpStatus;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package com.example.daemawiki.domain.content.service;

import com.example.daemawiki.domain.common.UserFilter;
import com.example.daemawiki.domain.content.dto.AddContentRequest;
import com.example.daemawiki.domain.content.model.Content;
import com.example.daemawiki.domain.document.component.UpdateDocumentComponent;
import com.example.daemawiki.domain.document.component.UpdateDocumentEditorAndUpdatedDate;
import com.example.daemawiki.domain.document.component.facade.DocumentFacade;
import com.example.daemawiki.domain.document.model.DefaultDocument;
import com.example.daemawiki.domain.revision.component.RevisionComponent;
import com.example.daemawiki.domain.revision.dto.request.SaveRevisionHistoryRequest;
import com.example.daemawiki.domain.revision.model.type.RevisionType;
import com.example.daemawiki.domain.user.dto.response.UserDetailResponse;
import com.example.daemawiki.domain.user.model.User;
import com.example.daemawiki.domain.user.service.facade.UserFacade;
import com.example.daemawiki.global.exception.h400.VersionMismatchException;
import com.example.daemawiki.global.exception.h403.NoEditPermissionUserException;
import com.example.daemawiki.global.exception.h500.ExecuteFailedException;
package org.daemawiki.domain.content.service;

import org.daemawiki.domain.common.UserFilter;
import org.daemawiki.domain.content.dto.AddContentRequest;
import org.daemawiki.domain.content.model.Content;
import org.daemawiki.domain.document.component.UpdateDocumentComponent;
import org.daemawiki.domain.document.component.facade.DocumentFacade;
import org.daemawiki.domain.document.model.DefaultDocument;
import org.daemawiki.domain.revision.component.RevisionComponent;
import org.daemawiki.domain.revision.dto.request.SaveRevisionHistoryRequest;
import org.daemawiki.domain.revision.model.type.RevisionType;
import org.daemawiki.domain.user.dto.response.UserDetailResponse;
import org.daemawiki.domain.user.model.User;
import org.daemawiki.domain.user.service.facade.UserFacade;
import org.daemawiki.exception.h400.VersionMismatchException;
import org.daemawiki.exception.h403.NoEditPermissionUserException;
import org.daemawiki.exception.h500.ExecuteFailedException;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
import reactor.util.function.Tuple2;
Expand Down Expand Up @@ -49,11 +48,11 @@ public Mono<Void> execute(AddContentRequest request, String documentId) {
}

private DefaultDocument checkPermissionAndAddDocumentContentTable(Tuple2<User, DefaultDocument> tuple, AddContentRequest request) {
userFilter.userPermissionAndDocumentVersionCheck(tuple.getT2(), tuple.getT1().getEmail(), request.version());

DefaultDocument document = tuple.getT2();
User user = tuple.getT1();

userFilter.userPermissionAndDocumentVersionCheck(document, user.getEmail(), request.version());

updateDocumentComponent.updateEditorAndUpdatedDate(document, user);
setDocumentContent(document, request.index(), request.title());
setDocument(document, user);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.example.daemawiki.domain.content.service;
package org.daemawiki.domain.content.service;

import com.example.daemawiki.domain.common.UserFilter;
import com.example.daemawiki.domain.content.dto.DeleteContentRequest;
import com.example.daemawiki.domain.document.component.UpdateDocumentComponent;
import com.example.daemawiki.domain.document.component.UpdateDocumentEditorAndUpdatedDate;
import com.example.daemawiki.domain.document.component.facade.DocumentFacade;
import com.example.daemawiki.domain.document.model.DefaultDocument;
import com.example.daemawiki.domain.revision.component.RevisionComponent;
import com.example.daemawiki.domain.revision.dto.request.SaveRevisionHistoryRequest;
import com.example.daemawiki.domain.revision.model.type.RevisionType;
import com.example.daemawiki.domain.user.model.User;
import com.example.daemawiki.domain.user.service.facade.UserFacade;
import com.example.daemawiki.global.exception.h400.VersionMismatchException;
import com.example.daemawiki.global.exception.h403.NoEditPermissionUserException;
import com.example.daemawiki.global.exception.h500.ExecuteFailedException;
import org.daemawiki.domain.common.UserFilter;
import org.daemawiki.domain.content.dto.DeleteContentRequest;
import org.daemawiki.domain.document.component.UpdateDocumentComponent;
import org.daemawiki.domain.document.component.facade.DocumentFacade;
import org.daemawiki.domain.document.model.DefaultDocument;
import org.daemawiki.domain.revision.component.RevisionComponent;
import org.daemawiki.domain.revision.dto.request.SaveRevisionHistoryRequest;
import org.daemawiki.domain.revision.model.type.RevisionType;
import org.daemawiki.domain.user.model.User;
import org.daemawiki.domain.user.service.facade.UserFacade;
import org.daemawiki.exception.h400.VersionMismatchException;
import org.daemawiki.exception.h403.NoEditPermissionUserException;
import org.daemawiki.exception.h500.ExecuteFailedException;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
import reactor.util.function.Tuple2;
Expand Down
Loading

0 comments on commit 9699e20

Please sign in to comment.