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> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId> <artifactId>spring-security-jwt</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>

View File

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