Skip to content

muxfe/spring-boot-scaffold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-scaffold

Build Status

一个简单的 SpringBoot 开发脚手架,记录学习过程和踩的坑。

Getting Started

git clone https://github.com/muxfe/spring-boot-scaffold.git my-project
cd my-project

./gradlew tasks

# run all checks
./gradlew check

# run as spring boot application
SPRING_PROFILES_ACTIVE=development ./gradlew bootRun

Open hal http://localhost:9091/api in browser.

IntelliJ IDEA Configuration

Run/Debug Configurations

Add New Configuration: SpringBoot

  • Program Arguments: --spring.profiles.active=development.

Compile Configurations

Build project Automatically for Liveload

Enable File->Settings->Build,Execution,Deployment->Compiler: Build project automatically.

Annotation Processors for Lombok

Enable File->Settings->Build,Execution,Deployment->Compiler->Annotation Processors: Enable annotation processing.

Repository REST APIs

  • GET /api/[repository]
    • Accept: application/json;chartset=utf-8
    • Status: 200 Ok
    • QueryString
      • page(=0)
      • size(=20)
      • sort([property],asc|desc)
    • Response
      • _embedded
        • [entity](=[])
      • page
        • size
        • number
        • totalElements
        • totalPages
  • GET /api/[repository]/fuzzy
    • Accept: application/json;chartset=utf-8
    • Status: 200 Ok
    • QueryString
      • page(=0)
      • size(=20)
      • sort([property],asc|desc)
      • selective [Entity] properties(exclude id)
    • Response
      • _embedded
        • [entity](=[])
      • page
        • size
        • number
        • totalElements
        • totalPages
  • POST /api/[repository]
    • ContentType: application/json
    • Accept: application/json;chartset=utf-8
    • Status: 201 Created
    • Body
      • [Entity]
    • Response
      • new [Entity]
  • PUT /api/[repository]/[id]
    • ContentType: application/json
    • Accept: application/json;chartset=utf-8
    • Status: 200 Ok
    • Body
      • All [Entity] properties
    • Response
      • updated [Entity]
  • PATCH /api/[repository]/[id]
    • ContentType: application/json
    • Accept: application/json;chartset=utf-8
    • Status: 200 Ok
    • Body
      • Partial [Entity] properties
    • Response
      • updated [Entity]
  • DELETE /api/[repository]/[id]
    • Status 204 NoContent

TODO

  • SpringBootApplication
  • Jpa Crud Operation
  • Entity and Controller Examples
  • Unit Test
  • ExposeIdsRepositoryRestConfiguration
  • Support CORS
  • Fuzzy search
  • Application initializer
  • Entity Projection

References

Spring Boot

About

SprintBoot Scaffold(SpringBoot开发脚手架)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages