| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.config.annotation.CloudRequiredPermission; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitRequest; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DESUtil; |
| | | 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.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | | * @date 2023/11/30 15:33 |
| | |
| | | private HkSyncPushServiceImpl hkSyncPushService; |
| | | @Autowired |
| | | private HkSyncLoginAuthServiceImpl hkSyncLoginAuthService; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | @Autowired |
| | | private RedisTemplate<String,Object> redisTemplate; |
| | | |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("【海康】全量同步月台信息接口") |
| | | @PostMapping("/syncPlatforms") |
| | |
| | | } |
| | | |
| | | /** |
| | | * 访客来访配置 |
| | | * 获取安防平台系统免密菜单调整地址 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "获取安防平台系统免密菜单调整地址" ) |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "type",example = "0",value = "菜单类型", required = true), |
| | | }) |
| | | public ApiResponse<String> getHkMenuLink(Integer type){ |
| | | String token = "";//------------TODO----------康康继续写 |
| | | return ApiResponse.success( HKService.getMenuUrl(type,token)); |
| | | public ApiResponse<String> getHkMenuLink(Integer type,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | LoginUserInfo loginUserInfo = this.getLoginUser(token); |
| | | String hkToken = DESUtil.generateTokenToHk(loginUserInfo.getUsername(),Integer.valueOf( |
| | | systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_TOKEN_VALIDITY).getCode() |
| | | ),redisTemplate); |
| | | String url = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_HTTPS).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.HK_HOST).getCode() |
| | | + HKService.getMenuUrl(type,hkToken); |
| | | |
| | | return ApiResponse.success( url); |
| | | } |
| | | |
| | | } |