【update】修改生成器模板模板
This commit is contained in:
+19
-6
@@ -67,7 +67,7 @@ public class ${entityName}Controller extends JeroController<${entityName}, I${en
|
|||||||
*/
|
*/
|
||||||
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
@AutoLog(value = "${tableVo.ftlDescription}-分页列表查询")
|
||||||
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
@ApiOperation(value="${tableVo.ftlDescription}-分页列表查询", notes="${tableVo.ftlDescription}-分页列表查询")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/page")
|
||||||
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,
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
@@ -78,6 +78,19 @@ public class ${entityName}Controller extends JeroController<${entityName}, I${en
|
|||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "${tableVo.ftlDescription}-列表查询")
|
||||||
|
@ApiOperation(value="${tableVo.ftlDescription}-列表查询", notes="${tableVo.ftlDescription}-列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<List<${entityName}>> queryList() {
|
||||||
|
List<?> list = ${entityName?uncap_first}Service.queryList();
|
||||||
|
return Result.OK(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
@@ -91,7 +104,7 @@ public class ${entityName}Controller extends JeroController<${entityName}, I${en
|
|||||||
<#if bpm_flag>
|
<#if bpm_flag>
|
||||||
${entityName?uncap_first}.setBpmStatus("1");
|
${entityName?uncap_first}.setBpmStatus("1");
|
||||||
</#if>
|
</#if>
|
||||||
${entityName?uncap_first}Service.save(${entityName?uncap_first});
|
${entityName?uncap_first}Service.add(${entityName?uncap_first});
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,7 +118,7 @@ public class ${entityName}Controller extends JeroController<${entityName}, I${en
|
|||||||
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
@ApiOperation(value="${tableVo.ftlDescription}-编辑", notes="${tableVo.ftlDescription}-编辑")
|
||||||
@PutMapping(value = "/edit")
|
@PutMapping(value = "/edit")
|
||||||
public Result<?> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
public Result<?> edit(@RequestBody ${entityName} ${entityName?uncap_first}) {
|
||||||
${entityName?uncap_first}Service.updateById(${entityName?uncap_first});
|
${entityName?uncap_first}Service.editById(${entityName?uncap_first});
|
||||||
return Result.OK("编辑成功!");
|
return Result.OK("编辑成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +132,7 @@ public class ${entityName}Controller extends JeroController<${entityName}, I${en
|
|||||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${tableVo.ftlDescription}-通过id删除")
|
@ApiOperation(value="${tableVo.ftlDescription}-通过id删除", notes="${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.removeById(id);
|
${entityName?uncap_first}Service.deleteById(id);
|
||||||
return Result.OK("删除成功!");
|
return Result.OK("删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +146,7 @@ public class ${entityName}Controller extends JeroController<${entityName}, I${en
|
|||||||
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${tableVo.ftlDescription}-批量删除")
|
@ApiOperation(value="${tableVo.ftlDescription}-批量删除", notes="${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.deleteByIds(Arrays.asList(ids.split(",")));
|
||||||
return Result.OK("批量删除成功!");
|
return Result.OK("批量删除成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +160,7 @@ public class ${entityName}Controller extends JeroController<${entityName}, I${en
|
|||||||
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${tableVo.ftlDescription}-通过id查询")
|
@ApiOperation(value="${tableVo.ftlDescription}-通过id查询", notes="${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.queryById(id);
|
||||||
if(${entityName?uncap_first}==null) {
|
if(${entityName?uncap_first}==null) {
|
||||||
return Result.error("未找到对应数据");
|
return Result.error("未找到对应数据");
|
||||||
}
|
}
|
||||||
|
|||||||
+47
@@ -2,6 +2,7 @@ package ${bussiPackage}.${entityPackage}.service;
|
|||||||
|
|
||||||
import ${bussiPackage}.${entityPackage}.entity.${entityName};
|
import ${bussiPackage}.${entityPackage}.entity.${entityName};
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: ${tableVo.ftlDescription}
|
* @Description: ${tableVo.ftlDescription}
|
||||||
@@ -11,4 +12,50 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
*/
|
*/
|
||||||
public interface I${entityName}Service extends IService<${entityName}> {
|
public interface I${entityName}Service extends IService<${entityName}> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*
|
||||||
|
* @param ${entityName?uncap_first}
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void add(${entityName} ${entityName?uncap_first});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
*
|
||||||
|
* @param ${entityName?uncap_first}
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void editById(${entityName} ${entityName?uncap_first});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void deleteById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void deleteByIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
${entityName} queryById(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<${entityName}> queryList();
|
||||||
}
|
}
|
||||||
|
|||||||
+64
@@ -16,4 +16,68 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
@Service
|
@Service
|
||||||
public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, ${entityName}> implements I${entityName}Service {
|
public class ${entityName}ServiceImpl extends ServiceImpl<${entityName}Mapper, ${entityName}> implements I${entityName}Service {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存
|
||||||
|
*
|
||||||
|
* @param ${entityName?uncap_first}
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
void add(${entityName} ${entityName?uncap_first}) {
|
||||||
|
save(${entityName?uncap_first});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
*
|
||||||
|
* @param ${entityName?uncap_first}
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
void editById(${entityName} ${entityName?uncap_first}) {
|
||||||
|
updateById(${entityName?uncap_first});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
void deleteById(String id) {
|
||||||
|
removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
void deleteByIds(List<String> ids) {
|
||||||
|
removeByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
${entityName} queryById(String id) {
|
||||||
|
return getById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
List<${entityName}> queryList() {
|
||||||
|
return list();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -2,6 +2,7 @@ package ${bussiPackage}.${entityPackage}.service;
|
|||||||
|
|
||||||
import ${bussiPackage}.${entityPackage}.entity.${entityName};
|
import ${bussiPackage}.${entityPackage}.entity.${entityName};
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: ${tableVo.ftlDescription}
|
* @Description: ${tableVo.ftlDescription}
|
||||||
|
|||||||
Reference in New Issue
Block a user