Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oplekal committed Dec 31, 2024
1 parent 0e31038 commit c36f8fc
Show file tree
Hide file tree
Showing 29 changed files with 6 additions and 4,799 deletions.
257 changes: 0 additions & 257 deletions eperusteet/eperusteet-service/pom.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@EnableCaching
@EnableTransactionManagement
@EnableMethodSecurity(securedEnabled = true)
@EnableAspectJAutoProxy // (proxyTargetClass = true)
@EnableAspectJAutoProxy
@EnableJpaRepositories(basePackages = "fi.vm.sade.eperusteet.repository", repositoryFactoryBeanClass = JpaWithVersioningRepositoryFactoryBean.class)
@PropertySource(
ignoreResourceNotFound = true, value={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,14 @@
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.stream.Collectors;

@Configuration
//@EnableSwagger2
//@Profile("!test")
public class SwaggerConfig {

// @Bean
// public Docket api(TypeResolver typeResolver) {
// return new Docket(DocumentationType.SWAGGER_2)
// .apiInfo(apiInfo())
// .directModelSubstitute(JsonNode.class, Object.class)
// .genericModelSubstitutes(ResponseEntity.class, Optional.class)
// .forCodeGeneration(true)
// .select()
// .apis(not(RequestHandlerSelectors.withClassAnnotation(InternalApi.class)))
// .build()
// .alternateTypeRules(
// AlternateTypeRules.newRule(
// typeResolver.resolve(new GenericType<Callable<ResponseEntity<Object>>>() {
// }),
// typeResolver.resolve(Object.class)));
// }

// private ApiInfo apiInfo() {
// return new ApiInfo(
// "ePerusteet rajapinta",
// "",
// "Spring MVC API based on the swagger 2.0 and 1.2 specification",
// null,
// null,
// "EUPL 1.1",
// "http://ec.europa.eu/idabc/eupl",
// new ArrayList<>());
// }

@Bean
public OpenAPI springShopOpenAPI() {
return new OpenAPI()
Expand Down Expand Up @@ -80,21 +48,4 @@ public GroupedOpenApi externalOpenApi() {
.pathsToMatch("/api/external/**")
.build();
}

// @Bean
// public OpenApiCustomiser customOpenApi() {
// return openApi -> {
// // Define the base path of the controller to keep visible
// String visibleControllerBasePath = "/api/external";
//
// // Filter paths to only include the ones that match the desired controller
// openApi.setPaths(openApi.getPaths().entrySet().stream()
// .filter(entry -> entry.getKey().startsWith(visibleControllerBasePath))
// .collect(
// Paths::new,
// (paths, entry) -> paths.addPathItem(entry.getKey(), entry.getValue()),
// HashMap::putAll
// ));
// };
// }
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fi.vm.sade.eperusteet.config;

import fi.vm.sade.eperusteet.repository.OphSessionMappingStorage;
import fi.vm.sade.eperusteet.service.util.RestClientFactoryImpl;
import fi.vm.sade.java_utils.security.OpintopolkuCasAuthenticationFilter;
import fi.vm.sade.javautils.http.auth.CasAuthenticator;
import fi.vm.sade.javautils.kayttooikeusclient.OphUserDetailsServiceImpl;
Expand All @@ -19,13 +18,11 @@
import org.springframework.security.cas.authentication.CasAuthenticationProvider;
import org.springframework.security.cas.web.CasAuthenticationEntryPoint;
import org.springframework.security.cas.web.CasAuthenticationFilter;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
import org.springframework.security.web.authentication.logout.HeaderWriterLogoutHandler;
Expand Down Expand Up @@ -73,11 +70,6 @@ public CasAuthenticator casAuthenticator() {
return new CasAuthenticator(this.webUrlCas, eperusteet_username, eperusteet_password, hostAlb, null, false, null);
}

// @Bean
// public UserDetailsService userDetailsService() {
// return new OphUserDetailsServiceImpl(this.hostAlb, RestClientFactoryImpl.CALLER_ID, casAuthenticator());
// }

@Bean
public ServiceProperties serviceProperties() {
ServiceProperties serviceProperties = new ServiceProperties();
Expand All @@ -90,7 +82,6 @@ public ServiceProperties serviceProperties() {
@Bean
public CasAuthenticationProvider casAuthenticationProvider() {
CasAuthenticationProvider casAuthenticationProvider = new CasAuthenticationProvider();
// casAuthenticationProvider.setUserDetailsService(userDetailsService());
casAuthenticationProvider.setAuthenticationUserDetailsService(new OphUserDetailsServiceImpl());
casAuthenticationProvider.setServiceProperties(serviceProperties());
casAuthenticationProvider.setTicketValidator(ticketValidator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
@Entity
@Immutable
@Table(name = "julkaistu_peruste_data")
//@TypeDef(name = "jsonb", defaultForType = JsonBType.class, typeClass = JsonBType.class)
//@Convert(attributeName = "data", converter = JsonBType.class)
public class JulkaistuPerusteData {

@Id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package fi.vm.sade.eperusteet.domain;

import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ public class ArvioinninKohdealue implements Serializable {
@ManyToOne(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST})
private Koodi koodi;

/// TODO: rikkoo testin fi.vm.sade.eperusteet.service.AuditedEntityTestIT#testTutkinnonOsaRevisions
// @Getter
// @NotAudited
// @RelatesToPeruste
// @ManyToMany(fetch = FetchType.LAZY)
// @JoinTable(name = "arviointi_arvioinninkohdealue",
// inverseJoinColumns = @JoinColumn(name = "arviointi_id"),
// joinColumns = @JoinColumn(name = "arvioinninkohdealue_id"))
// private Set<Arviointi> arvioinnit = new HashSet<>();

public ArvioinninKohdealue() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class Liite implements Serializable {
private String mime;

@Getter
//@NotNull
@Size(max = 1024)
private String nimi;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,6 @@ public class Osaamistavoite implements Serializable, PartialMergeable<Osaamistav
@OneToOne(cascade = CascadeType.ALL)
private Ammattitaitovaatimukset2019 tavoitteet2020;

// FIXME: siivoa kannasta - testissa vaikka tallentaa vain tavoitteet2020 niin tavoitteet menee myös tyhjänä = syntyy id = menee confliktiin tavoitteet2020 kanssa
// @Deprecated
// @Getter
// @Setter
// @ValidHtml(whitelist = ValidHtml.WhitelistType.SIMPLIFIED)
// @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER)
// @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
// private TekstiPalanen tavoitteet;

@Deprecated
@Getter
@Setter
Expand Down Expand Up @@ -127,7 +118,6 @@ public Osaamistavoite() {
this.kieli = ot.kieli;
this.koodi = ot.koodi;
this.arviointi = ot.getArviointi() == null ? null : new Arviointi(ot.getArviointi());
// this.tavoitteet = ot.tavoitteet;

for (AmmattitaitovaatimuksenKohdealue avKohdealue : ot.ammattitaitovaatimuksetLista) {
this.ammattitaitovaatimuksetLista.add(new AmmattitaitovaatimuksenKohdealue(avKohdealue));
Expand Down Expand Up @@ -157,7 +147,6 @@ public void mergeState(Osaamistavoite updated) {
this.setPakollinen(updated.isPakollinen());
this.setKieli(updated.getKieli());
this.setLaajuus(updated.getLaajuus());
// this.setTavoitteet(updated.getTavoitteet());
this.setTunnustaminen(updated.getTunnustaminen());
this.setArviointi(updated.getArviointi());
this.setKoodi(updated.getKoodi());
Expand Down Expand Up @@ -200,7 +189,6 @@ public boolean structureEquals(Osaamistavoite other) {
boolean result = refXnor(getNimi(), other.getNimi());
result &= isPakollinen() == other.isPakollinen();
result &= Objects.equal(getLaajuus(), other.getLaajuus());
// result &= refXnor(getTavoitteet(), other.getTavoitteet());
result &= refXnor(getTunnustaminen(), other.getTunnustaminen());
result &= refXnor(getEsitieto(), other.getEsitieto());
result &= refXnor(getArviointi(), other.getArviointi());
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class PerusteBaseDto implements Serializable, PerusteIdentifiabl
private List<MuutosmaaraysDto> muutosmaaraykset = new ArrayList<>();

private String diaarinumero;
@ApiModelProperty("Perusteen alkuperäinen voimaantulon alkamispäivä.")
@Schema(description = "Perusteen alkuperäinen voimaantulon alkamispäivä.")
private Date voimassaoloAlkaa;

@Schema(description = "Voimassaolon loppumisen jälkeinen perusteen päättymispäivämäärä.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@
import fi.vm.sade.eperusteet.dto.yl.PerusopetuksenPerusteenSisaltoDto;
import fi.vm.sade.eperusteet.dto.yl.TPOOpetuksenSisaltoDto;
import fi.vm.sade.eperusteet.dto.yl.lukio.julkinen.LukiokoulutuksenPerusteenSisaltoDto;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -89,7 +87,7 @@ public class PerusteKaikkiDto extends PerusteBaseDto {
private DigitaalisenOsaamisenSisaltoDto digitaalinenOsaaminenSisalto;

@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModelProperty("Perusteen viimeisimmän muutosmääräyksen voimaantulon alkamispäivä.")
@Schema(description = "Perusteen viimeisimmän muutosmääräyksen voimaantulon alkamispäivä.")
private Date muutosmaarayksenVoimassaoloAlkaa;

@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ public class PerusteKevytDto {
private Reference perusteprojekti;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
// @Schema(type = "array")
private Set<SuoritustapaDto> suoritustavat;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,4 @@ public class PerusteprojektiQueryDto {
private boolean voimassaolo;
private boolean siirtyma;
private boolean poistunut;

// public void setTila(ProjektiTila tila) {
// this.tila = new HashSet<>();
// this.tila.add(tila);
// }

public void setTila(Set<ProjektiTila> tila) {
this.tila = tila;
}
}
Loading

0 comments on commit c36f8fc

Please sign in to comment.