mazq 1 год назад
Родитель
Сommit
d7ef60c8e2

+ 3 - 2
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/controller/ApprovalApiController.java

@@ -1,6 +1,7 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller;
 
 import com.dragoninfo.dcuc.auth.api.vo.zerotrust.ZeroTrustMessageRespVO;
+import com.dragoninfo.dcuc.auth.auth.api.IZeroTrustAuthApplyFacade;
 import com.dragoninfo.dcuc.auth.auth.facade.IApprovalFacade;
 import com.dragoninfo.dcuc.auth.auth.vo.zerotrust.approval.ApprovalCallBackReqVO;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,11 +16,11 @@ import javax.validation.Valid;
 @RequestMapping(value = "api/auth-service/v1/approval")
 public class ApprovalApiController {
     @Autowired
-    private IApprovalFacade iApprovalFacade;
+    private IZeroTrustAuthApplyFacade zeroTrustAuthApplyFacade;
 
     @PostMapping("call-back")
     public ZeroTrustMessageRespVO approvalCallBack(@Valid @RequestBody ApprovalCallBackReqVO approvalCallBackReqVO) {
-        return iApprovalFacade.callBack(approvalCallBackReqVO);
+        return zeroTrustAuthApplyFacade.callBack(approvalCallBackReqVO);
     }
 
 }

+ 44 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/controller/AuthApplyApiController.java

@@ -0,0 +1,44 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller;
+
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.ZeroTrustDataRespVO;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.ZeroTrustMessageRespVO;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authapply.ApiRoleAuthReqVo;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authapply.AuthApplyRespVo;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.role.ApiAppRoleRespVo;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.role.ApiRolesReqVo;
+import com.dragoninfo.dcuc.auth.auth.api.IZeroTrustAuthApplyFacade;
+import com.dragoninfo.dcuc.auth.auth.api.IZeroTrustAuthFacade;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * @author mazq
+ * @date 2023/11/22
+ */
+@RestController
+@RequestMapping("api/auth-service/v1/")
+public class AuthApplyApiController {
+
+    @Autowired
+    private IZeroTrustAuthApplyFacade zeroTrustAuthApplyFacade;
+
+    @ApiOperation(value = "角色授权申请")
+    @PostMapping("roles")
+    public ZeroTrustDataRespVO<List<ApiAppRoleRespVo>> appRoleInfos(@Valid @RequestBody ApiRolesReqVo reqVo) {
+        return zeroTrustAuthApplyFacade.appRoleInfos(reqVo);
+    }
+
+    @ApiOperation(value = "角色授权申请")
+    @PostMapping("auth-apply/role")
+    public ZeroTrustDataRespVO<AuthApplyRespVo> roleAuthApply(@Valid @RequestBody ApiRoleAuthReqVo reqVo) {
+        return zeroTrustAuthApplyFacade.roleAuthApply(reqVo);
+    }
+
+}

+ 0 - 32
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/controller/WorkFlowApiController.java

@@ -1,17 +1,11 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.controller;
 
-import com.auth0.jwt.JWT;
-import com.auth0.jwt.interfaces.DecodedJWT;
 import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthFlowDTO;
-import com.dragoninfo.dcuc.auth.auth.dto.WorkFlowResutlAcceptDTO;
-import com.dragoninfo.dcuc.auth.auth.enumresources.WorkFlowStatusEnum;
 import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFlowFacade;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.AuthFlowRepeatCheckVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ResourceInfoVo;
 import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.ServiceAuthFlowAcceptVo;
-import com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo.WorkFlowResutlAcceptVo;
 import com.dragoninfo.dcuc.authweb.util.HeadTokenUtils;
-import com.dragoninfo.dcuc.common.Constants;
 import com.dragoninfo.dcuc.common.entity.ApiResult;
 import com.dragonsoft.duceap.base.entity.http.ResponseDTO;
 import com.dragonsoft.duceap.base.entity.http.ResponseStatus;
@@ -22,7 +16,6 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
 import org.springframework.stereotype.Controller;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -32,7 +25,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
-import java.util.Optional;
 
 /**
  * @author mazq
@@ -96,7 +88,6 @@ public class WorkFlowApiController {
         }
     }
 
-
     /**
      * 服务授权撤销是否存在授权结果
      */
@@ -118,29 +109,6 @@ public class WorkFlowApiController {
         }
     }
 
-
-
-//    /**
-//     * 服务授权工作单审批结果处理
-//     * 提供接口
-//     * 也提供kafka消息的形式
-//     * kafka形式在auth服务内部处理
-//     */
-//    @ApiOperation(value = "服务授权工作单审批结果处理")
-//    @ApiImplicitParams({@ApiImplicitParam(name = "workFlowResutlVo", value = "审批结果vo")})
-//    @PostMapping(value = "service-result", consumes = MediaType.APPLICATION_JSON_VALUE)
-//    @ResponseBody
-//    public ApiResult dealAuthFlowResult(@RequestBody WorkFlowResutlAcceptVo flowResutlVo) {
-//        WorkFlowResutlAcceptDTO dto = new WorkFlowResutlAcceptDTO();
-//        dto.setApproveResult(WorkFlowStatusEnum.SUCCESS.getValue());
-//        dto.setProcessInstanceId(flowResutlVo.getProcessInstanceId());
-//        dto.setRemark(flowResutlVo.getDesc());
-//        dto.setMessageId(flowResutlVo.getMessageId());
-//        serviceAuthFlowFacade.dealAuthFlowResult(dto);
-//        return ApiResult.setSuccess();
-//    }
-
-
     /**
      * 设置申请单appCode和serviceCode信息
      */

+ 97 - 0
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/vo/AuthFlowAcceptBaseVo.java

@@ -0,0 +1,97 @@
+package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotBlank;
+import java.util.Date;
+
+/**
+ * @author mazq
+ * @date 2023/11/21
+ */
+@Data
+@ApiModel(value = "权限流程申请基础Vo")
+public class AuthFlowAcceptBaseVo {
+
+    /**
+     * 流程类型
+     */
+    @ApiModelProperty(value = "流程类型")
+    private String processType;
+
+    /**
+     * 流程标识码
+     */
+    @ApiModelProperty(value = "流程标识码")
+    private String businessCode;
+
+
+    /**
+     * 工作单类型
+     * SERVICE_AUTH-服务授权工作单 SERVICE_CANCEL-服务权限撤销工作单
+     */
+    @ApiModelProperty(value = "工作单类型 SERVICE_AUTH-服务授权工作单 SERVICE_CANCEL-服务权限撤销工作单")
+    private String flowType;
+
+
+    /**
+     * 申请理由
+     */
+    @ApiModelProperty(value = "申请理由")
+    @NotBlank
+    private String applyReason;
+
+    /**
+     * 申请人身份证号
+     */
+    @ApiModelProperty(value = "申请人身份证号")
+    @NotBlank
+    private String applicantIdcard;
+    /**
+     * 申请人姓名
+     */
+    @ApiModelProperty(value = "申请人姓名")
+    @NotBlank
+    private String applicantName;
+
+    /**
+     * 申请机构code
+     */
+    @ApiModelProperty(value = "申请人单位编码")
+    @NotBlank
+    private String applicantOrgCode;
+    /**
+     * 申请机构名称
+     */
+    @ApiModelProperty(value = "申请人单位名称")
+    @NotBlank
+    private String applicantOrgName;
+
+    /**
+     * 申请人联系方式
+     */
+    @ApiModelProperty(value = "申请人联系方式")
+    @NotBlank
+    private String applicantPhoneNo;
+
+    /**
+     * 权限有效类型(01:自定义 | 02:长期)
+     */
+    @ApiModelProperty(value = "权限有效类型")
+    @NotBlank
+    private String permissionValidType;
+
+    @ApiModelProperty(value = "权限有效起始时间(2020-01-01 00:00:00)")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date startTime;
+
+    @ApiModelProperty(value = "权限有效终止时间(2020-01-01 00:00:00)")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
+}

+ 3 - 81
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/api/authservice/v1/vo/ServiceAuthFlowAcceptVo.java

@@ -1,15 +1,12 @@
 package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v1.vo;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
+import lombok.EqualsAndHashCode;
 
 import javax.validation.Valid;
-import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -18,15 +15,11 @@ import java.util.List;
  * @author mazq
  * @date 2021/2/19
  */
+@EqualsAndHashCode(callSuper = true)
 @ApiModel(value = "提交工作流申请信息Vo")
 @Data
-public class ServiceAuthFlowAcceptVo {
+public class ServiceAuthFlowAcceptVo extends AuthFlowAcceptBaseVo {
 
-    /**
-     * 流程类型
-     */
-    @ApiModelProperty(value = "流程类型")
-    private String processType;
     /**
      * 工单号
      */
@@ -34,69 +27,6 @@ public class ServiceAuthFlowAcceptVo {
     private String applicantId;
 
 
-    /**
-     * 流程标识码
-     */
-    @ApiModelProperty(value = "流程标识码")
-    private String businessCode;
-
-    /**
-     * 申请理由
-     */
-    @ApiModelProperty(value = "申请理由")
-    @NotBlank
-    private String applyReason;
-
-    /**
-     * 申请人身份证号
-     */
-    @ApiModelProperty(value = "申请人身份证号")
-    @NotBlank
-    private String applicantIdcard;
-    /**
-     * 申请人姓名
-     */
-    @ApiModelProperty(value = "申请人姓名")
-    @NotBlank
-    private String applicantName;
-
-    /**
-     * 申请机构code
-     */
-    @ApiModelProperty(value = "申请人单位编码")
-    @NotBlank
-    private String applicantOrgCode;
-    /**
-     * 申请机构名称
-     */
-    @ApiModelProperty(value = "申请人单位名称")
-    @NotBlank
-    private String applicantOrgName;
-
-    /**
-     * 申请人联系方式
-     */
-    @ApiModelProperty(value = "申请人联系方式")
-    @NotBlank
-    private String applicantPhoneNo;
-
-    /**
-     * 权限有效类型(01:自定义 | 02:长期)
-     */
-    @ApiModelProperty(value = "权限有效类型")
-    @NotBlank
-    private String permissionValidType;
-
-    @ApiModelProperty(value = "权限有效起始时间(2020-01-01 00:00:00)")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date startTime;
-
-    @ApiModelProperty(value = "权限有效终止时间(2020-01-01 00:00:00)")
-    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    private Date endTime;
-
     @ApiModelProperty(value = "服务共享方式")
     private String fwgxfs;
 
@@ -108,14 +38,6 @@ public class ServiceAuthFlowAcceptVo {
     @NotNull
     private ResourceInfoVo resourceInfo;
 
-    /**
-     * 工作单类型
-     * SERVICE_AUTH-服务授权工作单 SERVICE_CANCEL-服务权限撤销工作单
-     */
-    @ApiModelProperty(value = "工作单类型 SERVICE_AUTH-服务授权工作单 SERVICE_CANCEL-服务权限撤销工作单")
-    private String flowType;
-
-
     @ApiModelProperty(value = "下一任务对象信息")
     private List<ActivitiHolderVo> activitiHolderList;
 }

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

@@ -3,7 +3,8 @@ package com.dragoninfo.dcuc.authweb.restcontroller.api.authservice.v4.controller
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSON;
 import com.dragoninfo.dcuc.auth.api.enums.zerotrust.ZeroTrustBusinessRespEnum;
-import com.dragoninfo.dcuc.auth.api.vo.zerotrust.*;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.ZeroTrustDataRespVO;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.authticate.*;
 import com.dragoninfo.dcuc.auth.auth.api.IZeroTrustAuthFacade;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;