Skip to content

Commit

Permalink
fix auth bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cyjseagull committed Oct 30, 2024
1 parent 316ba7c commit 139e903
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package com.webank.wedpr.components.authorization.dao;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.webank.wedpr.common.config.WeDPRCommonConfig;
import com.webank.wedpr.common.utils.TimeRange;
import com.webank.wedpr.components.authorization.model.AuthChain;
Expand All @@ -24,10 +25,15 @@
import com.webank.wedpr.components.uuid.generator.WeDPRUuidGenerator;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@EqualsAndHashCode(callSuper = true)
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class AuthorizationDO extends TimeRange {
private static final Logger logger = LoggerFactory.getLogger(AuthorizationDO.class);

Expand Down Expand Up @@ -156,64 +162,13 @@ public AuthorizationDO(
setResult(result);
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getApplicant() {
return applicant;
}

public void setApplicant(String applicant) {
this.applicant = applicant;
}

public String getApplicantAgency() {
return applicantAgency;
}

public void setApplicantAgency(String applicantAgency) {
this.applicantAgency = applicantAgency;
}

public String getApplyType() {
return applyType;
}

public void setApplyType(String applyType) {
this.applyType = applyType;
}

public String getApplyTitle() {
return applyTitle;
}

public void setApplyTitle(String applyTitle) {
this.applyTitle = applyTitle;
}

public String getApplyDesc() {
return applyDesc;
}

public void setApplyDesc(String applyDesc) {
this.applyDesc = applyDesc;
}

public String getApplyChain() {
return applyChain;
}

public List<String> getAuthIDList() {
return authIDList;
}

public void setAuthIDList(List<String> authIDList) {
this.authIDList = authIDList;
if (this.followerDOList != null && !this.followerDOList.isEmpty()) {
for (FollowerDO followerDO : this.followerDOList) {
followerDO.setId(id);
}
}
}

public void setApplyChain(String applyChain) {
Expand All @@ -224,10 +179,6 @@ public void setApplyChain(String applyChain) {
this.authChain = AuthChain.deserialize(applyChain);
}

public AuthChain getAuthChain() {
return authChain;
}

public void setAuthChain(AuthChain authChain) {
this.authChain = authChain;
if (authChain == null) {
Expand All @@ -236,30 +187,6 @@ public void setAuthChain(AuthChain authChain) {
this.applyChain = this.authChain.serialize();
}

public String getApplyContent() {
return applyContent;
}

public void setApplyContent(String applyContent) {
this.applyContent = applyContent;
}

public String getApplyTemplateName() {
return applyTemplateName;
}

public void setApplyTemplateName(String applyTemplateName) {
this.applyTemplateName = applyTemplateName;
}

public String getStatus() {
return status;
}

public AuthStatus getAuthStatus() {
return authStatus;
}

public void setAuthStatus(AuthStatus authStatus) {
this.authStatus = authStatus;
if (authStatus == null) {
Expand All @@ -277,42 +204,6 @@ public void setStatus(String status) {
this.authStatus = AuthStatus.deserialize(status);
}

public String getCurrentApplyNode() {
return currentApplyNode;
}

public void setCurrentApplyNode(String currentApplyNode) {
this.currentApplyNode = currentApplyNode;
}

public String getCurrentApplyNodeAgency() {
return currentApplyNodeAgency;
}

public void setCurrentApplyNodeAgency(String currentApplyNodeAgency) {
this.currentApplyNodeAgency = currentApplyNodeAgency;
}

public String getCreateTime() {
return createTime;
}

public void setCreateTime(String createTime) {
this.createTime = createTime;
}

public String getLastUpdateTime() {
return lastUpdateTime;
}

public void setLastUpdateTime(String lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}

public String getResult() {
return result;
}

public void setResult(String result) {
this.result = result;
if (StringUtils.isBlank(result)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ private void updateAuthResult(
AuthorizationDO authorizationDO,
AuthorizationDO lastRecorder,
AuthResultStatus authResultStatus) {
authorizationDO.setAuthChain(lastRecorder.getAuthChain());
if (authorizationDO.getAuthChain() == null) {
authorizationDO.setAuthChain(lastRecorder.getAuthChain());
}
authorizationDO.setResult(lastRecorder.getResult());
// update the authResult
AuthResult.AuthResultDetail authResultDetail = new AuthResult.AuthResultDetail();
Expand Down

0 comments on commit 139e903

Please sign in to comment.