去除无效依赖

This commit is contained in:
Chopper
2021-09-27 14:50:19 +08:00
parent 87c82ce4d3
commit 444b617c63
10 changed files with 0 additions and 563 deletions

View File

@@ -1,77 +0,0 @@
package ${entity.controllerPackage};
import cn.lili.mybatis.util.PageUtil;
import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.PageVO;
import cn.lili.common.vo.SearchVO;
import cn.lili.common.vo.ResultMessage;
import ${entity.entityPackage}.${entity.className};
import ${entity.servicePackage}.${entity.className}Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.RequiredArgsConstructor;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author ${entity.author}
*/
@RestController
@Api(tags = "${entity.description}接口")
@RequestMapping("/lili/${entity.classNameLowerCase}")
@Transactional(rollbackFor = Exception.class)
public class ${entity.className}Controller {
private final ${entity.className}Service ${entity.classNameLowerCase}Service;
@GetMapping(value = "/{id}")
@ApiOperation(value = "查看${entity.description}详情")
public ResultMessage<${entity.className}> get(@PathVariable ${entity.primaryKeyType} id){
${entity.className} ${entity.classNameLowerCase} = ${entity.classNameLowerCase}Service.getById(id);
return new ResultUtil<${entity.className}>().setData(${entity.classNameLowerCase});
}
@GetMapping
@ApiOperation(value = "分页获取${entity.description}")
public ResultMessage<IPage<${entity.className}>> getByPage(${entity.className} entity,
SearchVO searchVo,
PageVO page){
IPage<${entity.className}> data = ${entity.classNameLowerCase}Service.page(PageUtil.initPage(page),PageUtil.initWrapper(entity, searchVo));
return new ResultUtil<IPage<${entity.className}>>().setData(data);
}
@PostMapping
@ApiOperation(value = "新增${entity.description}")
public ResultMessage<${entity.className}> save(${entity.className} ${entity.classNameLowerCase}){
if(${entity.classNameLowerCase}Service.save(${entity.classNameLowerCase})){
return new ResultUtil<${entity.className}>().setData(${entity.classNameLowerCase});
}
return new ResultUtil<${entity.className}>().setErrorMsg("未知异常,请稍后重试");
}
@PutMapping("/{id}")
@ApiOperation(value = "更新${entity.description}")
public ResultMessage<${entity.className}> update(@PathVariable String id, ${entity.className} ${entity.classNameLowerCase}){
if(${entity.classNameLowerCase}Service.updateById(${entity.classNameLowerCase})){
return new ResultUtil<${entity.className}>().setData(${entity.classNameLowerCase});
}
return new ResultUtil<${entity.className}>().setErrorMsg("未知异常,请稍后重试");
}
@DeleteMapping(value = "/{ids}")
@ApiOperation(value = "删除${entity.description}")
public ResultMessage<Object> delAllByIds(@PathVariable List ids){
${entity.classNameLowerCase}Service.removeByIds(ids);
return ResultUtil.success("成功删除");
}
}

View File

@@ -1,23 +0,0 @@
package ${entity.entityPackage};
import cn.lili.mybatis.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @author ${entity.author}
*/
@Data
@Entity
@Table(name = "${entity.tableName}")
@TableName("${entity.tableName}")
@ApiModel(value = "${entity.description}")
public class ${entity.className} extends BaseEntity {
private static final long serialVersionUID = 1L;
}

View File

@@ -1,14 +0,0 @@
package ${entity.daoPackage};
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import ${entity.entityPackage}.${entity.className};
import java.util.List;
/**
* ${entity.description} Dao层
* @author ${entity.author}
*/
public interface ${entity.className}Mapper extends BaseMapper<${entity.className}> {
}

View File

@@ -1,5 +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="${entity.daoPackage}.${entity.className}Mapper">
</mapper>

View File

@@ -1,14 +0,0 @@
package ${entity.servicePackage};
import com.baomidou.mybatisplus.extension.service.IService;
import ${entity.entityPackage}.${entity.className};
import java.util.List;
/**
* ${entity.description} 业务层
* @author ${entity.author}
*/
public interface ${entity.className}Service extends IService<${entity.className}> {
}

View File

@@ -1,23 +0,0 @@
package ${entity.serviceImplPackage};
import ${entity.daoPackage}.${entity.className}Mapper;
import ${entity.entityPackage}.${entity.className};
import ${entity.servicePackage}.${entity.className}Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* ${entity.description} 业务实现
* @author ${entity.author}
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class ${entity.className}ServiceImpl extends ServiceImpl<${entity.className}Mapper, ${entity.className}> implements ${entity.className}Service {
private final ${entity.className}Mapper ${entity.classNameLowerCase}Mapper;
}