| | |
| | | package ${packageName}.controller;
|
| | |
|
| | | import java.util.List;
|
| | | import java.io.IOException;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | | import org.springframework.security.access.prepost.PreAuthorize;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.web.bind.annotation.GetMapping;
|
| | |
| | | import org.springframework.web.bind.annotation.RequestBody;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RestController;
|
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
| | | import com.ruoyi.common.log.annotation.Log;
|
| | | import com.ruoyi.common.log.enums.BusinessType;
|
| | | import ${packageName}.domain.${ClassName};
|
| | | import ${packageName}.service.I${ClassName}Service;
|
| | | import com.ruoyi.framework.web.controller.BaseController;
|
| | | import com.ruoyi.framework.web.domain.AjaxResult;
|
| | | import com.ruoyi.common.utils.poi.ExcelUtil;
|
| | | import com.ruoyi.common.core.web.controller.BaseController;
|
| | | import com.ruoyi.common.core.web.domain.AjaxResult;
|
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
| | | #if($table.crud)
|
| | | import com.ruoyi.framework.web.page.TableDataInfo;
|
| | | import com.ruoyi.common.core.web.page.TableDataInfo;
|
| | | #elseif($table.tree)
|
| | | #end
|
| | |
|
| | |
| | | * @date ${datetime}
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/${moduleName}/${businessName}")
|
| | | @RequestMapping("/${businessName}")
|
| | | public class ${ClassName}Controller extends BaseController
|
| | | {
|
| | | @Autowired
|
| | |
| | | @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
|
| | | @Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
| | | @GetMapping("/export")
|
| | | public AjaxResult export(${ClassName} ${className})
|
| | | public void export(HttpServletResponse response, ${ClassName} ${className}) throws IOException
|
| | | {
|
| | | List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
|
| | | ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
|
| | | return util.exportExcel(list, "${businessName}");
|
| | | return util.exportExcel(response, list, "${businessName}");
|
| | | }
|
| | |
|
| | | /**
|