| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.HouseResource; |
| | | import com.stylefeng.guns.modular.system.model.HousingDemand; |
| | | import com.stylefeng.guns.modular.system.service.IAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.ICollectionHousingDemandService; |
| | | import com.stylefeng.guns.modular.system.service.IHousingDemandService; |
| | | import com.stylefeng.guns.modular.system.service.IReportHousingDemandService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.AddHouseReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.HousingDemandReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.ReportHousingDemandReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchHousingDemandReq; |
| | |
| | | private IReportHousingDemandService reportHousingDemandService; |
| | | @Autowired |
| | | private ICollectionHousingDemandService collectionHousingDemandService; |
| | | |
| | | @Autowired |
| | | private IAppUserService appUserService; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/housingDemand/addHousingDemand") |
| | | @GetMapping("/base/houseDemand/qrCode/{id}") |
| | | @ApiOperation(value = "海报二维码", tags = {"求房源"}) |
| | | public ResultUtil<String> poster(@PathVariable("id") Integer id){ |
| | | HousingDemand houseResource = housingDemandService.selectById(id); |
| | | return ResultUtil.success(houseResource.getQrCode()); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/housingDemand/addHousingDemand") |
| | | @ApiOperation(value = "添加房源", tags = {"求房源"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil addHousingDemand(HousingDemandReq req){ |
| | | |
| | | public ResultUtil addHousingDemand(@RequestBody HousingDemandReq req){ |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if(null != appUser && (appUser.getStatus() == 2|| appUser.getStatus() == 3)){ |
| | | return ResultUtil.errorLogin("当前账号已被冻结或删除"); |
| | | } |
| | | return housingDemandService.addHousingDemand(req); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/housingDemand/searchHousingDemand") |
| | |
| | | return ResultUtil.success(searchHousingDemandRes); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/housingDemand/housingDemandInfo") |
| | | @PostMapping("/base/housingDemand/housingDemandInfo") |
| | | @ApiOperation(value = "获取求房源详情", tags = {"求房源"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "数据id", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = false, paramType = "header") |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil<HousingDemandInfoRes> housingDemandInfo(Integer id){ |
| | | // AppUser appUser = appUserService.getAppUser(); |
| | | // if(null != appUser && (appUser.getStatus() == 2|| appUser.getStatus() == 3)){ |
| | | // return ResultUtil.errorLogin("当前账号已被冻结或删除"); |
| | | // } |
| | | HousingDemandInfoRes housingDemandInfoRes = housingDemandService.housingDemandInfo(id); |
| | | return ResultUtil.success(housingDemandInfoRes); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/housingDemand/addReportHousingDemand") |
| | | @PostMapping("/base/housingDemand/addReportHousingDemand") |
| | | @ApiOperation(value = "添加举报数据", tags = {"求房源"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil addReportHousingDemand(ReportHousingDemandReq req){ |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if(null != appUser && (appUser.getStatus() == 2|| appUser.getStatus() == 3)){ |
| | | return ResultUtil.errorLogin("当前账号已被冻结或删除"); |
| | | } |
| | | return reportHousingDemandService.addReportHousingDemand(req); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/housingDemand/collectionHousingDemand") |
| | | @PostMapping("/base/housingDemand/collectionHousingDemand") |
| | | @ApiOperation(value = "收藏/取消收藏房源操作", tags = {"求房源"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "房源id", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil collectionHousingDemand(Integer id){ |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if(null != appUser && (appUser.getStatus() == 2|| appUser.getStatus() == 3)){ |
| | | return ResultUtil.errorLogin("当前账号已被冻结或删除"); |
| | | } |
| | | return collectionHousingDemandService.collectionHousingDemand(id); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/housingDemand/getContactInformation") |
| | | @GetMapping("/base/housingDemand/getContactInformation/{id}") |
| | | @ApiOperation(value = "获取联系方式", tags = {"求房源"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "房源id", required = true), |
| | | }) |
| | | public ResultUtil<ContactInformationRes> getContactInformation(Integer id){ |
| | | public ResultUtil<ContactInformationRes> getContactInformation(@PathVariable("id") Integer id){ |
| | | ContactInformationRes contactInformation = housingDemandService.getContactInformation(id); |
| | | return ResultUtil.success(contactInformation); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/housingDemand/getSurplusPushNumber") |
| | | @PostMapping("/base/housingDemand/getSurplusPushNumber") |
| | | @ApiOperation(value = "获取剩余发布数量", tags = {"求房源"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil<Integer> getSurplusPushNumber(){ |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if(null != appUser && (appUser.getStatus() == 2|| appUser.getStatus() == 3)){ |
| | | return ResultUtil.errorLogin("当前账号已被冻结或删除"); |
| | | } |
| | | return housingDemandService.getSurplusPushNumber(); |
| | | } |
| | | } |