java 脚手架 自动生成_Sloth 是一个生成SpringBoot应用的脚手架代码工具

logo.png

SLOTH 1.0

68747470733a2f2f696d672e736869656c64732e696f2f6368726f6d652d7765622d73746f72652f73746172732f6e696d656c65706270656a6a6c626d6f6f626f6370666e6a6869686e706b65642e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f72656c656173652d76312e302e312d627269676874677265656e2e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f6973737565732d322d6f72616e67652e73766768747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e63652d4170616368652d626c75652e737667

sloth is A tool to generate scaffold code from SQL databases.You just need to specify your application database may be used. It allows for rapidly getting started on new projects. If you know what the code generator does in Ruby on Rails (RoR), sloth works just like that, and it’s specific to JAVA language now. sloth is always the right choice for your scaffolding needs.sloth can help developers quickly build beautiful web applications. Read this in other languages: 中文

Features

Generate Stand-Alone SpringBoot Applications

Rapidly create a new project executable

Generate Model–View–Controller Code

Generate API DOC

Provide Many Kinds Of Data Access With JDBC

Reduce repetitive coding

Never copy and paste boilerplate between projects again

Generate your code in less time with fewer bugs

Prerequisites

Before useing sloth, you will need the following:

JDK (Java Development Kit), version 1.7 and above

Maven (Project Management Tool), version 3.0 and above

GIT

Quick Start

Step 1: Prepare Your Database And Create Your Database Structure

host

port

username

password

dbname

127.0.0.1

3306

root

123456

test

Step 2: Clone Sloth

git clone https://github.com/coolcooldee/sloth.git

Step 3: Into The Sloth Root Directory

cd sloth

Step 4: Maven Install

mvn clean install

Step 5: 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

-projectname

mySlothProject

the target project name

-package

com.test

tell sloth to use the package name

-help

to see which options are available

-strategy

ssm

generattion strategy:ssd=SpringBoot + SpringData,ssm=SpringMVC + Spring+MyBatis,sss=SpringBoot + SpringJDBC,ssj=SpringBoot + JOOQ

-h

127.0.0.1

database host

-P

3306

database port

-u

root

database username

-p

123456

database password

-d

test

database name

Step 6: Into Sloth Target Project Generated

cd /workspaces/mySlothProject

Step 7: Runngin Sloth Target Project

mvn clean install

mvn exec:java -Dexec.mainClass=”com.test.Application” -Dexec.cleanupDaemonThreads=false

Step 8: Open a new tab in your web browser on http://localhost:8081/apis-docs-by-sloth.html

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

│ │ │ │ │ ├── controller

│ │ │ │ │ │ ├── restfulapi

│ │ │ │ │ │ │ ├── GameController.java

│ │ │ │ │ │ │ ├── GameRoleController.java

│ │ │ │ │ │ │ ├── GameServerController.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

demo1.png

Contributing

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

Author

Others

QQ Group 570997546

License

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值