kaif
This commit is contained in:
parent
e42408413a
commit
794388d0f6
@ -3,9 +3,13 @@ package com.webproglabs.lab1.dto;
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.webproglabs.lab1.models.Comment;
|
import com.webproglabs.lab1.models.Comment;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
public class CommentDto {
|
public class CommentDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@NotBlank
|
||||||
private String text;
|
private String text;
|
||||||
|
@NotBlank
|
||||||
private String authorLogin;
|
private String authorLogin;
|
||||||
|
|
||||||
public CommentDto(Comment comment) {
|
public CommentDto(Comment comment) {
|
||||||
|
@ -4,13 +4,18 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
import com.webproglabs.lab1.models.Comment;
|
import com.webproglabs.lab1.models.Comment;
|
||||||
import com.webproglabs.lab1.models.Post;
|
import com.webproglabs.lab1.models.Post;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PostDto {
|
public class PostDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@NotBlank
|
||||||
private String text;
|
private String text;
|
||||||
|
@NotNull
|
||||||
private List<CommentDto> comments = new ArrayList<>();
|
private List<CommentDto> comments = new ArrayList<>();
|
||||||
|
@NotBlank
|
||||||
private String authorLogin;
|
private String authorLogin;
|
||||||
|
|
||||||
public PostDto(Post post){
|
public PostDto(Post post){
|
||||||
|
@ -4,13 +4,18 @@ import com.webproglabs.lab1.models.Comment;
|
|||||||
import com.webproglabs.lab1.models.Post;
|
import com.webproglabs.lab1.models.Post;
|
||||||
import com.webproglabs.lab1.models.Topic;
|
import com.webproglabs.lab1.models.Topic;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TopicDto {
|
public class TopicDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@NotBlank
|
||||||
private String name;
|
private String name;
|
||||||
|
@NotBlank
|
||||||
private String description;
|
private String description;
|
||||||
|
@NotNull
|
||||||
private List<PostDto> posts = new ArrayList<>();
|
private List<PostDto> posts = new ArrayList<>();
|
||||||
|
|
||||||
public TopicDto(Topic topic) {
|
public TopicDto(Topic topic) {
|
||||||
|
@ -6,15 +6,22 @@ import com.webproglabs.lab1.models.Post;
|
|||||||
import com.webproglabs.lab1.models.User;
|
import com.webproglabs.lab1.models.User;
|
||||||
import com.webproglabs.lab1.models.UserRole;
|
import com.webproglabs.lab1.models.UserRole;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class UserDto {
|
public class UserDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@NotBlank
|
||||||
private String login;
|
private String login;
|
||||||
|
@NotBlank
|
||||||
private String password;
|
private String password;
|
||||||
|
@NotNull
|
||||||
private List<CommentDto> comments = new ArrayList<>();
|
private List<CommentDto> comments = new ArrayList<>();
|
||||||
|
@NotNull
|
||||||
private List<PostDto> posts = new ArrayList<>();
|
private List<PostDto> posts = new ArrayList<>();
|
||||||
|
@NotNull
|
||||||
private UserRole role;
|
private UserRole role;
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<div class="dropdown text-center mx-auto w-75">
|
<div class="dropdown text-center mx-auto w-75">
|
||||||
<div class="text-center mt-3">
|
<div class="text-center mt-3">
|
||||||
<button class="btn btn-secondary dropdown-toggle ms-3 mb-3 w-50" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
<button class="btn btn-secondary dropdown-toggle mb-3 w-100" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
Выбор темы
|
Выбор темы
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu w-50" >
|
<ul class="dropdown-menu w-100" >
|
||||||
<li th:each="topic: ${topics}">
|
<li th:each="topic: ${topics}">
|
||||||
<a class="dropdown-item" th:href="@{/feed/{id}(id=${topic.id})}" th:text="${topic.name + '. ' + topic.description}">
|
<a class="dropdown-item" th:href="@{/feed/{id}(id=${topic.id})}" th:text="${topic.name + '. ' + topic.description}">
|
||||||
</a>
|
</a>
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div layout:fragment="contentFeed">
|
<div layout:fragment="contentFeed">
|
||||||
|
|
||||||
<div class='mb-3 mx-auto w-75'>
|
<div class='mb-3 mx-auto w-75'>
|
||||||
<div class="text-center w-100 border border-2">
|
<div class="text-center w-100 border border-2 bg-light">
|
||||||
<p class="text-center h3" th:text="${selectedTopic.name}"></p>
|
<p class="text-center h3" th:text="${selectedTopic.name}"></p>
|
||||||
<p class="text-center fw-light" th:text="${selectedTopic.description}"></p>
|
<p class="text-center fw-light" th:text="${selectedTopic.description}"></p>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user