From 85f5b9d435427f7ebb5a50402149786ac384826e Mon Sep 17 00:00:00 2001 From: mabofu Date: Tue, 17 Jan 2023 13:52:48 +0800 Subject: [PATCH] Add file system feature model --- .../controller/FileSystemController.java | 28 +++++++++++ .../service/impl/FileSystemServiceImpl.java | 24 ++++++++++ .../common/constant/FileSystemStatusEnum.java | 36 +++++++++++++++ .../dsms/dfsbroker/filesystem/FileSystem.java | 46 +++++++++++++++++++ .../service/IFileSystemService.java | 22 +++++++++ 5 files changed, 156 insertions(+) create mode 100644 dsms-engine-application/src/main/java/com/dsms/modules/filesystem/controller/FileSystemController.java create mode 100644 dsms-engine-application/src/main/java/com/dsms/modules/filesystem/service/impl/FileSystemServiceImpl.java create mode 100644 dsms-engine-common/src/main/java/com/dsms/common/constant/FileSystemStatusEnum.java create mode 100644 dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/FileSystem.java create mode 100644 dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/service/IFileSystemService.java diff --git a/dsms-engine-application/src/main/java/com/dsms/modules/filesystem/controller/FileSystemController.java b/dsms-engine-application/src/main/java/com/dsms/modules/filesystem/controller/FileSystemController.java new file mode 100644 index 0000000..b9665dd --- /dev/null +++ b/dsms-engine-application/src/main/java/com/dsms/modules/filesystem/controller/FileSystemController.java @@ -0,0 +1,28 @@ +/* + * Copyright 2022 The DSMS Authors. + * + * 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. + */ + +package com.dsms.modules.filesystem.controller; + +import io.swagger.annotations.Api; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/api/cephfs") +@Api(tags = "文件系统模块") +public class FileSystemController { + +} diff --git a/dsms-engine-application/src/main/java/com/dsms/modules/filesystem/service/impl/FileSystemServiceImpl.java b/dsms-engine-application/src/main/java/com/dsms/modules/filesystem/service/impl/FileSystemServiceImpl.java new file mode 100644 index 0000000..76d63a0 --- /dev/null +++ b/dsms-engine-application/src/main/java/com/dsms/modules/filesystem/service/impl/FileSystemServiceImpl.java @@ -0,0 +1,24 @@ +/* + * Copyright 2022 The DSMS Authors. + * + * 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. + */ + +package com.dsms.modules.filesystem.service.impl; + +import com.dsms.dfsbroker.filesystem.service.IFileSystemService; +import org.springframework.stereotype.Service; + +@Service +public class FileSystemServiceImpl implements IFileSystemService { +} diff --git a/dsms-engine-common/src/main/java/com/dsms/common/constant/FileSystemStatusEnum.java b/dsms-engine-common/src/main/java/com/dsms/common/constant/FileSystemStatusEnum.java new file mode 100644 index 0000000..6bd30b9 --- /dev/null +++ b/dsms-engine-common/src/main/java/com/dsms/common/constant/FileSystemStatusEnum.java @@ -0,0 +1,36 @@ +/* + * Copyright 2022 The DSMS Authors. + * + * 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. + */ + +package com.dsms.common.constant; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum FileSystemStatusEnum { + /** + * file system is stopped + */ + DOWN(0, "停用"), + /** + * file system is running + */ + ACTIVE(1, "运行"); + + private final int status; + private final String message; +} diff --git a/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/FileSystem.java b/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/FileSystem.java new file mode 100644 index 0000000..af2cd3a --- /dev/null +++ b/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/FileSystem.java @@ -0,0 +1,46 @@ +/* + * Copyright 2022 The DSMS Authors. + * + * 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. + */ + +package com.dsms.dfsbroker.filesystem; + + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "FileSystem对象", description = "文件系统") +public class FileSystem { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(name = "文件系统名称") + private String fsName; + + @ApiModelProperty(name = "元数据存储池") + private String metadataPoolName; + + @ApiModelProperty(name = "数据存储池") + private String dataPoolName; + + @ApiModelProperty(name = "文件系统用量") + private String dataPoolUsedSize; + + @ApiModelProperty(name = "文件系统容量") + private String dataPoolTotalSize; + + @ApiModelProperty(name = "文件系统状态(0-停用,1-运行") + private Integer status; +} diff --git a/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/service/IFileSystemService.java b/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/service/IFileSystemService.java new file mode 100644 index 0000000..5c73e4e --- /dev/null +++ b/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/filesystem/service/IFileSystemService.java @@ -0,0 +1,22 @@ +/* + * Copyright 2022 The DSMS Authors. + * + * 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. + */ + +package com.dsms.dfsbroker.filesystem.service; + +public interface IFileSystemService { + + +} -- Gitee