New file |
| | |
| | | package com.panzhihua.applets.api; |
| | | |
| | | |
| | | 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.rentHouse.RentingHoursePreOrderVO; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * 房屋租赁-房屋定金订单表(RentingHoursePreOrder)表控制层 |
| | | * |
| | | * @author makejava |
| | | * @since 2021-11-23 10:47:54 |
| | | */ |
| | | @RestController |
| | | @Slf4j |
| | | @Api(tags = {"房屋租赁定金订单相关接口"}) |
| | | @RequestMapping("rentingHoursePreOrder") |
| | | public class RentingHoursePreOrderApi extends BaseController { |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CommunityService communityService; |
| | | |
| | | /** |
| | | * 分页查询所有数据 |
| | | * |
| | | * @param commonPage 查询实体 |
| | | * @return 所有数据 |
| | | */ |
| | | @ApiOperation(value = "分页查询",response = RentingHoursePreOrderVO.class) |
| | | @PostMapping("queryAll") |
| | | public R selectAll(@RequestBody CommonPage commonPage) { |
| | | commonPage.setCommunityId(this.getCommunityId()); |
| | | return communityService.selectAllRentingHoursePreOrder(commonPage); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @ApiOperation(value = "详情",response = RentingHoursePreOrderVO.class) |
| | | @GetMapping("{id}") |
| | | public R selectOne(@PathVariable("id") Long id) { |
| | | return communityService.selectOneRentingHoursePreOrder(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增数据 |
| | | * |
| | | * @param rentingHoursePreOrderVO 实体对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @ApiOperation(value = "创建定金订单") |
| | | @PostMapping |
| | | public R insert(@RequestBody RentingHoursePreOrderVO rentingHoursePreOrderVO) { |
| | | rentingHoursePreOrderVO.setCommunityId(this.getCommunityId()); |
| | | return communityService.insertRentingHoursePreOrder(rentingHoursePreOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改数据 |
| | | * |
| | | * @param rentingHoursePreOrderVO 实体对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @ApiOperation("修改") |
| | | @PostMapping("/update") |
| | | public R update(@RequestBody RentingHoursePreOrderVO rentingHoursePreOrderVO) { |
| | | return communityService.updateRentingHoursePreOrder(rentingHoursePreOrderVO); |
| | | } |
| | | |
| | | /** |
| | | * 删除数据 |
| | | * |
| | | * @param id 主键结合 |
| | | * @return 删除结果 |
| | | */ |
| | | @ApiOperation("删除数据") |
| | | @GetMapping("del") |
| | | public R delete(@RequestParam("id") Long id) { |
| | | return communityService.deleteRentingHoursePreOrder(id); |
| | | } |
| | | } |