Commit c8716b97 by guojuxing

微盟授权加日志

parent a697e98b
......@@ -374,11 +374,11 @@ public class WmMallStoreController {
* @param code
*/
@RequestMapping("auth-callback")
public void authCallBack(String code) throws IOException {
public RestResponse authCallBack(String code) throws IOException {
Object obj = RedisUtil.getCache("enterprise:wm:auth:" + UserDetailUtils.getUserDetail().getEnterpriseId());
try {
Object obj = RedisUtil.getCache("enterprise:wm:auth:" + UserDetailUtils.getUserDetail().getEnterpriseId());
if (obj == null) {
LOGGER.warn("微盟授权-店铺ID缓存不存在");
return RestResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "微盟授权-店铺ID缓存不存在");
}
ServiceResponse<Void> authWmResponse = weimobMerchantService.weimobStoreAuth((Integer) obj, code);
LOGGER.info("微盟中间件返回结果:{}", JSON.toJSONString(authWmResponse));
......@@ -388,11 +388,15 @@ public class WmMallStoreController {
if (!wmMallStoreResponse.isSuccess()) {
LOGGER.warn("企业侧微盟店铺授权结果:{}", JSON.toJSONString(wmMallStoreResponse));
}
return RestResponse.success();
}
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), authWmResponse.getMessage());
} catch (Exception e) {
LOGGER.warn("微盟授权返回结果:{}", e.getMessage(), e);
return RestResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), e.getMessage());
} finally {
//清空缓存
LOGGER.warn("微盟授权-缓存:{}", obj);
RedisUtil.delCache("enterprise:wm:auth:" + UserDetailUtils.getUserDetail().getEnterpriseId());
}
}
......
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