| | |
| | | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | | import com.smartor.domain.PatImportInfoVO; |
| | | import com.smartor.domain.SvyLibTopicRes; |
| | | import com.smartor.domain.SvyTopicReq; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | * @author ruoyi |
| | | * @date 2023-03-03 |
| | | */ |
| | | @Api("问卷题目") |
| | | @Api(description = "问卷题目") |
| | | @RestController |
| | | @RequestMapping("/smartor/svytopic") |
| | | public class SvyLibTopicController extends BaseController { |
| | |
| | | * 查询问卷题目列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytopic:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(SvyLibTopic svyLibTopic) { |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody SvyLibTopic svyLibTopic) { |
| | | startPage(); |
| | | List<SvyLibTopic> list = svyLibTopicService.selectSvyLibTopicList(svyLibTopic); |
| | | return getDataTable(list); |
| | |
| | | @ApiOperation("新增问卷题目") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytopic:add')") |
| | | @Log(title = "问卷题目", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody SvyLibTopic svyLibTopic) { |
| | | return toAjax(svyLibTopicService.insertSvyLibTopic(svyLibTopic)); |
| | | } |
| | |
| | | @ApiOperation("修改问卷题目") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytopic:edit')") |
| | | @Log(title = "问卷题目", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @PostMapping("/edit") |
| | | public AjaxResult edit(@RequestBody SvyLibTopic svyLibTopic) { |
| | | return toAjax(svyLibTopicService.updateSvyLibTopic(svyLibTopic)); |
| | | } |
| | |
| | | @ApiOperation("删除问卷题目") |
| | | @PreAuthorize("@ss.hasPermi('smartor:svytopic:remove')") |
| | | @Log(title = "问卷题目", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{topicids}") |
| | | @GetMapping("/remove/{topicids}") |
| | | public AjaxResult remove(@PathVariable Long[] topicids) { |
| | | return toAjax(svyLibTopicService.deleteSvyLibTopicByTopicids(topicids)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 批量导入问问题目 |
| | | */ |
| | | @ApiOperation("批量导入问问题目") |
| | | @PostMapping("/importLitTopic") |
| | | public AjaxResult importLitTopic(MultipartFile multipartFile) { |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | |
| | | return success(svyLibTopicService.importLitTopic(user, multipartFile)); |
| | | } |
| | | |
| | | } |