Revert "Merge branch 'master' into 'vegetarian_meal'"
This reverts commit b3eeffdb32aa058f9f1aa6b9cbec3d05e2d07b8f
This commit is contained in:
@@ -10,8 +10,8 @@ import org.springframework.stereotype.Controller;
|
||||
|
||||
@Controller
|
||||
public class DashBoardController {
|
||||
|
||||
private int count = 0;
|
||||
@Autowired
|
||||
UserService userService;
|
||||
|
||||
@FXML
|
||||
public AnchorPane menuBar;
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
|
||||
@Autowired
|
||||
RestTemplate restTemplate;
|
||||
|
||||
@@ -37,26 +36,4 @@ public class UserService {
|
||||
System.out.println(builder.build().encode().toUri());
|
||||
return this.restTemplate.getForObject(builder.build().encode().toUri(), UserDTO.class);
|
||||
}
|
||||
|
||||
public UserDTO loginUser(String name, String password) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
|
||||
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/loginUser")
|
||||
.queryParam("name", name)
|
||||
.queryParam("password", password);
|
||||
HttpEntity<?> entity = new HttpEntity<>(headers);
|
||||
System.out.println(builder.build().encode().toUri());
|
||||
return this.restTemplate.getForObject(builder.build().encode().toUri(), UserDTO.class);
|
||||
}
|
||||
|
||||
public UserDTO addVeganMeal(Long id, String name) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.set("Accept", MediaType.APPLICATION_JSON_VALUE);
|
||||
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl("http://localhost:8080/addVeganMeal")
|
||||
.queryParam("id", id)
|
||||
.queryParam("name", name);
|
||||
HttpEntity<?> entity = new HttpEntity<>(headers);
|
||||
System.out.println(builder.build().encode().toUri());
|
||||
return this.restTemplate.getForObject(builder.build().encode().toUri(), UserDTO.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user