From 0c2a59c4ea20e6692cc2fe96e320cc492304f21b Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 02:12:51 +0000 Subject: Initial commit --- ufund-api/.gitignore | 32 +++++ ufund-api/HELP.md | 22 +++ ufund-api/pom.xml | 155 +++++++++++++++++++++ .../ufund/api/ufundapi/UfundApiApplication.java | 13 ++ .../java/com/ufund/api/ufundapi/WebConfig.java | 16 +++ .../src/main/resources/application.properties | 1 + .../api/ufundapi/UfundApiApplicationTests.java | 13 ++ 7 files changed, 252 insertions(+) create mode 100644 ufund-api/.gitignore create mode 100644 ufund-api/HELP.md create mode 100644 ufund-api/pom.xml create mode 100644 ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java create mode 100644 ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java create mode 100644 ufund-api/src/main/resources/application.properties create mode 100644 ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java (limited to 'ufund-api') diff --git a/ufund-api/.gitignore b/ufund-api/.gitignore new file mode 100644 index 0000000..7ed0d6b --- /dev/null +++ b/ufund-api/.gitignore @@ -0,0 +1,32 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/ufund-api/HELP.md b/ufund-api/HELP.md new file mode 100644 index 0000000..f110fea --- /dev/null +++ b/ufund-api/HELP.md @@ -0,0 +1,22 @@ +# Read Me First +The following was discovered as part of building this project: + +* The original package name 'com.ufund.api.ufund-api' is invalid and this project uses 'com.ufund.api.ufundapi' instead. + +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.6.2/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.6.2/maven-plugin/reference/html/#build-image) +* [Spring Web](https://docs.spring.io/spring-boot/docs/2.6.2/reference/htmlsingle/#boot-features-developing-web-applications) + +### Guides +The following guides illustrate how to use some features concretely: + +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/bookmarks/) + diff --git a/ufund-api/pom.xml b/ufund-api/pom.xml new file mode 100644 index 0000000..ce96d60 --- /dev/null +++ b/ufund-api/pom.xml @@ -0,0 +1,155 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.4.2 + + + com.ufund.api + ufund-api + 0.0.1-SNAPSHOT + ufund-api + API for U-Fund + + 21 + 0.8.11 + 3.5.0 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.codehaus.mojo + exec-maven-plugin + ${exec.maven.version} + + + + java + + + + tests-and-coverage + + mvn + + clean + test-compile + surefire:test@controller + jacoco:report@controller + surefire:test@model + jacoco:report@model + surefire:test@persistence + jacoco:report@persistence + + + + + + com.ufund.api.ufundapi.UfundApiApplication + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.version} + + /target/coverage-reports/jacoco-unit.exec + /target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + + false + + + prepare-agent + + + + + report + test + + report + + + + controller + +
Controller Tier
+ U-Fund API Controller Tier Test Coverage + target/site/jacoco/controller +
+ + report + +
+ + persistence + +
Persistence Tier
+ U-Fund API Persistence Tier Test Coverage + target/site/jacoco/persistence +
+ + report + +
+ + model + +
Model Tier
+ U-Fund API Model Tier Test Coverage + target/site/jacoco/model +
+ + report + +
+ + jacoco-check + + check + + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + 0.90 + + + + + + +
+
+
+
+
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java new file mode 100644 index 0000000..6e263d5 --- /dev/null +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/UfundApiApplication.java @@ -0,0 +1,13 @@ +package com.ufund.api.ufundapi; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class UfundApiApplication { + + public static void main(String[] args) { + SpringApplication.run(UfundApiApplication.class, args); + } + +} diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java new file mode 100644 index 0000000..7d7bfa0 --- /dev/null +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/WebConfig.java @@ -0,0 +1,16 @@ +package com.ufund.api.ufundapi; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +@EnableWebMvc +public class WebConfig implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedMethods("HEAD", "GET", "PUT", "POST", "DELETE", "PATCH"); + } +} \ No newline at end of file diff --git a/ufund-api/src/main/resources/application.properties b/ufund-api/src/main/resources/application.properties new file mode 100644 index 0000000..3e7fc8a --- /dev/null +++ b/ufund-api/src/main/resources/application.properties @@ -0,0 +1 @@ +server.error.include-message=always diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java new file mode 100644 index 0000000..fc7eda8 --- /dev/null +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/UfundApiApplicationTests.java @@ -0,0 +1,13 @@ +package com.ufund.api.ufundapi; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class UfundApiApplicationTests { + + @Test + void contextLoads() { + } + +} -- cgit v1.2.3