| | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest; |
| | | import com.doumee.core.haikang.model.param.request.EventSubRequest; |
| | | import com.doumee.core.haikang.model.param.request.ParkListRequest; |
| | | import com.doumee.core.haikang.model.param.request.PrivilegeGroupRequest; |
| | | import com.doumee.core.haikang.model.param.request.*; |
| | | import com.doumee.core.haikang.model.param.request.event.acs.EventAcsRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventParkRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.service.business.impl.hksync.HkSyncDeviceServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.HkSyncParkServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.HkSyncPrivilegeServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.HkSyncPushServiceImpl; |
| | | import com.doumee.dao.business.model.Device; |
| | | import com.doumee.service.business.impl.hksync.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | public class HkSyncCloudController extends BaseController { |
| | | |
| | | @Autowired |
| | | private HkSyncPlatformsServiceImpl hkSyncPlatformsService; |
| | | @Autowired |
| | | private HkSyncDeviceServiceImpl hkSyncDeviceService; |
| | | @Autowired |
| | | private HkSyncParkServiceImpl hkSyncParkService; |
| | |
| | | private HkSyncPrivilegeServiceImpl hkSyncPrivilegeService; |
| | | @Autowired |
| | | private HkSyncPushServiceImpl hkSyncPushService; |
| | | |
| | | @Autowired |
| | | private HkSyncLoginAuthServiceImpl hkSyncLoginAuthService; |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步月台信息接口") |
| | | @PostMapping("/syncPlatforms") |
| | | @CloudRequiredPermission("business:hksync:platforms") |
| | | public ApiResponse syncPlatforms(@RequestBody PlatformsListRequest param) { |
| | | String result = hkSyncPlatformsService.syncPlatforms(param); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步月台状态信息接口") |
| | | @PostMapping("/syncPlatformStatus") |
| | | @CloudRequiredPermission("business:hksync:platforms") |
| | | public ApiResponse syncPlatformStatus(@RequestBody PlatformStatusRequest param) { |
| | | String result = hkSyncPlatformsService.getPlatformStatus(param); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步门禁设备接口") |
| | | @PostMapping("/syncDevices") |
| | | @CloudRequiredPermission("business:hksync:device") |
| | | public ApiResponse syncHkDevices(@RequestBody AcsDeviceListRequest param,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | String result = hkSyncDeviceService.syncHkDevices(param); |
| | | public ApiResponse syncHkDevices(@RequestBody Device param, @RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | String result = null; |
| | | if(Constants.equalsInteger(param.getType(),Constants.ZERO)){ |
| | | result = hkSyncDeviceService.syncHkDevices(param); |
| | | }else if(Constants.equalsInteger(param.getType(),Constants.TWO)){ |
| | | //同步LED |
| | | result = hkSyncDeviceService.syncHkLed(param); |
| | | }else if(Constants.equalsInteger(param.getType(),Constants.THREE)){ |
| | | //同步广播 |
| | | result = hkSyncDeviceService.syncHkBroadcast(param); |
| | | } |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】获取组件授权登录地址接口") |
| | | @PostMapping("/getServiceUrl") |
| | | public ApiResponse getServiceUrl(@RequestBody HKGetServiceLoginUrlRequest param,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | param.setUsername(this.getLoginUser(token).getUsername()); |
| | | String result = hkSyncLoginAuthService.getServiceUrl(param); |
| | | return ApiResponse.success(result); |
| | | } |
| | | @PreventRepeat |