fix
This commit is contained in:
parent
321f55c09d
commit
6d4818943a
@ -31,6 +31,7 @@ import de.bstly.board.controller.support.EntityResponseStatusException;
|
|||||||
import de.bstly.board.controller.support.RequestBodyErrors;
|
import de.bstly.board.controller.support.RequestBodyErrors;
|
||||||
import de.bstly.board.controller.validation.CommentValidator;
|
import de.bstly.board.controller.validation.CommentValidator;
|
||||||
import de.bstly.board.model.Comment;
|
import de.bstly.board.model.Comment;
|
||||||
|
import de.bstly.board.model.FlaggedStatus;
|
||||||
import de.bstly.board.model.Types;
|
import de.bstly.board.model.Types;
|
||||||
import de.bstly.board.model.Vote;
|
import de.bstly.board.model.Vote;
|
||||||
import de.bstly.board.model.VoteType;
|
import de.bstly.board.model.VoteType;
|
||||||
@ -183,6 +184,7 @@ public class CommentController extends BaseController {
|
|||||||
comment.setCreated(Instant.now().plus(getCommentDelay(), ChronoUnit.MINUTES));
|
comment.setCreated(Instant.now().plus(getCommentDelay(), ChronoUnit.MINUTES));
|
||||||
comment.setAuthor(getCurrentUsername());
|
comment.setAuthor(getCurrentUsername());
|
||||||
comment.setText(comment.getText().trim());
|
comment.setText(comment.getText().trim());
|
||||||
|
comment.setFlaggedStatus(FlaggedStatus.NORMAL);
|
||||||
comment = commentManager.save(comment);
|
comment = commentManager.save(comment);
|
||||||
|
|
||||||
Vote vote = new Vote();
|
Vote vote = new Vote();
|
||||||
|
@ -37,6 +37,7 @@ import de.bstly.board.controller.support.RequestBodyErrors;
|
|||||||
import de.bstly.board.controller.validation.EntryValidator;
|
import de.bstly.board.controller.validation.EntryValidator;
|
||||||
import de.bstly.board.model.Entry;
|
import de.bstly.board.model.Entry;
|
||||||
import de.bstly.board.model.EntryStatus;
|
import de.bstly.board.model.EntryStatus;
|
||||||
|
import de.bstly.board.model.FlaggedStatus;
|
||||||
import de.bstly.board.model.RankedEntry;
|
import de.bstly.board.model.RankedEntry;
|
||||||
import de.bstly.board.model.Types;
|
import de.bstly.board.model.Types;
|
||||||
import de.bstly.board.model.Vote;
|
import de.bstly.board.model.Vote;
|
||||||
@ -63,11 +64,11 @@ public class EntryController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Fetch by ranking.
|
* Fetch by ranking.
|
||||||
*
|
*
|
||||||
* @param pageParameter the page parameter
|
* @param pageParameter the page parameter
|
||||||
* @param sizeParameter the size parameter
|
* @param sizeParameter the size parameter
|
||||||
* @param dateParameter the date parameter
|
* @param dateParameter the date parameter
|
||||||
* @param gravityParameter the gravity parameter
|
* @param gravityParameter the gravity parameter
|
||||||
* @param ignoreParameter the ignore parameter
|
* @param ignoreParameter the ignore parameter
|
||||||
* @return the page
|
* @return the page
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("isAuthenticated()")
|
@PreAuthorize("isAuthenticated()")
|
||||||
@ -110,9 +111,9 @@ public class EntryController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Fetch by date.
|
* Fetch by date.
|
||||||
*
|
*
|
||||||
* @param pageParameter the page parameter
|
* @param pageParameter the page parameter
|
||||||
* @param sizeParameter the size parameter
|
* @param sizeParameter the size parameter
|
||||||
* @param dateParameter the date parameter
|
* @param dateParameter the date parameter
|
||||||
* @param ignoreParameter the ignore parameter
|
* @param ignoreParameter the ignore parameter
|
||||||
* @return the page
|
* @return the page
|
||||||
*/
|
*/
|
||||||
@ -142,11 +143,11 @@ public class EntryController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Fetch by comments.
|
* Fetch by comments.
|
||||||
*
|
*
|
||||||
* @param pageParameter the page parameter
|
* @param pageParameter the page parameter
|
||||||
* @param sizeParameter the size parameter
|
* @param sizeParameter the size parameter
|
||||||
* @param dateParameter the date parameter
|
* @param dateParameter the date parameter
|
||||||
* @param gravityParameter the gravity parameter
|
* @param gravityParameter the gravity parameter
|
||||||
* @param ignoreParameter the ignore parameter
|
* @param ignoreParameter the ignore parameter
|
||||||
* @return the page
|
* @return the page
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("isAuthenticated()")
|
@PreAuthorize("isAuthenticated()")
|
||||||
@ -183,9 +184,9 @@ public class EntryController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Fetch by last.
|
* Fetch by last.
|
||||||
*
|
*
|
||||||
* @param pageParameter the page parameter
|
* @param pageParameter the page parameter
|
||||||
* @param sizeParameter the size parameter
|
* @param sizeParameter the size parameter
|
||||||
* @param dateParameter the date parameter
|
* @param dateParameter the date parameter
|
||||||
* @param ignoreParameter the ignore parameter
|
* @param ignoreParameter the ignore parameter
|
||||||
* @return the page
|
* @return the page
|
||||||
*/
|
*/
|
||||||
@ -216,11 +217,11 @@ public class EntryController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Fetch by user.
|
* Fetch by user.
|
||||||
*
|
*
|
||||||
* @param username the username
|
* @param username the username
|
||||||
* @param pageParameter the page parameter
|
* @param pageParameter the page parameter
|
||||||
* @param sizeParameter the size parameter
|
* @param sizeParameter the size parameter
|
||||||
* @param dateParameter the date parameter
|
* @param dateParameter the date parameter
|
||||||
* @param ascParameter the asc parameter
|
* @param ascParameter the asc parameter
|
||||||
* @param ignoreParameter the ignore parameter
|
* @param ignoreParameter the ignore parameter
|
||||||
* @return the page
|
* @return the page
|
||||||
*/
|
*/
|
||||||
@ -253,7 +254,7 @@ public class EntryController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Gets the entry.
|
* Gets the entry.
|
||||||
*
|
*
|
||||||
* @param id the id
|
* @param id the id
|
||||||
* @param ignoreParameter the ignore parameter
|
* @param ignoreParameter the ignore parameter
|
||||||
* @return the entry
|
* @return the entry
|
||||||
*/
|
*/
|
||||||
@ -277,7 +278,7 @@ public class EntryController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* Creates the entry.
|
* Creates the entry.
|
||||||
*
|
*
|
||||||
* @param entry the entry
|
* @param entry the entry
|
||||||
* @param ignoreParameter the ignore parameter
|
* @param ignoreParameter the ignore parameter
|
||||||
* @return the entry
|
* @return the entry
|
||||||
*/
|
*/
|
||||||
@ -296,6 +297,7 @@ public class EntryController extends BaseController {
|
|||||||
entry.setCreated(Instant.now());
|
entry.setCreated(Instant.now());
|
||||||
entry.setAuthor(getCurrentUsername());
|
entry.setAuthor(getCurrentUsername());
|
||||||
entry.setEntryStatus(EntryStatus.NORMAL);
|
entry.setEntryStatus(EntryStatus.NORMAL);
|
||||||
|
entry.setFlaggedStatus(FlaggedStatus.NORMAL);
|
||||||
entry.setTitle(entry.getTitle().trim());
|
entry.setTitle(entry.getTitle().trim());
|
||||||
entry.setText(entry.getText().trim());
|
entry.setText(entry.getText().trim());
|
||||||
entry = entryManager.save(entry);
|
entry = entryManager.save(entry);
|
||||||
|
Loading…
Reference in New Issue
Block a user