|
@@ -0,0 +1,104 @@
|
|
|
+package com.ruoyi.eas.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.ruoyi.common.annotation.Log;
|
|
|
+import com.ruoyi.common.core.controller.BaseController;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.eas.domain.BaseDirection;
|
|
|
+import com.ruoyi.eas.service.IBaseDirectionService;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 学科Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2023-03-02
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/eas/direction")
|
|
|
+public class BaseDirectionController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private IBaseDirectionService baseDirectionService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询学科列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('eas:direction:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(BaseDirection baseDirection)
|
|
|
+ {
|
|
|
+ startPage();
|
|
|
+ List<BaseDirection> list = baseDirectionService.selectBaseDirectionList(baseDirection);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出学科列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('eas:direction:export')")
|
|
|
+ @Log(title = "学科", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(HttpServletResponse response, BaseDirection baseDirection)
|
|
|
+ {
|
|
|
+ List<BaseDirection> list = baseDirectionService.selectBaseDirectionList(baseDirection);
|
|
|
+ ExcelUtil<BaseDirection> util = new ExcelUtil<BaseDirection>(BaseDirection.class);
|
|
|
+ util.exportExcel(response, list, "学科数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取学科详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('eas:direction:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ {
|
|
|
+ return success(baseDirectionService.selectBaseDirectionById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增学科
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('eas:direction:add')")
|
|
|
+ @Log(title = "学科", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ public AjaxResult add(@RequestBody BaseDirection baseDirection)
|
|
|
+ {
|
|
|
+ return toAjax(baseDirectionService.insertBaseDirection(baseDirection));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改学科
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('eas:direction:edit')")
|
|
|
+ @Log(title = "学科", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody BaseDirection baseDirection)
|
|
|
+ {
|
|
|
+ return toAjax(baseDirectionService.updateBaseDirection(baseDirection));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除学科
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('eas:direction:remove')")
|
|
|
+ @Log(title = "学科", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
+ {
|
|
|
+ return toAjax(baseDirectionService.deleteBaseDirectionByIds(ids));
|
|
|
+ }
|
|
|
+}
|