package com.ruoyi.web.controller.zhang;
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.domain.ZfFamily;
|
import com.ruoyi.domain.dto.UserInfoDto;
|
import com.ruoyi.service.ZfFamilyService;
|
import org.springframework.security.core.parameters.P;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
/**
|
* @Author Jinquan_Ou
|
* @Description
|
* @Date 2023-07-14 14:43
|
* @Version 1.0.0
|
**/
|
|
@RestController
|
@RequestMapping("/family")
|
public class ZfFamilyController {
|
@Resource
|
ZfFamilyService zfFamilyService;
|
|
@GetMapping("/all")
|
public AjaxResult getAllFamily(){
|
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);
|
|
}
|
|
/**
|
*
|
* @param zfFamily
|
* @return
|
*/
|
@PostMapping("/addFam")
|
public AjaxResult addFamilyMember(@RequestBody ZfFamily zfFamily){
|
|
return zfFamilyService.addFamily(zfFamily);
|
|
}
|
/**
|
*
|
* @param zfFamily
|
* @return
|
*/
|
@PostMapping("/updateFam")
|
public AjaxResult updateFamily(@RequestBody ZfFamily zfFamily){
|
|
return zfFamilyService.updateFam(zfFamily);
|
|
}
|
/**
|
* 删除家庭成员
|
*/
|
|
@DeleteMapping()
|
public AjaxResult removeFamilyMember(@RequestBody UserInfoDto userInfoDto){
|
return zfFamilyService.removeMember(userInfoDto);
|
}
|
|
|
|
|
}
|