| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.BufferedReader; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | */ |
| | | @Api(tags = "海康数据同步接口") |
| | | @RestController |
| | | @Slf4j |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX+"/business/hksync") |
| | | public class HkSyncCloudController extends BaseController { |
| | | |
| | |
| | | String result = hkSyncPushService.dealPlatformCarsEvent(param,response); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @ApiOperation("【海康test】月台车辆状态事件订阅推送对接处理接口") |
| | | @PostMapping("/push/platform/carstatusTest") |
| | | @LoginNoRequired |
| | | public ApiResponse pushPlatformCarStatus(HttpServletRequest request, HttpServletResponse response ){ |
| | | doPringParam(request,"【海康test】月台车辆状态事件订阅推送对接处理接口:\n"); |
| | | return ApiResponse.success(null); |
| | | } |
| | | public void doPringParam(HttpServletRequest request,String name) { |
| | | try { |
| | | StringBuilder data =new StringBuilder(); |
| | | String line; |
| | | BufferedReader reader =request.getReader(); |
| | | while(null !=(line = reader.readLine())) { |
| | | data.append(line); |
| | | } |
| | | if(StringUtils.isNotBlank( data.toString())){ |
| | | log.info(name+"=================参数:"+ data.toString()); |
| | | }else { |
| | | log.info(name+"=================:参数为空"); |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | log.info(name+"================= 参数异常:"+e.getMessage()); |
| | | } |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】取消订阅事件") |
| | | @PostMapping("/cancelEventSub") |