|
@@ -2,14 +2,18 @@ package com.fdkankan.openApi.controller.www;
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaIgnore;
|
|
|
+import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.openApi.aop.RedisLimit;
|
|
|
import com.fdkankan.openApi.aop.ValidateApi;
|
|
|
+import com.fdkankan.openApi.common.PageInfo;
|
|
|
import com.fdkankan.openApi.controller.BaseController;
|
|
|
+import com.fdkankan.openApi.exception.ApiBusinessException;
|
|
|
import com.fdkankan.openApi.httpclient.client.FdKKClient;
|
|
|
import com.fdkankan.openApi.service.www.IUserService;
|
|
|
import com.fdkankan.openApi.vo.www.FdRoomParam;
|
|
|
import com.fdkankan.openApi.vo.www.FdkkLoginParamVo;
|
|
|
import com.fdkankan.web.response.ResultData;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -37,7 +41,18 @@ public class TakeLookController extends BaseController {
|
|
|
@ValidateApi
|
|
|
@RedisLimit(name = "takelook/roomList", limitCount = 1, period = 5)
|
|
|
public ResultData login(@RequestBody @Validated FdRoomParam param){
|
|
|
- return fdKKClient.roomList(param,request.getHeader("fd-takelook-token"));
|
|
|
+ String token = request.getHeader("fd-takelook-token");
|
|
|
+ if(StringUtils.isBlank(token)){
|
|
|
+ throw new ApiBusinessException(ErrorCode.FAILURE_CODE_3004);
|
|
|
+ }
|
|
|
+ ResultData<PageInfo> data = fdKKClient.roomList(param, token);
|
|
|
+ if(data.getCode() != 0 && data.getCode() == 4008){
|
|
|
+ throw new ApiBusinessException(ErrorCode.FAILURE_CODE_3004);
|
|
|
+ }
|
|
|
+ if(data.getCode() != 0 ){
|
|
|
+ throw new ApiBusinessException(data.getCode(),data.getMessage());
|
|
|
+ }
|
|
|
+ return data;
|
|
|
}
|
|
|
|
|
|
}
|