-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce exterior & interior distinction (#155)
- Loading branch information
Showing
140 changed files
with
653 additions
and
662 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
lombok.builder.className=Builder | ||
lombok.addLombokGeneratedAnnotation = true | ||
lombok.addLombokGeneratedAnnotation=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 0 additions & 82 deletions
82
apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaConverterImpl.java
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
apps/sepuling/src/main/java/smecalculus/bezmen/interior/construction/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package smecalculus.bezmen.interior.construction; | ||
|
||
import static smecalculus.bezmen.interior.configuration.MessageMappingMode.SPRING_MVC; | ||
import static smecalculus.bezmen.interior.configuration.StateMappingMode.MY_BATIS; | ||
import static smecalculus.bezmen.interior.configuration.StateMappingMode.SPRING_DATA; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Import; | ||
import org.springframework.context.annotation.PropertySource; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaClient; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapper; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapperImpl; | ||
import smecalculus.bezmen.interior.core.SepulkaService; | ||
import smecalculus.bezmen.interior.core.SepulkaServiceImpl; | ||
import smecalculus.bezmen.interior.core.SepulkaSliceMapper; | ||
import smecalculus.bezmen.interior.core.SepulkaSliceMapperImpl; | ||
import smecalculus.bezmen.interior.messaging.SepulkaClientImpl; | ||
import smecalculus.bezmen.interior.messaging.springmvc.SepulkaController; | ||
import smecalculus.bezmen.interior.storage.SepulkaDao; | ||
import smecalculus.bezmen.interior.storage.SepulkaDaoMyBatis; | ||
import smecalculus.bezmen.interior.storage.SepulkaDaoSpringData; | ||
import smecalculus.bezmen.interior.storage.SepulkaRecMapper; | ||
import smecalculus.bezmen.interior.storage.SepulkaRecMapperImpl; | ||
import smecalculus.bezmen.interior.storage.mybatis.SepulkaSqlMapper; | ||
import smecalculus.bezmen.interior.storage.springdata.SepulkaRepository; | ||
import smecalculus.bezmen.interior.validation.EdgeValidator; | ||
|
||
@Import({ValidationBeans.class, ConfigBeans.class, MessagingBeans.class, StorageBeans.class}) | ||
@PropertySource("classpath:application.properties") | ||
@Configuration(proxyBeanMethods = false) | ||
public class App { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(App.class, args); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMessageMappingModes(SPRING_MVC) | ||
SepulkaController sepulkaControllerSpringMvc( | ||
EdgeValidator validator, SepulkaClient client, SepulkaMsgMapper mapper) { | ||
return new SepulkaController(validator, client, mapper); | ||
} | ||
|
||
@Bean | ||
SepulkaMsgMapper sepulkaMsgMapper() { | ||
return new SepulkaMsgMapperImpl(); | ||
} | ||
|
||
@Bean | ||
SepulkaClient sepulkaClient(SepulkaService service, SepulkaSliceMapper mapper) { | ||
return new SepulkaClientImpl(service, mapper); | ||
} | ||
|
||
@Bean | ||
SepulkaService sepulkaService(SepulkaDao sepulkaDao) { | ||
return new SepulkaServiceImpl(sepulkaDao); | ||
} | ||
|
||
@Bean | ||
SepulkaSliceMapper sepulkaSliceMapper() { | ||
return new SepulkaSliceMapperImpl(); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnStateMappingMode(SPRING_DATA) | ||
SepulkaDaoSpringData sepulkaDaoSpringData(SepulkaRecMapper mapper, SepulkaRepository repository) { | ||
return new SepulkaDaoSpringData(mapper, repository); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnStateMappingMode(MY_BATIS) | ||
SepulkaDaoMyBatis sepulkaDaoMyBatis(SepulkaRecMapper recMapper, SepulkaSqlMapper sqlMapper) { | ||
return new SepulkaDaoMyBatis(recMapper, sqlMapper); | ||
} | ||
|
||
@Bean | ||
SepulkaRecMapper sepulkaRecMapper() { | ||
return new SepulkaRecMapperImpl(); | ||
} | ||
} |
11 changes: 5 additions & 6 deletions
11
...culus/bezmen/core/SepulkaServiceImpl.java → ...men/interior/core/SepulkaServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
apps/sepuling/src/main/java/smecalculus/bezmen/interior/messaging/SepulkaClientImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package smecalculus.bezmen.interior.messaging; | ||
|
||
import lombok.NonNull; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaClient; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; | ||
import smecalculus.bezmen.interior.core.Sepulka; | ||
import smecalculus.bezmen.interior.core.SepulkaService; | ||
import smecalculus.bezmen.interior.core.SepulkaSliceMapper; | ||
|
||
public record SepulkaClientImpl(@NonNull SepulkaService service, @NonNull SepulkaSliceMapper mapper) | ||
implements SepulkaClient { | ||
|
||
@Override | ||
public SepulkaRegisteredSlice register(SepulkaRegisterSlice request) { | ||
Sepulka sepulka = service.register(request); | ||
return mapper.toSlice(sepulka); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ling/src/main/java/smecalculus/bezmen/interior/messaging/springmvc/SepulkaController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package smecalculus.bezmen.interior.messaging.springmvc; | ||
|
||
import lombok.NonNull; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaClient; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaMsgMapper; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSlice; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaRegisterSliceMsg; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSlice; | ||
import smecalculus.bezmen.exterior.messaging.SepulkaRegisteredSliceMsg; | ||
import smecalculus.bezmen.interior.validation.EdgeValidator; | ||
|
||
@RestController | ||
@RequestMapping("sepulkas") | ||
public record SepulkaController( | ||
@NonNull EdgeValidator validator, @NonNull SepulkaClient client, @NonNull SepulkaMsgMapper mapper) { | ||
|
||
@PostMapping | ||
ResponseEntity<SepulkaRegisteredSliceMsg> register(@RequestBody SepulkaRegisterSliceMsg sliceMsg) { | ||
validator.validate(sliceMsg); | ||
SepulkaRegisterSlice requestSlice = mapper.toDomain(sliceMsg); | ||
SepulkaRegisteredSlice responseSlice = client.register(requestSlice); | ||
return ResponseEntity.status(HttpStatus.CREATED).body(mapper.toMsg(responseSlice)); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
...mecalculus/bezmen/storage/SepulkaDao.java → ...s/bezmen/interior/storage/SepulkaDao.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...lus/bezmen/storage/SepulkaDaoMyBatis.java → ...n/interior/storage/SepulkaDaoMyBatis.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../bezmen/storage/SepulkaDaoSpringData.java → ...nterior/storage/SepulkaDaoSpringData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...mecalculus/bezmen/storage/SepulkaRec.java → ...s/bezmen/interior/storage/SepulkaRec.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ulus/bezmen/storage/SepulkaRecMapper.java → ...en/interior/storage/SepulkaRecMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...men/storage/mybatis/SepulkaSqlMapper.java → ...ior/storage/mybatis/SepulkaSqlMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...storage/springdata/SepulkaRepository.java → ...storage/springdata/SepulkaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package smecalculus.bezmen.storage.springdata; | ||
package smecalculus.bezmen.interior.storage.springdata; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
import smecalculus.bezmen.storage.SepulkaRec; | ||
import smecalculus.bezmen.interior.storage.SepulkaRec; | ||
|
||
public interface SepulkaRepository extends CrudRepository<SepulkaRec, String> {} |
Oops, something went wrong.