New file |
| | |
| | | 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)); |
| | | } |
| | | } |