class GenTemplateController {

	private final GenTemplateService genTemplateService;

	/**
	 * 分页查询
	 * @param page 分页对象
	 * @param genTemplate 模板
	 * @return
	 */
	@Operation(summary = "分页查询", description = "分页查询")
	@GetMapping("/page")
	@PreAuthorize("@pms.hasPermission('codegen_template_view')")
	public R getgenTemplatePage(Page page, GenTemplateEntity genTemplate) {<FILL_FUNCTION_BODY>}

	/**
	 * 查询全部模板
	 * @return
	 */
	@Operation(summary = "查询全部", description = "查询全部")
	@GetMapping("/list")
	@PreAuthorize("@pms.hasPermission('codegen_template_view')")
	public R list() {
		return R.ok(genTemplateService.list(Wrappers.emptyWrapper()));
	}

	/**
	 * 通过id查询模板
	 * @param id id
	 * @return R
	 */
	@Operation(summary = "通过id查询", description = "通过id查询")
	@GetMapping("/{id}")
	@PreAuthorize("@pms.hasPermission('codegen_template_view')")
	public R getById(@PathVariable("id") Long id) {
		return R.ok(genTemplateService.getById(id));
	}

	/**
	 * 新增模板
	 * @param genTemplate 模板
	 * @return R
	 */
	@Operation(summary = "新增模板", description = "新增模板")
	@SysLog("新增模板")
	@PostMapping
	@PreAuthorize("@pms.hasPermission('codegen_template_add')")
	public R save(@RequestBody GenTemplateEntity genTemplate) {
		return R.ok(genTemplateService.save(genTemplate));
	}

	/**
	 * 修改模板
	 * @param genTemplate 模板
	 * @return R
	 */
	@Operation(summary = "修改模板", description = "修改模板")
	@SysLog("修改模板")
	@PutMapping
	@PreAuthorize("@pms.hasPermission('codegen_template_edit')")
	public R updateById(@RequestBody GenTemplateEntity genTemplate) {
		return R.ok(genTemplateService.updateById(genTemplate));
	}

	/**
	 * 通过id删除模板
	 * @param ids id列表
	 * @return R
	 */
	@Operation(summary = "通过id删除模板", description = "通过id删除模板")
	@SysLog("通过id删除模板")
	@DeleteMapping
	@PreAuthorize("@pms.hasPermission('codegen_template_del')")
	public R removeById(@RequestBody Long[] ids) {
		return R.ok(genTemplateService.removeBatchByIds(CollUtil.toList(ids)));
	}

	/**
	 * 导出excel 表格
	 * @param genTemplate 查询条件
	 * @return excel 文件流
	 */
	@ResponseExcel
	@GetMapping("/export")
	@PreAuthorize("@pms.hasPermission('codegen_template_export')")
	public List<GenTemplateEntity> export(GenTemplateEntity genTemplate) {
		return genTemplateService.list(Wrappers.query(genTemplate));
	}

}

		LambdaQueryWrapper<GenTemplateEntity> wrapper = Wrappers.<GenTemplateEntity>lambdaQuery()
			.like(genTemplate.getId() != null, GenTemplateEntity::getId, genTemplate.getId())
			.like(StrUtil.isNotEmpty(genTemplate.getTemplateName()), GenTemplateEntity::getTemplateName,
					genTemplate.getTemplateName());
		return R.ok(genTemplateService.page(page, wrapper));
	
<no_super_class>