Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The code generation tools that is easy for programmers to quickly develop programs

License

Notifications You must be signed in to change notification settings

danielzhou888/zzx-generatecode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

代码生成工具使用说明

@(zzx)[代码生成工具]

[TOC]

欢迎关注:


前言

  在公司开发一段时间发现公司很多业务代码都是可以通过工具直接生成的,故此决定使用FreeMarker定制模板生成单表curl代码,减少开发工作量。
  欢迎大家批评指教。

1. curl代码生成

访问:
  测试环境:http://10.100.1.145:8088/scmd-generatetools/
  线上环境:https://www.carecnn.com/scmd-generatetools/(暂不公开)

输入表名(支持多表,表之间使用英文逗号进行隔开)
  如:sc_user,sc_customer,sc_appointment
点击下载: 生成code.zip

目录结构:

2. 代码部署

1. 复制controller 里面的目录到项目的

2. 复制service 里面的目录到项目的

3. 复制mybatis_mysql 里面的目录到项目的

3. 代码说明

  整体思想:接口整体采用post请求,json作为请求参数;所有Controller继承基类并使用JSONObject对象接收请求json,经过PageData构造将JSONObject转成map,方便于xml文件进行数据获取;然后使用PageData对象的静态方法convertEntity(PageData request,Class T)将PageData对象转成对应的实体类,再对实体类进行curl操作;

3.1. Controller:

新增:

修改:

详情:

删除:

列表:

批量删除:

3.2. ServiceImpl:

列表:

3.3. Mapper.xml:

  列表查询条件,所有字符串都转成模糊查询,根据不同业务需求,程序员需要对其进行更改。

插入insert模板:

删除delete模板:

**修改update模板:**根据需要加入useGeneratedKeys=true keyProperty=”id” 用来返回主键id值。

列表查询分页,排序:

4. 前端接口文档

  见同级目录接口文档。

About

The code generation tools that is easy for programmers to quickly develop programs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •