mirror of
https://github.com/usatiuk/y.git
synced 2025-10-28 10:37:47 +01:00
a bit of cleanup
This commit is contained in:
@@ -2,10 +2,7 @@ package com.usatiuk.tjv.y.server.controller;
|
||||
|
||||
import com.usatiuk.tjv.y.server.dto.MessageCreateTo;
|
||||
import com.usatiuk.tjv.y.server.dto.MessageTo;
|
||||
import com.usatiuk.tjv.y.server.dto.converters.MessageMapper;
|
||||
import com.usatiuk.tjv.y.server.service.ChatService;
|
||||
import com.usatiuk.tjv.y.server.service.MessageService;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.core.Authentication;
|
||||
@@ -16,15 +13,9 @@ import java.util.Collection;
|
||||
@RestController
|
||||
@RequestMapping(value = "/message", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class MessageController {
|
||||
private final ChatService chatService;
|
||||
private final EntityManager entityManager;
|
||||
private final MessageMapper messageMapper;
|
||||
private final MessageService messageService;
|
||||
|
||||
public MessageController(ChatService chatService, EntityManager entityManager, MessageMapper messageMapper, MessageService messageService) {
|
||||
this.chatService = chatService;
|
||||
this.entityManager = entityManager;
|
||||
this.messageMapper = messageMapper;
|
||||
public MessageController(MessageService messageService) {
|
||||
this.messageService = messageService;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,12 @@ package com.usatiuk.tjv.y.server.controller;
|
||||
|
||||
import com.usatiuk.tjv.y.server.dto.PersonCreateTo;
|
||||
import com.usatiuk.tjv.y.server.dto.PersonTo;
|
||||
import com.usatiuk.tjv.y.server.dto.converters.PersonMapper;
|
||||
import com.usatiuk.tjv.y.server.service.ChatService;
|
||||
import com.usatiuk.tjv.y.server.service.PersonService;
|
||||
import com.usatiuk.tjv.y.server.service.exceptions.UserAlreadyExistsException;
|
||||
import com.usatiuk.tjv.y.server.service.exceptions.UserNotFoundException;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -19,15 +16,9 @@ import java.util.Collection;
|
||||
@RequestMapping(value = "/person", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class PersonController {
|
||||
private final PersonService personService;
|
||||
private final ChatService chatService;
|
||||
private final PersonMapper personMapper;
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
public PersonController(PersonService personService, ChatService chatService, PersonMapper personMapper, PasswordEncoder passwordEncoder) {
|
||||
public PersonController(PersonService personService) {
|
||||
this.personService = personService;
|
||||
this.chatService = chatService;
|
||||
this.personMapper = personMapper;
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.usatiuk.tjv.y.server.controller;
|
||||
import com.usatiuk.tjv.y.server.dto.TokenRequestTo;
|
||||
import com.usatiuk.tjv.y.server.dto.TokenResponseTo;
|
||||
import com.usatiuk.tjv.y.server.service.LoginTokenService;
|
||||
import com.usatiuk.tjv.y.server.service.PersonService;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -13,11 +12,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RestController
|
||||
@RequestMapping(value = "/token", produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
public class TokenController {
|
||||
private final PersonService personService;
|
||||
private final LoginTokenService loginTokenService;
|
||||
|
||||
public TokenController(PersonService personService, LoginTokenService loginTokenService) {
|
||||
this.personService = personService;
|
||||
public TokenController(LoginTokenService loginTokenService) {
|
||||
this.loginTokenService = loginTokenService;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package com.usatiuk.tjv.y.server.repository;
|
||||
|
||||
import com.usatiuk.tjv.y.server.entity.Post;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public interface PostRepository extends PagingAndSortingRepository<Post, Long>, CrudRepository<Post, Long> {
|
||||
public interface PostRepository extends CrudRepository<Post, Long> {
|
||||
Collection<Post> findByAuthorUuid(String authorUuid);
|
||||
|
||||
Collection<Post> findByAuthorUsername(String authorUsername);
|
||||
|
||||
Reference in New Issue
Block a user