mitao
2025-02-21 31573d6180d15ef65ed0df9c2732495f40b12663
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.panzhihua.service_property.api;
 
 
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.api.ApiController;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.vos.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.panzhihua.common.model.vos.property.ComPropertyAlarmSettingVO;
import com.panzhihua.service_property.entity.ComPropertyAlarmSetting;
import com.panzhihua.service_property.service.ComPropertyAlarmSettingService;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
 
/**
 * (ComPropertyAlarmSetting)表控制层
 *
 * @author makejava
 * @since 2021-09-09 09:46:51
 */
@RestController
@RequestMapping("comPropertyAlarmSetting")
public class ComPropertyAlarmSettingApi {
    /**
     * 服务对象
     */
    @Resource
    private ComPropertyAlarmSettingService comPropertyAlarmSettingService;
 
    /**
     * 通过主键查询单条数据
     *
     * @param communityId 主键
     * @return 单条数据
     */
    @GetMapping
    public R selectOne(@RequestParam("communityId") Long communityId) {
        return this.comPropertyAlarmSettingService.getByCommunityId(communityId);
    }
 
    /**
     * 新增数据
     *
     * @param comPropertyAlarmSettingVO 实体对象
     * @return 新增结果
     */
    @PostMapping
    public R insert(@RequestBody ComPropertyAlarmSettingVO comPropertyAlarmSettingVO) {
        ComPropertyAlarmSetting comPropertyAlarmSetting=new ComPropertyAlarmSetting();
        BeanUtils.copyProperties(comPropertyAlarmSettingVO,comPropertyAlarmSetting);
        comPropertyAlarmSetting.setCreateTime(DateUtil.date());
        return R.ok(this.comPropertyAlarmSettingService.insert(comPropertyAlarmSetting));
    }
}