Skip to content

Commit

Permalink
Refuse ksp
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Feb 17, 2024
1 parent c101c5f commit 10c422f
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 116 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import smecalculus.bezmen.core.SepulkaMapper;
import smecalculus.bezmen.core.SepulkaMapperImpl;
import smecalculus.bezmen.core.SepulkaConverter;
import smecalculus.bezmen.core.SepulkaConverterImpl;
import smecalculus.bezmen.core.SepulkaService;
import smecalculus.bezmen.core.SepulkaServiceImpl;
import smecalculus.bezmen.messaging.SepulkaClient;
Expand Down Expand Up @@ -53,13 +53,13 @@ SepulkaClient sepulkaClient(EdgeValidator validator, SepulkaMessageMapper mapper
}

@Bean
SepulkaMapper sepulkaMapper() {
return new SepulkaMapperImpl();
SepulkaConverter sepulkaConverter() {
return new SepulkaConverterImpl();
}

@Bean
SepulkaService sepulkaService(SepulkaMapper mapper, SepulkaDao dao) {
return new SepulkaServiceImpl(mapper, dao);
SepulkaService sepulkaService(SepulkaConverter converter, SepulkaDao dao) {
return new SepulkaServiceImpl(converter, dao);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
public class SepulkaServiceImpl implements SepulkaService {

@NonNull
private SepulkaMapper mapper;
private SepulkaConverter converter;

@NonNull
private SepulkaDao dao;

@Override
public RegistrationResponse register(RegistrationRequest request) {
var now = LocalDateTime.now();
var sepulkaCreated = mapper.toState(request)
var sepulkaCreated = converter.toState(request)
.internalId(randomUUID())
.revision(0)
.createdAt(now)
.updatedAt(now)
.build();
var sepulkaSaved = dao.add(sepulkaCreated);
return mapper.toMessage(sepulkaSaved).build();
return converter.toMessage(sepulkaSaved).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.springframework.context.annotation.PropertySource
import smecalculus.bezmen.configuration.MessagingDm.MappingMode.SPRING_MVC
import smecalculus.bezmen.configuration.StorageDm.MappingMode.MY_BATIS
import smecalculus.bezmen.configuration.StorageDm.MappingMode.SPRING_DATA
import smecalculus.bezmen.core.SepulkaMapper
import smecalculus.bezmen.core.SepulkaMapperImpl
import smecalculus.bezmen.core.SepulkaConverter
import smecalculus.bezmen.core.SepulkaConverterImpl
import smecalculus.bezmen.core.SepulkaService
import smecalculus.bezmen.core.SepulkaServiceImpl
import smecalculus.bezmen.messaging.SepulkaClient
Expand Down Expand Up @@ -55,13 +55,13 @@ class App {
}

@Bean
fun sepulkaMapper(): SepulkaMapper {
return SepulkaMapperImpl()
fun sepulkaConverter(): SepulkaConverter {
return SepulkaConverterImpl()
}

@Bean
fun sepulkaService(
mapper: SepulkaMapper,
mapper: SepulkaConverter,
dao: SepulkaDao,
): SepulkaService {
return SepulkaServiceImpl(mapper, dao)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ import java.time.LocalDateTime
import java.util.UUID

class SepulkaServiceImpl(
private val mapper: SepulkaMapper,
private val converter: SepulkaConverter,
private val dao: SepulkaDao,
) : SepulkaService {
override fun register(request: RegistrationRequest): RegistrationResponse {
val now = LocalDateTime.now()
val sepulkaCreated =
mapper.toState(request)
converter.toState(request)
.internalId(UUID.randomUUID())
.revision(0)
.createdAt(now)
.updatedAt(now)
.build()
val sepulkaSaved = dao.add(sepulkaCreated)
return mapper.toMessage(sepulkaSaved).build()
return converter.toMessage(sepulkaSaved).build()
}

override fun view(request: PreviewRequest): List<PreviewResponse> {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import smecalculus.bezmen.core.SepulkaStateDm.AggregateRoot;

@Mapper
public interface SepulkaMapper {
public interface SepulkaConverter {
AggregateRoot.Builder toState(RegistrationRequest request);

RegistrationResponse.Builder toMessage(AggregateRoot state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import smecalculus.bezmen.configuration.ValidationDm;
import smecalculus.bezmen.configuration.ValidationDm.ValidationMode;
import smecalculus.bezmen.configuration.ValidationEm;
import smecalculus.bezmen.mapping.EdgeMapper;

@Mapper
public interface ValidationPropsMapper extends EdgeMapper {
public interface ValidationPropsMapper {
@Mapping(source = "mode", target = "validationMode")
ValidationDm.ValidationProps toDomain(ValidationEm.ValidationProps props);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
import org.mapstruct.Mapping;
import smecalculus.bezmen.configuration.MessagingDm.MappingMode;
import smecalculus.bezmen.configuration.MessagingDm.ProtocolMode;
import smecalculus.bezmen.mapping.EdgeMapper;

@Mapper
public interface MessagingPropsMapper extends EdgeMapper {
public interface MessagingPropsMapper {
@Mapping(source = "protocol", target = "protocolProps")
@Mapping(source = "mapping", target = "mappingProps")
MessagingDm.MessagingProps toDomain(MessagingEm.MessagingProps propsEdge);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import org.mapstruct.Mapper;
import smecalculus.bezmen.core.SepulkaMessageDm;
import smecalculus.bezmen.mapping.EdgeMapper;

@Mapper
public interface SepulkaMessageMapper extends EdgeMapper {
public interface SepulkaMessageMapper {
SepulkaMessageDm.RegistrationRequest toDomain(SepulkaMessageEm.RegistrationRequest request);

SepulkaMessageEm.RegistrationResponse toEdge(SepulkaMessageDm.RegistrationResponse response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

import org.mapstruct.Mapper;
import smecalculus.bezmen.core.SepulkaStateDm;
import smecalculus.bezmen.mapping.EdgeMapper;

@Mapper
public interface SepulkaStateMapper extends EdgeMapper {
public interface SepulkaStateMapper {
SepulkaStateEm.AggregateRoot toEdge(SepulkaStateDm.AggregateRoot state);

SepulkaStateDm.AggregateRoot toDomain(SepulkaStateEm.AggregateRoot state);
Expand Down
19 changes: 0 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,6 @@
<version>${kotlin.version}</version>
<configuration>
<jvmTarget>${maven.compiler.release}</jvmTarget>
<compilerPlugins>
<plugin>ksp</plugin>
</compilerPlugins>
<pluginOptions>
<option>ksp:apoption=konvert.konverter.generate-class=true</option>
<option>ksp:apoption=konvert.enforce-not-null=true</option>
</pluginOptions>
</configuration>
<executions>
<execution>
Expand All @@ -180,18 +173,6 @@
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.dyescape</groupId>
<artifactId>kotlin-maven-symbol-processing</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>io.mcarle</groupId>
<artifactId>konvert</artifactId>
<version>${konvert.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit 10c422f

Please sign in to comment.