Skip to content
Snippets Groups Projects
Commit 87c07f35 authored by Thomas's avatar Thomas
Browse files

Comment bugfix

parent c7917820
Branches
Tags
No related merge requests found
......@@ -38,6 +38,7 @@ public class WebSecurity extends WebSecurityConfigurerAdapter{
.antMatchers(HttpMethod.POST, "/login").permitAll()
.antMatchers(HttpMethod.POST, "/user/signup").permitAll()
.antMatchers(HttpMethod.GET, "/search").permitAll()
.antMatchers(HttpMethod.GET, "/comments").permitAll()
.antMatchers(HttpMethod.GET, "/models").permitAll()
.antMatchers(HttpMethod.GET, "/models/tags").permitAll()
.antMatchers(HttpMethod.GET, "/models/download").permitAll()
......
package mozen.business;
import java.util.Collection;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,6 +37,7 @@ public class CommentManager implements ICommentManager {
comment.setAuthor(user);
comment.setContent(message.getContent());
comment.setModel(model);
comment.setAdded(new Date());
commentRepo.save(comment);
}
......
......@@ -43,6 +43,9 @@ public class ModelManager implements IModelManager {
model.setName(message.getName());
model.setShortDescription(message.getShortDescription());
model.setLongDescription(message.getLongDescription());
model.setPerformanceUnit(message.getPerformanceUnit());
model.setPerformance(message.getPerformance());
model.setParameterCount(message.getParameterCount());
if (message.getTags() != null) {
Set<Tag> tags = new HashSet<Tag>();
......
......@@ -22,17 +22,27 @@ public class ModelMessage implements Serializable {
private String [] customLayers;
private int performance;
private String performanceUnit;
private int parameterCount;
public ModelMessage() {
}
public ModelMessage(String name, String shortDescription, String longDescription, String[] tags, String[] customLayers) {
public ModelMessage(String name, String shortDescription, String longDescription, String[] tags, String[] customLayers, int performance, String performanceUnit, int parameterCount) {
this.name = name;
this.shortDescription = shortDescription;
this.longDescription = longDescription;
this.tags = tags;
this.customLayers = customLayers;
this.performance = performance;
this.performanceUnit = performanceUnit;
this.parameterCount = parameterCount;
}
public String getName() {
return this.name;
}
......@@ -73,4 +83,29 @@ public class ModelMessage implements Serializable {
this.customLayers = customLayers;
}
public int getPerformance() {
return this.performance;
}
public void setPerformance(int performance) {
this.performance = performance;
}
public String getPerformanceUnit() {
return this.performanceUnit;
}
public void setPerformanceUnit(String performanceUnit) {
this.performanceUnit = performanceUnit;
}
public int getParameterCount() {
return this.parameterCount;
}
public void setParameterCount(int parameterCount) {
this.parameterCount = parameterCount;
}
}
\ No newline at end of file
......@@ -21,7 +21,6 @@ import mozen.model.Comment;
import mozen.model.User;
import mozen.utils.UserHelper;
@RestController
@RequestMapping("/comments")
@CrossOrigin
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment