ÎļþÃû´Ó ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SvyLibTitleController.java ÐÞ¸Ä |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.smartor.domain.SvyLibTitle; |
| | | import com.smartor.domain.SvyLibTitleReq; |
| | | import com.smartor.service.ISvyLibTitleService; |
| | | import com.smartor.domain.SvyLibTemplate; |
| | | import com.smartor.domain.SvyLibTemplateReq; |
| | | import com.smartor.service.ISvyLibTemplateService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | |
| | | */ |
| | | @Api(description = "é®å·æ¨¡æ¿") |
| | | @RestController |
| | | @RequestMapping("/smartor/svytitle") |
| | | public class SvyLibTitleController extends BaseController { |
| | | @RequestMapping("/smartor/svyTemplate") |
| | | public class SvyLibTemplateController extends BaseController { |
| | | @Autowired |
| | | private ISvyLibTitleService svyLibTitleService; |
| | | private ISvyLibTemplateService svyLibTemplateService; |
| | | |
| | | /** |
| | | * æ¥è¯¢é®å·å表 |
| | | */ |
| | | @ApiOperation("æ¥è¯¢é®å·å表详æ
") |
| | | @PostMapping("/selectSvyLibTitlelist") |
| | | public TableDataInfo selectSvyLibTitlelist(@RequestBody SvyLibTitleReq svyLibTitleReq) { |
| | | @PostMapping("/selectSvyLibTemplatelist") |
| | | public TableDataInfo selectSvyLibTemplatelist(@RequestBody SvyLibTemplateReq svyLibTemplateReq) { |
| | | startPage(); |
| | | List<SvyLibTitle> list = svyLibTitleService.selectSvyLibTitleList(svyLibTitleReq); |
| | | List<SvyLibTemplate> list = svyLibTemplateService.selectSvyLibTemplateList(svyLibTemplateReq); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | |
| | | // * è·åé®å·è¯¦ç»ä¿¡æ¯(å表) |
| | | // */ |
| | | // @ApiOperation("è·åé®å·è¯¦ç»ä¿¡æ¯") |
| | | // @PreAuthorize("@ss.hasPermi('smartor:svytitle:query')") |
| | | // @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:query')") |
| | | // @GetMapping(value = "/{svyid}") |
| | | // public AjaxResult getInfo(@PathVariable("svyid") Long svyid) { |
| | | // return success(svyLibTitleService.selectSvyLibTitleBySvyid(svyid)); |
| | | // return success(svyLibTemplateService.selectSvyLibTemplateBySvyid(svyid)); |
| | | // } |
| | | |
| | | /** |
| | | * æ°å¢é®å· |
| | | */ |
| | | @ApiOperation("æ°å¢é®å·") |
| | | @PostMapping("/addSvyLibTitle") |
| | | public AjaxResult addSvyLibTitle(@RequestBody SvyLibTitle svyLibTitle) { |
| | | return toAjax(svyLibTitleService.insertSvyLibTitle(svyLibTitle)); |
| | | @PostMapping("/addSvyLibTemplate") |
| | | public AjaxResult addSvyLibTemplate(@RequestBody SvyLibTemplate svyLibTemplate) { |
| | | return toAjax(svyLibTemplateService.insertSvyLibTemplate(svyLibTemplate)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation("æ°å¢æä¿®æ¹é®å·æ¨¡æ¿ä¿¡æ¯") |
| | | @PreAuthorize("@ss.hasPermi('system:script:list')") |
| | | @PostMapping("/saveOrUpdateTitle") |
| | | public AjaxResult saveOrUpdateTitle(@RequestBody SvyLibTitle svyLibTitle) { |
| | | if (ObjectUtils.isEmpty(svyLibTitle)) { |
| | | @PostMapping("/saveOrUpdateTemplate") |
| | | public AjaxResult saveOrUpdateTemplate(@RequestBody SvyLibTemplate svyLibTemplate) { |
| | | if (ObjectUtils.isEmpty(svyLibTemplate)) { |
| | | throw new BaseException("å
¥å为空ï¼è¯·æ£æ¥å
¥å"); |
| | | } |
| | | return success(svyLibTitleService.saveOrUpdateTitle(svyLibTitle)); |
| | | return success(svyLibTemplateService.saveOrUpdateTemplate(svyLibTemplate)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹é®å· |
| | | */ |
| | | @ApiOperation("ä¿®æ¹é®å·") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytitle:edit')") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:edit')") |
| | | @Log(title = "é®å·", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody SvyLibTitle svyLibTitle) { |
| | | return toAjax(svyLibTitleService.updateSvyLibTitle(svyLibTitle)); |
| | | public AjaxResult edit(@RequestBody SvyLibTemplate svyLibTemplate) { |
| | | return toAjax(svyLibTemplateService.updateSvyLibTemplate(svyLibTemplate)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤é®å· |
| | | */ |
| | | @ApiOperation("å é¤é®å·") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytitle:remove')") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:remove')") |
| | | @Log(title = "é®å·", businessType = BusinessType.DELETE) |
| | | @GetMapping("/remove/{svyids}") |
| | | public AjaxResult remove(@PathVariable Long[] svyids) { |
| | | return toAjax(svyLibTitleService.deleteSvyLibTitleBySvyids(svyids)); |
| | | return toAjax(svyLibTemplateService.deleteSvyLibTemplateBySvyids(svyids)); |
| | | } |
| | | |
| | | /** |
| | | * åéçä¿¡ |
| | | */ |
| | | @ApiOperation("åéçä¿¡") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytitle:remove')") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svyTemplate:remove')") |
| | | @Log(title = "é®å·", businessType = BusinessType.DELETE) |
| | | @PostMapping("/sendMessage") |
| | | public AjaxResult sendMessage(@PathVariable Long[] svyids) { |
| | |
| | | // } catch (Exception e) { |
| | | // System.err.println("åéç信失败ï¼" + e.getMessage()); |
| | | // } |
| | | return toAjax(svyLibTitleService.deleteSvyLibTitleBySvyids(svyids)); |
| | | return toAjax(svyLibTemplateService.deleteSvyLibTemplateBySvyids(svyids)); |
| | | } |
| | | |
| | | |