|
|
@ -40,8 +40,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -50,7 +50,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
|
* @Date: ${.now?string["yyyy-MM-dd"]}
|
|
|
|
* @Date: ${.now?string["yyyy-MM-dd"]}
|
|
|
|
* @Version: V1.0
|
|
|
|
* @Version: V1.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Api(tags="${tableVo.ftlDescription}")
|
|
|
|
@Tag(name="${tableVo.ftlDescription}")
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
|
|
|
|
@RequestMapping("/${entityPackage}/${entityName?uncap_first}")
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
@ -72,7 +72,7 @@ public class ${entityName}Controller {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
|
|
|
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
|
|
|
@Operation(summary = "${tableVo.ftlDescription}-分页列表查询")
|
|
|
|
@GetMapping(value = "/list")
|
|
|
|
@GetMapping(value = "/list")
|
|
|
|
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
|
|
|
public Result<?> queryPageList(${entityName} ${entityName?uncap_first},
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
@ -91,7 +91,7 @@ public class ${entityName}Controller {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-添加")
|
|
|
|
@ApiOperation(value="${tableVo.ftlDescription}-添加", notes="${tableVo.ftlDescription}-添加")
|
|
|
|
@Operation(summary = "${tableVo.ftlDescription}-添加")
|
|
|
|
@PostMapping(value = "/add")
|
|
|
|
@PostMapping(value = "/add")
|
|
|
|
public Result<?> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
|
|
|
public Result<?> add(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
|
|
|
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
|
|
|
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
|
|
@ -107,7 +107,7 @@ public class ${entityName}Controller {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-编辑")
|
|
|
|
@ApiOperation(value="${tableVo.ftlDescription}-", notes="${tableVo.ftlDescription}-编辑")
|
|
|
|
@Operation(summary = "${tableVo.ftlDescription}-编辑")
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
public Result<?> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
|
|
|
public Result<?> edit(@RequestBody ${entityName}Page ${entityName?uncap_first}Page) {
|
|
|
|
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
|
|
|
${entityName} ${entityName?uncap_first} = new ${entityName}();
|
|
|
@ -123,7 +123,7 @@ public class ${entityName}Controller {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-通过id删除")
|
|
|
|
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
|
|
|
@Operation(summary = "${tableVo.ftlDescription}-通过id删除")
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
|
${entityName?uncap_first}Service.delMain(id);
|
|
|
|
${entityName?uncap_first}Service.delMain(id);
|
|
|
@ -137,7 +137,7 @@ public class ${entityName}Controller {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-批量删除")
|
|
|
|
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
|
|
|
@Operation(summary = "${tableVo.ftlDescription}-批量删除")
|
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
|
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
|
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
|
this.${entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
|
this.${entityName?uncap_first}Service.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
@ -151,7 +151,7 @@ public class ${entityName}Controller {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
|
|
|
@AutoLog(value = "${tableVo.ftlDescription}-通过id查询")
|
|
|
|
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
|
|
|
|
@Operation(summary = "${tableVo.ftlDescription}-通过id查询")
|
|
|
|
@GetMapping(value = "/queryById")
|
|
|
|
@GetMapping(value = "/queryById")
|
|
|
|
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
|
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
|
|
|
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
|
|
|
${entityName} ${entityName?uncap_first} = ${entityName?uncap_first}Service.getById(id);
|
|
|
@ -168,7 +168,7 @@ public class ${entityName}Controller {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-通过主表id查询")
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-通过主表id查询")
|
|
|
|
@ApiOperation(value="${sub.ftlDescription}-通过主表id查询", notes="${sub.ftlDescription}-通过主表id查询")
|
|
|
|
@Operation(summary = "${sub.ftlDescription}-通过主表id查询")
|
|
|
|
<#-- update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页-------------------- -->
|
|
|
|
<#-- update-begin--Author:kangxiaolin Date:20190905 for:[442]主子表分开维护,生成的代码子表的分页改为真实的分页-------------------- -->
|
|
|
|
@GetMapping(value = "/list${sub.entityName}ByMainId")
|
|
|
|
@GetMapping(value = "/list${sub.entityName}ByMainId")
|
|
|
|
public Result<?> list${sub.entityName}ByMainId(${sub.entityName} ${sub.entityName?uncap_first},
|
|
|
|
public Result<?> list${sub.entityName}ByMainId(${sub.entityName} ${sub.entityName?uncap_first},
|
|
|
@ -208,7 +208,7 @@ ${sub.entityName?uncap_first}.get${key}()!=null<#rt/>
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-添加")
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-添加")
|
|
|
|
@ApiOperation(value="${sub.ftlDescription}-添加", notes="${sub.ftlDescription}-添加")
|
|
|
|
@Operation(summary = "${sub.ftlDescription}-添加")
|
|
|
|
@PostMapping(value = "/add${sub.entityName}")
|
|
|
|
@PostMapping(value = "/add${sub.entityName}")
|
|
|
|
public Result<?> add${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
|
|
|
public Result<?> add${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
|
|
|
${sub.entityName?uncap_first}Service.save(${sub.entityName?uncap_first});
|
|
|
|
${sub.entityName?uncap_first}Service.save(${sub.entityName?uncap_first});
|
|
|
@ -222,7 +222,7 @@ ${sub.entityName?uncap_first}.get${key}()!=null<#rt/>
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-编辑")
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-编辑")
|
|
|
|
@ApiOperation(value="${sub.ftlDescription}-编辑", notes="${sub.ftlDescription}-编辑")
|
|
|
|
@Operation(summary = "${sub.ftlDescription}-编辑")
|
|
|
|
@RequestMapping(value = "/edit${sub.entityName}", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/edit${sub.entityName}", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
|
public Result<?> edit${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
|
|
|
public Result<?> edit${sub.entityName}(@RequestBody ${sub.entityName} ${sub.entityName?uncap_first}) {
|
|
|
|
${sub.entityName?uncap_first}Service.updateById(${sub.entityName?uncap_first});
|
|
|
|
${sub.entityName?uncap_first}Service.updateById(${sub.entityName?uncap_first});
|
|
|
@ -236,7 +236,7 @@ ${sub.entityName?uncap_first}.get${key}()!=null<#rt/>
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-通过id删除")
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-通过id删除")
|
|
|
|
@ApiOperation(value="${sub.ftlDescription}-通过id删除", notes="${sub.ftlDescription}-通过id删除")
|
|
|
|
@Operation(summary = "${sub.ftlDescription}-通过id删除")
|
|
|
|
@DeleteMapping(value = "/delete${sub.entityName}")
|
|
|
|
@DeleteMapping(value = "/delete${sub.entityName}")
|
|
|
|
public Result<?> delete${sub.entityName}(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
public Result<?> delete${sub.entityName}(@RequestParam(name = "id", required = true) String id) {
|
|
|
|
${sub.entityName?uncap_first}Service.removeById(id);
|
|
|
|
${sub.entityName?uncap_first}Service.removeById(id);
|
|
|
@ -250,7 +250,7 @@ ${sub.entityName?uncap_first}.get${key}()!=null<#rt/>
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-批量删除")
|
|
|
|
@AutoLog(value = "${sub.ftlDescription}-批量删除")
|
|
|
|
@ApiOperation(value="${sub.ftlDescription}-批量删除", notes="${sub.ftlDescription}-批量删除")
|
|
|
|
@Operation(summary = "${sub.ftlDescription}-批量删除")
|
|
|
|
@DeleteMapping(value = "/deleteBatch${sub.entityName}")
|
|
|
|
@DeleteMapping(value = "/deleteBatch${sub.entityName}")
|
|
|
|
public Result<?> deleteBatch${sub.entityName}(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
|
public Result<?> deleteBatch${sub.entityName}(@RequestParam(name = "ids", required = true) String ids) {
|
|
|
|
if (ids == null || "".equals(ids.trim())) {
|
|
|
|
if (ids == null || "".equals(ids.trim())) {
|
|
|
|