Spring Boot web app for calculating sweater knitting parameters.
- Java 17
- Spring Boot 3.2
- Maven
- HTML/CSS/JavaScript frontend in
src/main/resources/static
src/main/java/com/knittedsweater/KnittedSweaterApplication.javasrc/main/java/com/knittedsweater/controller/SweaterCalculatorController.javasrc/main/java/com/knittedsweater/service/SweaterCalculationService.javasrc/main/java/com/knittedsweater/dto/SweaterCalculationRequest.javasrc/main/java/com/knittedsweater/dto/SweaterCalculationResponse.javasrc/main/resources/static/index.htmlsrc/main/resources/static/styles.csssrc/main/resources/static/script.jssrc/test/java/com/knittedsweater/service/SweaterCalculationServiceTest.java
Set-Location "D:\JProjects\KnittedSweater"
mvn spring-boot:runOpen:
http://localhost:8080
Set-Location "D:\JProjects\KnittedSweater"
mvn test- Method:
POST - URL:
/api/sweater/calculate
Request example:
{
"width": 40,
"length": 60,
"stitchDensity": 20,
"rowDensity": 25
}Response example:
{
"totalStitches": 80,
"totalRows": 150,
"width": 40.0,
"length": 60.0,
"stitchDensity": 20.0,
"rowDensity": 25.0,
"message": "Calculation completed successfully"
}- Method:
GET - URL:
/api/sweater/health