1.app远程接口代码提交

This commit is contained in:
wr
2023-11-09 16:49:02 +08:00
parent 2f674a1f53
commit b657c31e4b
35 changed files with 598 additions and 14 deletions

View File

@@ -4,8 +4,8 @@ import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.event.api.fallback.EventDetailFeignClientFallbackFactory;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.GeneralVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -51,4 +51,9 @@ public interface EventDetailFeignClient {
@PostMapping("/getEventDetailCount")
HttpResult<List<GeneralVO>> getEventDetailCount(@RequestBody Map<String, Object> condMap);
/**
* 根据暂态id集合获取暂降列表
*/
@PostMapping("/getEventDetailByIdsList")
HttpResult<List<RmpEventDetailPO>> getEventDetailByIdsList(@RequestBody List<String> ids);
}

View File

@@ -5,6 +5,7 @@ import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.event.api.EventDetailFeignClient;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.GeneralVO;
import com.njcn.event.utils.EventlEnumUtil;
import feign.hystrix.FallbackFactory;
@@ -56,6 +57,12 @@ public class EventDetailFeignClientFallbackFactory implements FallbackFactory<Ev
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<RmpEventDetailPO>> getEventDetailByIdsList(List<String> ids) {
log.error("{}异常,降级处理,异常为:{}", "根据暂态id集合获取暂降列表", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -8,6 +8,7 @@ import com.njcn.common.utils.HttpResultUtil;
import com.njcn.common.utils.LogUtil;
import com.njcn.event.mapper.majornetwork.EventDetailMapper;
import com.njcn.event.pojo.po.EventDetail;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import com.njcn.event.pojo.vo.GeneralVO;
import com.njcn.event.service.majornetwork.EventDetailService;
import com.njcn.web.controller.BaseController;
@@ -141,4 +142,16 @@ public class EventDetailController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, generalVOS, methodDescribe);
}
/**
* 根据监测点集合获取短时终端,电压暂升,电压暂降
* @return
*/
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/getEventDetailByIdsList")
@ApiOperation("根据暂态id集合获取暂降列表")
public HttpResult<List<RmpEventDetailPO>> getEventDetailByIdsList(@RequestBody List<String> ids) {
String methodDescribe = getMethodDescribe("getEventDetailByIdsList");
List<RmpEventDetailPO> eventDetailPOS = eventDetailService.listByIds(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, eventDetailPOS, methodDescribe);
}
}