| | |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.StringUtil; |
| | | import com.java110.utils.util.ValidatorUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | Assert.hasKeyAndValue(reqJson, "msgCode", "未包含验证码信息"); |
| | | |
| | | OwnerDto ownerDto = computeOwner(reqJson); |
| | | String smsCode = CommonCache.getValue(reqJson.getString(ownerDto.getLink()) + SendSmsFactory.VALIDATE_CODE); |
| | | String smsCode = CommonCache.getValue(ownerDto.getLink() + SendSmsFactory.VALIDATE_CODE); |
| | | |
| | | if (!StringUtil.isEmpty(smsCode) && smsCode.contains("-")) { |
| | | smsCode = smsCode.substring(0, smsCode.indexOf("-")); |
| | | } |
| | | |
| | | if (!reqJson.getString("msgCode").equals(smsCode)) { |
| | | throw new CmdException("验证码错误"); |
| | |
| | | |
| | | OwnerDto ownerDto = computeOwner(reqJson); |
| | | |
| | | context.setResponseEntity(ResultVo.createResponseEntity(ownerDto.getOwnerId())); |
| | | String ownerName = ownerDto.getName(); |
| | | |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("ownerId",ownerDto.getOwnerId()); |
| | | data.put("roomId",ownerDto.getRoomId()); |
| | | data.put("ownerName",StringUtil.maskName(ownerName)); |
| | | |
| | | context.setResponseEntity(ResultVo.createResponseEntity(data)); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (ownerDtos == null || ownerDtos.size() < 1) { |
| | | throw new CmdException("业主不存在"); |
| | | } |
| | | |
| | | ownerDtos.get(0).setRoomId(roomDtos.get(0).getRoomId()); |
| | | return ownerDtos.get(0); |
| | | } |
| | | } |