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.RentingHourseOrderVO;
|
import com.panzhihua.common.model.vos.community.rentHouse.WxPayNotifyOrderVO;
|
import com.panzhihua.common.model.vos.community.rentHouse.WxPayOrderVO;
|
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;
|
|
/**
|
* 房屋租赁-房屋订单表(RentingHourseOrder)表控制层
|
*
|
* @author makejava
|
* @since 2021-11-23 10:46:57
|
*/
|
@RestController
|
@Slf4j
|
@Api(tags = {"房屋租赁普通订单相关接口"})
|
@RequestMapping("rentingHourseOrder")
|
public class RentingHourseOrderApi extends BaseController {
|
/**
|
* 服务对象
|
*/
|
@Resource
|
private CommunityService communityService;
|
|
/**
|
* 分页查询所有数据
|
*
|
* @param commonPage 查询实体
|
* @return 所有数据
|
*/
|
@ApiOperation(value = "分页查询所有数据",response = RentingHourseOrderVO.class)
|
@PostMapping("queryAll")
|
public R selectAll(@RequestBody CommonPage commonPage) {
|
commonPage.setCommunityId(this.getCommunityId());
|
return communityService.selectRentingHourseOrderAll(commonPage);
|
}
|
|
/**
|
* 通过主键查询单条数据
|
*
|
* @param id 主键
|
* @return 单条数据
|
*/
|
@ApiOperation(value = "分页查询所有数据")
|
@GetMapping("{id}")
|
public R selectOne(@PathVariable("id") Long id) {
|
return communityService.selectRentingHourseOrderOne(id);
|
}
|
|
/**
|
* 新增数据
|
*
|
* @param rentingHourseOrder 实体对象
|
* @return 新增结果
|
*/
|
@ApiOperation("创建订单")
|
@PostMapping
|
public R insert(@RequestBody RentingHourseOrderVO rentingHourseOrder) {
|
rentingHourseOrder.setCommunityId(this.getCommunityId());
|
return communityService.insertRentingHourseOrder(rentingHourseOrder);
|
}
|
|
/**
|
* 修改数据
|
*
|
* @param rentingHourseOrdervo 实体对象
|
* @return 修改结果
|
*/
|
@PostMapping("/update")
|
public R update(@RequestBody RentingHourseOrderVO rentingHourseOrdervo) {
|
return communityService.updateRentingHourseOrder(rentingHourseOrdervo);
|
}
|
|
/**
|
* 删除数据
|
*
|
* @param id 主键结合
|
* @return 删除结果
|
*/
|
@ApiOperation("删除")
|
@GetMapping("del")
|
public R delete(@RequestParam("id") Long id) {
|
return communityService.deleteRentingHourseOrder(id);
|
}
|
|
/**
|
* 支付回调处理订单状态以及房屋状态
|
*/
|
@ApiOperation("支付回调处理订单状态以及房屋状态")
|
@PostMapping("/wxNotify")
|
public R wxNotify(@RequestBody WxPayNotifyOrderVO wxPayNotifyOrderVO){
|
return communityService.wxNotifyRentingHourseOrder(wxPayNotifyOrderVO);
|
}
|
|
/**
|
* 支付付款
|
*/
|
@ApiOperation("支付付款")
|
@PostMapping("/wxPay")
|
public R wxPay(@RequestBody WxPayOrderVO wxPayOrderVO){
|
return communityService.wxPayRentingHourseOrder(wxPayOrderVO);
|
}
|
}
|