2021-04-09 20:19:31 +08:00
|
|
|
package ink.wgink.properties;
|
2021-02-25 23:23:47 +08:00
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ClassName: AccessControl
|
|
|
|
* @Description: 访问控制
|
|
|
|
* @Author: WangGeng
|
|
|
|
* @Date: 2019-06-12 22:01
|
|
|
|
* @Version: 1.0
|
|
|
|
**/
|
|
|
|
@Component
|
|
|
|
@ConfigurationProperties(prefix = "access-control")
|
|
|
|
public class AccessControlProperties {
|
|
|
|
|
2021-07-26 23:47:46 +08:00
|
|
|
private Boolean rolePermission;
|
2021-02-25 23:23:47 +08:00
|
|
|
private List<String> passPaths = new ArrayList<>(0);
|
|
|
|
|
2021-07-26 23:47:46 +08:00
|
|
|
public Boolean getRolePermission() {
|
|
|
|
return rolePermission == null ? true: rolePermission;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setRolePermission(Boolean rolePermission) {
|
|
|
|
this.rolePermission = rolePermission;
|
|
|
|
}
|
|
|
|
|
2021-02-25 23:23:47 +08:00
|
|
|
public List<String> getPassPaths() {
|
|
|
|
if (passPaths == null) {
|
|
|
|
return new ArrayList<>();
|
|
|
|
}
|
|
|
|
return passPaths;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPassPaths(List<String> passPaths) {
|
|
|
|
this.passPaths = passPaths;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
final StringBuilder sb = new StringBuilder("{");
|
2021-07-26 23:47:46 +08:00
|
|
|
sb.append("\"rolePermission\":")
|
|
|
|
.append(rolePermission);
|
|
|
|
sb.append(",\"passPaths\":")
|
2021-02-25 23:23:47 +08:00
|
|
|
.append(passPaths);
|
|
|
|
sb.append('}');
|
|
|
|
return sb.toString();
|
|
|
|
}
|
|
|
|
}
|