Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A tool to generate java scaffold code for SQL databases。

Notifications You must be signed in to change notification settings

Biligle/sloth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

26 Commits

Repository files navigation

SLOTH 1.0

Sloth is A tool to generate scaffold code from SQL databases. You just need to specify your application database may be used.

Features

  • Generate Stand-Alone SpringBoot Applications
  • Generate Model–View–Controller Code
  • Generate API DOC
  • Provide Many Kinds Of Data Access With JDBC
    • Mybatis
    • JOOQ
    • Spring JDBC
  • DRY ( don't repeat yourself principle )
    • Never copy and paste boilerplate between projects again

Quick Start

  • Prepare Your Database

    host | port | username | password | dbname 
    --------- | ---- |:--------:| -------- |:------:
    127.0.0.1 | 3306 | root | 123456 | test 
    
  • Clone Sloth

git clone https://github.com/coolcooldee/sloth.git
  • Into The Sloth Root Directory
cd sloth
  • Maven Install
mvn clean install
  • Sloth Generating
mvn exec:java -Dexec.args="-path/workspaces/mySlothProject -packagecom.test -h127.0.0.1 -P3306 -uroot -p123456 -dtest -strategyssm" -Dexec.cleanupDaemonThreads=false -Dexec.mainClass="com.github.coolcooldee.sloth.Application"
 generate args | e.g | description 
 :--------- | ---- | ---- 
 -path |/workspaces/mySlothProject | the path where code generate 
 -package | com.test | Tell Sloth to use the package name
 -strategy | ssm | generattion strategy. ssm=SpringMVC+Spring+Mybatis, ssj=SpringMVC+Spring+JOOQ, sss=SpringMVC+Spring+SpringJDBC
 -h | 127.0.0.1 | database host 
 -P | 3306 | database port 
 -u | root | database username 
 -p | 123456 | database password
 -d | test | database name
  • Into Sloth Target Project Generated
cd /workspaces/mySlothProject
  • Runngin Sloth Target Project
mvn clean install
mvn exec:java -Dexec.mainClass="com.test.Application" -Dexec.cleanupDaemonThreads=false

Example

  • Database Tables Source

    TableName |
    --------- |
    game |
    gameRole |
    gameServer |
    
  • Target Project Code

├── deploy.sh
├── mvn.sh
├── pom.xml
├── src
│ ├── main
│ │ ├── assembly
│ │ │ ├── assembly.xml
│ │ ├── java
│ │ │ ├── com
│ │ │ │ ├── sloth
│ │ │ │ │ ├── aop
│ │ │ │ │ │ ├── LogAspect.java
│ │ │ │ │ ├── Application.java
│ │ │ │ │ ├── common
│ │ │ │ │ │ ├── Page.java
│ │ │ │ │ ├── config
│ │ │ │ │ │ ├── database
│ │ │ │ │ │ │ ├── DB.java
│ │ │ │ │ │ │ ├── DBConfig.java
│ │ │ │ │ │ ├── redis
│ │ │ │ │ │ │ ├── RedisConfig.java
│ │ │ │ │ │ ├── swagger
│ │ │ │ │ │ │ ├── SwaggerConfig.java
│ │ │ │ │ ├── controller
│ │ │ │ │ │ ├── IndexController.java
│ │ │ │ │ │ ├── restfulapi
│ │ │ │ │ │ │ ├── GameController.java
│ │ │ │ │ │ │ ├── GameRoleController.java
│ │ │ │ │ │ │ ├── GameServerController.java
│ │ │ │ │ │ ├── webpage
│ │ │ │ │ │ │ ├── GamePageController.java
│ │ │ │ │ │ │ ├── GameRolePageController.java
│ │ │ │ │ │ │ ├── GameServerPageController.java
│ │ │ │ │ ├── mapper
│ │ │ │ │ │ ├── GameMapper.java
│ │ │ │ │ │ ├── GameRoleMapper.java
│ │ │ │ │ │ ├── GameServerMapper.java
│ │ │ │ │ ├── model
│ │ │ │ │ │ ├── Game.java
│ │ │ │ │ │ ├── GameRole.java
│ │ │ │ │ │ ├── GameServer.java
│ │ │ │ │ ├── service
│ │ │ │ │ │ ├── GameRoleService.java
│ │ │ │ │ │ ├── GameServerService.java
│ │ │ │ │ │ ├── GameService.java
│ │ │ │ │ │ ├── impl
│ │ │ │ │ │ │ ├── GameRoleServiceImpl.java
│ │ │ │ │ │ │ ├── GameServerServiceImpl.java
│ │ │ │ │ │ │ ├── GameServiceImpl.java
│ │ ├── resources
│ │ │ ├── application.properties
│ │ │ ├── static
│ │ │ │ ├── apis-docs-by-sloth.html
│ │ │ │ ├── css
│ │ │ │ ├── fonts
│ │ │ │ ├── html
│ │ │ │ ├── js
│ │ │ ├── template
├── start.sh
├── stop.sh
  • Target Project Api Webpage

Contributing

If you want to contribute code, we are waiting for your pull requests !

Author

License

Sloth is licensed under the Apache License, Version 2.0 (the "License");

About

A tool to generate java scaffold code for SQL databases。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%

AltStyle によって変換されたページ (->オリジナル) /