-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
926 additions
and
460 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
...ew-admin-system/src/main/java/top/charles7c/continew/admin/system/enums/FileTypeEnum.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,65 @@ | ||
/* | ||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. | ||
* | ||
* 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 top.charles7c.continew.admin.system.enums; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import top.charles7c.continew.starter.data.mybatis.plus.base.IBaseEnum; | ||
|
||
/** | ||
* 文件分类枚举 | ||
* | ||
* @author Charles7c | ||
* @since 2023/12/23 13:38 | ||
*/ | ||
@Getter | ||
@RequiredArgsConstructor | ||
public enum FileTypeEnum implements IBaseEnum<Integer> { | ||
|
||
/** | ||
* 其他 | ||
*/ | ||
UNKNOWN(1, "其他", Collections.emptyList()), | ||
|
||
/** | ||
* 图片 | ||
*/ | ||
IMAGE(2, "图片", List.of("jpg", "png", "gif", "bmp", "webp", "ico", "psd", "tiff", "dwg", "jxr", "apng", "xcf")), | ||
|
||
/** | ||
* 文档 | ||
*/ | ||
DOC(3, "文档", List.of("txt", "pdf", "doc", "xls", "ppt", "docx", "xlsx", "pptx")), | ||
|
||
/** | ||
* 视频 | ||
*/ | ||
VIDEO(4, "视频", List.of("mp4", "avi", "mkv", "flv", "webm", "wmv", "m4v", "mov", "mpg", "rmvb", "3gp")), | ||
|
||
/** | ||
* 音频 | ||
*/ | ||
AUDIO(5, "音频", List.of("mp3", "flac", "wav", "ogg", "midi", "m4a", "aac", "amr", "ac3", "aiff")),; | ||
|
||
private final Integer value; | ||
private final String description; | ||
private final List<String> extensions; | ||
} |
28 changes: 28 additions & 0 deletions
28
...new-admin-system/src/main/java/top/charles7c/continew/admin/system/mapper/FileMapper.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,28 @@ | ||
/* | ||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. | ||
* | ||
* 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 top.charles7c.continew.admin.system.mapper; | ||
|
||
import top.charles7c.continew.admin.system.model.entity.FileDO; | ||
import top.charles7c.continew.starter.data.mybatis.plus.base.BaseMapper; | ||
|
||
/** | ||
* 文件 Mapper | ||
* | ||
* @author Charles7c | ||
* @since 2023/12/23 10:38 | ||
*/ | ||
public interface FileMapper extends BaseMapper<FileDO> {} |
75 changes: 75 additions & 0 deletions
75
...w-admin-system/src/main/java/top/charles7c/continew/admin/system/model/entity/FileDO.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,75 @@ | ||
/* | ||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. | ||
* | ||
* 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 top.charles7c.continew.admin.system.model.entity; | ||
|
||
import java.io.Serial; | ||
|
||
import lombok.Data; | ||
|
||
import com.baomidou.mybatisplus.annotation.TableName; | ||
|
||
import top.charles7c.continew.admin.system.enums.FileTypeEnum; | ||
import top.charles7c.continew.starter.extension.crud.base.BaseDO; | ||
|
||
/** | ||
* 文件实体 | ||
* | ||
* @author Charles7c | ||
* @since 2023/12/23 10:38 | ||
*/ | ||
@Data | ||
@TableName("sys_file") | ||
public class FileDO extends BaseDO { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* 名称 | ||
*/ | ||
private String name; | ||
|
||
/** | ||
* 大小(字节) | ||
*/ | ||
private Long size; | ||
|
||
/** | ||
* URL | ||
*/ | ||
private String url; | ||
|
||
/** | ||
* 扩展名 | ||
*/ | ||
private String extension; | ||
|
||
/** | ||
* MIME类型 | ||
*/ | ||
private String mimeType; | ||
|
||
/** | ||
* 类型 | ||
*/ | ||
private FileTypeEnum type; | ||
|
||
/** | ||
* 存储库ID | ||
*/ | ||
private Long storageId; | ||
} |
55 changes: 55 additions & 0 deletions
55
...admin-system/src/main/java/top/charles7c/continew/admin/system/model/query/FileQuery.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) 2022-present Charles7c Authors. All Rights Reserved. | ||
* | ||
* 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 top.charles7c.continew.admin.system.model.query; | ||
|
||
import java.io.Serial; | ||
import java.io.Serializable; | ||
|
||
import lombok.Data; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import top.charles7c.continew.starter.data.mybatis.plus.query.Query; | ||
import top.charles7c.continew.starter.data.mybatis.plus.query.QueryType; | ||
|
||
/** | ||
* 文件查询条件 | ||
* | ||
* @author Charles7c | ||
* @since 2023/12/23 10:38 | ||
*/ | ||
@Data | ||
@Schema(description = "文件查询条件") | ||
public class FileQuery implements Serializable { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* 名称 | ||
*/ | ||
@Schema(description = "名称") | ||
@Query(type = QueryType.INNER_LIKE) | ||
private String name; | ||
|
||
/** | ||
* 类型 | ||
*/ | ||
@Schema(description = "类型") | ||
@Query(type = QueryType.EQUAL) | ||
private Integer type; | ||
} |
39 changes: 39 additions & 0 deletions
39
...new-admin-system/src/main/java/top/charles7c/continew/admin/system/model/req/FileReq.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,39 @@ | ||
/* | ||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. | ||
* | ||
* 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 top.charles7c.continew.admin.system.model.req; | ||
|
||
import java.io.Serial; | ||
|
||
import lombok.Data; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import top.charles7c.continew.starter.extension.crud.base.BaseReq; | ||
|
||
/** | ||
* 创建或修改文件信息 | ||
* | ||
* @author Charles7c | ||
* @since 2023/12/23 10:38 | ||
*/ | ||
@Data | ||
@Schema(description = "创建或修改文件信息") | ||
public class FileReq extends BaseReq { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 1L; | ||
} |
93 changes: 93 additions & 0 deletions
93
...n-system/src/main/java/top/charles7c/continew/admin/system/model/resp/FileDetailResp.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,93 @@ | ||
/* | ||
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. | ||
* | ||
* 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 top.charles7c.continew.admin.system.model.resp; | ||
|
||
import java.io.Serial; | ||
|
||
import lombok.Data; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||
import com.alibaba.excel.annotation.ExcelProperty; | ||
|
||
import top.charles7c.continew.admin.system.enums.FileTypeEnum; | ||
import top.charles7c.continew.starter.extension.crud.base.BaseDetailResp; | ||
|
||
/** | ||
* 文件详情信息 | ||
* | ||
* @author Charles7c | ||
* @since 2023/12/23 10:38 | ||
*/ | ||
@Data | ||
@ExcelIgnoreUnannotated | ||
@Schema(description = "文件详情信息") | ||
public class FileDetailResp extends BaseDetailResp { | ||
|
||
@Serial | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* 名称 | ||
*/ | ||
@Schema(description = "名称") | ||
@ExcelProperty(value = "名称") | ||
private String name; | ||
|
||
/** | ||
* 大小(字节) | ||
*/ | ||
@Schema(description = "大小(字节)") | ||
@ExcelProperty(value = "大小(字节)") | ||
private Long size; | ||
|
||
/** | ||
* URL | ||
*/ | ||
@Schema(description = "URL") | ||
@ExcelProperty(value = "URL") | ||
private String url; | ||
|
||
/** | ||
* 扩展名 | ||
*/ | ||
@Schema(description = "扩展名") | ||
@ExcelProperty(value = "扩展名") | ||
private String extension; | ||
|
||
/** | ||
* MIME类型 | ||
*/ | ||
@Schema(description = "MIME类型") | ||
@ExcelProperty(value = "MIME类型") | ||
private String mimeType; | ||
|
||
/** | ||
* 类型 | ||
*/ | ||
@Schema(description = "类型") | ||
@ExcelProperty(value = "类型") | ||
private FileTypeEnum type; | ||
|
||
/** | ||
* 存储库ID | ||
*/ | ||
@Schema(description = "存储库ID") | ||
@ExcelProperty(value = "存储库ID") | ||
private Long storageId; | ||
} |
Oops, something went wrong.