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