Comment unused files
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
package com.rossa.api.controllers;
|
// package com.rossa.api.controllers;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
// import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
// import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
// import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
// import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
@Controller
|
// @Controller
|
||||||
public class AppContoller {
|
// public class AppContoller {
|
||||||
@RequestMapping(value = "/public/index", method = RequestMethod.GET)
|
// @RequestMapping(value = "/public/index", method = RequestMethod.GET)
|
||||||
public ModelAndView index() {
|
// public ModelAndView index() {
|
||||||
ModelAndView retVal = new ModelAndView();
|
// ModelAndView retVal = new ModelAndView();
|
||||||
retVal.setViewName("indexPage");
|
// retVal.setViewName("indexPage");
|
||||||
return retVal;
|
// return retVal;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
package com.rossa.api.controllers;
|
// package com.rossa.api.controllers;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
// import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
// import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
// @RestController
|
||||||
public class HelloController {
|
// public class HelloController {
|
||||||
|
|
||||||
@GetMapping("/hello")
|
// @GetMapping("/hello")
|
||||||
public String index() {
|
// public String index() {
|
||||||
return "Greetings from Spring Boot!";
|
// return "Greetings from Spring Boot!";
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
@@ -1,62 +1,63 @@
|
|||||||
package com.rossa.api.controllers;
|
// package com.rossa.api.controllers;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
// import java.util.ArrayList;
|
||||||
import java.util.List;
|
// import java.util.List;
|
||||||
|
|
||||||
import com.rossa.api.models.TitleModel;
|
// import com.rossa.api.models.TitleModel;
|
||||||
import org.springframework.http.MediaType;
|
// import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
// import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
// import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
// import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
// import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
// import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@RestController
|
// @RestController
|
||||||
public class SecureApiController {
|
// public class SecureApiController {
|
||||||
public SecureApiController() {
|
// public SecureApiController() {
|
||||||
}
|
// }
|
||||||
|
|
||||||
@PreAuthorize("isAuthenticated()")
|
// @PreAuthorize("isAuthenticated()")
|
||||||
@RequestMapping(value = "/secure/allGameTitles", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
// @RequestMapping(value = "/secure/allGameTitles", method = RequestMethod.GET,
|
||||||
public ResponseEntity<List<TitleModel>> allGameTitles() {
|
// produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
List<TitleModel> resp = new ArrayList<TitleModel>();
|
// public ResponseEntity<List<TitleModel>> allGameTitles() {
|
||||||
|
// List<TitleModel> resp = new ArrayList<TitleModel>();
|
||||||
|
|
||||||
TitleModel titleToAdd = new TitleModel();
|
// TitleModel titleToAdd = new TitleModel();
|
||||||
titleToAdd.setGameTitle("Cyberpunk 2077");
|
// titleToAdd.setGameTitle("Cyberpunk 2077");
|
||||||
titleToAdd.setPublisher("Warnder Bros");
|
// titleToAdd.setPublisher("Warnder Bros");
|
||||||
titleToAdd.setDevStudioName("CD Projekt Red");
|
// titleToAdd.setDevStudioName("CD Projekt Red");
|
||||||
titleToAdd.setPublishingYear((short) 2019);
|
// titleToAdd.setPublishingYear((short) 2019);
|
||||||
titleToAdd.setRetailPrice(69.95f);
|
// titleToAdd.setRetailPrice(69.95f);
|
||||||
|
|
||||||
resp.add(titleToAdd);
|
// resp.add(titleToAdd);
|
||||||
|
|
||||||
titleToAdd = new TitleModel();
|
// titleToAdd = new TitleModel();
|
||||||
titleToAdd.setGameTitle("Final Fantasy XV");
|
// titleToAdd.setGameTitle("Final Fantasy XV");
|
||||||
titleToAdd.setPublisher("Square Enix");
|
// titleToAdd.setPublisher("Square Enix");
|
||||||
titleToAdd.setDevStudioName("Square Enix");
|
// titleToAdd.setDevStudioName("Square Enix");
|
||||||
titleToAdd.setPublishingYear((short) 2016);
|
// titleToAdd.setPublishingYear((short) 2016);
|
||||||
titleToAdd.setRetailPrice(59.95f);
|
// titleToAdd.setRetailPrice(59.95f);
|
||||||
|
|
||||||
resp.add(titleToAdd);
|
// resp.add(titleToAdd);
|
||||||
|
|
||||||
titleToAdd = new TitleModel();
|
// titleToAdd = new TitleModel();
|
||||||
titleToAdd.setGameTitle("Fallout 4");
|
// titleToAdd.setGameTitle("Fallout 4");
|
||||||
titleToAdd.setPublisher("Bethesda Softworks");
|
// titleToAdd.setPublisher("Bethesda Softworks");
|
||||||
titleToAdd.setDevStudioName("Bethesda Game Studios");
|
// titleToAdd.setDevStudioName("Bethesda Game Studios");
|
||||||
titleToAdd.setPublishingYear((short) 2015);
|
// titleToAdd.setPublishingYear((short) 2015);
|
||||||
titleToAdd.setRetailPrice(59.95f);
|
// titleToAdd.setRetailPrice(59.95f);
|
||||||
|
|
||||||
resp.add(titleToAdd);
|
// resp.add(titleToAdd);
|
||||||
|
|
||||||
titleToAdd = new TitleModel();
|
// titleToAdd = new TitleModel();
|
||||||
titleToAdd.setGameTitle("Dragon Quest XI");
|
// titleToAdd.setGameTitle("Dragon Quest XI");
|
||||||
titleToAdd.setPublisher("Square Enix");
|
// titleToAdd.setPublisher("Square Enix");
|
||||||
titleToAdd.setDevStudioName("Square Enix");
|
// titleToAdd.setDevStudioName("Square Enix");
|
||||||
titleToAdd.setPublishingYear((short) 2017);
|
// titleToAdd.setPublishingYear((short) 2017);
|
||||||
titleToAdd.setRetailPrice(59.95f);
|
// titleToAdd.setRetailPrice(59.95f);
|
||||||
|
|
||||||
resp.add(titleToAdd);
|
// resp.add(titleToAdd);
|
||||||
|
|
||||||
return ResponseEntity.ok(resp);
|
// return ResponseEntity.ok(resp);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
package com.rossa.api.models;
|
// package com.rossa.api.models;
|
||||||
|
|
||||||
public class TitleModel {
|
// public class TitleModel {
|
||||||
private String gameTitle;
|
// private String gameTitle;
|
||||||
|
|
||||||
private String publisher;
|
// private String publisher;
|
||||||
|
|
||||||
private String devStudioName;
|
// private String devStudioName;
|
||||||
|
|
||||||
private short publishingYear;
|
// private short publishingYear;
|
||||||
|
|
||||||
private float retailPrice;
|
// private float retailPrice;
|
||||||
|
|
||||||
public String getGameTitle() {
|
// public String getGameTitle() {
|
||||||
return gameTitle;
|
// return gameTitle;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void setGameTitle(String titleValue) {
|
// public void setGameTitle(String titleValue) {
|
||||||
this.gameTitle = titleValue;
|
// this.gameTitle = titleValue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getPublisher() {
|
// public String getPublisher() {
|
||||||
return publisher;
|
// return publisher;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void setPublisher(String publisher) {
|
// public void setPublisher(String publisher) {
|
||||||
this.publisher = publisher;
|
// this.publisher = publisher;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getDevStudioName() {
|
// public String getDevStudioName() {
|
||||||
return devStudioName;
|
// return devStudioName;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void setDevStudioName(String devStudioName) {
|
// public void setDevStudioName(String devStudioName) {
|
||||||
this.devStudioName = devStudioName;
|
// this.devStudioName = devStudioName;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public short getPublishingYear() {
|
// public short getPublishingYear() {
|
||||||
return publishingYear;
|
// return publishingYear;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void setPublishingYear(short publishingYear) {
|
// public void setPublishingYear(short publishingYear) {
|
||||||
this.publishingYear = publishingYear;
|
// this.publishingYear = publishingYear;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public float getRetailPrice() {
|
// public float getRetailPrice() {
|
||||||
return retailPrice;
|
// return retailPrice;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public void setRetailPrice(float retailPrice) {
|
// public void setRetailPrice(float retailPrice) {
|
||||||
this.retailPrice = retailPrice;
|
// this.retailPrice = retailPrice;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user