|
@@ -0,0 +1,83 @@
|
|
|
+package com.ruoyi.web.work.controller;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import com.ruoyi.common.annotation.Anonymous;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
|
|
+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.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.web.work.domain.Nk;
|
|
|
+import com.ruoyi.web.work.service.INkService;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 亲属关系
|
|
|
+ * @author lsw
|
|
|
+ * @date 2024-07-19
|
|
|
+ */
|
|
|
+@Api(tags = "亲属关系管理")
|
|
|
+@Anonymous
|
|
|
+@RestController
|
|
|
+@RequestMapping("/work/nk")
|
|
|
+public class NkController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private INkService nkService;
|
|
|
+
|
|
|
+ @ApiOperation(value = "获取亲属信息列表")
|
|
|
+ @Anonymous
|
|
|
+ //@PreAuthorize("@ss.hasPermi('work:nk:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(Nk nk){
|
|
|
+ startPage();
|
|
|
+ List<Nk> list = nkService.selectList(nk);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "根据id查询亲属信息")
|
|
|
+ @Anonymous
|
|
|
+ //@PreAuthorize("@ss.hasPermi('work:nk:query')")
|
|
|
+ @GetMapping(value = "/detail/{id}")
|
|
|
+ public AjaxResult detail(@PathVariable("id") Long id){
|
|
|
+ return AjaxResult.success(nkService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "添加亲属信息")
|
|
|
+ @Anonymous
|
|
|
+ //@PreAuthorize("@ss.hasPermi('work:nk:add')")
|
|
|
+ @Log(title = "亲属关系", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/add")
|
|
|
+ public AjaxResult add(@RequestBody Nk nk){
|
|
|
+ return toAjax(nkService.save(nk));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "修改亲属信息")
|
|
|
+ @Anonymous
|
|
|
+ //@PreAuthorize("@ss.hasPermi('work:nk:edit')")
|
|
|
+ @Log(title = "亲属关系", businessType = BusinessType.UPDATE)
|
|
|
+ @PostMapping("/edit")
|
|
|
+ public AjaxResult edit(@RequestBody Nk nk){
|
|
|
+ return toAjax(nkService.updateById(nk));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "删除亲属信息")
|
|
|
+ @Anonymous
|
|
|
+ //@PreAuthorize("@ss.hasPermi('work:nk:remove')")
|
|
|
+ @Log(title = "亲属关系", businessType = BusinessType.DELETE)
|
|
|
+ @GetMapping("/remove/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids){
|
|
|
+ return toAjax(nkService.removeByIds(Arrays.asList(ids)));
|
|
|
+ }
|
|
|
+}
|