Merge pull request #3471 from eugenp/BAEL-1177

remove gson
This commit is contained in:
Loredana Crusoveanu 2018-01-20 17:03:55 +02:00 committed by GitHub
commit a3585ddc8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 9 deletions

View File

@ -43,10 +43,6 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies>
<dependencyManagement>

View File

@ -6,16 +6,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.baeldung.model.Person;
import com.google.gson.Gson;
@RestController
public class PersonInfoController {
@GetMapping("/personResource")
@PreAuthorize("hasAnyRole('ADMIN', 'USER')")
public @ResponseBody String personInfo() {
Gson gson = new Gson();
String person = gson.toJson(new Person("abir", "Dhaka", "Bangladesh", 29, "Male"));
return person;
public @ResponseBody Person personInfo() {
return new Person("abir", "Dhaka", "Bangladesh", 29, "Male");
}
}