Merge pull request #5867 from amit2103/BAEL-9710

[BAEL-9710] - Standardized packages for spring-rest module
This commit is contained in:
Loredana Crusoveanu
2018-12-08 22:04:58 +02:00
committed by GitHub
57 changed files with 112 additions and 94 deletions
@@ -1,4 +1,4 @@
package org.baeldung.resttemplate.lists;
package com.baeldung.resttemplate.lists;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -1,11 +1,12 @@
package org.baeldung.resttemplate.lists.client;
package com.baeldung.resttemplate.lists.client;
import org.baeldung.resttemplate.lists.dto.Employee;
import org.baeldung.resttemplate.lists.dto.EmployeeList;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
import org.springframework.web.client.RestTemplate;
import com.baeldung.resttemplate.lists.dto.Employee;
import com.baeldung.resttemplate.lists.dto.EmployeeList;
import java.util.ArrayList;
import java.util.List;
@@ -1,14 +1,15 @@
package org.baeldung.resttemplate.lists.controller;
package com.baeldung.resttemplate.lists.controller;
import org.baeldung.resttemplate.lists.dto.Employee;
import org.baeldung.resttemplate.lists.dto.EmployeeList;
import org.baeldung.resttemplate.lists.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.resttemplate.lists.dto.Employee;
import com.baeldung.resttemplate.lists.dto.EmployeeList;
import com.baeldung.resttemplate.lists.service.EmployeeService;
import java.util.List;
@RestController
@@ -1,4 +1,4 @@
package org.baeldung.resttemplate.lists.dto;
package com.baeldung.resttemplate.lists.dto;
public class Employee {
@@ -1,4 +1,4 @@
package org.baeldung.resttemplate.lists.dto;
package com.baeldung.resttemplate.lists.dto;
import java.util.ArrayList;
import java.util.List;
@@ -1,8 +1,9 @@
package org.baeldung.resttemplate.lists.service;
package com.baeldung.resttemplate.lists.service;
import org.baeldung.resttemplate.lists.dto.Employee;
import org.springframework.stereotype.Service;
import com.baeldung.resttemplate.lists.dto.Employee;
import java.util.ArrayList;
import java.util.List;
@@ -1,4 +1,4 @@
package org.baeldung.config;
package com.baeldung.sampleapp.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -6,7 +6,7 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@EnableAutoConfiguration
@ComponentScan("org.baeldung")
@ComponentScan("com.baeldung.sampleapp")
public class MainApplication implements WebMvcConfigurer {
public static void main(final String[] args) {
@@ -1,15 +1,16 @@
package org.baeldung.config;
package com.baeldung.sampleapp.config;
import java.util.ArrayList;
import java.util.List;
import org.baeldung.interceptors.RestTemplateHeaderModifierInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.util.CollectionUtils;
import org.springframework.web.client.RestTemplate;
import com.baeldung.sampleapp.interceptors.RestTemplateHeaderModifierInterceptor;
@Configuration
public class RestClientConfig {
@@ -1,4 +1,4 @@
package org.baeldung.config;
package com.baeldung.sampleapp.config;
import java.text.SimpleDateFormat;
import java.util.List;
@@ -18,7 +18,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
*/
@Configuration
@EnableWebMvc
@ComponentScan({ "org.baeldung.web" })
@ComponentScan({ "com.baeldung.sampleapp.web" })
public class WebConfig implements WebMvcConfigurer {
public WebConfig() {
@@ -1,4 +1,4 @@
package org.baeldung.interceptors;
package com.baeldung.sampleapp.interceptors;
import java.io.IOException;
@@ -1,10 +1,10 @@
package org.baeldung.repository;
import org.baeldung.web.dto.HeavyResource;
import org.baeldung.web.dto.HeavyResourceAddressOnly;
package com.baeldung.sampleapp.repository;
import java.util.Map;
import com.baeldung.sampleapp.web.dto.HeavyResource;
import com.baeldung.sampleapp.web.dto.HeavyResourceAddressOnly;
public class HeavyResourceRepository {
public void save(HeavyResource heavyResource) {
@@ -1,4 +1,4 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@@ -1,10 +1,11 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import org.baeldung.web.dto.Company;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.sampleapp.web.dto.Company;
@RestController
public class CompanyController {
@@ -1,4 +1,4 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
@@ -1,11 +1,8 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import java.util.Map;
import org.baeldung.repository.HeavyResourceRepository;
import org.baeldung.web.dto.HeavyResource;
import org.baeldung.web.dto.HeavyResourceAddressOnly;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
@@ -14,6 +11,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.sampleapp.repository.HeavyResourceRepository;
import com.baeldung.sampleapp.web.dto.HeavyResource;
import com.baeldung.sampleapp.web.dto.HeavyResourceAddressOnly;
@RestController
public class HeavyResourceController {
@@ -1,14 +1,14 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import java.util.Date;
import org.baeldung.web.dto.Item;
import org.baeldung.web.dto.ItemManager;
import org.baeldung.web.dto.Views;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.sampleapp.web.dto.Item;
import com.baeldung.sampleapp.web.dto.ItemManager;
import com.baeldung.sampleapp.web.dto.Views;
import com.fasterxml.jackson.annotation.JsonView;
@RestController
@@ -1,4 +1,4 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import java.util.Collection;
import java.util.HashMap;
@@ -6,8 +6,6 @@ import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.baeldung.web.dto.Foo;
import org.baeldung.web.exception.ResourceNotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@@ -18,6 +16,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import com.baeldung.sampleapp.web.dto.Foo;
import com.baeldung.sampleapp.web.exception.ResourceNotFoundException;
@Controller
@RequestMapping(value = "/foos")
public class MyFooController {
@@ -1,9 +1,8 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import java.util.ArrayList;
import java.util.List;
import org.baeldung.web.dto.PactDto;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
@@ -12,6 +11,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.sampleapp.web.dto.PactDto;
@RestController
public class PactController {
@@ -1,4 +1,4 @@
package org.baeldung.web.controller;
package com.baeldung.sampleapp.web.controller;
import java.io.BufferedOutputStream;
import java.io.File;
@@ -7,7 +7,6 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.baeldung.web.dto.Foo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -15,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import com.baeldung.sampleapp.web.dto.Foo;
// used to test HttpClientPostingTest
@RestController
public class SimplePostController {
@@ -1,4 +1,4 @@
package org.baeldung.web.controller.advice;
package com.baeldung.sampleapp.web.controller.advice;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice;
@@ -1,13 +1,14 @@
package org.baeldung.web.controller.mediatypes;
package com.baeldung.sampleapp.web.controller.mediatypes;
import org.baeldung.web.dto.BaeldungItem;
import org.baeldung.web.dto.BaeldungItemV2;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.sampleapp.web.dto.BaeldungItem;
import com.baeldung.sampleapp.web.dto.BaeldungItemV2;
@RestController
@RequestMapping(value = "/", produces = "application/vnd.baeldung.api.v1+json")
public class CustomMediaTypeController {
@@ -1,4 +1,4 @@
package org.baeldung.web.controller.redirect;
package com.baeldung.sampleapp.web.controller.redirect;
import javax.servlet.http.HttpServletRequest;
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
public class BaeldungItem {
private final String itemId;
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
public class BaeldungItemV2 {
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
public class Company {
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
import com.thoughtworks.xstream.annotations.XStreamAlias;
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
public class HeavyResource {
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
public class HeavyResourceAddressOnly {
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
public class HeavyResourceAddressPartialUpdate {
@@ -1,4 +1,4 @@
package org.baeldung.web.dto;
package com.baeldung.sampleapp.web.dto;
import com.fasterxml.jackson.annotation.JsonView;

Some files were not shown because too many files have changed in this diff Show More