forked from loafle/openapi-generator-original
update java play petstore sample
This commit is contained in:
parent
70e2f643dd
commit
bc68e9706e
@ -11,6 +11,14 @@ import java.util.HashMap;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private PetApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPet(Pet body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -26,18 +34,42 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public List<Pet> findPetsByStatus(List<String> status) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pet> findPetsByTags(List<String> tags) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pet getPetById(Long petId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
return new Pet();
|
||||
}
|
||||
|
||||
@ -56,6 +88,10 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", ModelApiResponse.class);
|
||||
}
|
||||
return new ModelApiResponse();
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,14 @@ import java.util.HashMap;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private StoreApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrder(String orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -19,18 +27,38 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
@Override
|
||||
public Map<String, Integer> getInventory() throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Map.class);
|
||||
}
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order getOrderById(Long orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order placeOrder(Order body) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,14 @@ import java.util.HashMap;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private UserApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUser(User body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -37,12 +45,28 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
@Override
|
||||
public User getUserByName(String username) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
return new User();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String loginUser(String username, String password) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
return new String();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private PetApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPet(Pet body) {
|
||||
//Do your magic!!!
|
||||
@ -27,18 +35,42 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public List<Pet> findPetsByStatus( @NotNull List<String> status) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pet> findPetsByTags( @NotNull List<String> tags) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pet getPetById(Long petId) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
return new Pet();
|
||||
}
|
||||
|
||||
@ -57,6 +89,10 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", ModelApiResponse.class);
|
||||
}
|
||||
return new ModelApiResponse();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private StoreApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrder(String orderId) {
|
||||
//Do your magic!!!
|
||||
@ -20,18 +28,38 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
@Override
|
||||
public Map<String, Integer> getInventory() {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Map.class);
|
||||
}
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order getOrderById( @Min(1) @Max(5)Long orderId) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order placeOrder(Order body) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private UserApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUser(User body) {
|
||||
//Do your magic!!!
|
||||
@ -38,12 +46,28 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
@Override
|
||||
public User getUserByName(String username) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
return new User();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String loginUser( @NotNull String username, @NotNull String password) {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
return new String();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private PetApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPet(Pet body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -27,18 +35,42 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pet getPetById(Long petId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
return new Pet();
|
||||
}
|
||||
|
||||
@ -57,6 +89,10 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", ModelApiResponse.class);
|
||||
}
|
||||
return new ModelApiResponse();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private StoreApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrder(String orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -20,18 +28,38 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
@Override
|
||||
public Map<String, Integer> getInventory() throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Map.class);
|
||||
}
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order placeOrder(Order body) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private UserApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUser(User body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -38,12 +46,28 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
@Override
|
||||
public User getUserByName(String username) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
return new User();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String loginUser( @NotNull String username, @NotNull String password) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
return new String();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private PetApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPet(Pet body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -27,18 +35,42 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pet getPetById(Long petId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
return new Pet();
|
||||
}
|
||||
|
||||
@ -57,6 +89,10 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", ModelApiResponse.class);
|
||||
}
|
||||
return new ModelApiResponse();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private StoreApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrder(String orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -20,18 +28,38 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
@Override
|
||||
public Map<String, Integer> getInventory() throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Map.class);
|
||||
}
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order placeOrder(Order body) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private UserApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUser(User body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -38,12 +46,28 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
@Override
|
||||
public User getUserByName(String username) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
return new User();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String loginUser( @NotNull String username, @NotNull String password) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
return new String();
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private PetApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPet(Pet body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -27,18 +35,42 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public List<Pet> findPetsByStatus( @NotNull List<String> status) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Pet> findPetsByTags( @NotNull List<String> tags) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", List.class);
|
||||
}
|
||||
return new ArrayList<Pet>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pet getPetById(Long petId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Pet.class);
|
||||
}
|
||||
return new Pet();
|
||||
}
|
||||
|
||||
@ -57,6 +89,10 @@ public class PetApiControllerImp implements PetApiControllerImpInterface {
|
||||
@Override
|
||||
public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", ModelApiResponse.class);
|
||||
}
|
||||
return new ModelApiResponse();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private StoreApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrder(String orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -20,18 +28,38 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface {
|
||||
@Override
|
||||
public Map<String, Integer> getInventory() throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Map.class);
|
||||
}
|
||||
return new HashMap<String, Integer>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Order placeOrder(Order body) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", Order.class);
|
||||
}
|
||||
return new Order();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,14 @@ import java.io.FileInputStream;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
|
||||
private final ObjectMapper mapper;
|
||||
|
||||
@Inject
|
||||
private UserApiControllerImp() {
|
||||
mapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createUser(User body) throws Exception {
|
||||
//Do your magic!!!
|
||||
@ -38,12 +46,28 @@ public class UserApiControllerImp implements UserApiControllerImpInterface {
|
||||
@Override
|
||||
public User getUserByName(String username) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", User.class);
|
||||
}
|
||||
return new User();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String loginUser( @NotNull String username, @NotNull String password) throws Exception {
|
||||
//Do your magic!!!
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/xml")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
String accept = request().getHeader("Accept");
|
||||
if (accept != null && accept.contains("application/json")) {
|
||||
return mapper.readValue("", String.class);
|
||||
}
|
||||
return new String();
|
||||
}
|
||||
|
||||
|
@ -900,13 +900,12 @@
|
||||
}
|
||||
},
|
||||
"title" : "An uploaded response",
|
||||
"description" : "Describes the result of uploading an image resource"
|
||||
},
|
||||
"PetStatus" : {
|
||||
"type" : "string",
|
||||
"description" : "Pet's status",
|
||||
"example" : "Healthy",
|
||||
"enum" : [ "Healthy", "Sick", "Quarantined", "InPetsHeaven" ]
|
||||
"description" : "Describes the result of uploading an image resource",
|
||||
"example" : {
|
||||
"code" : 0,
|
||||
"type" : "aeiou",
|
||||
"message" : "aeiou"
|
||||
}
|
||||
}
|
||||
},
|
||||
"externalDocs" : {
|
||||
|
Loading…
x
Reference in New Issue
Block a user