Coder Social home page Coder Social logo

car-rental's Introduction

Car Rental

设计一个可以提供汽车预约时段功能的后端

1. 系统 ER 图

image-20220327141128661

简单起见,项目使用的 h2 数据库 + spring jpa

库里已经存在的数据如下:

        CarProductDO carProductDO1 = new CarProductDO(1L, "ToyotaCamry", "Toyota Camr", 2L);
        CarProductDO carProductDO2 = new CarProductDO(2L, "BMW650", "BMW 650", 2L);
        carProductRepository.save(carProductDO1);
        carProductRepository.save(carProductDO2);

        CarDO carDO1 = new CarDO("ToyotaCamry1", 1L);
        CarDO carDO2 = new CarDO("ToyotaCamry2", 1L);
        CarDO carDO3 = new CarDO("BMW6501", 2L);
        CarDO carDO4 = new CarDO("BMW6502", 2L);
        carRepository.save(carDO1);
        carRepository.save(carDO2);
        carRepository.save(carDO3);
        carRepository.save(carDO4);
        return ResponseEntity.ok().body("success");

2. api

集成了 swagger,入口:http://localhost:8080/swagger-ui.html,访问ip:http://13.89.25.182:8080/swagger-ui.html

有两个接口:

  1. 获取可预约时段

    com.lingjiancong.car.controller.CarReserveController#getCarReserveTime
  2. 预约时段

    com.lingjiancong.car.controller.CarReserveController#carReserveTime

3. 测试

集成测试:

com.lingjiancong.car.controller.CarReserveControllerIntegrationTest

单元测试:

com.lingjiancong.car.repository.CarRepositoryTest

car-rental's People

Contributors

lingjiancong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.