whywhyo
2023-05-03 ab06f7043e4192556c4d9881b0430bcb6cc75f50
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java
@@ -11,6 +11,8 @@
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZInfoUser;
import com.ruoyi.domain.ZfRelation;
import com.ruoyi.domain.dto.EmpowerDto;
import com.ruoyi.service.ZInfoUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@@ -18,6 +20,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.PathParam;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
@@ -146,7 +149,6 @@
    /**
     * 查询家庭主要成员及关系
     */
    @GetMapping("/relation")
    public AjaxResult listMyRelation() {
        SysUser user = SecurityUtils.getLoginUser().getUser();
@@ -154,6 +156,63 @@
        return zInfoUserService.searchMyRelation(userId);
    }
    @PostMapping("/relation")
    public AjaxResult addRelation(@RequestBody ZfRelation zfRelation){
        return zInfoUserService.addRelation(zfRelation);
    }
    @PutMapping("/relation")
    public AjaxResult updateRelation(@RequestBody ZfRelation zfRelation){
        return zInfoUserService.updateRelation(zfRelation);
    }
    @DeleteMapping("/relation/{ids}")
    public AjaxResult deleteRelation(@PathVariable Long[] ids){
        return zInfoUserService.deleteRelation(ids);
    }
    /**
     * 授权
     */
    @PostMapping("/empower")
    public AjaxResult empower(@RequestBody EmpowerDto empowerDto){
        return zInfoUserService.empower(empowerDto);
    }
    /**
     * 家根网
     */
    @GetMapping("/root")
    public AjaxResult listAllPeopleWithTree(){
        return zInfoUserService.listWithTree();
    }
    /**
     * 找到所有的成员
     */
    @GetMapping("/all")
    public AjaxResult listAllPeople(){
        return zInfoUserService.listAllExceptAdmin();
    }
    /**
     * 新增、修改父子关系
     */
    @PutMapping("/setParent")
    public AjaxResult addParent(@PathParam("fatherId")Long fatherId,@PathParam("motherId")Long motherId){
        return zInfoUserService.addParent(fatherId,motherId);
    }
}