Skip to content

Commit 6ea627c

Browse files
committed
Code cleanup and REST improvements
1 parent 0eb815c commit 6ea627c

20 files changed

+161
-672
lines changed

src/main/java/com/patternpedia/api/config/ResourceServerConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import org.springframework.context.annotation.Bean;
55
import org.springframework.context.annotation.Configuration;
66
import org.springframework.core.Ordered;
7+
import org.springframework.http.HttpMethod;
8+
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
79
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
810
import org.springframework.security.config.http.SessionCreationPolicy;
911
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

src/main/java/com/patternpedia/api/entities/designmodel/ConcreteSolution.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ public class ConcreteSolution {
2929
@ElementCollection
3030
private List<String> properties;
3131

32-
private String templateRef;
32+
private String templateUri;
3333

3434
private String aggregatorType;
35-
36-
private Integer priority;
3735
}

src/main/java/com/patternpedia/api/entities/designmodel/ConcreteSolutionOption.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/main/java/com/patternpedia/api/entities/designmodel/DesignModel.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,4 @@ public class DesignModel extends EntityWithURI {
3131
@JsonIgnore
3232
@OneToMany(mappedBy = "designModel", cascade = CascadeType.ALL, orphanRemoval = true)
3333
private List<DesignModelUndirectedEdge> undirectedEdges;
34-
35-
// public void removePattern(Pattern pattern) {
36-
// for (Iterator<DesignModelPattern> iterator = this.patterns.iterator(); iterator.hasNext(); ) {
37-
// DesignModelPattern designModelPattern = iterator.next();
38-
// if (designModelPattern.getDesignModel().equals(this) && designModelPattern.getPattern().equals(pattern)) {
39-
// iterator.remove();
40-
// designModelPattern.getPattern().getDesignModels().remove(designModelPattern);
41-
// designModelPattern.setPattern(null);
42-
// designModelPattern.setDesignModel(null);
43-
// break;
44-
// }
45-
// }
46-
// }
47-
//
48-
// public void removeDirectedEdge(DirectedEdge directedEdge) {
49-
// for (Iterator<DesignModelDirectedEdge> iterator = this.directedEdges.iterator(); iterator.hasNext(); ) {
50-
// DesignModelDirectedEdge designModelDirectedEdge = iterator.next();
51-
// if (designModelDirectedEdge.getDesignModel().equals(this) &&
52-
// designModelDirectedEdge.getDirectedEdge().equals(directedEdge)) {
53-
// iterator.remove();
54-
// designModelDirectedEdge.getDirectedEdge().getDesignModels().remove(designModelDirectedEdge);
55-
// designModelDirectedEdge.setDirectedEdge(null);
56-
// designModelDirectedEdge.setDesignModel(null);
57-
// break;
58-
// }
59-
// }
60-
// }
6134
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.patternpedia.api.entities.designmodel;
2+
3+
import lombok.Data;
4+
5+
import javax.persistence.Entity;
6+
import javax.persistence.Id;
7+
8+
@Entity
9+
@Data
10+
public class DesignModelEdgeType {
11+
12+
@Id
13+
private String name;
14+
15+
private Boolean swap;
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.patternpedia.api.exception;
2+
3+
public class AggregationException extends RuntimeException {
4+
5+
public AggregationException(String message) {
6+
super(message);
7+
}
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.patternpedia.api.repositories;
2+
3+
import com.patternpedia.api.entities.designmodel.DesignModelEdgeType;
4+
import org.springframework.data.jpa.repository.JpaRepository;
5+
6+
import java.util.Optional;
7+
8+
public interface DesignModelEdgeTypeRepository extends JpaRepository<DesignModelEdgeType, String> {
9+
10+
Optional<DesignModelEdgeType> findTopByName(String name);
11+
}

src/main/java/com/patternpedia/api/rest/controller/ConcreteSolutionController.java

Lines changed: 0 additions & 75 deletions
This file was deleted.

0 commit comments

Comments
 (0)