Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename organization and set new (DDD based) based project structure t… #18

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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
66 changes: 51 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## :hammer: Installation
```bash
git clone https://github.com/Programmers-Only-Group/mentorship
git clone https://github.com/Geeks-Academy/mentorship
cd mentorship
```

Expand All @@ -36,20 +36,56 @@ You can then access application here: http://localhost:8080/
## :memo: Project structure

```bash
├── pom.xml
├── src
│ ├── main.java
│ │ ├── package (com...)
│ │ │ ├── MentorshipApplication.java
│ │ │ ├── commons
│ │ │ ├── mentors
│ │ │ ├── notification
│ │ │ ├── offers
│ ├── main.resources
│ │ ├── application.yml
│ │ ├── application-prod.yml
├── mvnw
└── mvnw.cmd

│ lombok.config
│ mvnw
│ mvnw.cmd
│ pom.xml
│ README.md
└───app
│ pom.xml
├───api-direct
│ │ pom.xml
│ ├───src
│ └───main.java.com.geeksacagemy
│ └───mentorship
│ └───direct
│ ├───mentors
│ └───web
├───api-service
│ │ pom.xml
│ ├───src
│ └───main.java.com.geeksacagemy
│ └───mentorship
│ └───service
│ ├───mentors
│ └───web
├───application
│ │ pom.xml
│ ├───src
│ ├───main.java.com.geeksacagemy
│ │ └───mentorship
│ │ MentorshipApplication.java
│ └───resources
│ application-prod.yml
│ application.yml
├───domain
│ │ pom.xml
│ ├───src
│ └───main.java.com.geeksacagemy
│ └───mentorship
│ ├───exception
│ ├───notifications
│ ├───offers
│ └───mentors
└───infrastructure
│ pom.xml
├───src
└───main.java.com.geeksacagemy
└───mentorship
└───template


```

The project was splitted into three seperated bounded contexts `mentors` , `offers` , `notification` and shared `commons` package.
Expand Down
4 changes: 2 additions & 2 deletions app/api-direct/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
Expand All @@ -15,7 +15,7 @@

<dependencies>
<dependency>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>domain</artifactId>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.direct.template;
package com.geeksacagemy.mentorship.direct.template;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.direct.template;
package com.geeksacagemy.mentorship.direct.template;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.direct.template;
package com.geeksacagemy.mentorship.direct.template;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package com.programmersonly.mentorship.direct.template;
package com.geeksacagemy.mentorship.direct.template;

import com.programmersonly.mentorship.template.TemplateService;
import com.programmersonly.mentorship.template.dto.CreateTemplateDto;
import com.geeksacagemy.mentorship.template.TemplateService;
import com.geeksacagemy.mentorship.template.dto.CreateTemplateDto;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@AllArgsConstructor
@RequestMapping(value = "/template")
class TemplateController {
public class TemplateController {

private static final Logger logger = LoggerFactory.getLogger(TemplateController.class);

private TemplateService templateService;

Expand All @@ -27,6 +31,7 @@ public ResponseEntity<Void> createMentorTemplate(@RequestBody CreateTemplateRequ

@PutMapping("/confirm")
public ResponseEntity<Void> confirmMentorTemplate(@RequestBody ConfirmTemplateRequest request){
logger.info("confirmation method");
templateService.confirm(request.getTemplateId());
return new ResponseEntity<>(HttpStatus.OK);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.programmersonly.mentorship.direct.web;
package com.geeksacagemy.mentorship.direct.web;

import com.programmersonly.mentorship.exception.BusinessException;
import com.programmersonly.mentorship.exception.ConfirmationConflictException;
import com.geeksacagemy.mentorship.exception.BusinessException;
import com.geeksacagemy.mentorship.exception.ConfirmationConflictException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
Expand Down
4 changes: 2 additions & 2 deletions app/api-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
Expand All @@ -15,7 +15,7 @@

<dependencies>
<dependency>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>domain</artifactId>
</dependency>

Expand Down
19 changes: 9 additions & 10 deletions app/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
Expand All @@ -15,19 +15,19 @@

<dependencies>
<dependency>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>domain</artifactId>
</dependency>
<dependency>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>api-direct</artifactId>
</dependency>
<dependency>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>api-service</artifactId>
</dependency>
<dependency>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>infrastructure</artifactId>
</dependency>

Expand Down Expand Up @@ -69,6 +69,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
Expand All @@ -82,11 +86,6 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.programmersonly.mentorship;
package com.geeksacagemy.mentorship;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication(scanBasePackageClasses = MentorshipApplication.class)
@SpringBootApplication
public class MentorshipApplication {

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.programmersonly.mentorship.direct.template
package com.geeksacagemy.mentorship.direct.template

import com.github.springtestdbunit.DbUnitTestExecutionListener
import com.github.springtestdbunit.annotation.DatabaseSetup
import com.github.springtestdbunit.annotation.DatabaseTearDown
import com.github.springtestdbunit.annotation.ExpectedDatabase
import com.github.springtestdbunit.assertion.DatabaseAssertionMode
import com.programmersonly.mentorship.MentorshipApplication
import com.geeksacagemy.mentorship.MentorshipApplication
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.boot.test.web.client.TestRestTemplate
import org.springframework.boot.web.server.LocalServerPort
Expand All @@ -18,9 +18,9 @@ import org.springframework.test.context.TestExecutionListeners
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener
import spock.lang.Specification

import static com.programmersonly.mentorship.direct.template.TemplateRequestProvider.getConfirmTemplateRequest
import static com.programmersonly.mentorship.direct.template.TemplateRequestProvider.getCreateTemplateRequest
import static com.programmersonly.mentorship.direct.template.TemplateRequestProvider.getRemoveTemplateRequest
import static TemplateRequestProvider.getConfirmTemplateRequest
import static TemplateRequestProvider.getCreateTemplateRequest
import static TemplateRequestProvider.getRemoveTemplateRequest

@SpringBootTest(classes = MentorshipApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@TestExecutionListeners([DependencyInjectionTestExecutionListener.class, DbUnitTestExecutionListener.class])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.direct.template;
package com.geeksacagemy.mentorship.direct.template;

import java.util.UUID;

Expand Down
2 changes: 1 addition & 1 deletion app/domain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.exception;
package com.geeksacagemy.mentorship.exception;

import lombok.AllArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.exception;
package com.geeksacagemy.mentorship.exception;

public class ConfirmationConflictException extends BusinessException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.exception;
package com.geeksacagemy.mentorship.exception;

public enum ErrorCode {
MS01("Cannot confirm"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.exception;
package com.geeksacagemy.mentorship.exception;

public interface ErrorResponse {
ErrorCode getErrorCode();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.exception;
package com.geeksacagemy.mentorship.exception;

public class TemplateNotFoundException extends BusinessException {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.template;
package com.geeksacagemy.mentorship.template;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.template;
package com.geeksacagemy.mentorship.template;

import java.util.Optional;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.programmersonly.mentorship.template;
package com.geeksacagemy.mentorship.template;

import com.programmersonly.mentorship.template.dto.CreateTemplateDto;
import com.geeksacagemy.mentorship.template.dto.CreateTemplateDto;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.programmersonly.mentorship.template;
package com.geeksacagemy.mentorship.template;

import com.programmersonly.mentorship.exception.ConfirmationConflictException;
import com.programmersonly.mentorship.exception.TemplateNotFoundException;
import com.programmersonly.mentorship.template.dto.CreateTemplateDto;
import com.geeksacagemy.mentorship.exception.ConfirmationConflictException;
import com.geeksacagemy.mentorship.exception.TemplateNotFoundException;
import com.geeksacagemy.mentorship.template.dto.CreateTemplateDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.geeksacagemy.mentorship.template;

enum TemplateStatus {
CREATED, CONFIRMED
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.template.dto;
package com.geeksacagemy.mentorship.template.dto;

import lombok.*;

Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions app/infrastructure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>app</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
Expand All @@ -15,7 +15,7 @@

<dependencies>
<dependency>
<groupId>com.programmersonly</groupId>
<groupId>com.geeksacagemy</groupId>
<artifactId>domain</artifactId>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.template;
package com.geeksacagemy.mentorship.template;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.programmersonly.mentorship.template;
package com.geeksacagemy.mentorship.template;

import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Loading