Commit afd396e5 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	common-lib/src/main/java/com/mortals/xhx/feign/area/IApiAreaFeign.java
parents 792d4162 97a2f0d3
...@@ -60,6 +60,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu ...@@ -60,6 +60,7 @@ public class SiteBusinessServiceImpl extends AbstractCRUDCacheServiceImpl<SiteBu
item.setDatashow(businessEntity.getDatashow()); item.setDatashow(businessEntity.getDatashow());
item.setEnglishname(businessEntity.getEnglishname()); item.setEnglishname(businessEntity.getEnglishname());
item.setBusinessType(businessEntity.getBusinessType()); item.setBusinessType(businessEntity.getBusinessType());
item.setRemark(businessEntity.getRemark());
//判断业务是否含有子业务 //判断业务是否含有子业务
if (businessEntity.getIsBusiness() == IsBusinessEnum.一级业务.getValue()) { if (businessEntity.getIsBusiness() == IsBusinessEnum.一级业务.getValue()) {
//添加二级业务列表 //添加二级业务列表
......
...@@ -70,9 +70,6 @@ public interface IApiAreaFeign extends IFeign { ...@@ -70,9 +70,6 @@ public interface IApiAreaFeign extends IFeign {
@PostMapping(value = "/site/getFlatSitesByAreaIds") @PostMapping(value = "/site/getFlatSitesByAreaIds")
String getFlatSitesByAreaIds(@RequestBody SitePdu query); String getFlatSitesByAreaIds(@RequestBody SitePdu query);
@PostMapping(value = "/site/list")
String getSitesByQuery(@RequestBody SitePdu query);
} }
...@@ -128,14 +125,6 @@ class AreaFeignFallbackFactory implements FallbackFactory<IApiAreaFeign> { ...@@ -128,14 +125,6 @@ class AreaFeignFallbackFactory implements FallbackFactory<IApiAreaFeign> {
failResp.setMsg("暂时无法获取站点列表,请稍后再试!"); failResp.setMsg("暂时无法获取站点列表,请稍后再试!");
return JSON.toJSONString(failResp); return JSON.toJSONString(failResp);
} }
@Override
public String getSitesByQuery(SitePdu query) {
ApiResp<String> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点列表,请稍后再试!");
return JSON.toJSONString(failResp);
}
}; };
} }
} }
......
package com.mortals.xhx.feign.user; package com.mortals.xhx.feign.user;
import com.alibaba.fastjson.JSON;
import com.mortals.xhx.common.code.ApiRespCodeEnum;
import com.mortals.xhx.feign.IFeign; import com.mortals.xhx.feign.IFeign;
import com.mortals.xhx.feign.req.BaseUserQuery; import com.mortals.xhx.feign.req.BaseUserQuery;
import com.mortals.xhx.feign.req.BaseUserReq; import com.mortals.xhx.feign.req.BaseUserReq;
import com.mortals.xhx.feign.rsp.ApiResp; import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.feign.rsp.UserRsp; import com.mortals.xhx.feign.rsp.UserRsp;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -15,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -15,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author: zxfei * @author: zxfei
* @date: 2022/5/30 10:40 * @date: 2022/5/30 10:40
*/ */
@FeignClient(name = "portal-manager", path = "/zwfw") @FeignClient(name = "portal-manager", path = "/zwfw", fallback = UserFeignFallbackFactory.class)
public interface IApiUserFeign extends IFeign { public interface IApiUserFeign extends IFeign {
/** /**
...@@ -29,3 +34,20 @@ public interface IApiUserFeign extends IFeign { ...@@ -29,3 +34,20 @@ public interface IApiUserFeign extends IFeign {
} }
@Slf4j
@Component
class UserFeignFallbackFactory implements FallbackFactory<IApiUserFeign> {
@Override
public IApiUserFeign create(Throwable t) {
return new IApiUserFeign() {
@Override
public ApiResp<UserRsp> findAllUser(BaseUserReq<BaseUserQuery> req) {
ApiResp<UserRsp> failResp = new ApiResp<>();
failResp.setCode(ApiRespCodeEnum.FAILED.getValue());
failResp.setMsg("暂时无法获取站点列表,请稍后再试!");
return failResp;
}
};
}
}
\ No newline at end of file
...@@ -7,7 +7,6 @@ import cn.hutool.core.util.IdUtil; ...@@ -7,7 +7,6 @@ import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ReflectUtil; import cn.hutool.core.util.ReflectUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.service.ICacheService; import com.mortals.framework.service.ICacheService;
import com.mortals.framework.utils.redis.RedisUtils;
import com.mortals.xhx.base.framework.config.CaptchaProperties; import com.mortals.xhx.base.framework.config.CaptchaProperties;
import com.mortals.xhx.base.framework.expection.CaptchaException; import com.mortals.xhx.base.framework.expection.CaptchaException;
import com.mortals.xhx.base.framework.expection.CaptchaExpireException; import com.mortals.xhx.base.framework.expection.CaptchaExpireException;
...@@ -98,7 +97,8 @@ public class ValidateCodeServiceImpl implements ValidateCodeService { ...@@ -98,7 +97,8 @@ public class ValidateCodeServiceImpl implements ValidateCodeService {
} }
String verifyKey = Constant.CAPTCHA_CODE_KEY + uuid; String verifyKey = Constant.CAPTCHA_CODE_KEY + uuid;
String captcha = cacheService.get(verifyKey); String captcha = cacheService.get(verifyKey);
RedisUtils.deleteObject(verifyKey); cacheService.del(verifyKey);
// RedisUtils.deleteObject(verifyKey);
if (!code.equalsIgnoreCase(captcha)) { if (!code.equalsIgnoreCase(captcha)) {
throw new CaptchaException(); throw new CaptchaException();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment