| | |
| | | ByteSource credentialsSalt = new Md5Hash(salt); |
| | | SimpleAuthenticationInfo simpleAuthenticationInfo = new SimpleAuthenticationInfo( |
| | | new ShiroUser(), credentials, credentialsSalt, ""); |
| | | |
| | | //校验用户账号密码 |
| | | HashedCredentialsMatcher md5CredentialsMatcher = new HashedCredentialsMatcher(); |
| | | md5CredentialsMatcher.setHashAlgorithmName(ShiroKit.hashAlgorithmName); |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.FeedBack; |
| | | import com.stylefeng.guns.modular.system.model.HouseResource; |
| | | import com.stylefeng.guns.modular.system.service.IAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.IFeedBackService; |
| | | import com.stylefeng.guns.modular.system.service.IHouseResourceService; |
| | | import com.stylefeng.guns.modular.system.service.impl.FeedBackServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.RegisterAccountReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.*; |
| | | import com.stylefeng.guns.modular.system.warpper.res.AppletLoginRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.CollectRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryRes; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @Autowired |
| | | private IAppUserService appUserService; |
| | | |
| | | @Autowired |
| | | private IFeedBackService feedBackService; |
| | | @Autowired |
| | | private IHouseResourceService houseResourceService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "jscode", value = "微信jscode", required = true) |
| | | }) |
| | | public ResultUtil<AppletLoginRes> appletLogin(String jscode){ |
| | | return appUserService.appletLogin(jscode); |
| | | public ResultUtil<AppletLoginRes> appletLogin(String jscode,String encryptedPhoneData,String phoneIv){ |
| | | RegisterAccountReq req = new RegisterAccountReq(); |
| | | req.setJscode(jscode); |
| | | req.setEncryptedPhoneData(encryptedPhoneData); |
| | | req.setPhone_iv(phoneIv); |
| | | return appUserService.appletLogin(req); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/registerAccount") |
| | | @ApiOperation(value = "小程序注册账户", tags = {"登录注册"}) |
| | | public ResultUtil<AppletLoginRes> registerAccount(RegisterAccountReq req){ |
| | | public ResultUtil<AppletLoginRes> registerAccount(@RequestBody RegisterAccountReq req){ |
| | | return appUserService.registerAccount(req); |
| | | } |
| | | |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/userInfo") |
| | | @ApiOperation(value = "个人中心", tags = {"个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil<AppUser> userInfo(){ |
| | | return appUserService.userInfo(); |
| | | } |
| | | |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/release") |
| | | @ApiOperation(value = "发布", tags = {"个人中心"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil<CollectRes> release(){ |
| | | return appUserService.collect(); |
| | | } |
| | | |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/collect") |
| | | @ApiOperation(value = "收藏", tags = {"个人中心"}) |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | public ResultUtil<CollectRes> collect(@RequestBody UserInfoQuery query){ |
| | | return appUserService.release(query); |
| | | } |
| | | |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @GetMapping("/base/appUser/edit/{id}") |
| | | @ApiOperation(value = "编辑发布的房源", tags = {"个人中心"}) |
| | | public ResultUtil<HouseResource> edit(@PathVariable("id") Integer id){ |
| | | |
| | | return ResultUtil.success(houseResourceService.selectById(id)); |
| | | } |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/auth/{id}") |
| | | @ApiOperation(value = "中介认证", tags = {"个人中心"}) |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", |
| | | required = true, paramType = "header") |
| | | public ResultUtil auth(@RequestBody AppUser appUser){ |
| | | AppUser appUser1 = appUserService.getAppUser(); |
| | | appUser1.setAgentLicenceCode(appUser.getAgentLicenceCode()); |
| | | appUser1.setCompanyName(appUser.getCompanyName()); |
| | | appUser1.setCompanyAddress(appUser.getCompanyAddress()); |
| | | appUser1.setBusinessCardPhoto(appUser.getBusinessCardPhoto()); |
| | | appUser1.setCityId(appUser.getCityId()); |
| | | appUser1.setDistrictId(appUser.getDistrictId()); |
| | | appUser1.setAuditStatus(1); |
| | | appUserService.updateById(appUser1); |
| | | return ResultUtil.success(); |
| | | } |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @GetMapping("/base/appUser/editSubmit") |
| | | @ApiOperation(value = "编辑提交", tags = {"个人中心"}) |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", |
| | | required = true, paramType = "header") |
| | | public ResultUtil editSubmit(@RequestBody AddHouseReq req){ |
| | | HouseResource houseResource = new HouseResource(); |
| | | BeanUtils.copyProperties(req,houseResource); |
| | | houseResource.setInsertTime(new Date()); |
| | | houseResource.setAuthStatus(1); |
| | | houseResource.setIsDelete(0); |
| | | houseResource.setUpdateUserId(appUserService.getAppUser().getId()); |
| | | houseResource.setUpdateTime(new Date()); |
| | | houseResource.setStatus(0); |
| | | houseResource.setLeaseTime(req.getTime()); |
| | | houseResource.setFirmHouse(req.getFirmHouse()); |
| | | if (req.getTime().contains("年")){ |
| | | houseResource.setRentalDuration(2); |
| | | }else{ |
| | | houseResource.setRentalDuration(1); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @GetMapping("/base/appUser/operate") |
| | | @ApiOperation(value = "发布-删除/下架/顶上去", tags = {"个人中心"}) |
| | | public ResultUtil delete(@RequestBody UserInfoDTO dto){ |
| | | switch (dto.getType()){ |
| | | case 1: |
| | | HouseResource houseResource = houseResourceService.selectById(dto.getId()); |
| | | houseResource.setIsDelete(1); |
| | | houseResourceService.updateById(houseResource); |
| | | break; |
| | | case 2: |
| | | HouseResource houseResource1 = houseResourceService.selectById(dto.getId()); |
| | | houseResource1.setStatus(0); |
| | | houseResourceService.updateById(houseResource1); |
| | | break; |
| | | case 3: |
| | | HouseResource houseResource2 = houseResourceService.selectById(dto.getId()); |
| | | houseResource2.setInsertTime(new Date()); |
| | | houseResourceService.updateById(houseResource2); |
| | | break; |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/feedback") |
| | | @ApiOperation(value = "意见反馈", tags = {"个人中心"}) |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", |
| | | required = true, paramType = "header") |
| | | public ResultUtil feedback(@RequestBody FeedBack feedBack){ |
| | | feedBack.setAppUserId(appUserService.getAppUser().getId()); |
| | | feedBack.setInsertTime(new Date()); |
| | | feedBackService.insert(feedBack); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/appUser/update") |
| | | @ApiOperation(value = "个人资料修改", tags = {"个人中心"}) |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", |
| | | required = true, paramType = "header") |
| | | public ResultUtil update(@RequestBody UpdateAppUser user){ |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if (StringUtils.hasLength(user.getProfilePhoto())){ |
| | | appUser.setProfilePhoto(user.getProfilePhoto()); |
| | | } |
| | | if (StringUtils.hasLength(user.getNickname())){ |
| | | appUser.setNickname(user.getNickname()); |
| | | } |
| | | appUserService.updateById(appUser); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | } |
| | |
| | | @GetMapping("/base/banner/getBanners") |
| | | @ApiOperation(value = "获取各种banner", tags = {"首页"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "position", value = "位置(1=首页,2=详情)", required = true) |
| | | @ApiImplicitParam(name = "position", value = "位置(1=首页,2=租房,3=买房,4=公司盘,5=求房源)", required = true) |
| | | }) |
| | | public ResultUtil<List<BannerRes>> getBanners(Integer position){ |
| | | List<BannerRes> banners = bannerService.getBanners(position); |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.EncyclopedicKnowledge; |
| | | import com.stylefeng.guns.modular.system.model.SysDataType; |
| | | import com.stylefeng.guns.modular.system.service.IAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.IEncyclopedicKnowledgeService; |
| | | import com.stylefeng.guns.modular.system.service.ISysDataTypeService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.res.EncyclopedicKnowledgeInfoRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.EncyclopedicKnowledgeRes; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchHouseResourceReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchIntermediaryReq; |
| | | import com.stylefeng.guns.modular.system.warpper.res.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | public ResultUtil upvoteEncyclopedicKnowledge(Integer id){ |
| | | return encyclopedicKnowledgeService.upvoteEncyclopedicKnowledge(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.HouseType; |
| | | import com.stylefeng.guns.modular.system.service.ICollectionHouseResourceService; |
| | | import com.stylefeng.guns.modular.system.service.IHouseResourceService; |
| | | import com.stylefeng.guns.modular.system.service.IHouseTypeService; |
| | | import com.stylefeng.guns.modular.system.service.IReportHouseResourceService; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.ReportHouseResourceReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchHouseResourceReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.*; |
| | | import com.stylefeng.guns.modular.system.warpper.res.*; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | private ICollectionHouseResourceService collectionHouseResourceService; |
| | | @Autowired |
| | | private IReportHouseResourceService reportHouseResourceService; |
| | | @Autowired |
| | | private IAppUserService appUserService; |
| | | |
| | | |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/addHouse/confirm") |
| | | @ApiOperation(value = "中介身份提示", tags = {"发布"}) |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", |
| | | required = true, paramType = "header") |
| | | public ResultUtil confirm(@RequestBody Integer userType){ |
| | | return houseResourceService.confirm(userType); |
| | | } |
| | | // todo 放行 |
| | | @ResponseBody |
| | | @PostMapping("/base/addHouse/add") |
| | | @ApiOperation(value = "发布房源", tags = {"发布"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil addHouse(@RequestBody AddHouseReq req){ |
| | | return houseResourceService.addHouse(req); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/houseResource/searchHouseResource") |
| | |
| | | return ResultUtil.success(searchHouseResource); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/houseType/getHouseType") |
| | | @ApiOperation(value = "获取房源类型", tags = {"首页"}) |
| | |
| | | List<HouseType> houseTypes = houseTypeService.selectList(null); |
| | | return ResultUtil.success(houseTypes); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/houseResource/getDistrictHouseResourceNumber") |
| | |
| | | @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 = false, paramType = "header") |
| | | }) |
| | | public ResultUtil<HouseResourceInfoRes> getHouseResourceInfo(Integer id){ |
| | | HouseResourceInfoRes houseResourceInfo = houseResourceService.getHouseResourceInfo(id); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/api/houseResource/addReportHouseResource") |
| | | @ApiOperation(value = "添加房源举报", tags = {"详情"}) |
| | | public ResultUtil addReportHouseResource(ReportHouseResourceReq req){ |
| | | public ResultUtil addReportHouseResource(@RequestBody ReportHouseResourceReq req){ |
| | | return reportHouseResourceService.addReportHouseResource(req); |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/intermediary/list") |
| | | @ApiOperation(value = "找中介", tags = {"服务"}) |
| | | public ResultUtil<SearchIntermediaryRes> searchIntermediaryList(@RequestBody SearchIntermediaryReq req){ |
| | | SearchIntermediaryRes res= appUserService.searchIntermediaryList(req); |
| | | return ResultUtil.success(res); |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/intermediary/listHouse") |
| | | @ApiOperation(value = "个人详情-我的房源", tags = {"服务"}) |
| | | @ApiImplicitParams({ |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil<SearchHouseResourceRes> listHouse(@RequestBody HouseQuery query){ |
| | | SearchHouseResourceRes res= houseResourceService.listHouse(query); |
| | | return ResultUtil.success(res); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil addHousingDemand(HousingDemandReq req){ |
| | | public ResultUtil addHousingDemand(@RequestBody HousingDemandReq req){ |
| | | return housingDemandService.addHousingDemand(req); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @GetMapping("/base/housingDemand/searchHousingDemand") |
| | | @ApiOperation(value = "求房源列表", tags = {"求房源"}) |
| | | public ResultUtil<SearchHousingDemandRes> searchHousingDemand(SearchHousingDemandReq req){ |
| | | public ResultUtil<SearchHousingDemandRes> searchHousingDemand(@RequestBody SearchHousingDemandReq req){ |
| | | SearchHousingDemandRes searchHousingDemandRes = housingDemandService.searchHousingDemand(req); |
| | | return ResultUtil.success(searchHousingDemandRes); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "id", value = "数据id", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = false, paramType = "header") |
| | | }) |
| | | public ResultUtil<HousingDemandInfoRes> housingDemandInfo(Integer id){ |
| | | public ResultUtil<HousingDemandInfoRes> housingDemandInfo(@RequestBody Integer id){ |
| | | HousingDemandInfoRes housingDemandInfoRes = housingDemandService.housingDemandInfo(id); |
| | | return ResultUtil.success(housingDemandInfoRes); |
| | | } |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil addReportHousingDemand(ReportHousingDemandReq req){ |
| | | public ResultUtil addReportHousingDemand(@RequestBody ReportHousingDemandReq req){ |
| | | return reportHousingDemandService.addReportHousingDemand(req); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "id", value = "房源id", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = true, paramType = "header") |
| | | }) |
| | | public ResultUtil collectionHousingDemand(Integer id){ |
| | | public ResultUtil collectionHousingDemand(@RequestBody Integer id){ |
| | | return collectionHousingDemandService.collectionHousingDemand(id); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "房源id", required = true), |
| | | }) |
| | | public ResultUtil<ContactInformationRes> getContactInformation(Integer id){ |
| | | public ResultUtil<ContactInformationRes> getContactInformation(@RequestBody Integer id){ |
| | | ContactInformationRes contactInformation = housingDemandService.getContactInformation(id); |
| | | return ResultUtil.success(contactInformation); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchIntermediaryReq; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryRes; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface AppUserMapper extends BaseMapper<AppUser> { |
| | | |
| | | |
| | | |
| | | |
| | | List<SearchIntermediaryListRes> searchIntermediaryList(@Param("req") SearchIntermediaryReq req, |
| | | @Param("districtIds") List<Integer> districtIds, |
| | | @Param("cityIds")List<Integer> cityIds); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.FeedBack; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchIntermediaryReq; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface FeedBackMapper extends BaseMapper<FeedBack> { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.HouseResource; |
| | | import com.stylefeng.guns.modular.system.warpper.req.HouseQuery; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchHouseResourceReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.UserInfoQuery; |
| | | import com.stylefeng.guns.modular.system.warpper.res.CollectListRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.DistrictHouseResourceNumberRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchHouseResourceListRes; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | */ |
| | | List<DistrictHouseResourceNumberRes> getDistrictHouseResourceNumber(@Param("userType") Integer userType, @Param("dataType") Integer dataType); |
| | | |
| | | List<SearchHouseResourceListRes> listHouse(@Param("query") HouseQuery query); |
| | | |
| | | List<CollectListRes> collect(@Param("ids") List<Integer> ids); |
| | | |
| | | List<CollectListRes> release(@Param("query") UserInfoQuery query,@Param("ids")List<Integer> collect); |
| | | |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.AppUserMapper"> |
| | | |
| | | |
| | | |
| | | <select id="searchIntermediaryList" |
| | | resultType="com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes"> |
| | | select t1.id,t1.profile_photo as profilePhoto,t1.nickname as nickname,t1.company_name as companyName, |
| | | t1.company_address as companyAddress,t1.introduce as introduce,t1.phone as phone, |
| | | COUNT(t2.id) AS houseCount |
| | | from t_app_user t1 |
| | | left join t_house_resource t2 on t1.id = t2.insert_user_id |
| | | <where> |
| | | <if test="null != req.name and '' != req.name"> |
| | | and t1.nickname = CONCAT('%', #{req.name}, '%') |
| | | </if> |
| | | <if test="null != cityIds"> |
| | | and t1.city_id in |
| | | <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != districtIds"> |
| | | and t1.district_id in |
| | | <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | and t1.audit_status = 2 |
| | | and t1.status = 1 |
| | | and t1.user_type = 3 |
| | | and t2.auth_status = 2 |
| | | and t2.is_delete = 0 |
| | | and t2.status = 1 |
| | | and t2.type=2 |
| | | </where> |
| | | group by t1.id |
| | | order by houseCount desc |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.FeedBackMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | left join t_region rc on (hr.district_id = rc.id) |
| | | left join t_region rp on (rp.id = rc.parent_id) |
| | | where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2 |
| | | and hr.type=2 |
| | | <if test="null != req.type"> |
| | | and hr.data_type = #{req.type} |
| | | </if> |
| | |
| | | <if test="null != req.content and '' != req.content"> |
| | | and hr.title = CONCAT('%', #{req.content}, '%') |
| | | </if> |
| | | <if test="null != cityIds"> |
| | | <if test="null != cityIds and cityIds.size()>0" > |
| | | and hr.city_id in |
| | | <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != districtIds"> |
| | | <if test="null != districtIds and districtIds.size()>0"> |
| | | and hr.district_id in |
| | | <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | |
| | | from t_house_resource hr |
| | | left join t_app_user au on (hr.app_user_id = au.id) |
| | | where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2 |
| | | and hr.type=2 |
| | | <if test="null != req.type"> |
| | | and hr.data_type = #{req.type} |
| | | </if> |
| | |
| | | <if test="null != req.content and '' != req.content"> |
| | | and hr.title = CONCAT('%', #{req.content}, '%') |
| | | </if> |
| | | <if test="null != cityIds"> |
| | | <if test="null != cityIds and cityIds.size()>0" > |
| | | and hr.city_id in |
| | | <foreach collection="cityIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="null != districtIds"> |
| | | <if test="null != districtIds and districtIds.size()>0"> |
| | | and hr.district_id in |
| | | <foreach collection="districtIds" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | |
| | | from t_house_resource hr |
| | | left join t_app_user au on (hr.app_user_id = au.id) |
| | | where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2 |
| | | and hr.type=2 |
| | | <if test="null != userType and 4 != userType"> |
| | | and au.user_type = #{userType} and au.status = 1 and au.audit_status = 2 |
| | | </if> |
| | |
| | | left join t_region r on (dn.district_id = r.id) |
| | | left join t_region pr on (pr.id = r.parent_id) |
| | | </select> |
| | | <select id="listHouse" |
| | | resultType="com.stylefeng.guns.modular.system.warpper.res.SearchHouseResourceListRes"> |
| | | select |
| | | hr.id, |
| | | hr.house_photo as imgUrl, |
| | | hr.title, |
| | | hr.house_area as houseArea, |
| | | hr.house_model as houseModel, |
| | | concat(rp.`name`, rc.`name`) as address, |
| | | hr.longitude, |
| | | hr.latitude, |
| | | hr.sale_amount as saleAmount, |
| | | hr.elevator, |
| | | hr.drying_area as dryingArea, |
| | | hr.garden, |
| | | hr.carport, |
| | | hr.balcony, |
| | | hr.keep_pet as keepPet |
| | | from t_house_resource hr |
| | | left join t_region rc on (hr.district_id = rc.id) |
| | | left join t_region rp on (rp.id = rc.parent_id) |
| | | where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2 |
| | | and hr.type=2 |
| | | and hr.app_user_id = #{query.id} |
| | | and hr.data_type = #{query.type} |
| | | </select> |
| | | <select id="collect" resultType="com.stylefeng.guns.modular.system.warpper.res.CollectListRes"> |
| | | select |
| | | hr.id, |
| | | hr.title, |
| | | hr.sale_amount as saleAmount, |
| | | hr.elevator, |
| | | hr.drying_area as dryingArea, |
| | | hr.garden, |
| | | hr.carport, |
| | | hr.balcony, |
| | | hr.city_id as cityId, |
| | | hr.district_id as districtId, |
| | | hr.keep_pet as keepPet, |
| | | hr.views_number as viewsNumber, |
| | | hr.code as code, |
| | | hr.leaseTime as leaseTime, |
| | | hr.data_type as dataType, |
| | | hr.insert_time as insertTime,hr.type as `type`, |
| | | hr.status as status |
| | | from t_house_resource hr |
| | | left join t_collection_house_resource t1 on hr.id = t1.house_resource_id |
| | | where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2 |
| | | <if test="null != ids and ids.size()>0"> |
| | | and hr.id in |
| | | <foreach collection="ids" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | <select id="release" resultType="com.stylefeng.guns.modular.system.warpper.res.CollectListRes"> |
| | | select |
| | | hr.id, |
| | | hr.title, |
| | | hr.sale_amount as saleAmount, |
| | | hr.elevator, |
| | | hr.drying_area as dryingArea, |
| | | hr.garden, |
| | | hr.carport, |
| | | hr.balcony, |
| | | hr.app_user_id as appUserId, |
| | | hr.city_id as cityId, |
| | | hr.district_id as districtId, |
| | | hr.keep_pet as keepPet, |
| | | hr.views_number as viewsNumber, |
| | | hr.code as code, |
| | | hr.leaseTime as leaseTime, |
| | | hr.data_type as dataType, |
| | | hr.house_photo as housePhoto, |
| | | hr.house_video as houseVideo, |
| | | hr.insert_time as insertTime,hr.type as `type`, |
| | | hr.status as status, |
| | | au.profile_photo as profilePhoto, |
| | | au.nickname as nickname, |
| | | au.user_type as userType |
| | | from t_house_resource hr |
| | | left join t_collection_house_resource t1 on hr.id = t1.house_resource_id |
| | | left join t_app_user au on hr.app_user_id = au.id |
| | | where hr.is_delete = 0 and hr.`status` = 1 and hr.auth_status = 2 |
| | | <if test="null != ids and ids.size()>0"> |
| | | and hr.id in |
| | | <foreach collection="ids" item="item" index="index" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <select id="searchHousingDemand" resultType="com.stylefeng.guns.modular.system.warpper.res.SearchHousingDemandListRes"> |
| | | select |
| | | hd.id, |
| | | hd.app_user_id as appuserId, |
| | | hd.title, |
| | | hd.house_model as houseModel, |
| | | hd.sale_amount as saleAmount, |
| | |
| | | hd.garden, |
| | | hd.carport, |
| | | hd.balcony, |
| | | hd.type, |
| | | hd.keep_pet as keepPet |
| | | from t_housing_demand hd |
| | | left join t_app_user au on (hd.app_user_id = au.id) |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @Date 2021/12/1 12:03 |
| | | */ |
| | | @Data |
| | | @TableName("db_user") |
| | | @TableName("t_app_user") |
| | | public class AppUser { |
| | | /** |
| | | * 主键 |
| | |
| | | * 注册时间 |
| | | */ |
| | | @TableField("insert_time") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date insertTime; |
| | | /** |
| | | * 中介的个人简介 |
| | | */ |
| | | @TableField("introduce") |
| | | private String introduce; |
| | | /** |
| | | * 中介所在公司所在的市 |
| | | */ |
| | | @TableField("city_id") |
| | | private Integer cityId; |
| | | /** |
| | | * 中介所在公司所在的区 |
| | | */ |
| | | @TableField("district_id") |
| | | private Integer districtId; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 管理员表 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2017-07-11 |
| | | */ |
| | | @TableName("t_feedback") |
| | | @Data |
| | | public class FeedBack extends Model<FeedBack> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value="id", type= IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("app_user_id") |
| | | private Integer appUserId; |
| | | /** |
| | | * 反馈内容 |
| | | */ |
| | | @TableField("content") |
| | | private String content; |
| | | /** |
| | | * 反馈内容 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return null; |
| | | } |
| | | } |
| | |
| | | * 区id |
| | | */ |
| | | @TableField("district_id") |
| | | private String districtId; |
| | | private Integer districtId; |
| | | /** |
| | | * 房屋地址 |
| | | */ |
| | |
| | | */ |
| | | @TableField("update_user_id") |
| | | private Integer updateUserId; |
| | | |
| | | /** |
| | | * 起租时间 |
| | | */ |
| | | @TableField("startTime") |
| | | private String startTime; |
| | | /** |
| | | * 性别要求 1男2女3不限 |
| | | */ |
| | | @TableField("sex") |
| | | private Integer sex; |
| | | /** |
| | | * 租期 |
| | | */ |
| | | @TableField("leaseTime") |
| | | private String leaseTime; |
| | | /** |
| | | * 类型 1为收藏 2为草稿 |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | } |
| | |
| | | */ |
| | | @TableField("update_user_id") |
| | | private Integer updateUserId; |
| | | /** |
| | | * 性别要求1男2女3不限 |
| | | */ |
| | | @TableField("sex") |
| | | private Integer sex; |
| | | /** |
| | | * 1草稿2发布 |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 起租日期 |
| | | */ |
| | | @TableField("startTime") |
| | | private String startTime; |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.RegisterAccountReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchHouseResourceReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchIntermediaryReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.UserInfoQuery; |
| | | import com.stylefeng.guns.modular.system.warpper.res.AppletLoginRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.CollectRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryRes; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | /** |
| | | * 小程序登录 |
| | | * @param jscode |
| | | * |
| | | * @return |
| | | */ |
| | | ResultUtil<AppletLoginRes> appletLogin(String jscode); |
| | | ResultUtil<AppletLoginRes> appletLogin(RegisterAccountReq req); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | ResultUtil<AppletLoginRes> registerAccount(RegisterAccountReq req); |
| | | |
| | | |
| | | SearchIntermediaryRes searchIntermediaryList(SearchIntermediaryReq req); |
| | | |
| | | ResultUtil<AppUser> userInfo(); |
| | | |
| | | |
| | | ResultUtil<CollectRes> collect(); |
| | | |
| | | ResultUtil<CollectRes> release(UserInfoQuery query); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.FeedBack; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.RegisterAccountReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchIntermediaryReq; |
| | | import com.stylefeng.guns.modular.system.warpper.res.AppletLoginRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryRes; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/7 11:07 |
| | | */ |
| | | public interface IFeedBackService extends IService<FeedBack> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.HouseResource; |
| | | 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.HouseQuery; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchHouseResourceReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.UserInfoQuery; |
| | | import com.stylefeng.guns.modular.system.warpper.res.*; |
| | | |
| | | import java.util.List; |
| | |
| | | ContactInformationRes getContactInformation(Integer id); |
| | | |
| | | |
| | | SearchHouseResourceRes listHouse(HouseQuery query); |
| | | |
| | | ResultUtil addHouse(AddHouseReq req); |
| | | |
| | | ResultUtil confirm(Integer userType); |
| | | |
| | | List<CollectListRes> collect(List<Integer> ids); |
| | | |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.JwtTokenUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.AppUserMapper; |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.CollectionHouseResource; |
| | | import com.stylefeng.guns.modular.system.model.HouseResource; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.service.IAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.ICollectionHouseResourceService; |
| | | import com.stylefeng.guns.modular.system.service.IHousingDemandService; |
| | | import com.stylefeng.guns.modular.system.service.IRegionService; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.util.weChat.WXCore; |
| | | import com.stylefeng.guns.modular.system.util.weChat.WeChatUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.RegisterAccountReq; |
| | | import com.stylefeng.guns.modular.system.warpper.res.AppletLoginRes; |
| | | import com.stylefeng.guns.modular.system.warpper.req.*; |
| | | import com.stylefeng.guns.modular.system.warpper.res.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | import sun.rmi.runtime.Log; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | private WeChatUtil weChatUtil; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | @Autowired |
| | | private IAppUserService appUserService; |
| | | @Autowired |
| | | private HouseResourceService houseResourceService; |
| | | @Autowired |
| | | private CollectionHouseResourceServiceImpl collectionHouseResourceService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); |
| | | HttpServletRequest request = servletRequestAttributes.getRequest(); |
| | | String authorization = request.getHeader("Authorization"); |
| | | if(ToolUtil.isNotEmpty(authorization) && authorization.contains("Bearer")){ |
| | | // todo 这里注释了一段代码 |
| | | // && authorization.contains("Bearer") |
| | | if(ToolUtil.isNotEmpty(authorization) && authorization.contains("Bearer") ){ |
| | | String token = authorization.substring(7); |
| | | //通过token获取用户id |
| | | Integer appUserId = getAppUserIdFromToken(token); |
| | |
| | | |
| | | /** |
| | | * 小程序登录 |
| | | * @param jscode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil<AppletLoginRes> appletLogin(String jscode) { |
| | | public ResultUtil<AppletLoginRes> appletLogin(RegisterAccountReq req) { |
| | | try { |
| | | //调用微信获取用户小程序openid |
| | | Map<String, Object> map = weChatUtil.code2Session(jscode); |
| | | Map<String, Object> map = weChatUtil.code2Session(req.getJscode()); |
| | | if(null == map){ |
| | | return ResultUtil.error("获取微信身份信息失败"); |
| | | } |
| | |
| | | if(null != appUser){ |
| | | String token = JwtTokenUtil.generateToken(appUser.getPhone()); |
| | | appletLoginRes.setToken(token); |
| | | appletLoginRes.setUserType(appUser.getUserType()); |
| | | }else{ |
| | | System.err.println("新增"); |
| | | String sessionKey = map.get("sessionKey").toString(); |
| | | //解密手机号 |
| | | String phone = WXCore.decrypt(req.getEncryptedPhoneData(), sessionKey, req.getPhone_iv()); |
| | | appUser = this.selectOne(new EntityWrapper<AppUser>() |
| | | .eq("phone", phone) |
| | | .eq("audit_status", 2) |
| | | .eq("status", 1)); |
| | | if(null == appUser){ |
| | | JSONObject jsonObject = JSONObject.parseObject(phone); |
| | | String phone1 = jsonObject.getString("phoneNumber"); |
| | | System.err.println("看看json"); |
| | | System.err.println(jsonObject); |
| | | System.err.println(phone1); |
| | | //注册新账号 |
| | | addNewAppUser(openid, phone1); |
| | | }else{ |
| | | appUser.setWechatOpenid(openid); |
| | | this.updateById(appUser); |
| | | } |
| | | } |
| | | AppUser appUser1 = this.selectOne(new EntityWrapper<AppUser>() |
| | | .eq("wechat_openid", openid) |
| | | .eq("audit_status", 2) |
| | | .eq("status", 1)); |
| | | //生成token |
| | | String token = JwtTokenUtil.generateToken(appUser1.getPhone()); |
| | | appletLoginRes.setToken(token); |
| | | appletLoginRes.setUserType(appUser1.getUserType()); |
| | | System.err.println("看看TOKEN:"+token); |
| | | //存入缓存中 |
| | | addTokenToRedis(token, appUser1.getId()); |
| | | return ResultUtil.success(appletLoginRes); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | if(null == map){ |
| | | return ResultUtil.error("获取微信身份信息失败"); |
| | | } |
| | | System.err.println("看看返回结果map"); |
| | | System.err.println(map); |
| | | String openid = map.get("openid").toString(); |
| | | AppUser appUser = this.selectOne(new EntityWrapper<AppUser>() |
| | | .eq("wechat_openid", openid) |
| | |
| | | .eq("audit_status", 2) |
| | | .eq("status", 1)); |
| | | if(null == appUser){ |
| | | JSONObject jsonObject = JSONObject.parseObject(phone); |
| | | String phone1 = jsonObject.getString("phoneNumber"); |
| | | System.err.println("看看json"); |
| | | System.err.println(jsonObject); |
| | | System.err.println(phone1); |
| | | //注册新账号 |
| | | addNewAppUser(openid, phone); |
| | | addNewAppUser(openid, phone1); |
| | | }else{ |
| | | appUser.setWechatOpenid(openid); |
| | | this.updateById(appUser); |
| | | } |
| | | } |
| | | AppUser appUser1 = this.selectOne(new EntityWrapper<AppUser>() |
| | | .eq("wechat_openid", openid) |
| | | .eq("audit_status", 2) |
| | | .eq("status", 1)); |
| | | //生成token |
| | | String token = JwtTokenUtil.generateToken(appUser.getPhone()); |
| | | String token = JwtTokenUtil.generateToken(appUser1.getPhone()); |
| | | appletLoginRes.setToken(token); |
| | | appletLoginRes.setUserType(appUser1.getUserType()); |
| | | //存入缓存中 |
| | | addTokenToRedis(token, appUser.getId()); |
| | | addTokenToRedis(token, appUser1.getId()); |
| | | return ResultUtil.success(appletLoginRes); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public SearchIntermediaryRes searchIntermediaryList(SearchIntermediaryReq req) { |
| | | req.setPageNum((req.getPageNum() - 1) * req.getPageSize()); |
| | | //区域 |
| | | List<Integer> districtIds = new ArrayList<>(); |
| | | List<Integer> cityIds = new ArrayList<>(); |
| | | if (req.getDistrict() != null &&(!req.getDistrict().equals("")) ){ |
| | | // 一级id |
| | | Integer integer = Integer.valueOf(req.getDistrict()); |
| | | districtIds.add(integer); |
| | | if (req.getArea()!=null && (!req.getArea().equals(""))){ |
| | | String[] split = req.getArea().split(","); |
| | | for (String s : split) { |
| | | cityIds.add(Integer.valueOf(s)); |
| | | } |
| | | } |
| | | } |
| | | SearchIntermediaryRes searchIntermediaryRes = new SearchIntermediaryRes(); |
| | | List<SearchIntermediaryListRes> res =this.baseMapper.searchIntermediaryList(req,districtIds,cityIds); |
| | | searchIntermediaryRes.setList(res); |
| | | searchIntermediaryRes.setTotal(res.size()); |
| | | return searchIntermediaryRes; |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil<AppUser> userInfo() { |
| | | // 获取当前登录用户 |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | return ResultUtil.success(appUser); |
| | | |
| | | } |
| | | @Autowired |
| | | private IHousingDemandService housingDemandService; |
| | | @Override |
| | | public ResultUtil<CollectRes> collect() { |
| | | // 查询发布的求房源信息 |
| | | SearchHousingDemandReq req = new SearchHousingDemandReq(); |
| | | SearchHousingDemandRes searchHousingDemandRes = housingDemandService.searchHousingDemand(req); |
| | | List<SearchHousingDemandListRes> list1 = searchHousingDemandRes.getList(); |
| | | List<SearchHousingDemandListRes> collect1 = list1.stream().filter(t -> t.getAppuserId() == appUserService.getAppUser().getId()). |
| | | collect(Collectors.toList()); |
| | | // 拿到收藏的房源ids |
| | | List<Integer> ids = new ArrayList<>(); |
| | | CollectRes searchIntermediaryRes = new CollectRes(); |
| | | searchIntermediaryRes.setList1(collect1); |
| | | List<CollectListRes> list = houseResourceService.collect(ids); |
| | | long count1 = collect1.stream().filter(t -> t.getType() == 1).count(); |
| | | long count = list.stream().filter(t -> t.getType() == 1).count(); |
| | | // 草稿数量 |
| | | searchIntermediaryRes.setDraft(Integer.parseInt(String.valueOf(count))+Integer.parseInt(String.valueOf(count1))); |
| | | // 上架房源数 |
| | | int size = list.stream().filter(t -> t.getStatus() == 1 && t.getType()==2).collect(Collectors.toList()).size(); |
| | | searchIntermediaryRes.setOn(size); |
| | | // 下架房源数 |
| | | int size1 = list.stream().filter(t -> t.getStatus() == 0 && t.getType()==2).collect(Collectors.toList()).size(); |
| | | searchIntermediaryRes.setOff(size1); |
| | | for (CollectListRes collectListRes : list) { |
| | | // 查询这个房源的收藏 |
| | | int collect = collectionHouseResourceService.selectList(new EntityWrapper<CollectionHouseResource>() |
| | | .eq("house_resource_id", collectListRes.getId())).size(); |
| | | collectListRes.setCollect(collect); |
| | | // 根据区id 查询下级 |
| | | Region city = regionService.selectById(collectListRes.getCityId()); |
| | | Region dis = regionService.selectById(collectListRes.getDistrictId()); |
| | | Region region = regionService.selectOne(new EntityWrapper<Region>().eq("parent_id",dis.getId())); |
| | | StringBuilder stringBuilder = new StringBuilder(""); |
| | | stringBuilder.append(dis.getName()); |
| | | if (region!=null){ |
| | | stringBuilder.append("/"+region.getName()); |
| | | Region region1 = regionService.selectOne(new EntityWrapper<Region>().eq("parent_id",region.getId())); |
| | | if (region!=null){ |
| | | stringBuilder.append(region1.getName()); |
| | | Region region2 = regionService.selectOne(new EntityWrapper<Region>().eq("parent_id",region1.getId())); |
| | | if (region2!=null){ |
| | | stringBuilder.append("/"+region2.getName()); |
| | | } |
| | | } |
| | | } |
| | | collectListRes.setAddress(city.getName()+">"+stringBuilder.toString()); |
| | | } |
| | | searchIntermediaryRes.setList(list); |
| | | searchIntermediaryRes.setTotal(list.size()); |
| | | return ResultUtil.success(searchIntermediaryRes); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil<CollectRes> release(UserInfoQuery query) { |
| | | query.setPageNum((query.getPageNum() - 1) * query.getPageSize()); |
| | | // 房源ids |
| | | List<Integer> ids = collectionHouseResourceService.selectList(new EntityWrapper<CollectionHouseResource>() |
| | | .eq("app_user_id", appUserService.getAppUser().getId())) |
| | | .stream().map(CollectionHouseResource::getHouseResourceId).collect(Collectors.toList()); |
| | | List<Integer> collect = houseResourceService.selectList(new EntityWrapper<HouseResource>() |
| | | .eq("is_delete", 0) |
| | | .eq("status", 1) |
| | | .eq("auth_status", 2) |
| | | .in("id", ids)).stream().map(HouseResource::getId).collect(Collectors.toList()); |
| | | List<CollectListRes> list = houseResourceService.release(query,collect); |
| | | for (CollectListRes collectListRes : list) { |
| | | // 根据区id 查询下级 |
| | | Region city = regionService.selectById(collectListRes.getCityId()); |
| | | Region dis = regionService.selectById(collectListRes.getDistrictId()); |
| | | Region region = regionService.selectOne(new EntityWrapper<Region>().eq("parent_id",dis.getId())); |
| | | StringBuilder stringBuilder = new StringBuilder(""); |
| | | stringBuilder.append(dis.getName()); |
| | | if (region!=null){ |
| | | stringBuilder.append("/"+region.getName()); |
| | | Region region1 = regionService.selectOne(new EntityWrapper<Region>().eq("parent_id",region.getId())); |
| | | if (region!=null){ |
| | | stringBuilder.append(region1.getName()); |
| | | Region region2 = regionService.selectOne(new EntityWrapper<Region>().eq("parent_id",region1.getId())); |
| | | if (region2!=null){ |
| | | stringBuilder.append("/"+region2.getName()); |
| | | } |
| | | } |
| | | } |
| | | collectListRes.setAddress(city.getName()+">"+stringBuilder.toString()); |
| | | } |
| | | CollectRes searchIntermediaryRes = new CollectRes(); |
| | | searchIntermediaryRes.setList(list); |
| | | searchIntermediaryRes.setTotal(list.size()); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 添加新用户到数据库 |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.JwtTokenUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.AppUserMapper; |
| | | import com.stylefeng.guns.modular.system.dao.FeedBackMapper; |
| | | import com.stylefeng.guns.modular.system.model.AppUser; |
| | | import com.stylefeng.guns.modular.system.model.FeedBack; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.service.IAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.IFeedBackService; |
| | | import com.stylefeng.guns.modular.system.service.IHouseResourceService; |
| | | import com.stylefeng.guns.modular.system.service.IRegionService; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.util.weChat.WXCore; |
| | | import com.stylefeng.guns.modular.system.util.weChat.WeChatUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.req.RegisterAccountReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchIntermediaryReq; |
| | | import com.stylefeng.guns.modular.system.warpper.res.AppletLoginRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryListRes; |
| | | import com.stylefeng.guns.modular.system.warpper.res.SearchIntermediaryRes; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/7 11:07 |
| | | */ |
| | | @Service |
| | | public class FeedBackServiceImpl extends ServiceImpl<FeedBackMapper, FeedBack> implements IFeedBackService { |
| | | |
| | | |
| | | } |
| | |
| | | import com.stylefeng.guns.modular.system.dao.HouseResourceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.PointLocation; |
| | | import com.stylefeng.guns.modular.system.warpper.req.AddHouseReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.HouseQuery; |
| | | import com.stylefeng.guns.modular.system.warpper.req.SearchHouseResourceReq; |
| | | import com.stylefeng.guns.modular.system.warpper.req.UserInfoQuery; |
| | | import com.stylefeng.guns.modular.system.warpper.res.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.geo.Circle; |
| | | import org.springframework.data.geo.Distance; |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private ICollectionHouseResourceService collectionHouseResourceService; |
| | | @Resource |
| | | private MongoTemplate mongoTemplate; |
| | | @Autowired |
| | | private IHousingDemandService housingDemandService; |
| | | |
| | | |
| | | |
| | |
| | | if(req.getType() == 1){ |
| | | fillSearchHistory(req); |
| | | } |
| | | |
| | | //区域 |
| | | List<Integer> districtIds = null; |
| | | List<Integer> cityIds = null; |
| | | if(StringUtils.hasLength(req.getDistrict())){ |
| | | cityIds = new ArrayList<>(); |
| | | districtIds = new ArrayList<>(); |
| | | JSONArray jsonArray = JSON.parseArray(req.getDistrict()); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer cityId = jsonObject.getInteger("cityId"); |
| | | Integer districtId = jsonObject.getInteger("districtId"); |
| | | //不限区域 |
| | | if(0 == districtId || null == districtId){ |
| | | List<Region> regions = regionService.selectList(new EntityWrapper<Region>().eq("parent_id", cityId)); |
| | | districtIds.addAll(regions.stream().map(Region::getId).collect(Collectors.toList())); |
| | | List<Integer> districtIds = new ArrayList<>(); |
| | | List<Integer> cityIds = new ArrayList<>(); |
| | | if (req.getDistrict() != null &&(!req.getDistrict().equals("")) ){ |
| | | // 一级id |
| | | Integer integer = Integer.valueOf(req.getDistrict()); |
| | | districtIds.add(integer); |
| | | if (req.getArea()!=null && (!req.getArea().equals(""))){ |
| | | String[] split = req.getArea().split(","); |
| | | for (String s : split) { |
| | | cityIds.add(Integer.valueOf(s)); |
| | | } |
| | | cityIds.add(cityId); |
| | | districtIds.add(districtId); |
| | | } |
| | | } |
| | | // if(StringUtils.hasLength(req.getDistrict())){ |
| | | // cityIds = new ArrayList<>(); |
| | | // districtIds = new ArrayList<>(); |
| | | // JSONArray jsonArray = JSON.parseArray(req.getDistrict()); |
| | | // for (int i = 0; i < jsonArray.size(); i++) { |
| | | // JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | // Integer cityId = jsonObject.getInteger("cityId"); |
| | | // Integer districtId = jsonObject.getInteger("districtId"); |
| | | // //不限区域 |
| | | // if(0 == districtId || null == districtId){ |
| | | // List<Region> regions = regionService.selectList(new EntityWrapper<Region>().eq("parent_id", cityId)); |
| | | // districtIds.addAll(regions.stream().map(Region::getId).collect(Collectors.toList())); |
| | | // } |
| | | // cityIds.add(cityId); |
| | | // districtIds.add(districtId); |
| | | // } |
| | | // } |
| | | |
| | | //价格范围 |
| | | Double saleAmountStart = null; |
| | |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if(null != appUser){ |
| | | //获取历史搜索数据 |
| | | SearchHistoryCondition searchHistoryCondition = searchHistoryConditionService.selectOne(new EntityWrapper<SearchHistoryCondition>().eq("app_user_id", appUser.getId())); |
| | | SearchHistoryCondition searchHistoryCondition = searchHistoryConditionService |
| | | .selectOne(new EntityWrapper<SearchHistoryCondition>().eq("app_user_id", appUser.getId())); |
| | | if(null == searchHistoryCondition){ |
| | | //没有历史记录,将现有记录添加进去 |
| | | searchHistoryCondition = new SearchHistoryCondition(); |
| | |
| | | if(ToolUtil.isEmpty(req.getDistrict()) && ToolUtil.isEmpty(req.getSaleAmount()) && |
| | | ToolUtil.isEmpty(req.getHouseModel()) && ToolUtil.isEmpty(req.getElevator()) && |
| | | ToolUtil.isEmpty(req.getHouseTypeId())){ |
| | | req.setDistrict(searchHistoryCondition.getDistrict()); |
| | | req.setSaleAmount(searchHistoryCondition.getPrice()); |
| | | req.setHouseModel(searchHistoryCondition.getHouseModels()); |
| | | req.setElevator(searchHistoryCondition.getElevator()); |
| | | req.setHouseTypeId(searchHistoryCondition.getHouseTypeIds()); |
| | | // req.setDistrict(searchHistoryCondition.getDistrict()); |
| | | // req.setSaleAmount(searchHistoryCondition.getPrice()); |
| | | // req.setHouseModel(searchHistoryCondition.getHouseModels()); |
| | | // req.setElevator(searchHistoryCondition.getElevator()); |
| | | // req.setHouseTypeId(searchHistoryCondition.getHouseTypeIds()); |
| | | }else{ |
| | | //更新历史搜索记录 |
| | | searchHistoryCondition.setDistrict(req.getDistrict()); |
| | |
| | | houseResourceInfoRes.setSaleAmount(houseResource.getSaleAmount()); |
| | | houseResourceInfoRes.setHouseModel(houseResource.getHouseModel()); |
| | | houseResourceInfoRes.setRentalDuration(houseResource.getRentalDuration()); |
| | | houseResourceInfoRes.setSaleDate(sdf.format(houseResource.getSaleDate())); |
| | | houseResourceInfoRes.setSaleDate(houseResource.getStartTime()); |
| | | houseResourceInfoRes.setHousePhoto(houseResource.getHousePhoto()); |
| | | HouseType houseType = houseTypeService.selectById(houseResource.getHouseTypeId()); |
| | | houseResourceInfoRes.setHouseType(houseType.getName()); |
| | |
| | | houseResourceInfoRes.setNickname(appUser1.getNickname()); |
| | | houseResourceInfoRes.setUserType(appUser1.getUserType()); |
| | | houseResourceInfoRes.setInsertTime(sdf.format(houseResource.getInsertTime())); |
| | | houseResourceInfoRes.setUpdateTime(sdf.format(houseResource.getUpdateTime())); |
| | | if (houseResource.getUpdateTime()!=null){ |
| | | houseResourceInfoRes.setUpdateTime(sdf.format(houseResource.getUpdateTime())); |
| | | } |
| | | houseResourceInfoRes.setCode(houseResource.getCode()); |
| | | int collectionTimes = collectionHouseResourceService.selectCount(new EntityWrapper<CollectionHouseResource>().eq("house_resource_id", id)); |
| | | houseResourceInfoRes.setCollectionTimes(collectionTimes); |
| | |
| | | Query query = Query.query(Criteria.where("geoJsonPoint").withinSphere(circle)); |
| | | List<PointLocation> pointLocations = mongoTemplate.find(query, PointLocation.class); |
| | | List<Integer> ids = pointLocations.stream().map(PointLocation::getHouseId).collect(Collectors.toList()); |
| | | if (ids.size()!= 0){ |
| | | List<HouseResource> houseResources = this.selectBatchIds(ids); |
| | | List<SearchHouseResourceListRes> list = new ArrayList<>(); |
| | | //遍历解析出返回数据 |
| | |
| | | searchHouseResourceListRes.setKeepPet(resource.getKeepPet()); |
| | | list.add(searchHouseResourceListRes); |
| | | } |
| | | return list; |
| | | } |
| | | List<SearchHouseResourceListRes> list = new ArrayList<>(); |
| | | return list; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | return contactInformationRes; |
| | | } |
| | | |
| | | @Override |
| | | public SearchHouseResourceRes listHouse(HouseQuery query) { |
| | | SearchHouseResourceRes res = new SearchHouseResourceRes(); |
| | | res.setList(this.baseMapper.listHouse(query)); |
| | | res.setTotal(res.getList().size()); |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil addHouse(AddHouseReq req) { |
| | | Integer appUserId = appUserService.getAppUser().getId(); |
| | | AppUser appUser = appUserService.selectOne(new EntityWrapper<AppUser>() |
| | | .eq("id", appUserId) |
| | | .eq("audit_status", 2) |
| | | .eq("status", 1)); |
| | | if (appUser!=null){ |
| | | |
| | | if (appUser.getAgentLicenceCode()==null){ |
| | | // 未认证 只能能发布三条房源信息 |
| | | List<HouseResource> houseResources = this.selectList(new EntityWrapper<HouseResource>() |
| | | .eq("app_user_id", appUserId) |
| | | .eq("is_delete", 1) |
| | | .eq("status", 1) |
| | | ); |
| | | if (houseResources.size()>=3){ |
| | | return ResultUtil.error("中介账号未认证,只能同时上架3条房源信息"); |
| | | } |
| | | }else{ |
| | | // 已经认证 只能能发布20条房源信息 |
| | | List<HouseResource> houseResources = this.selectList(new EntityWrapper<HouseResource>() |
| | | .eq("app_user_id", appUserId) |
| | | .eq("is_delete", 1) |
| | | .eq("status", 1) |
| | | ); |
| | | if (houseResources.size()>=20){ |
| | | return ResultUtil.error("当前中介账号只能同时上架20条房源信息"); |
| | | } |
| | | } |
| | | |
| | | HouseResource houseResource = new HouseResource(); |
| | | BeanUtils.copyProperties(req,houseResource); |
| | | System.err.println(houseResource); |
| | | houseResource.setInsertTime(new Date()); |
| | | houseResource.setAuthStatus(1); |
| | | houseResource.setIsDelete(0); |
| | | houseResource.setInsertUserId(appUserId); |
| | | houseResource.setViewsNumber(0); |
| | | houseResource.setStatus(0); |
| | | houseResource.setLeaseTime(req.getTime()); |
| | | houseResource.setFirmHouse(req.getFirmHouse()); |
| | | if (req.getTime().contains("年")){ |
| | | houseResource.setRentalDuration(2); |
| | | }else{ |
| | | houseResource.setRentalDuration(1); |
| | | } |
| | | this.baseMapper.insert(houseResource); |
| | | return ResultUtil.success(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil confirm(Integer userType) { |
| | | AppUser appUser = appUserService.getAppUser(); |
| | | if (userType == 3){ |
| | | // 需要下架所有个人房源和求房源信息 |
| | | List<HouseResource> list = this.selectList(new EntityWrapper<HouseResource>() |
| | | .eq("app_user_id", appUser.getId())); |
| | | for (HouseResource houseResource : list) { |
| | | houseResource.setStatus(0); |
| | | this.baseMapper.updateById(houseResource); |
| | | } |
| | | List<HousingDemand> list2 = housingDemandService.selectList(new EntityWrapper<HousingDemand>() |
| | | .eq("app_user_id", appUser.getId())); |
| | | for (HousingDemand housingDemand : list2) { |
| | | housingDemand.setStatus(0); |
| | | housingDemandService.updateById(housingDemand); |
| | | } |
| | | // housingDemandService.updateBatchById(list2); |
| | | } |
| | | appUser.setUserType(userType); |
| | | appUserService.updateById(appUser); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<CollectListRes> collect(List<Integer> ids) { |
| | | return this.baseMapper.collect(ids); |
| | | } |
| | | |
| | | |
| | | public List<CollectListRes> release(UserInfoQuery query, List<Integer> collect) { |
| | | return this.baseMapper.release(query,collect); |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public Map<String, Object> code2Session(String jscode) throws Exception{ |
| | | System.err.println("看看调用奥"); |
| | | System.err.println("jsCode"+"========="+jscode); |
| | | String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxAppletsAppid + "&secret=" + wxAppletsAppSecret |
| | | + "&js_code=" + jscode + "&grant_type=authorization_code"; |
| | | HttpResult httpResult = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | |
| | | return null; |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(httpResult.getData()); |
| | | System.err.println("返回json串"+jsonObject); |
| | | int errcode = jsonObject.getIntValue("errcode"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("errcode", errcode); |
| | | System.err.println("返回code"+errcode); |
| | | if(errcode == 0){//成功 |
| | | map.put("openid", jsonObject.getString("openid")); |
| | | map.put("sessionKey", jsonObject.getString("session_key")); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.req; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 找中介-个人详情-我的房源 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class AddHouseReq { |
| | | |
| | | @ApiModelProperty(value = "类型 1=租赁 2=买卖", required = true) |
| | | private Integer dataType; |
| | | @ApiModelProperty(value = "户型", required = true) |
| | | private String houseModel; |
| | | @ApiModelProperty(value = "出租时长(买卖房不填该字段) 例:1 = 不限 /1年1月 ", required = true) |
| | | private String time; |
| | | @ApiModelProperty(value = "出租(售卖)日期 例:随时/九月上旬", required = true) |
| | | private String startTime; |
| | | @ApiModelProperty(value = "售卖金额(月租金额)", required = true) |
| | | private BigDecimal saleAmount; |
| | | @ApiModelProperty(value = "房屋类型", required = true) |
| | | private Integer houseTypeId; |
| | | @ApiModelProperty(value = "所在楼层", required = true) |
| | | private String floor; |
| | | @ApiModelProperty(value = "是否有电梯(0=否,1=是)", required = true) |
| | | private Integer elevator; |
| | | @ApiModelProperty(value = "是否有晾晒区(0=否,1=是)", required = true) |
| | | private Integer dryingArea; |
| | | @ApiModelProperty(value = "是否有花园(0=否,1=是)", required = true) |
| | | private Integer garden; |
| | | @ApiModelProperty(value = "是否有车位(0=否,1=是)", required = true) |
| | | private Integer carport; |
| | | @ApiModelProperty(value = "是否有平台(0=否,1=是)", required = true) |
| | | private Integer balcony; |
| | | @ApiModelProperty(value = "是否可养宠物(0=否,1=是)", required = true) |
| | | private Integer keepPet; |
| | | @ApiModelProperty(value = "房屋面积", required = true) |
| | | private String houseArea; |
| | | @ApiModelProperty(value = "市id", required = true) |
| | | private Integer cityId; |
| | | @ApiModelProperty(value = "区id", required = true) |
| | | private Integer districtId; |
| | | @ApiModelProperty(value = "地址", required = true) |
| | | private String houseAddress; |
| | | @ApiModelProperty(value = "所属小区", required = true) |
| | | private String cellName; |
| | | @ApiModelProperty(value = "房源照片", required = true) |
| | | private String housePhoto; |
| | | @ApiModelProperty(value = "房源视频", required = true) |
| | | private String houseVideo; |
| | | @ApiModelProperty(value = "标题", required = true) |
| | | private String title; |
| | | @ApiModelProperty(value = "更多介绍(求租描述)", required = true) |
| | | private String moreIntroduction; |
| | | @ApiModelProperty(value = "微信二维码", required = false) |
| | | private String wechatQRCode; |
| | | @ApiModelProperty(value = "whatsApp", required = false) |
| | | private String watchApp; |
| | | @ApiModelProperty(value = "电话号码", required = false) |
| | | private String phone; |
| | | @ApiModelProperty(value = "房屋朝向", required = false) |
| | | private String buildingOrientation; |
| | | @ApiModelProperty(value ="公司盘 0=否1=是",required = false) |
| | | private Integer firmHouse; |
| | | @ApiModelProperty(value ="经度",required = true) |
| | | private String longitude; |
| | | @ApiModelProperty(value ="纬度",required = true) |
| | | private String latitude; |
| | | @ApiModelProperty(value ="性别要求 1男2女3不限",required = true) |
| | | private Integer sex; |
| | | @ApiModelProperty(value ="类型1为草稿 2为发布",required = true) |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.req; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 找中介-个人详情-我的房源 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class HouseQuery { |
| | | @ApiModelProperty(value = "中介id", required = true) |
| | | private Integer id; |
| | | @ApiModelProperty(value = "类型 1=租赁 2=买卖", required = true) |
| | | private Integer type; |
| | | @ApiModelProperty(value = "页码,首页1", required = true) |
| | | private Integer pageNum; |
| | | @ApiModelProperty(value = "页条数", required = true) |
| | | private Integer pageSize; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/8 15:20 |
| | |
| | | private Integer userType; |
| | | @ApiModelProperty(value = "搜索内容", required = false) |
| | | private String content; |
| | | @ApiModelProperty(value = "区域[{cityId:1,districtId:0},{cityId:2,districtId:6}]", required = false) |
| | | @ApiModelProperty(value = "区域id", required = false) |
| | | private String district; |
| | | @ApiModelProperty(value = "二级区域不限不传 1,2,3", required = false) |
| | | private String area; |
| | | @ApiModelProperty(value = "租金1000-2000", required = false) |
| | | private String saleAmount; |
| | | @ApiModelProperty(value = "户型,多个逗号分隔", required = false) |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.req; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 找中介列表 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class SearchIntermediaryReq { |
| | | @ApiModelProperty(value = "经纪人姓名", required = false) |
| | | private String name; |
| | | @ApiModelProperty(value = "区域id", required = false) |
| | | private String district; |
| | | @ApiModelProperty(value = "二级区域不限不传 1,2,3", required = false) |
| | | private String area; |
| | | @ApiModelProperty(value = "页码,首页1", required = true) |
| | | private Integer pageNum; |
| | | @ApiModelProperty(value = "页条数", required = true) |
| | | private Integer pageSize; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.req; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * APP用户 |
| | | * @author pzb |
| | | * @Date 2021/12/1 12:03 |
| | | */ |
| | | @Data |
| | | public class UpdateAppUser { |
| | | /** |
| | | * 头像 |
| | | */ |
| | | @ApiModelProperty(value = "头像", required = false) |
| | | private String profilePhoto; |
| | | /** |
| | | * 昵称 |
| | | */ |
| | | @ApiModelProperty(value = "昵称", required = true) |
| | | private String nickname; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.req; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 找中介-个人详情-我的房源 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class UserInfoDTO { |
| | | |
| | | @ApiModelProperty(value = "类型 1=删除 2=下架 3=顶上去", required = true) |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "房源id", required = true) |
| | | private Integer id; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.req; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 个人中心-收藏/发布 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class UserInfoQuery { |
| | | @ApiModelProperty(value = "页码,首页1", required = true) |
| | | private Integer pageNum; |
| | | @ApiModelProperty(value = "页条数", required = true) |
| | | private Integer pageSize; |
| | | } |
| | |
| | | public class AppletLoginRes { |
| | | @ApiModelProperty("token") |
| | | private String token; |
| | | |
| | | @ApiModelProperty("登录用户类型1=普通用户 2=房东 3=中介") |
| | | private Integer userType; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.res; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | 个人中心 房源列表 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CollectListRes { |
| | | @ApiModelProperty("数据库-房源id") |
| | | private Integer id; |
| | | @ApiModelProperty("房源类型") |
| | | private Integer dataType; |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | @ApiModelProperty("市id") |
| | | private Integer cityId; |
| | | @ApiModelProperty("区id") |
| | | private Integer districtId; |
| | | @ApiModelProperty("地址") |
| | | private String address; |
| | | @ApiModelProperty("售卖金额(月租金额)") |
| | | private BigDecimal saleAmount; |
| | | @ApiModelProperty("浏览量") |
| | | private Integer viewsNumber; |
| | | @ApiModelProperty("收藏量") |
| | | private Integer collect; |
| | | @ApiModelProperty("发布时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date insertTime; |
| | | @ApiModelProperty("展示使用的房源id") |
| | | private String code; |
| | | @ApiModelProperty("是否有电梯(0=否,1=是)") |
| | | private Integer elevator; |
| | | @ApiModelProperty("是否有晾晒区(0=否,1=是)") |
| | | private Integer dryingArea; |
| | | @ApiModelProperty("是否有花园(0=否,1=是)") |
| | | private Integer garden; |
| | | @ApiModelProperty("是否有车位(0=否,1=是)") |
| | | private Integer carport; |
| | | @ApiModelProperty("是否有平台(0=否,1=是)") |
| | | private Integer balcony; |
| | | @ApiModelProperty("是否可养宠物(0=否,1=是)") |
| | | private Integer keepPet; |
| | | @ApiModelProperty("租期") |
| | | private String leaseTime; |
| | | @ApiModelProperty("状态 0下架 1上架") |
| | | private Integer status; |
| | | @ApiModelProperty("状态 0下架 1上架") |
| | | private Integer type; |
| | | @ApiModelProperty("照片") |
| | | private String housePhoto; |
| | | @ApiModelProperty("视频") |
| | | private String houseVideo; |
| | | @ApiModelProperty("发布用户id--前端忽略") |
| | | private Integer appUserId; |
| | | @ApiModelProperty("发布用户头像") |
| | | private String profilePhoto; |
| | | @ApiModelProperty("发布用户名称") |
| | | private String nickname; |
| | | @ApiModelProperty("发布用户身份 1=普通 2=房东 3=中介") |
| | | private Integer userType; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.res; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 个人中心 房源列表 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class CollectRes { |
| | | @ApiModelProperty("总数量") |
| | | private Integer total; |
| | | @ApiModelProperty("上架") |
| | | private Integer on; |
| | | @ApiModelProperty("下架") |
| | | private Integer off; |
| | | @ApiModelProperty("草稿") |
| | | private Integer draft; |
| | | @ApiModelProperty("房源") |
| | | private List<CollectListRes> list; |
| | | @ApiModelProperty("求房源") |
| | | private List<SearchHousingDemandListRes> list1; |
| | | } |
| | |
| | | public class SearchHousingDemandListRes { |
| | | @ApiModelProperty("数据id") |
| | | private Integer id; |
| | | @ApiModelProperty("用户id") |
| | | private Integer appuserId; |
| | | @ApiModelProperty("标题") |
| | | private String title; |
| | | @ApiModelProperty("户型") |
| | |
| | | private Integer balcony; |
| | | @ApiModelProperty("是否可养宠物(0=否,1=是)") |
| | | private Integer keepPet; |
| | | @ApiModelProperty("类型 1=草稿 2=发布") |
| | | private Integer type; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.res; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/11/21 15:38 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class SearchIntermediaryListRes { |
| | | @ApiModelProperty("用户id") |
| | | private Integer id; |
| | | @ApiModelProperty("昵称") |
| | | private String nickname; |
| | | @ApiModelProperty("公司名称") |
| | | private String companyName; |
| | | @ApiModelProperty("公司地址") |
| | | private String companyAddress; |
| | | @ApiModelProperty("个人简介") |
| | | private String introduce; |
| | | @ApiModelProperty("头像") |
| | | private String profilePhoto; |
| | | @ApiModelProperty("电话") |
| | | private String phone; |
| | | @ApiModelProperty("房源上传量") |
| | | private Integer houseCount; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper.res; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 找中介列表 |
| | | */ |
| | | @Data |
| | | @ApiModel |
| | | public class SearchIntermediaryRes { |
| | | @ApiModelProperty("总数量") |
| | | private Integer total; |
| | | @ApiModelProperty("列表数据") |
| | | private List<SearchIntermediaryListRes> list; |
| | | } |