| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.dto.UserInfoDto; |
| | | import com.ruoyi.service.ZfFamilyService; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.security.core.parameters.P; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | return AjaxResult.success(zfFamilyService.list()); |
| | | } |
| | | |
| | | /** |
| | | * 根据家庭id查询家庭成员 |
| | | */ |
| | | @GetMapping("/{fid}") |
| | | public AjaxResult getByFamilyId(@PathVariable Long fid){ |
| | | return AjaxResult.success(zfFamilyService.getByFamilyId(fid)); |
| | | } |
| | | |
| | | /** |
| | | * 查看当前用户当前家庭的家庭成员 |
| | | */ |
| | | |
| | | @GetMapping("/now") |
| | | public AjaxResult getNowMember(){ |
| | | return AjaxResult.success(zfFamilyService.getNowMember()); |
| | | } |
| | | |
| | | /** |
| | | * 新增家庭成员 |
| | | */ |
| | | @PostMapping() |
| | | public AjaxResult addFamilyMember(@RequestBody UserInfoDto userInfoDto){ |
| | | return zfFamilyService.addMember(userInfoDto); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除家庭成员 |
| | | */ |
| | | |
| | | @DeleteMapping() |
| | | public AjaxResult removeFamilyMember(@RequestBody UserInfoDto userInfoDto){ |
| | | return zfFamilyService.removeMember(userInfoDto); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |