diff --git a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongoFileApi.java b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongoFileApi.java index 028f45a50..0af3915f4 100644 --- a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongoFileApi.java +++ b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongoFileApi.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.api; import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult; @@ -5,37 +29,51 @@ import org.springframework.web.multipart.MultipartFile; import java.util.Optional; /** + * Mongodb文件管理API + * * @author huziyang - * @create 2021-03-30 11:06 + * @date 2021/03/30 11:06 */ public interface MongoFileApi { /** * 保存文件 - * @param file - * @return + * + * @param file 上传的文件对象 + * @return 返回数据结果 + * @author huziyang + * @date 2021/03/30 11:06 */ T saveFile(MultipartFile file); /** - * 删除文件 - * @param id + * 根据id删除文件 + * + * @param id 集合id + * @author huziyang + * @date 2021/03/30 11:06 */ void removeFile(ID id); /** * 根据id获取文件 - * @param id - * @return + * + * @param id 集合id + * @return 返回查询到数据的Optional + * @author huziyang + * @date 2021/03/30 11:06 */ Optional getFileById(ID id); /** - * 分页获取文件 + * 分页获取文件列表 + * * @param fileDocument 查询条件 - * @return + * @return 返回查询文件的分页结果 + * @author huziyang + * @date 2021/03/30 11:06 */ PageResult getFilesByPage(T fileDocument); diff --git a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongodbApi.java b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongodbApi.java index 0e7ccf858..b52554cfd 100644 --- a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongodbApi.java +++ b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/MongodbApi.java @@ -1,46 +1,85 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.api; - - import java.util.List; import java.util.Optional; /** + * Mongodb数据存储的api,适用于存map类型数据,存储在guns_map集合中 + * * @author huziyang - * @create 2021-03-20 16:24 + * @date 2021/03/20 16:24 */ public interface MongodbApi { /** - * 新增操作 - * @param gunsMapEntity - * @return + * 新增数据 + * + * @param gunsMapEntity 数据存储的参数 + * @return 返回数据结果 + * @author huziyang + * @date 2020/10/27 17:38 */ T insert(T gunsMapEntity); /** - * 修改 - * @param gunsMapEntity - * @return + * 修改数据 + * + * @param gunsMapEntity 数据存储的参数 + * @return 返回数据结果 + * @author huziyang + * @date 2020/10/27 17:38 */ T update(T gunsMapEntity); /** * 根据id删除 - * @param id + * + * @param id 集合id + * @author huziyang + * @date 2020/10/27 17:38 */ void deleteById(ID id); /** * 根据id查询 - * @param id - * @return + * + * @param id 集合id + * @return 返回查询到数据的Optional + * @author huziyang + * @date 2020/10/27 17:38 */ Optional findById(ID id); /** - * 查询所有 - * @return + * 查询所有数据 + * + * @return 返回所有数据列表 + * @author huziyang + * @date 2020/10/27 17:38 */ List findAll(); } diff --git a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/constants/MongodbConstants.java b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/constants/MongodbConstants.java index 0938ce64f..5b919d4f4 100644 --- a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/constants/MongodbConstants.java +++ b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/constants/MongodbConstants.java @@ -1,8 +1,34 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.api.constants; /** + * Mongodb模块的常量 + * * @author huziyang - * @create 2021-03-20 16:24 + * @date 2021/03/20 16:24 */ public interface MongodbConstants { diff --git a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/exception/MongodbException.java b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/exception/MongodbException.java index d8b13dac5..089c03143 100644 --- a/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/exception/MongodbException.java +++ b/kernel-d-mongodb/mongodb-api/src/main/java/cn/stylefeng/roses/kernel/mongodb/api/exception/MongodbException.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.api.exception; import cn.stylefeng.roses.kernel.mongodb.api.constants.MongodbConstants; diff --git a/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/ModelViewController.java b/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/ModelViewController.java index 331a0fbb5..91046c818 100644 --- a/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/ModelViewController.java +++ b/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/ModelViewController.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.integration.controller; import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource; @@ -5,14 +29,22 @@ import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource; import org.springframework.stereotype.Controller; /** + * MongoDB文件管理界面渲染控制器 + * * @author huziyang - * @create 2021-03-30 15:21 + * @date 2021/03/30 15:21 */ @Controller @ApiResource(name = "MongoDB文件管理界面渲染控制器") public class ModelViewController { + /** + * 文件管理视图 + * + * @author huziyang + * @date 2021/03/30 15:21 + */ @GetResource(name = "Mongodb文件列表视图", path = "/view/mongodb/file") public String mongodbFile() { return "/modular/mongodb/fileList.html"; diff --git a/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/MongoFileController.java b/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/MongoFileController.java index d25a15efa..551d4842a 100644 --- a/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/MongoFileController.java +++ b/kernel-d-mongodb/mongodb-integration-beetl/src/main/java/cn/stylefeng/roses/kernel/mongodb/integration/controller/MongoFileController.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.integration.controller; import cn.stylefeng.roses.kernel.mongodb.api.MongoFileApi; @@ -14,15 +38,16 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestPart; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.multipart.MultipartFile; - import javax.annotation.Resource; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Optional; /** + * Mongodb文件管理接口控制器 + * * @author huziyang - * @create 2021-03-31 17:28 + * @date 2021/03/31 17:28 */ @RestController @ApiResource(name = "Mongodb文件接口控制器") @@ -31,22 +56,46 @@ public class MongoFileController { @Resource private MongoFileApi mongoFileApi; + /** + * 新增文件 + * + * @author huziyang + * @date 2021/03/31 17:28 + */ @PostResource(name = "Mongodb文件新增", path = "/view/mongodb/file/add") public ResponseData mongodbFileAdd(@RequestPart("file") MultipartFile file) { return new SuccessResponseData(mongoFileApi.saveFile(file)); } + /** + * 根据id删除文件 + * + * @author huziyang + * @date 2021/03/31 17:28 + */ @PostResource(name = "Mongodb文件删除", path = "/view/mongodb/file/del") public ResponseData mongodbFileDel(@RequestParam String id) { mongoFileApi.removeFile(id); return new SuccessResponseData(); } + /** + * 获取分页文件列表 + * + * @author huziyang + * @date 2021/03/31 17:28 + */ @GetResource(name = "Mongodb文件列表", path = "/view/mongodb/file/list") public ResponseData mongodbFileList(MongoFileEntity mongoFileEntity) { return new SuccessResponseData(mongoFileApi.getFilesByPage(mongoFileEntity)); } + /** + * 根据id下载文件 + * + * @author huziyang + * @date 2021/03/31 17:28 + */ @GetResource(name = "Mongodb文件下载", path = "/view/mongodb/file/down") public ResponseEntity mongodbFileDown(@RequestParam String id) throws UnsupportedEncodingException { Optional file = mongoFileApi.getFileById(id); diff --git a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/entity/MongoFileEntity.java b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/entity/MongoFileEntity.java index 419f2d9e0..20b6d980e 100644 --- a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/entity/MongoFileEntity.java +++ b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/entity/MongoFileEntity.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.file.entity; import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest; @@ -11,8 +35,10 @@ import org.springframework.data.mongodb.core.mapping.Document; import java.util.Date; /** + * Mongodb 文件存储集合实体 + * * @author huziyang - * @create 2021-03-26 17:23 + * @date 2021/03/26 17:23 */ @Data @NoArgsConstructor diff --git a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/mapper/MongoFileMapper.java b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/mapper/MongoFileMapper.java index cf97ad1cb..817e5bfa9 100644 --- a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/mapper/MongoFileMapper.java +++ b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/mapper/MongoFileMapper.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.file.mapper; import cn.stylefeng.roses.kernel.mongodb.file.entity.MongoFileEntity; @@ -5,8 +29,10 @@ import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.repository.MongoRepository; /** + * Mongodb 文件存储Mapper + * * @author huziyang - * @create 2021-03-26 17:27 + * @date 2021/03/26 17:27 */ @Configuration public interface MongoFileMapper extends MongoRepository { diff --git a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/MongoFileService.java b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/MongoFileService.java index e9443ccf0..1c6515b50 100644 --- a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/MongoFileService.java +++ b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/MongoFileService.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.file.service; import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult; @@ -6,37 +30,51 @@ import org.springframework.web.multipart.MultipartFile; import java.util.Optional; /** + * Mongodb 文件存储接口 + * * @author huziyang - * @create 2021-03-26 17:28 + * @date 2021/03/26 17:28 */ public interface MongoFileService { /** * 保存文件 - * @param file - * @return + * + * @param file 上传的文件对象 + * @return 返回数据结果 + * @author huziyang + * @date 2021/03/30 11:06 */ MongoFileEntity saveFile(MultipartFile file); /** - * 删除文件 - * @param id + * 根据id删除文件 + * + * @param id 集合id + * @author huziyang + * @date 2021/03/30 11:06 */ void removeFile(String id); /** * 根据id获取文件 - * @param id - * @return + * + * @param id 集合id + * @return 返回查询到数据的Optional + * @author huziyang + * @date 2021/03/30 11:06 */ Optional getFileById(String id); /** - * 分页获取文件 + * 分页获取文件列表 + * * @param fileDocument 查询条件 - * @return + * @return 返回查询文件的分页结果 + * @author huziyang + * @date 2021/03/30 11:06 */ PageResult getFilesByPage(MongoFileEntity fileDocument); diff --git a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/impl/MongoFileServiceImpl.java b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/impl/MongoFileServiceImpl.java index 1cc1d7241..ab9891e98 100644 --- a/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/impl/MongoFileServiceImpl.java +++ b/kernel-d-mongodb/mongodb-sdk-file/src/main/java/cn/stylefeng/roses/kernel/mongodb/file/service/impl/MongoFileServiceImpl.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.file.service.impl; import cn.hutool.core.io.IoUtil; @@ -28,8 +52,10 @@ import java.util.Date; import java.util.Optional; /** + * Mongodb 文件存储实现类 + * * @author huziyang - * @create 2021-03-26 17:29 + * @date 2021/03/26 17:29 */ @Slf4j @Service diff --git a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/entity/GunsMapEntity.java b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/entity/GunsMapEntity.java index 574cf59b4..14fb085be 100644 --- a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/entity/GunsMapEntity.java +++ b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/entity/GunsMapEntity.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.entity; import lombok.AllArgsConstructor; @@ -9,8 +33,10 @@ import java.util.HashMap; import java.util.Map; /** + * Mongodb 数据存储集合实体 + * * @author huziyang - * @create 2021-03-20 16:24 + * @date 2021/03/20 16:24 */ @Data @NoArgsConstructor diff --git a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/mapper/GunsMapRepository.java b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/mapper/GunsMapRepository.java index 14301698b..94bc0f2c0 100644 --- a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/mapper/GunsMapRepository.java +++ b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/mapper/GunsMapRepository.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.mapper; import cn.stylefeng.roses.kernel.mongodb.entity.GunsMapEntity; @@ -5,8 +29,10 @@ import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.repository.MongoRepository; /** + * Mongodb 数据存储mapper + * * @author huziyang - * @create 2021-03-20 16:24 + * @date 2021/03/20 16:24 */ @Configuration public interface GunsMapRepository extends MongoRepository { diff --git a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/GunsMapService.java b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/GunsMapService.java index d183252e4..5683cfff8 100644 --- a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/GunsMapService.java +++ b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/GunsMapService.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.service; import cn.stylefeng.roses.kernel.mongodb.entity.GunsMapEntity; @@ -6,41 +30,58 @@ import java.util.List; import java.util.Optional; /** + * Mongodb 数据存储接口 + * * @author huziyang - * @create 2021-03-20 16:24 + * @date 2021/03/20 16:24 */ public interface GunsMapService { /** - * 新增操作 - * @param gunsMapEntity - * @return + * 新增数据 + * + * @param gunsMapEntity 数据参数 + * @return 返回新增数据结果 + * @author huziyang + * @date 2021/03/20 16:24 */ GunsMapEntity insert(GunsMapEntity gunsMapEntity); /** - * 修改 - * @param gunsMapEntity - * @return + * 修改数据 + * + * @param gunsMapEntity 数据参数 + * @return 返回修改数据结果 + * @author huziyang + * @date 2021/03/20 16:24 */ GunsMapEntity update(GunsMapEntity gunsMapEntity); /** * 根据id删除 - * @param id + * + * @param id 集合id + * @author huziyang + * @date 2021/03/20 16:24 */ void deleteById(String id); /** * 根据id查询 - * @param id - * @return + * + * @param id 集合id + * @return 返回查询到数据的Optional + * @author huziyang + * @date 2021/03/20 16:24 */ Optional findById(String id); /** - * 查询所有 - * @return + * 查询所有集合中数据 + * + * @return 返回所有数据集合 + * @author huziyang + * @date 2021/03/20 16:24 */ List findAll(); diff --git a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/impl/GunsMapServiceImpl.java b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/impl/GunsMapServiceImpl.java index 398e3ffea..7dd511baa 100644 --- a/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/impl/GunsMapServiceImpl.java +++ b/kernel-d-mongodb/mongodb-sdk-springboot/src/main/java/cn/stylefeng/roses/kernel/mongodb/service/impl/GunsMapServiceImpl.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.service.impl; import cn.stylefeng.roses.kernel.mongodb.api.MongodbApi; @@ -10,8 +34,10 @@ import java.util.List; import java.util.Optional; /** + * Mongodb 数据存储实现类 + * * @author huziyang - * @create 2021-03-20 16:24 + * @date 2021/03/20 16:24 */ @Service public class GunsMapServiceImpl implements GunsMapService, MongodbApi { diff --git a/kernel-d-mongodb/mongodb-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/mongodb/starter/GunsMongodbAutoConfiguration.java b/kernel-d-mongodb/mongodb-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/mongodb/starter/GunsMongodbAutoConfiguration.java index 48613d92c..c83d5ee52 100644 --- a/kernel-d-mongodb/mongodb-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/mongodb/starter/GunsMongodbAutoConfiguration.java +++ b/kernel-d-mongodb/mongodb-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/mongodb/starter/GunsMongodbAutoConfiguration.java @@ -1,3 +1,27 @@ +/* + * Copyright [2020-2030] [https://www.stylefeng.cn] + * + * 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. + * + * Guns采用APACHE LICENSE 2.0开源协议,您在使用过程中,需要注意以下几点: + * + * 1.请不要删除和修改根目录下的LICENSE文件。 + * 2.请不要删除和修改Guns源码头部的版权声明。 + * 3.请保留源码和相关描述文件的项目出处,作者声明等。 + * 4.分发源码时候,请注明软件出处 https://gitee.com/stylefeng/guns + * 5.在修改包名,模块名称,项目代码等时,请注明软件出处 https://gitee.com/stylefeng/guns + * 6.若您的项目无法满足以上几点,可申请商业授权 + */ package cn.stylefeng.roses.kernel.mongodb.starter; import cn.stylefeng.roses.kernel.mongodb.api.MongoFileApi; @@ -8,19 +32,32 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; /** + * Mongodb模块自动配置 + * * @author huziyang - * @create 2021-03-20 16:24 + * @date 2021/03/20 16:24 */ @Configuration public class GunsMongodbAutoConfiguration { - + /** + * Mongodb 数据存储 + * + * @author huziyang + * @date 2021/03/20 16:24 + */ @Bean public MongodbApi mongodbApi() { return new GunsMapServiceImpl(); } + /** + * Mongodb 文件管理 + * + * @author huziyang + * @date 2021/03/20 16:24 + */ @Bean public MongoFileApi mongoFileApi() { return new MongoFileServiceImpl();