template.controller.vm.20220823.back Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of primo-generator-mybatis-plus-maven-plugin Show documentation
Show all versions of primo-generator-mybatis-plus-maven-plugin Show documentation
自动生成增删改查代码插件,通过Maven插件配置,一键生成单表的所有CRUD操作
package ${package.Controller};
import ${package.Service}.${table.serviceName};
import ${package.ResultModel}.ResultModel;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import ${package.QueryBo}.${table.queryName};
import ${package.EntityReq}.${table.entityReqName};
import ${package.EntityResp}.${table.entityRespName};
import ${package.Entity}.${entity};
import java.util.ArrayList;
import java.util.List;
import ${package.PageVOResp}.PageVOResp;
import ${package.PageVOReq}.${table.pageVOReqName};
import ${package.EntityVOReq}.${table.entityVOReqName};
/**
*
* ${table.comment} 前端控制器
*
*
* @author ${author}
* @since ${date}
*/
@Controller
@RequestMapping("/primo#if(${package.ModuleName})/${package.ModuleName.toLowerCase()}#end/${table.entityName.toLowerCase()}")
public class ${table.controllerName} {
@Autowired
private ${table.serviceName} ${table.strConvertLowerCamel(${table.serviceName})};
/**
* 表格页面
*/
@RequestMapping({"tables"})
public String tables() {
return "tables/${table.strConvertLowerCamel(${table.entityName})}";
}
/**
* 添加对象
*
* @param ${table.strConvertLowerCamel(${table.entityVOReqName})} 对象
* @return ResultModel统一响应结果
*/
@PostMapping("save")
@ResponseBody
public ResultModel
© 2015 - 2025 Weber Informatics LLC | Privacy Policy