123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- package com.kgraph.web.controller;
- import java.util.List;
- 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.PostMapping;
- import org.springframework.web.bind.annotation.PutMapping;
- import org.springframework.web.bind.annotation.DeleteMapping;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import com.kgraph.common.annotation.Log;;
- import com.kgraph.common.core.controller.BaseController;;
- import com.kgraph.common.core.domain.AjaxResult;;
- import com.kgraph.common.enums.BusinessType;;
- import com.kgraph.web.domain.CaseDoc;
- import com.kgraph.web.service.ICaseDocService;
- import com.kgraph.common.utils.poi.ExcelUtil;;
- import com.kgraph.common.core.page.TableDataInfo;;
- /**
- * 案例Controller
- *
- * @author Allen
- * @date 2023-04-13
- */
- @RestController
- @RequestMapping("/doc/case")
- public class CaseDocController extends BaseController
- {
- @Autowired
- private ICaseDocService caseDocService;
- /**
- * 查询案例列表
- */
- @PreAuthorize("@ss.hasPermi('doc:case:list')")
- @GetMapping("/list")
- public TableDataInfo list(CaseDoc caseDoc)
- {
- startPage();
- List<CaseDoc> list = caseDocService.selectCaseDocList(caseDoc);
- return getDataTable(list);
- }
- /**
- * 导出案例列表
- */
- @PreAuthorize("@ss.hasPermi('doc:case:export')")
- @Log(title = "案例", businessType = BusinessType.EXPORT)
- @PostMapping("/export")
- public void export(HttpServletResponse response, CaseDoc caseDoc)
- {
- List<CaseDoc> list = caseDocService.selectCaseDocList(caseDoc);
- ExcelUtil<CaseDoc> util = new ExcelUtil<CaseDoc>(CaseDoc.class);
- util.exportExcel(response, list, "案例数据");
- }
- /**
- * 获取案例详细信息
- */
- @PreAuthorize("@ss.hasPermi('doc:case:query')")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id)
- {
- return success(caseDocService.selectCaseDocById(id));
- }
- /**
- * 新增案例
- */
- @PreAuthorize("@ss.hasPermi('doc:case:add')")
- @Log(title = "案例", businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody CaseDoc caseDoc)
- {
- return toAjax(caseDocService.insertCaseDoc(caseDoc));
- }
- /**
- * 修改案例
- */
- @PreAuthorize("@ss.hasPermi('doc:case:edit')")
- @Log(title = "案例", businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody CaseDoc caseDoc)
- {
- return toAjax(caseDocService.updateCaseDoc(caseDoc));
- }
- /**
- * 删除案例
- */
- @PreAuthorize("@ss.hasPermi('doc:case:remove')")
- @Log(title = "案例", businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids)
- {
- return toAjax(caseDocService.deleteCaseDocByIds(ids));
- }
- }
|