-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request !14 from 码匠君/develop
- Loading branch information
Showing
50 changed files
with
1,926 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...-core/src/main/java/cn/herodotus/oss/minio/core/converter/GroupInfoToDomainConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright (c) 2020-2030 ZHENGGENGWEI(码匠君)<herodotus@aliyun.com> | ||
* | ||
* Dante Cloud licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* <http://www.apache.org/licenses/LICENSE-2.0> | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Dante OSS 采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: | ||
* | ||
* 1.请不要删除和修改根目录下的LICENSE文件。 | ||
* 2.请不要删除和修改 Dante Cloud 源码头部的版权声明。 | ||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。 | ||
* 4.分发源码时候,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 6.若您的项目无法满足以上几点,可申请商业授权 | ||
*/ | ||
|
||
package cn.herodotus.oss.minio.core.converter; | ||
|
||
import cn.herodotus.oss.minio.core.domain.GroupDomain; | ||
import io.minio.admin.GroupInfo; | ||
import org.apache.commons.lang3.ObjectUtils; | ||
import org.springframework.core.convert.converter.Converter; | ||
|
||
/** | ||
* <p>Description: GroupInfo 转 GroupDomain 转换器 </p> | ||
* | ||
* @author : gengwei.zheng | ||
* @date : 2023/6/25 15:32 | ||
*/ | ||
public class GroupInfoToDomainConverter implements Converter<GroupInfo, GroupDomain> { | ||
@Override | ||
public GroupDomain convert(GroupInfo groupInfo) { | ||
|
||
GroupDomain domain = new GroupDomain(); | ||
|
||
if (ObjectUtils.isNotEmpty(groupInfo)) { | ||
domain.setName(groupInfo.name()); | ||
domain.setStatus(groupInfo.status()); | ||
domain.setMembers(groupInfo.members()); | ||
domain.setPolicy(groupInfo.policy()); | ||
} | ||
|
||
return domain; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...o-core/src/main/java/cn/herodotus/oss/minio/core/converter/UserInfoToDomainConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright (c) 2020-2030 ZHENGGENGWEI(码匠君)<herodotus@aliyun.com> | ||
* | ||
* Dante Cloud licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* <http://www.apache.org/licenses/LICENSE-2.0> | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Dante OSS 采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: | ||
* | ||
* 1.请不要删除和修改根目录下的LICENSE文件。 | ||
* 2.请不要删除和修改 Dante Cloud 源码头部的版权声明。 | ||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。 | ||
* 4.分发源码时候,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 6.若您的项目无法满足以上几点,可申请商业授权 | ||
*/ | ||
|
||
package cn.herodotus.oss.minio.core.converter; | ||
|
||
import cn.herodotus.oss.minio.core.domain.UserDomain; | ||
import io.minio.admin.Status; | ||
import io.minio.admin.UserInfo; | ||
import org.apache.commons.lang3.ObjectUtils; | ||
import org.springframework.core.convert.converter.Converter; | ||
|
||
/** | ||
* <p>Description: UserInfo 转 UserDomain 转换器 </p> | ||
* | ||
* @author : gengwei.zheng | ||
* @date : 2023/6/25 14:20 | ||
*/ | ||
public class UserInfoToDomainConverter implements Converter<UserInfo, UserDomain> { | ||
@Override | ||
public UserDomain convert(UserInfo userInfo) { | ||
|
||
UserDomain domain = new UserDomain(); | ||
|
||
if (ObjectUtils.isNotEmpty(userInfo)) { | ||
domain.setSecretKey(userInfo.secretKey()); | ||
domain.setPolicyName(userInfo.policyName()); | ||
domain.setMemberOf(userInfo.memberOf()); | ||
domain.setStatus(Status.fromString(userInfo.status().name())); | ||
} | ||
|
||
return domain; | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...nio-core/src/main/java/cn/herodotus/oss/minio/core/converter/UsersToDomainsConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2020-2030 ZHENGGENGWEI(码匠君)<herodotus@aliyun.com> | ||
* | ||
* Dante Cloud licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* <http://www.apache.org/licenses/LICENSE-2.0> | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Dante OSS 采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: | ||
* | ||
* 1.请不要删除和修改根目录下的LICENSE文件。 | ||
* 2.请不要删除和修改 Dante Cloud 源码头部的版权声明。 | ||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。 | ||
* 4.分发源码时候,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 6.若您的项目无法满足以上几点,可申请商业授权 | ||
*/ | ||
|
||
package cn.herodotus.oss.minio.core.converter; | ||
|
||
import cn.herodotus.oss.minio.core.domain.UserDomain; | ||
import io.minio.admin.UserInfo; | ||
import org.apache.commons.collections4.MapUtils; | ||
import org.springframework.core.convert.converter.Converter; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* <p>Description: UserInfo Map 转 List<UserDomain> 转换器 </p> | ||
* | ||
* @author : gengwei.zheng | ||
* @date : 2023/6/25 14:51 | ||
*/ | ||
public class UsersToDomainsConverter implements Converter<Map<String, UserInfo>, List<UserDomain>> { | ||
|
||
private final Converter<UserInfo, UserDomain> toDomain = new UserInfoToDomainConverter(); | ||
|
||
@Override | ||
public List<UserDomain> convert(Map<String, UserInfo> source) { | ||
if (MapUtils.isNotEmpty(source)) { | ||
return source.entrySet().stream().map(entry -> { | ||
UserDomain domain = toDomain.convert(entry.getValue()); | ||
domain.setAccessKey(entry.getKey()); | ||
return domain; | ||
}).toList(); | ||
} | ||
|
||
return Collections.emptyList(); | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
oss-minio/minio-core/src/main/java/cn/herodotus/oss/minio/core/domain/GroupDomain.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright (c) 2020-2030 ZHENGGENGWEI(码匠君)<herodotus@aliyun.com> | ||
* | ||
* Dante Cloud licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* <http://www.apache.org/licenses/LICENSE-2.0> | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* Dante OSS 采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: | ||
* | ||
* 1.请不要删除和修改根目录下的LICENSE文件。 | ||
* 2.请不要删除和修改 Dante Cloud 源码头部的版权声明。 | ||
* 3.请保留源码和相关描述文件的项目出处,作者声明等。 | ||
* 4.分发源码时候,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 5.在修改包名,模块名称,项目代码等时,请注明软件出处 <https://gitee.com/herodotus/dante-oss> | ||
* 6.若您的项目无法满足以上几点,可申请商业授权 | ||
*/ | ||
|
||
package cn.herodotus.oss.minio.core.domain; | ||
|
||
import cn.herodotus.engine.assistant.core.definition.domain.Entity; | ||
import io.minio.admin.Status; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* <p>Description: Minio Group Domain </p> | ||
* | ||
* @author : gengwei.zheng | ||
* @date : 2023/6/25 15:24 | ||
*/ | ||
public class GroupDomain implements Entity { | ||
|
||
private String name; | ||
|
||
private Status status; | ||
|
||
private List<String> members; | ||
|
||
private String policy; | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Status getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(Status status) { | ||
this.status = status; | ||
} | ||
|
||
public List<String> getMembers() { | ||
return members; | ||
} | ||
|
||
public void setMembers(List<String> members) { | ||
this.members = members; | ||
} | ||
|
||
public String getPolicy() { | ||
return policy; | ||
} | ||
|
||
public void setPolicy(String policy) { | ||
this.policy = policy; | ||
} | ||
} |
Oops, something went wrong.