资源简介
本工具用于java web后端基础代码自动生成,包括controller层、service层、dao层、实体类、mybatis xml代码;
文档:https://blog.csdn.net/weixin_42686388/article/details/84203062
代码片段和文件信息
package com.test.controller;
import com.test.service.inter.SystemResourceService;
import com.test.entity.SystemResourceEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 控制层
* 通过拦截器,或者AOP的方式,处理异常信息
* Result类,封装返回结果对象 {“code“:0“data“:object“msg“:“ 成功/失败“}
* @author yuxue
* @date 2018-11-18 18:31:40
*/
@Api(description = “自动生成的代码--yuxue“)
@RestController
@RequestMapping(“/systemResource“)
public class SystemResourceController {
@Autowired
private SystemResourceService service;
/**
* 根据Id 查询
* @param id
*/
@ApiOperation(value = “根据ID获取记录“ notes = “根据ID获取记录“)
@ApiImplicitParam(name = “id“ value = “记录ID“ required = true paramType = “path“ dataType = “Integer“)
@RequestMapping(value = “/{id}“ method = RequestMethod.GET)
public object getByPrimaryKey(@PathVariable(“id“) Integer id) {
return Result.ok(service.getByPrimaryKey(id));
}
/**
* 分页查询
* @param pageNo
* @param pageSize
* @param entity
*/
@ApiOperation(value = “分页获取记录“ notes = “分页获取记录“)
@ApiImplicitParams({
@ApiImplicitParam(name = “pageNo“ value = “当前页码“ required = true paramType = “query“ dataType = “Integer“ defaultValue = “1“)
@ApiImplicitParam(name = “pageSize“ value = “每页数量“ required = true paramType = “query“ dataType = “Integer“ defaultValue = “10“)
@ApiImplicitParam(name = “map“ value = “举例:{} or {\“name\“:\“张三\“}“ dataType = “entity“)
})
@RequestMapping(value = “/queryByPage“ method = RequestMethod.POST)
public object queryByPage(@RequestParam Integer pageNo @RequestParam Integer pageSize @RequestBody Mapject> map) {
return Result.ok(service.queryByPage(pageNo pageSize map));
}
/**
* Post请求,新增数据,成功返回ID
* @param entity
*/
@ApiOperation(value = “新增数据,成功返回ID“ notes = “新增数据,成功返回ID“)
@ApiImplicitParam(name = “entity“ value = “举例:{} or {\“name\“:\“张三\“}“ required = true dataType = “entity“)
@RequestMapping(value = ““ method = RequestMethod.POST)
public object save(@RequestBody SystemResourceEntity entity) {
return Result.ok(service.save(entity));
}
/**
* 通过主键,逻辑删除
* @param id
*/
@ApiOperation(value = “通过主键,逻辑删除 “ notes = “通过主键,逻辑删除 “)
@Api
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-11-18 18:32 CodeGenerator\
文件 10535723 2018-11-16 17:38 CodeGenerator\code-generator-gui.jar
目录 0 2018-11-16 17:16 CodeGenerator\config\
文件 36864 2018-11-16 17:16 CodeGenerator\config\sqlite3.db
目录 0 2018-11-16 17:02 CodeGenerator\ftl\
文件 525 2018-11-16 16:32 CodeGenerator\ftl\ba
文件 4569 2018-11-16 16:55 CodeGenerator\ftl\Controller.ftl
文件 343 2018-11-16 15:49 CodeGenerator\ftl\MapperWithba
文件 2147 2018-11-16 16:51 CodeGenerator\ftl\ServiceImpl.ftl
文件 667 2018-11-18 21:31 CodeGenerator\ftl\ServiceInter.ftl
目录 0 2018-11-18 18:31 CodeGenerator\lib\
文件 233859 2018-08-02 15:56 CodeGenerator\lib\commons-beanutils-1.9.2.jar
文件 575389 2018-03-07 14:34 CodeGenerator\lib\commons-collections-3.2.1.jar
文件 208700 2018-08-02 15:56 CodeGenerator\lib\commons-io-2.5.jar
文件 434678 2018-03-07 13:33 CodeGenerator\lib\commons-lang3-3.4.jar
文件 60686 2018-03-07 14:34 CodeGenerator\lib\commons-logging-1.1.1.jar
文件 417221 2018-08-02 15:56 CodeGenerator\lib\fastjson-1.2.7.jar
文件 1350624 2018-10-11 11:34 CodeGenerator\lib\freemarker-2.3.23.jar
文件 45024 2018-03-07 13:33 CodeGenerator\lib\hamcrest-core-1.3.jar
文件 55784 2018-03-07 13:33 CodeGenerator\lib\jackson-annotations-2.8.0.jar
文件 281079 2018-03-07 13:33 CodeGenerator\lib\jackson-core-2.8.5.jar
文件 1236315 2018-03-07 13:33 CodeGenerator\lib\jackson-databind-2.8.5.jar
文件 314932 2018-03-07 13:33 CodeGenerator\lib\junit-4.12.jar
文件 270750 2018-08-02 15:56 CodeGenerator\lib\logback-classic-1.1.2.jar
文件 427729 2018-08-02 15:56 CodeGenerator\lib\logback-core-1.1.2.jar
文件 672120 2018-11-16 16:05 CodeGenerator\lib\mybatis-generator-core-1.3.6.jar
文件 983911 2018-10-26 10:12 CodeGenerator\lib\mysql-connector-java-5.1.38.jar
文件 1569668 2018-10-26 10:12 CodeGenerator\lib\ojdbc14.jar
文件 689278 2018-10-26 10:12 CodeGenerator\lib\postgresql-9.4.1209.jar
文件 28688 2018-08-02 15:56 CodeGenerator\lib\slf4j-api-1.7.6.jar
文件 6213670 2018-10-26 10:12 CodeGenerator\lib\sqlite-jdbc-3.19.3.jar
............此处省略22个文件信息
评论
共有 条评论