package com.panzhihua.service_community.api; import javax.annotation.Resource; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.panzhihua.common.model.dtos.community.rentingHouses.NearbyDTO; import com.panzhihua.common.model.dtos.community.rentingHouses.PageRentingHouseRegisterDTO; import com.panzhihua.common.model.dtos.community.rentingHouses.ReleaseOrCancelHouseDTO; import com.panzhihua.common.model.dtos.community.rentingHouses.RentingHouseRegisterDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.service_community.service.RentingHourseRegisterService; /** * 房屋租售-租赁房屋登记(RentingHourseRegister)表控制层 * * @author makejava * @since 2021-11-23 10:49:08 */ @RestController @RequestMapping("/rentingHourseRegister") public class RentingHourseRegisterApi { /** * 服务对象 */ @Resource private RentingHourseRegisterService rentingHourseRegisterService; /** * 分页获取房源信息 * @param pageRegisterDTO * @return */ @PostMapping("/page") public R pageRentingHouse(@RequestBody PageRentingHouseRegisterDTO pageRegisterDTO) { return rentingHourseRegisterService.pageRentingHouse(pageRegisterDTO); } /** * 新增房源信息 * @param registerDTO * @return */ @PostMapping("/register") public R registerRentingHouse(@RequestBody RentingHouseRegisterDTO registerDTO) { return rentingHourseRegisterService.registerRentingHouse(registerDTO); } /** * 编辑房源信息 * @param registerDTO * @return */ @PostMapping("/update") public R updateRentingHouse(@RequestBody RentingHouseRegisterDTO registerDTO) { return rentingHourseRegisterService.updateRentingHouse(registerDTO); } /** * 发布/取消发布 房源信 * @param releaseOrCancelHouseDTO * @return */ @PutMapping("/releaseOrCancel") public R releaseOrCancelHouse(@RequestBody ReleaseOrCancelHouseDTO releaseOrCancelHouseDTO) { return rentingHourseRegisterService.releaseOrCancelHouse(releaseOrCancelHouseDTO); } /** * 删除房源信息 * @param registerId * @return */ @DeleteMapping("/delete") public R deleteRentingHouse(@RequestParam("registerId") Long registerId) { return rentingHourseRegisterService.deleteRentingHouse(registerId); } /** * 获取详情-房源信息 * @param registerId * @return */ @GetMapping("/get") public R getRentingHouse(@RequestParam("registerId") Long registerId) { return rentingHourseRegisterService.getRentingHouse(registerId); } /** * 附近的房源 */ @PostMapping("/nearby") public R nearby(@RequestBody NearbyDTO nearbyDTO){ return rentingHourseRegisterService.nearby(nearbyDTO); } /** * 小程序分页获取房源信息 * @param pageRegisterDTO * @return */ @PostMapping("/houseList") public R pageRentingHouseApplet(@RequestBody PageRentingHouseRegisterDTO pageRegisterDTO) { return rentingHourseRegisterService.pageRentingHouseApplet(pageRegisterDTO); } @GetMapping("/updateAllHouseUnionAppCode") public void updateAllHouseUnionAppCode(@RequestParam("areaCode") String areaCode) { rentingHourseRegisterService.updateAllHouseUnionAppCode(areaCode); } }