删除部分无用文件
This commit is contained in:
@@ -1,114 +0,0 @@
|
||||
package ${package.Controller};
|
||||
|
||||
|
||||
import com.qizhi.itfin.common.util.PageUtils;
|
||||
import com.qizhi.itfin.common.util.R;
|
||||
import com.qizhi.itfin.entity.${table.entityName};
|
||||
import com.qizhi.itfin.service.${table.serviceName};
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* $!{table.comment} 前端控制器
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("#if(${package.ModuleName})/${package.ModuleName}#end/#if(${controllerMappingHyphenStyle})${controllerMappingHyphen}#else${table.entityPath}#end")
|
||||
#if(${kotlin})
|
||||
|
||||
class ${table.controllerName}#if(${superControllerClass}):${superControllerClass}()#end
|
||||
|
||||
#else
|
||||
#if(${superControllerClass})
|
||||
|
||||
public class ${table.controllerName}
|
||||
} extends ${superControllerClass}{
|
||||
#else
|
||||
|
||||
public class ${table.controllerName} {
|
||||
#end
|
||||
|
||||
#set($serviceImplName=$table.serviceName.substring(0,1).toLowerCase()+$table.serviceName.substring(1))
|
||||
#set($entityName=$table.entityName.substring(0,1).toLowerCase()+$table.entityName.substring(1))
|
||||
@Autowired
|
||||
private ${table.serviceName} ${serviceImplName};
|
||||
|
||||
/**
|
||||
* 分页显示$!{table.comment}
|
||||
*
|
||||
* @param currentPage 当前页
|
||||
* @param pageSize 每页大小
|
||||
* @param sortFields 排序字段
|
||||
* @param orderTypes asc/desc
|
||||
*/
|
||||
@RequestMapping("/page")
|
||||
public R page(Integer currentPage,Integer pageSize,String sortField,String orderType,
|
||||
${table.entityName}${entityName}){
|
||||
Page<${table.entityName}>page=PageUtils.getPage(currentPage,pageSize,sortField,orderType);
|
||||
PageResult pageResult=odrProductFromService.page(page,${entityName});
|
||||
return R.ok().put("page",pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增${table.comment}
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
public R save(${table.entityName}${entityName}){
|
||||
if(${serviceImplName}.save(${entityName})){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.error("添加失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除${table.comment}
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
public R delete(Integer id){
|
||||
if(${serviceImplName}.removeById(id)){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.error("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改${table.comment}
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(${table.entityName}${entityName},BindingResult result){
|
||||
if(${serviceImplName}.updateById(${entityName})){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.error("修改失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询${table.comment}信息
|
||||
*
|
||||
* @param id id
|
||||
*/
|
||||
@RequestMapping("/info")
|
||||
public R info(Integer id){
|
||||
${table.entityName}${entityName}=service.getById(id);
|
||||
return R.ok().put("data",${entityName});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#end
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="$daoPackage">
|
||||
|
||||
<resultMap id="BaseResultMap" type="$domainPackage.$domainClass">
|
||||
#foreach($resultMap in $resultMapList)
|
||||
<result column="$resultMap.dbColumn" property="$resultMap.javaField"/>
|
||||
#end
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">#foreach($resultMap in $resultMapList)#set($dbsaveAttr= $resultMap.dbColumn)#if($velocityCount != 1), #end$dbsaveAttr#end</sql>
|
||||
|
||||
<sql id="Base_Column_List_Without_Id">#foreach($resultMap in $resultMapList)#if($resultMap.dbColumn =='id')#else#set($dbsaveAttr= $resultMap.dbColumn)#if($velocityCount != 2), #end$dbsaveAttr#end#end</sql>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user