New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.property.CommonPage; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.ComPropertyVO; |
| | | import com.panzhihua.common.model.vos.property.ComPropertyHelpVO; |
| | | import com.panzhihua.common.service.property.PropertyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * (ComPropertyHelp)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-09-18 16:43:12 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = {"一件求助人员"}) |
| | | @RestController |
| | | @RequestMapping("/comPropertyHelp") |
| | | public class ComPropertyHelpApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private PropertyService propertyService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询所有数据",response = ComPropertyVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setStatus(1); |
| | | return this.propertyService.comPropertyHelpSelectAll(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "主键查询") |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Serializable id) { |
| | | return this.propertyService.comPropertyHelpSelectOne(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param comPropertyHelp 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "新增数据") |
| | | @PostMapping |
| | | public R insert(@RequestBody ComPropertyHelpVO comPropertyHelp) { |
| | | comPropertyHelp.setCommunityId(this.getCommunityId()); |
| | | comPropertyHelp.setCreateTime(DateUtil.date()); |
| | | return this.propertyService.comPropertyHelpInsert(comPropertyHelp); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param comPropertyHelp 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation(value = "修改数据") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody ComPropertyHelpVO comPropertyHelp) { |
| | | return this.propertyService.comPropertyHelpUpdate(comPropertyHelp); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation(value = "删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return this.propertyService.comPropertyHelpDelete(id); |
| | | } |
| | | } |