proxyprint-kitchen
June 28, 2016 ยท View on GitHub
Development Environment Set Up
- Open pom.xml and comment the spring-boot-starter-tomcat scope tag. The dependency should look like this (Only if you want to run the project in the IDE):
<dependency> <groupId>org.springframework.boot </groupId> <artifactId>spring-boot-starter-tomcat </artifactId> <!-- Comment in development environment --> <!-- <scope>provided </scope> --> </dependency> - Open application.properties and add a tmp folder to host the documents you submit on print requests. Add a line like this:
documents.path=/path/where/u/want/the/files
- Use maven version 3 or greater to build the project.
API Documentation
Swagger is integrated in kitchen, to see full API documentation open file docs/docs.html. To generate documentation just run ./swagger under scripts and see the result under docs/ folder.How to document Controller's methods
This is a simple sample on how to add information do the documentation: ```java @ApiOperation(value = "Returns a pricetable", notes = "This method returns a pricetable of a specific printshop.") @Secured({"ROLE_MANAGER","ROLE_USER"}) @RequestMapping(value = "/printshops/{id}/pricetable", method = RequestMethod.GET) public String getPrintShopPriceTable(@PathVariable(value = "id") long id) { ... ... } ```Database Population
To populate the database with some data just do: ``` curl -X POST localhost:8080/admin/seed ```scripts
Under the folder scripts, one may find some scripts that are usefull and increase speed of development enviroment set up:
- ppdb - Database utils like drop and create, or most frequent select operations.
- ppdb-mac - MacOS version for ppdb.
- swagger - Script that generates REST API documentation. The server must be running.