package com.yuchen.saas.park.service.controller.property;


import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.manage.system.api.param.CommonIdParam;
import com.yuchen.saas.park.api.entity.park.PeoplePropertyRelation;
import com.yuchen.saas.park.service.service.property.IPeoplePropertyRelationService;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 人员房源关系表 前端控制器
 * </p>
 *
 * @author 洪铭铭
 * @since 2024-06-25
 */
@RestController
@RequestMapping("/peoplePropertyRelation")
public class PeoplePropertyRelationController {

    @Autowired
    private IPeoplePropertyRelationService peoplePropertyRelationService;

    @PostMapping("/save")
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "新增", notes = "新增")
    public R save(@Valid @RequestBody PeoplePropertyRelation peoplePropertyRelation) {
        return R.status(peoplePropertyRelationService.save(peoplePropertyRelation));
    }

    @PostMapping("/delete")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "删除", notes = "删除")
    public R delete(@Valid @RequestBody CommonIdParam param) {
        return R.data(peoplePropertyRelationService.removeById(param.getId()));
    }



}
