#About this project.
## Task:
Create rest api for insurance calculation depending on tariff, bonus, customer age and customer inception date.
## Tech Stack:
- Java 8
- Maven
- SpringBoot 2.1.7
- H2
- jUnit 5
- Mockito
- Swagger 2.7.0
- Project Lombok
- ValidationAPI
- Log4j
## Project structure.
Maven multi module project consisting of 3 parts:
- “insurance-controller” main module with controllers, swagger and SpringBootApplication
- “insurance-data” module related to database features
- “insurance-engine” module related to final price calculation
## How to Start
### Requirements:
- JDK 8
- Preinstalled Maven 3+
- Free port 8080
### Steps:
1. Execute command in the root folder: mvn clean package
2. Go to {project_root_folder}/insurance-controller/target
3. Execute command: java -jar insurance-controller-0.0.1-SNAPSHOT.jar
4. Go to browser: http://localhost:8080/swagger-ui.html
## How to use
There are 2 ways of project usage:
1. Use swagger to explore all rest api methods.
It contains documented information about required path parameters, fields and json bodies.
Additionally, it is possible to execute all methods from swagger’s ui.
2. Use Postman collection from the file: {project_root_folder}/notForBuild/Insurance Api.postman_collection.json
## Logs
There will be file with logs when you start the application. It will be located in the {jar_folder}/logs/application.log.
Try to get user with wrong id or create customer with date of birth in the future, then you will observe messages in the log file.
## Docker
Docker may be used to test this application.
- Build image command should be performed from {project_root_folder}/insurance-controller/target directory
Command: docker build -t insurance-app -f ../../notForBuild/Dockerfile .
- Run docker image
Command: docker run -d -p 8080:8080 insurance-app
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
这是一个基于SpringBoot 2.1.7框架构建的保险计算REST API的演示项目。该项目使用Java 8和Maven进行开发,采用H2数据库,并集成了jUnit 5、Mockito、Swagger 2.7.0、Project Lombok、ValidationAPI和Log4j等技术栈。项目结构分为多个模块,包括保险控制器(主要负责API请求处理)、保险数据(与数据库交互)和保险引擎(负责最终价格计算)。项目可以通过Maven进行构建和打包,并通过Swagger UI或Postman进行API测试。此外,该项目还支持Docker容器化部署,方便进行测试和部署 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。
资源推荐
资源详情
资源评论
收起资源包目录
保险计算REST API系统.zip (36个子文件)
insurance-rest-api-master
pom.xml 2KB
insurance-data
pom.xml 2KB
src
test
java
com
scale
global
insurance
app
service
impl
CustomerServiceImplTest.java 5KB
main
resources
data-h2.sql 708B
java
com
scale
global
insurance
app
converters
CustomerCommandToCustomerConverter.java 920B
CustomerToCustomerCommandConverter.java 1KB
LocalDateAttributeConverter.java 595B
exceptions
CustomerNotFoundException.java 392B
service
CustomerService.java 320B
impl
CustomerServiceImpl.java 2KB
model
CustomerDTO.java 2KB
entity
Customer.java 695B
repositories
CustomerRepository.java 251B
insurance-engine
pom.xml 2KB
src
test
java
com
scale
global
insurance
app
engine
impl
TariffRateImplTest.java 2KB
DatesCalculatorImplTest.java 2KB
PriceCalculatorImplTest.java 3KB
main
resources
tariffs.properties 106B
java
com
scale
global
insurance
app
engine
DatesCalculator.java 247B
TariffRate.java 182B
impl
DatesCalculatorImpl.java 725B
TariffRateImpl.java 1003B
PriceCalculatorImpl.java 1KB
PriceCalculator.java 219B
insurance-controller
pom.xml 3KB
src
test
java
com
scale
global
insurance
app
controller
CustomersControllerTest.java 6KB
main
resources
application.properties 55B
log4j.properties 731B
java
com
scale
global
insurance
app
InsuranceRestApiApplication.java 355B
exceptionHandling
ControllerExceptionHandler.java 2KB
controller
CustomersController.java 2KB
swagger
SwaggerConfig.java 2KB
.gitignore 333B
README.md 2KB
notForBuild
Dockerfile 164B
Insurance Api.postman_collection.json 3KB
共 36 条
- 1
资源评论
sec0nd_
- 粉丝: 6359
- 资源: 2069
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功