Эх сурвалжийг харах

feature: V4鉴权接口改为361标准接口

mazq 2 жил өмнө
parent
commit
fd2b63cee1
23 өөрчлөгдсөн 591 нэмэгдсэн , 281 устгасан
  1. 40 0
      src/main/java/com/dragoninfo/dcuc/authweb/business/IAuthTokenBusiness.java
  2. 164 0
      src/main/java/com/dragoninfo/dcuc/authweb/business/impl/AuthTokenBusinessImpl.java
  3. 1 1
      src/main/java/com/dragoninfo/dcuc/authweb/business/impl/MtAuthBusiness.java
  4. 4 0
      src/main/java/com/dragoninfo/dcuc/authweb/config/DcucAuthWebConfig.java
  5. 61 36
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/controller/AuthV4Controller.java
  6. 47 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/AppTokenInfoRespVO.java
  7. 38 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/ResultRespPageVo.java
  8. 45 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/TokenDetailRespVo.java
  9. 57 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/TokenUserInfoReqVo.java
  10. 67 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/TokenUserInfoRespVo.java
  11. 65 0
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/UserTokenInfoRespVO.java
  12. 0 7
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/AppController.java
  13. 1 1
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ManufacturerInfoController.java
  14. 1 3
      src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/sub/AuthOrgInfoController.java
  15. 0 26
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkAppResultVo.java
  16. 0 36
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkFunctionResultVo.java
  17. 0 26
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkRoleResultVo.java
  18. 0 18
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsAppReqVo.java
  19. 0 21
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsAppRespVo.java
  20. 0 23
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsFuncReqVo.java
  21. 0 26
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsFuncRespVo.java
  22. 0 23
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsOrgRoleReqVo.java
  23. 0 34
      src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsOrgRoleRespVo.java

+ 40 - 0
src/main/java/com/dragoninfo/dcuc/authweb/business/IAuthTokenBusiness.java

@@ -0,0 +1,40 @@
+package com.dragoninfo.dcuc.authweb.business;
+
+import com.dragoninfo.dcuc.auth.sub.dto.AuthUserContactDTO;
+import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo.AppTokenInfoRespVO;
+import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo.TokenDetailRespVo;
+import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo.UserTokenInfoRespVO;
+
+/**
+ * @author mazq
+ * @date 2023/2/14
+ */
+public interface IAuthTokenBusiness {
+
+    /**
+     * 查询用户令牌
+     *
+     * @param userTokenId
+     * @return
+     */
+    UserTokenInfoRespVO getUserTokenInfo(String userTokenId);
+
+    /**
+     * 查询应用令牌
+     *
+     * @param appTokenId
+     * @return
+     */
+    AppTokenInfoRespVO getAppTokenInfo(String appTokenId);
+
+    /**
+     * 根据应用tokenId获取用户和应用信息
+     *
+     * @param appTokenId 应用令牌id
+     * @param needUserInfo 是否需要人员信息
+     * @param needAppInfo 是否需要应用信息
+     * @return
+     */
+    TokenDetailRespVo getByAppTokenId(String appTokenId, boolean needUserInfo, boolean needAppInfo);
+
+}

+ 164 - 0
src/main/java/com/dragoninfo/dcuc/authweb/business/impl/AuthTokenBusinessImpl.java

@@ -0,0 +1,164 @@
+package com.dragoninfo.dcuc.authweb.business.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.dragoninfo.dcuc.app.entity.ApplyInfo;
+import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
+import com.dragoninfo.dcuc.auth.sub.dto.AuthUserDTO;
+import com.dragoninfo.dcuc.auth.sub.facade.IAuthUserInfoFacade;
+import com.dragoninfo.dcuc.auth.sub.vo.ApplyInfoVo;
+import com.dragoninfo.dcuc.authweb.business.IAuthTokenBusiness;
+import com.dragoninfo.dcuc.authweb.config.DcucAuthWebConfig;
+import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo.*;
+import com.dragoninfo.dcuc.authweb.restcontroller.sub.vo.user.AuthUserVo;
+import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
+import com.dragonsoft.duceap.commons.util.string.StringUtils;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.util.List;
+
+/**
+ * token业务类
+ *
+ * @author mazq
+ * @date 2023/2/14
+ */
+@Slf4j
+@Service
+public class AuthTokenBusinessImpl implements IAuthTokenBusiness {
+
+    private RestTemplate restTemplate;
+
+    private DcucAuthWebConfig dcucAuthConfig;
+
+    private IApplyInfoFacade applyInfoFacade;
+
+    private IAuthUserInfoFacade userInfoFacade;
+
+    @Autowired
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+
+    @Autowired
+    public void setApplyInfoFacade(IApplyInfoFacade applyInfoFacade) {
+        this.applyInfoFacade = applyInfoFacade;
+    }
+
+    @Autowired
+    public void setDcucAuthConfig(DcucAuthWebConfig dcucAuthConfig) {
+        this.dcucAuthConfig = dcucAuthConfig;
+    }
+
+    @Override
+    public UserTokenInfoRespVO getUserTokenInfo(String userTokenId) {
+        // 查询用户令牌
+        String tokenQueryUrl = dcucAuthConfig.getUserTokenQueryUrl();
+        return getTokenInfo(tokenQueryUrl, userTokenId);
+    }
+
+    @Override
+    public AppTokenInfoRespVO getAppTokenInfo(String appTokenId) {
+        // 获取应用令牌
+        String tokenQueryUrl = dcucAuthConfig.getAppTokenQueryUrl();
+        return getTokenInfo(tokenQueryUrl, appTokenId);
+    }
+
+    @Override
+    public TokenDetailRespVo getByAppTokenId(String appTokenId, boolean needUserInfo, boolean needAppInfo) {
+        AppTokenInfoRespVO appToken = getAppTokenInfo(appTokenId);
+        if (null == appToken) {
+            return TokenDetailRespVo.empty();
+        }
+        TokenDetailRespVo.TokenDetailRespVoBuilder builder = TokenDetailRespVo.builder();
+        UserTokenInfoRespVO userToken = appToken.getUserToken();
+        builder.appToken(appToken).userToken(userToken);
+        // 根据用户令牌获取用户信息
+        if (needUserInfo) {
+            AuthUserVo userVo = getAuthUserVo(userToken.getPId());
+            builder.userInfo(userVo);
+        }
+        // 查询应用信息
+        if (needAppInfo) {
+            ApplyInfoVo applyInfoVo = new ApplyInfoVo();
+            String appCode = appToken.getAppId();
+            ApplyInfo applyInfo = applyInfoFacade.getAppByCode(appCode);
+            BeanUtils.copyProperties(applyInfo, applyInfoVo);
+            builder.applyInfo(applyInfoVo);
+        }
+        return builder.build();
+    }
+
+    private AuthUserVo getAuthUserVo(String pid) {
+        TokenUserInfoRespVo userInfoRespVo = getTokenUserByPid(pid);
+        if (userInfoRespVo == null) {
+            return null;
+        }
+        // 查询权限中心用户信息, 填充id字段
+        String idcard = userInfoRespVo.getIdcard();
+        AuthUserDTO authUserInfo = userInfoFacade.findByIdcard(idcard);
+        if (null == authUserInfo) {
+            return null;
+        }
+        AuthUserVo userVo = new AuthUserVo();
+        BeanUtils.copyProperties(authUserInfo, userVo);
+        return userVo;
+    }
+
+    private TokenUserInfoRespVo getTokenUserByPid(String pid) {
+        if (StringUtils.isBlank(pid)) {
+            return null;
+        }
+        String url = dcucAuthConfig.getUserInfoQueryUrl();
+        TokenUserInfoReqVo userReqVo = new TokenUserInfoReqVo();
+        userReqVo.setId(pid);
+        HttpEntity<TokenUserInfoReqVo> entity = new HttpEntity<>(userReqVo);
+        ResponseEntity<ResultRespPageVo<TokenUserInfoRespVo>> response = restTemplate.exchange(url, HttpMethod.POST, entity, new ParameterizedTypeReference<ResultRespPageVo<TokenUserInfoRespVo>>() {
+        });
+        ResultRespPageVo<TokenUserInfoRespVo> respBody = getRespBody(response);
+        if (null == respBody) {
+            return null;
+        }
+        ResultRespPageVo.ResultPageContent<TokenUserInfoRespVo> pageContent = respBody.getResult();
+        if (null == pageContent) {
+            return null;
+        }
+        List<TokenUserInfoRespVo> rows = pageContent.getRows();
+        return CollectionUtils.isEmpty(rows) ? null : rows.get(0);
+
+    }
+
+    private <T> T getTokenInfo(String tokenQueryUrl, Object... param) {
+        ResponseEntity<ResultRespVO<T>> response = restTemplate.exchange(tokenQueryUrl, HttpMethod.GET, null,
+                new ParameterizedTypeReference<ResultRespVO<T>>() {
+                }, param);
+        ResultRespVO<T> respBody = getRespBody(response);
+        if (null == respBody) {
+            return null;
+        }
+        return respBody.getResult();
+    }
+
+    private <T extends MessageRespVO> T getRespBody(ResponseEntity<T> response) {
+        HttpStatus statusCode = response.getStatusCode();
+        if (!statusCode.is2xxSuccessful()) {
+            log.info("request failed, resp:{}", response);
+            return null;
+        }
+        T body = response.getBody();
+        if (body == null || !ResponseStatus.SUCCESS_CODE.equals(body.getStatusCode())) {
+            log.info("response body failed, body:{}", JSON.toJSONString(body));
+            return null;
+        }
+        return body;
+    }
+}

+ 1 - 1
src/main/java/com/dragoninfo/dcuc/authweb/business/MtAuthBusiness.java → src/main/java/com/dragoninfo/dcuc/authweb/business/impl/MtAuthBusiness.java

@@ -1,4 +1,4 @@
-package com.dragoninfo.dcuc.authweb.business;
+package com.dragoninfo.dcuc.authweb.business.impl;
 
 import com.dragoninfo.dcuc.auth.admin.facade.*;
 import com.dragoninfo.dcuc.authweb.common.SysConstants;

+ 4 - 0
src/main/java/com/dragoninfo/dcuc/authweb/config/DcucAuthWebConfig.java

@@ -29,5 +29,9 @@ public class DcucAuthWebConfig {
      */
     private CheckTypeEnum checkTypeEnum = CheckTypeEnum.TOKEN;
 
+    private String userTokenQueryUrl;
 
+    private String appTokenQueryUrl;
+
+    private String userInfoQueryUrl;
 }

+ 61 - 36
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/controller/AuthV4Controller.java

@@ -1,22 +1,24 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.controller;
 
 import cn.hutool.core.util.StrUtil;
-import com.auth0.jwt.JWT;
-import com.auth0.jwt.interfaces.DecodedJWT;
 import com.dragoninfo.dcuc.auth.auth.api.IApiDataAuthFacade;
 import com.dragoninfo.dcuc.auth.auth.dto.AppDataSensitiveLevelDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.AppFunInfoDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.DataItemsDto;
 import com.dragoninfo.dcuc.auth.auth.dto.RoleApiDto;
+import com.dragoninfo.dcuc.auth.auth.dto.data.DataAuthV2ReqDTO;
+import com.dragoninfo.dcuc.auth.auth.dto.data.DataAuthV2RespDTO;
 import com.dragoninfo.dcuc.auth.auth.facade.IRoleFacade;
 import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFlowFacade;
 import com.dragoninfo.dcuc.auth.auth.facade.IStaffAssignAuthInfoFacade;
 import com.dragoninfo.dcuc.auth.auth.vo.ServiceAuthenticationResVO;
+import com.dragoninfo.dcuc.authweb.business.IAuthTokenBusiness;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.enums.BusinessRespEnum;
-import com.dragoninfo.dcuc.auth.sub.dto.AuthUserDTO;
-import com.dragoninfo.dcuc.auth.sub.facade.IAuthUserInfoFacade;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo.*;
+import com.dragoninfo.dcuc.authweb.restcontroller.sub.vo.user.AuthUserVo;
 import com.dragoninfo.dcuc.common.utils.LangUtil;
+import com.dragoninfo.dcuc.common.utils.ResponseUtil;
+import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -24,8 +26,11 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -40,24 +45,21 @@ import java.util.List;
 @RequestMapping(value = "/api/auth-service/v4/")
 public class AuthV4Controller {
 
-    @Autowired
-    private IAuthUserInfoFacade userFacade;
-
     @Autowired
     private IStaffAssignAuthInfoFacade staffAssignAuthInfoFacade;
 
     @Autowired
     private IServiceAuthFlowFacade serviceAuthFlowFacade;
 
-    @Autowired
-    private IAuthUserInfoFacade authUserInfoFacade;
-
     @Autowired
     private IRoleFacade roleFacade;
 
     @Autowired
     private IApiDataAuthFacade apiDataAuthFacade;
 
+    @Autowired
+    private IAuthTokenBusiness tokenBusiness;
+
     /**
      * 应用级鉴权
      *
@@ -72,10 +74,9 @@ public class AuthV4Controller {
             return ResultRespVO.resultEnumMessage(BusinessRespEnum.TOKEN_FAIL);
         }
 
-        DecodedJWT decode = JWT.decode(appTokenId);
-        String idcard = decode.getClaim("idCard").asString();
+        TokenDetailRespVo tokenInfo = tokenBusiness.getByAppTokenId(appTokenId, true, false);
 
-        AuthUserDTO userInfo = userFacade.findByIdcard(idcard);
+        AuthUserVo userInfo = tokenInfo.getUserInfo();
         if (userInfo == null) {
             return ResultRespVO.respRequestErrorMessage("用户不存在");
         }
@@ -106,23 +107,19 @@ public class AuthV4Controller {
         String taskId = functionAuthReqVO.getTaskId();
 
         if (StrUtil.isBlank(appTokenId)) {
-            return ResultRespVO.resultEnumMessage(BusinessRespEnum.TOKEN_FAIL);
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.PARAM_ERROR);
         }
-
-        DecodedJWT decode = JWT.decode(appTokenId);
-        String idcard = decode.getClaim("idCard").asString();
-        String appCode = decode.getClaim("appCode").asString();
-
-
-        AuthUserDTO userInfo = authUserInfoFacade.findByIdcard(idcard);
+        TokenDetailRespVo tokenInfo = tokenBusiness.getByAppTokenId(appTokenId, true, false);
+        AuthUserVo userInfo = tokenInfo.getUserInfo();
         if (userInfo == null) {
-            return ResultRespVO.respRequestErrorMessage("idcard无权限,或身份证错误");
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.AUTH_FAIL);
         }
+        String appCode = tokenInfo.getAppToken().getAppId();
 
         RoleApiDto roleApiDto = new RoleApiDto();
         roleApiDto.setAppCode(appCode);
         roleApiDto.setUserId(userInfo.getId());
-        roleApiDto.setIdcard(idcard);
+        roleApiDto.setIdcard(userInfo.getIdcard());
         List<AppFunInfoDTO> menus = roleFacade.getMenus(roleApiDto);
 
         StringBuilder functionAuthBuilder = new StringBuilder();
@@ -147,14 +144,17 @@ public class AuthV4Controller {
         String appTokenId = serviceAuthReqVO.getAppTokenId();
         String taskId = serviceAuthReqVO.getTaskId();
         if (StrUtil.isBlank(appTokenId)) {
-            return ResultRespVO.resultEnumMessage(BusinessRespEnum.TOKEN_FAIL);
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.PARAM_ERROR);
         }
 
-        DecodedJWT decode = JWT.decode(appTokenId);
-        String appCode = decode.getClaim("appCode").asString();
-        String idcard = decode.getClaim("idcard").asString();
+        TokenDetailRespVo tokenInfo = tokenBusiness.getByAppTokenId(appTokenId, true, false);
+        AuthUserVo userInfo = tokenInfo.getUserInfo();
+        if (userInfo == null) {
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.AUTH_FAIL);
+        }
+        String appCode = tokenInfo.getAppToken().getAppId();
 
-        List<ServiceAuthenticationResVO> serviceAuthenticationResVOList = serviceAuthFlowFacade.serviceAuthentication(idcard, appCode, "", "");
+        List<ServiceAuthenticationResVO> serviceAuthenticationResVOList = serviceAuthFlowFacade.serviceAuthentication(userInfo.getIdcard(), appCode, "", "");
 
         StringBuilder serviceAuthBuilder = new StringBuilder();
 
@@ -175,16 +175,41 @@ public class AuthV4Controller {
      */
     @PostMapping("dataAuth")
     public ResultRespVO<List<DataAuthRespVO>> dataAuth(@RequestBody DataAuthReqVO dataAuthReqVO) {
-        String resourceId = dataAuthReqVO.getResourceId();
-        String taskId = dataAuthReqVO.getTaskId();
+        String appTokenId = dataAuthReqVO.getAppTokenId();
 
-        // todo 数据级鉴权
+        if (StrUtil.isBlank(appTokenId)) {
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.PARAM_ERROR);
+        }
 
-        DataAuthRespVO dataAuthRespVO = new DataAuthRespVO();
+        String resourceId = dataAuthReqVO.getResourceId();
+        if (StrUtil.isBlank(resourceId)) {
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.PARAM_ERROR);
+        }
 
-        List<DataAuthRespVO> dataAuthRespVOList = new ArrayList<>();
-        dataAuthRespVOList.add(dataAuthRespVO);
-        return ResultRespVO.success(dataAuthRespVOList);
+        TokenDetailRespVo tokenInfo = tokenBusiness.getByAppTokenId(appTokenId, true, false);
+        AuthUserVo userInfo = tokenInfo.getUserInfo();
+        if (null == userInfo) {
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.AUTH_FAIL);
+        }
+
+        DataAuthV2ReqDTO v2ReqDTO = new DataAuthV2ReqDTO();
+        v2ReqDTO.setIdcard(userInfo.getIdcard());
+        v2ReqDTO.setResourceId(resourceId);
+
+        ResponseDTO<DataAuthV2RespDTO> dto = apiDataAuthFacade.dataItemsCheckV2(v2ReqDTO);
+        if (!ResponseUtil.isSuccess(dto)) {
+            return ResultRespVO.resultEnumMessage(BusinessRespEnum.AUTH_FAIL);
+        } else {
+            DataAuthV2RespDTO respDTO = (DataAuthV2RespDTO) dto.getResult();
+            Set<String> resultSet = respDTO.getItemIdentifier();
+            List<DataAuthRespVO> collect = Optional.ofNullable(resultSet).orElse(Collections.emptySet()).stream().map(e -> {
+                DataAuthRespVO vo = new DataAuthRespVO();
+                vo.setResourceId(resourceId);
+                vo.setItemIdentifier(e);
+                return vo;
+            }).collect(Collectors.toList());
+            return ResultRespVO.success(collect);
+        }
     }
 
     @PostMapping("userOrgDataAuth")

+ 47 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/AppTokenInfoRespVO.java

@@ -0,0 +1,47 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 应用令牌校验服务接口
+ * </p>
+ *
+ * @author huangzqa
+ * @date 2022/8/1
+ */
+@Data
+public class AppTokenInfoRespVO {
+
+    /**
+     * 应用标识
+     */
+    private String appId;
+
+    /**
+     * 用户令牌创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 用户令牌到期时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date expireAt;
+
+    /**
+     * 应用令牌ID
+     */
+    @JsonProperty("Id")
+    private String id;
+
+    /**
+     * 用户令牌详细信息
+     */
+    private UserTokenInfoRespVO userToken;
+}

+ 38 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/ResultRespPageVo.java

@@ -0,0 +1,38 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * @author mazq
+ * @date 2023/2/15
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class ResultRespPageVo<T> extends MessageRespVO {
+
+    private ResultPageContent<T> result;
+
+    /**
+     * 数据总条数
+     */
+    private Integer total;
+
+    /**
+     * 查询起始下标,默认 0,可不传
+     */
+    private Integer start;
+
+    /**
+     * 数据页大小 默认 1000,可不传
+     */
+    private Integer size;
+
+    @Data
+    public static class ResultPageContent<T> {
+        private List<T> rows;
+    }
+
+}

+ 45 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/TokenDetailRespVo.java

@@ -0,0 +1,45 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo;
+
+import com.dragoninfo.dcuc.auth.sub.vo.ApplyInfoVo;
+import com.dragoninfo.dcuc.authweb.restcontroller.sub.vo.user.AuthUserVo;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 令牌详情响应结果
+ *
+ * @author mazq
+ * @date 2023/2/14
+ */
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+@Data
+public class TokenDetailRespVo {
+
+    /**
+     * 根据令牌标识查询的用户信息
+     */
+    private AuthUserVo userInfo;
+
+    /**
+     * 根据令牌标识查询的应用信息
+     */
+    private ApplyInfoVo applyInfo;
+
+    /**
+     * 解析后的应用令牌
+     */
+    private AppTokenInfoRespVO appToken;
+
+    /**
+     * 解析后的用户令牌
+     */
+    private UserTokenInfoRespVO userToken;
+
+    public static TokenDetailRespVo empty() {
+        return new TokenDetailRespVo();
+    }
+}

+ 57 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/TokenUserInfoReqVo.java

@@ -0,0 +1,57 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+/**
+ * 认证服务用户请求Vo
+ * @author mazq
+ * @date 2023/2/15
+ */
+@Data
+public class TokenUserInfoReqVo {
+
+    /**
+     * 用户唯一标识
+     */
+    @JsonProperty("Id")
+    private String id;
+
+    /**
+     * 身份证号码
+     */
+    @JsonProperty("Idcard")
+    private String idcard;
+
+    /**
+     * 姓名
+     */
+    private String userName;
+
+    /**
+     * 姓名拼音
+     */
+    private String pinyin;
+
+    /**
+     * 组织机构编码
+     */
+    private String orgCode;
+
+    /**
+     * 警号
+     */
+    private String policeNo;
+
+    /**
+     * 查询起始下标,默认 0,可不传
+     */
+    private Integer start;
+
+    /**
+     * 数据页大小 默认 1000,可不传
+     */
+    private Integer size;
+
+
+}

+ 67 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/TokenUserInfoRespVo.java

@@ -0,0 +1,67 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+/**
+ * 认证服务用户信息响应Vo
+ *
+ * @author mazq
+ * @date 2023/2/15
+ */
+@Data
+public class TokenUserInfoRespVo {
+
+    /**
+     * 用户唯一标识
+     */
+    @JsonProperty("Id")
+    private String id;
+
+    /**
+     * 身份证号码
+     */
+    @JsonProperty("Idcard")
+    private String idcard;
+
+    /**
+     * 姓名
+     */
+    private String userName;
+
+    /**
+     * 组织机构编码
+     */
+    private String orgCode;
+
+    /**
+     * 组织机构名称
+     */
+    private String orgName;
+
+    /**
+     * 警种编码
+     */
+    private String policeType;
+
+    /**
+     * 岗位编码
+     */
+    private String positionCode;
+
+    /**
+     * 职务编码
+     */
+    private String dutyCode;
+
+    /**
+     * 手机号码
+     */
+    private String mobile;
+
+    /**
+     * 座机号码
+     */
+    private String telephone;
+
+}

+ 65 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v4/vo/UserTokenInfoRespVO.java

@@ -0,0 +1,65 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * <p>
+ * 用户令牌校验服务接口
+ * </p>
+ *
+ * @author huangzqa
+ * @date 2022/8/1
+ */
+@Data
+public class UserTokenInfoRespVO {
+
+    /**
+     * 用户标识
+     */
+    @JsonProperty("pId")
+    private String pId;
+
+    /**
+     * 用户名称
+     */
+    private String name;
+
+    /**
+     * 组织机构编码
+     */
+    private String orgCode;
+
+    /**
+     * 终端设备标识
+     */
+    @JsonProperty("mId")
+    private String mId;
+
+    /**
+     * 终端环境类型
+     */
+    private String env;
+
+    /**
+     * 用户令牌创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    /**
+     * 用户令牌到期时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date expireAt;
+
+    /**
+     * 用户令牌
+     */
+    @JsonProperty("Id")
+    private String id;
+
+}

+ 0 - 7
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/AppController.java

@@ -1,17 +1,10 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.app;
 
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.StrUtil;
-import com.alibaba.nacos.client.naming.utils.CollectionUtils;
 import com.dragoninfo.dcuc.app.dto.ApplyInfoDTO;
 import com.dragoninfo.dcuc.app.entity.ApplyInfo;
 import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
-import com.dragoninfo.dcuc.app.facade.IManufacturerInfoFacade;
-import com.dragoninfo.dcuc.auth.auth.vo.ApplicationInfoVO;
-import com.dragoninfo.dcuc.auth.power.facade.IApplicationInfoFacade;
-import com.dragoninfo.dcuc.auth.sub.dto.AuthOrgDTO;
 import com.dragoninfo.dcuc.auth.sub.facade.IAuthOrgInfoFacade;
-import com.dragoninfo.dcuc.authweb.business.MtAuthBusiness;
 import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.AppVo;
 import com.dragoninfo.dcuc.duceap.facade.IDuceapUploadFacade;
 import com.dragoninfo.duceap.core.enums.ResultEnum;

+ 1 - 1
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/ManufacturerInfoController.java

@@ -5,7 +5,7 @@
 //import com.dragoninfo.dcuc.app.entity.ManufacturerInfo;
 //import com.dragoninfo.dcuc.app.facade.IApplyInfoFacade;
 //import com.dragoninfo.dcuc.app.facade.IManufacturerInfoFacade;
-//import com.dragoninfo.dcuc.authweb.business.MtAuthBusiness;
+//import com.dragoninfo.dcuc.authweb.business.impl.MtAuthBusiness;
 //import com.dragoninfo.dcuc.authweb.common.SysConstants;
 //import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ManufacturerVo;
 //import com.dragoninfo.dcuc.org.facade.IOrgInfoFacade;

+ 1 - 3
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/sub/AuthOrgInfoController.java

@@ -4,7 +4,7 @@ import cn.hutool.core.util.StrUtil;
 import com.dragoninfo.dcuc.auth.sub.dto.AuthOrgDTO;
 import com.dragoninfo.dcuc.auth.sub.dto.OrgTreeNodeDTO;
 import com.dragoninfo.dcuc.auth.sub.facade.IAuthOrgInfoFacade;
-import com.dragoninfo.dcuc.authweb.business.MtAuthBusiness;
+import com.dragoninfo.dcuc.authweb.business.impl.MtAuthBusiness;
 import com.dragoninfo.dcuc.authweb.common.SysConstants;
 import com.dragoninfo.dcuc.authweb.restcontroller.org.vo.OrgRangeVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.sub.vo.org.AuthOrgVo;
@@ -18,13 +18,11 @@ import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
 import com.dragonsoft.duceap.base.entity.search.SearchDTO;
 import com.dragonsoft.duceap.base.entity.security.SecurityUser;
 import com.dragonsoft.duceap.base.utils.UserContextUtils;
-import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
 import com.dragonsoft.duceap.commons.util.string.StringUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.collections.ListUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;

+ 0 - 26
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkAppResultVo.java

@@ -1,26 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 安徽FK应用返回
- *
- * @author huangzqa
- * @date 2021/1/22
- **/
-@Data
-public class AhfkAppResultVo implements Serializable {
-
-    /**
-     * 应用名称
-     */
-    private String appName;
-
-    /**
-     * 应用代码
-     */
-    private String appCode;
-
-}

+ 0 - 36
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkFunctionResultVo.java

@@ -1,36 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 安徽FK功能资源返回
- *
- * @author huangzqa
- * @date 2021/1/22
- **/
-@Data
-public class AhfkFunctionResultVo implements Serializable {
-
-    /**
-     * 应用代码
-     */
-    private String appCode;
-
-    /**
-     * 资源代码
-     */
-    private String resourceCode;
-
-    /**
-     * 资源名称
-     */
-    private String resourceName;
-
-    /**
-     * 上级资源名称
-     */
-    private String upResourceCode;
-
-}

+ 0 - 26
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkRoleResultVo.java

@@ -1,26 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * 安徽FK角色返回
- *
- * @author huangzqa
- * @date 2021/1/22
- **/
-@Data
-public class AhfkRoleResultVo implements Serializable {
-
-    /**
-     * 角色代码
-     */
-    private String roleCode;
-
-    /**
-     * 角色名称
-     */
-    private String roleName;
-
-}

+ 0 - 18
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsAppReqVo.java

@@ -1,18 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * @author huangzqa
- * @date 2021/1/25
- **/
-@Data
-public class AhfkStatisticsAppReqVo {
-
-    /**
-     * 应用代码
-     */
-    private List<String> appCode;
-}

+ 0 - 21
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsAppRespVo.java

@@ -1,21 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-/**
- * @author huangzqa
- * @date 2021/1/25
- **/
-@Data
-public class AhfkStatisticsAppRespVo {
-
-    /**
-     * 应用代码
-     */
-    private String appCode;
-
-    /**
-     * 数量
-     */
-    private Integer number;
-}

+ 0 - 23
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsFuncReqVo.java

@@ -1,23 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * @author huangzqa
- * @date 2021/1/25
- **/
-@Data
-public class AhfkStatisticsFuncReqVo {
-
-    /**
-     * 应用代码
-     */
-    private String appCode;
-
-    /**
-     * 资源代码
-     */
-    private List<String> resourceCode;
-}

+ 0 - 26
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsFuncRespVo.java

@@ -1,26 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-/**
- * @author huangzqa
- * @date 2021/1/25
- **/
-@Data
-public class AhfkStatisticsFuncRespVo {
-
-    /**
-     * 应用代码
-     */
-    private String appCode;
-
-    /**
-     * 资源代码
-     */
-    private String resourceCode;
-
-    /**
-     * 数量
-     */
-    private Integer number;
-}

+ 0 - 23
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsOrgRoleReqVo.java

@@ -1,23 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-import java.util.List;
-
-/**
- * @author huangzqa
- * @date 2021/1/25
- **/
-@Data
-public class AhfkStatisticsOrgRoleReqVo {
-
-    /**
-     * 机构代码
-     */
-    private List<String> orgCode;
-
-    /**
-     * 角色代码
-     */
-    private List<String> roleCode;
-}

+ 0 - 34
src/main/java/com/dragoninfo/dcuc/authweb/vo/ahfk/AhfkStatisticsOrgRoleRespVo.java

@@ -1,34 +0,0 @@
-package com.dragoninfo.dcuc.authweb.vo.ahfk;
-
-import lombok.Data;
-
-/**
- * @author huangzqa
- * @date 2021/1/25
- **/
-@Data
-public class AhfkStatisticsOrgRoleRespVo {
-
-    /**
-     * 机构代码
-     */
-    private String orgCode;
-
-    /**
-     * 角色代码
-     */
-    private String roleCode;
-    /**
-     * 角色名称
-     */
-    private String roleName;
-    /**
-     * 应用名称
-     */
-    private String appName;
-
-    /**
-     * 数量
-     */
-    private Integer number;
-}