Changed DTO files to Dto because of checkstyle

This commit is contained in:
Merel Steenbergen
2019-03-17 18:23:18 +01:00
parent dd74a97c47
commit bfc9595d21
2 changed files with 8 additions and 8 deletions

View File

@@ -31,7 +31,7 @@ public class UserService {
* @return a built userDTO with the required information * @return a built userDTO with the required information
*/ */
@SuppressWarnings("Duplicates") @SuppressWarnings("Duplicates")
public UserDTO registerUser(String name, String password) { public UserDto registerUser(String name, String password) {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/registerUser") UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/registerUser")
@@ -52,7 +52,7 @@ public class UserService {
* @return a built userDTO with the required information * @return a built userDTO with the required information
*/ */
@SuppressWarnings("Duplicates") @SuppressWarnings("Duplicates")
public UserDTO loginUser(String name, String password) { public UserDto loginUser(String name, String password) {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/loginUser") UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/loginUser")
@@ -73,7 +73,7 @@ public class UserService {
* @return a built userDTO with the required information * @return a built userDTO with the required information
*/ */
@SuppressWarnings("Duplicates") @SuppressWarnings("Duplicates")
public UserDTO addVeganMeal(Long id, String name) { public UserDto addVeganMeal(Long id, String name) {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/addVeganMeal") UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/addVeganMeal")
@@ -90,13 +90,13 @@ public class UserService {
* @return a UserDTO with the required information * @return a UserDTO with the required information
*/ */
@SuppressWarnings("Duplicates") @SuppressWarnings("Duplicates")
public UserDTO getName(Long id) { public UserDto getName(Long id) {
HttpHeaders headers = new HttpHeaders(); HttpHeaders headers = new HttpHeaders();
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE); headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/getUsername") UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/getUsername")
.queryParam("id", id); .queryParam("id", id);
HttpEntity<?> entity = new HttpEntity<>(headers); HttpEntity<?> entity = new HttpEntity<>(headers);
System.out.println(builder.build().encode().toUri()); System.out.println(builder.build().encode().toUri());
return this.restTemplate.getForObject(builder.build().encode().toUri(), UserDTO.class); return this.restTemplate.getForObject(builder.build().encode().toUri(), UserDto.class);
} }
} }

View File

@@ -1,15 +1,15 @@
package greenify.common; package greenify.common;
public class ActivityDTO { public class ActivityDto {
private Long id; private Long id;
private String name; private String name;
private String description; private String description;
private int score; private int score;
public ActivityDTO() { public ActivityDto() {
} }
public ActivityDTO(Long id, String name, String description, int score) { public ActivityDto(Long id, String name, String description, int score) {
this.id = id; this.id = id;
this.name = name; this.name = name;
this.description = description; this.description = description;