mirror of https://gitee.com/stylefeng/roses
commit
e2f1b04ce3
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.api;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||||
|
@ -5,37 +29,51 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb文件管理API
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-30 11:06
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
public interface MongoFileApi<T,ID> {
|
public interface MongoFileApi<T,ID> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存文件
|
* 保存文件
|
||||||
* @param file
|
*
|
||||||
* @return
|
* @param file 上传的文件对象
|
||||||
|
* @return 返回数据结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
T saveFile(MultipartFile file);
|
T saveFile(MultipartFile file);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文件
|
* 根据id删除文件
|
||||||
* @param id
|
*
|
||||||
|
* @param id 集合id
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
void removeFile(ID id);
|
void removeFile(ID id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id获取文件
|
* 根据id获取文件
|
||||||
* @param id
|
*
|
||||||
* @return
|
* @param id 集合id
|
||||||
|
* @return 返回查询到数据的Optional
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
Optional<T> getFileById(ID id);
|
Optional<T> getFileById(ID id);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页获取文件
|
* 分页获取文件列表
|
||||||
|
*
|
||||||
* @param fileDocument 查询条件
|
* @param fileDocument 查询条件
|
||||||
* @return
|
* @return 返回查询文件的分页结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
PageResult<T> getFilesByPage(T fileDocument);
|
PageResult<T> getFilesByPage(T fileDocument);
|
||||||
|
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.api;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb数据存储的api,适用于存map类型数据,存储在guns_map集合中
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-20 16:24
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
public interface MongodbApi<T,ID> {
|
public interface MongodbApi<T,ID> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增操作
|
* 新增数据
|
||||||
* @param gunsMapEntity
|
*
|
||||||
* @return
|
* @param gunsMapEntity 数据存储的参数
|
||||||
|
* @return 返回数据结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2020/10/27 17:38
|
||||||
*/
|
*/
|
||||||
T insert(T gunsMapEntity);
|
T insert(T gunsMapEntity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改数据
|
||||||
* @param gunsMapEntity
|
*
|
||||||
* @return
|
* @param gunsMapEntity 数据存储的参数
|
||||||
|
* @return 返回数据结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2020/10/27 17:38
|
||||||
*/
|
*/
|
||||||
T update(T gunsMapEntity);
|
T update(T gunsMapEntity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id删除
|
* 根据id删除
|
||||||
* @param id
|
*
|
||||||
|
* @param id 集合id
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2020/10/27 17:38
|
||||||
*/
|
*/
|
||||||
void deleteById(ID id);
|
void deleteById(ID id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询
|
* 根据id查询
|
||||||
* @param id
|
*
|
||||||
* @return
|
* @param id 集合id
|
||||||
|
* @return 返回查询到数据的Optional
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2020/10/27 17:38
|
||||||
*/
|
*/
|
||||||
Optional<T> findById(ID id);
|
Optional<T> findById(ID id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有
|
* 查询所有数据
|
||||||
* @return
|
*
|
||||||
|
* @return 返回所有数据列表
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2020/10/27 17:38
|
||||||
*/
|
*/
|
||||||
List<T> findAll();
|
List<T> findAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.api.constants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb模块的常量
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-20 16:24
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
public interface MongodbConstants {
|
public interface MongodbConstants {
|
||||||
|
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.api.exception;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.mongodb.api.constants.MongodbConstants;
|
import cn.stylefeng.roses.kernel.mongodb.api.constants.MongodbConstants;
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.integration.controller;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
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;
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* MongoDB文件管理界面渲染控制器
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-30 15:21
|
* @date 2021/03/30 15:21
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@ApiResource(name = "MongoDB文件管理界面渲染控制器")
|
@ApiResource(name = "MongoDB文件管理界面渲染控制器")
|
||||||
public class ModelViewController {
|
public class ModelViewController {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件管理视图
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 15:21
|
||||||
|
*/
|
||||||
@GetResource(name = "Mongodb文件列表视图", path = "/view/mongodb/file")
|
@GetResource(name = "Mongodb文件列表视图", path = "/view/mongodb/file")
|
||||||
public String mongodbFile() {
|
public String mongodbFile() {
|
||||||
return "/modular/mongodb/fileList.html";
|
return "/modular/mongodb/fileList.html";
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.integration.controller;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.mongodb.api.MongoFileApi;
|
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.RequestPart;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb文件管理接口控制器
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-31 17:28
|
* @date 2021/03/31 17:28
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@ApiResource(name = "Mongodb文件接口控制器")
|
@ApiResource(name = "Mongodb文件接口控制器")
|
||||||
|
@ -31,22 +56,46 @@ public class MongoFileController {
|
||||||
@Resource
|
@Resource
|
||||||
private MongoFileApi<MongoFileEntity,String> mongoFileApi;
|
private MongoFileApi<MongoFileEntity,String> mongoFileApi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增文件
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/31 17:28
|
||||||
|
*/
|
||||||
@PostResource(name = "Mongodb文件新增", path = "/view/mongodb/file/add")
|
@PostResource(name = "Mongodb文件新增", path = "/view/mongodb/file/add")
|
||||||
public ResponseData mongodbFileAdd(@RequestPart("file") MultipartFile file) {
|
public ResponseData mongodbFileAdd(@RequestPart("file") MultipartFile file) {
|
||||||
return new SuccessResponseData(mongoFileApi.saveFile(file));
|
return new SuccessResponseData(mongoFileApi.saveFile(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id删除文件
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/31 17:28
|
||||||
|
*/
|
||||||
@PostResource(name = "Mongodb文件删除", path = "/view/mongodb/file/del")
|
@PostResource(name = "Mongodb文件删除", path = "/view/mongodb/file/del")
|
||||||
public ResponseData mongodbFileDel(@RequestParam String id) {
|
public ResponseData mongodbFileDel(@RequestParam String id) {
|
||||||
mongoFileApi.removeFile(id);
|
mongoFileApi.removeFile(id);
|
||||||
return new SuccessResponseData();
|
return new SuccessResponseData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取分页文件列表
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/31 17:28
|
||||||
|
*/
|
||||||
@GetResource(name = "Mongodb文件列表", path = "/view/mongodb/file/list")
|
@GetResource(name = "Mongodb文件列表", path = "/view/mongodb/file/list")
|
||||||
public ResponseData mongodbFileList(MongoFileEntity mongoFileEntity) {
|
public ResponseData mongodbFileList(MongoFileEntity mongoFileEntity) {
|
||||||
return new SuccessResponseData(mongoFileApi.getFilesByPage(mongoFileEntity));
|
return new SuccessResponseData(mongoFileApi.getFilesByPage(mongoFileEntity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id下载文件
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/31 17:28
|
||||||
|
*/
|
||||||
@GetResource(name = "Mongodb文件下载", path = "/view/mongodb/file/down")
|
@GetResource(name = "Mongodb文件下载", path = "/view/mongodb/file/down")
|
||||||
public ResponseEntity mongodbFileDown(@RequestParam String id) throws UnsupportedEncodingException {
|
public ResponseEntity mongodbFileDown(@RequestParam String id) throws UnsupportedEncodingException {
|
||||||
Optional<MongoFileEntity> file = mongoFileApi.getFileById(id);
|
Optional<MongoFileEntity> file = mongoFileApi.getFileById(id);
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.file.entity;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
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;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 文件存储集合实体
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-26 17:23
|
* @date 2021/03/26 17:23
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.file.mapper;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.mongodb.file.entity.MongoFileEntity;
|
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;
|
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 文件存储Mapper
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-26 17:27
|
* @date 2021/03/26 17:27
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public interface MongoFileMapper extends MongoRepository<MongoFileEntity,String> {
|
public interface MongoFileMapper extends MongoRepository<MongoFileEntity,String> {
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.file.service;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||||
|
@ -6,37 +30,51 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 文件存储接口
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-26 17:28
|
* @date 2021/03/26 17:28
|
||||||
*/
|
*/
|
||||||
public interface MongoFileService {
|
public interface MongoFileService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存文件
|
* 保存文件
|
||||||
* @param file
|
*
|
||||||
* @return
|
* @param file 上传的文件对象
|
||||||
|
* @return 返回数据结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
MongoFileEntity saveFile(MultipartFile file);
|
MongoFileEntity saveFile(MultipartFile file);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除文件
|
* 根据id删除文件
|
||||||
* @param id
|
*
|
||||||
|
* @param id 集合id
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
void removeFile(String id);
|
void removeFile(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id获取文件
|
* 根据id获取文件
|
||||||
* @param id
|
*
|
||||||
* @return
|
* @param id 集合id
|
||||||
|
* @return 返回查询到数据的Optional
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
Optional<MongoFileEntity> getFileById(String id);
|
Optional<MongoFileEntity> getFileById(String id);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页获取文件
|
* 分页获取文件列表
|
||||||
|
*
|
||||||
* @param fileDocument 查询条件
|
* @param fileDocument 查询条件
|
||||||
* @return
|
* @return 返回查询文件的分页结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/30 11:06
|
||||||
*/
|
*/
|
||||||
PageResult<MongoFileEntity> getFilesByPage(MongoFileEntity fileDocument);
|
PageResult<MongoFileEntity> getFilesByPage(MongoFileEntity fileDocument);
|
||||||
|
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.file.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
|
@ -28,8 +52,10 @@ import java.util.Date;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 文件存储实现类
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-26 17:29
|
* @date 2021/03/26 17:29
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.entity;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -9,8 +33,10 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 数据存储集合实体
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-20 16:24
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.mapper;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.mongodb.entity.GunsMapEntity;
|
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;
|
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 数据存储mapper
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-20 16:24
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public interface GunsMapRepository extends MongoRepository<GunsMapEntity,String> {
|
public interface GunsMapRepository extends MongoRepository<GunsMapEntity,String> {
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.service;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.mongodb.entity.GunsMapEntity;
|
import cn.stylefeng.roses.kernel.mongodb.entity.GunsMapEntity;
|
||||||
|
@ -6,41 +30,58 @@ import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 数据存储接口
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-20 16:24
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
public interface GunsMapService {
|
public interface GunsMapService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增操作
|
* 新增数据
|
||||||
* @param gunsMapEntity
|
*
|
||||||
* @return
|
* @param gunsMapEntity 数据参数
|
||||||
|
* @return 返回新增数据结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
GunsMapEntity insert(GunsMapEntity gunsMapEntity);
|
GunsMapEntity insert(GunsMapEntity gunsMapEntity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改数据
|
||||||
* @param gunsMapEntity
|
*
|
||||||
* @return
|
* @param gunsMapEntity 数据参数
|
||||||
|
* @return 返回修改数据结果
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
GunsMapEntity update(GunsMapEntity gunsMapEntity);
|
GunsMapEntity update(GunsMapEntity gunsMapEntity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id删除
|
* 根据id删除
|
||||||
* @param id
|
*
|
||||||
|
* @param id 集合id
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
void deleteById(String id);
|
void deleteById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询
|
* 根据id查询
|
||||||
* @param id
|
*
|
||||||
* @return
|
* @param id 集合id
|
||||||
|
* @return 返回查询到数据的Optional
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
Optional<GunsMapEntity> findById(String id);
|
Optional<GunsMapEntity> findById(String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有
|
* 查询所有集合中数据
|
||||||
* @return
|
*
|
||||||
|
* @return 返回所有数据集合
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
List<GunsMapEntity> findAll();
|
List<GunsMapEntity> findAll();
|
||||||
|
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.service.impl;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.mongodb.api.MongodbApi;
|
import cn.stylefeng.roses.kernel.mongodb.api.MongodbApi;
|
||||||
|
@ -10,8 +34,10 @@ import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb 数据存储实现类
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-20 16:24
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class GunsMapServiceImpl implements GunsMapService, MongodbApi<GunsMapEntity,String> {
|
public class GunsMapServiceImpl implements GunsMapService, MongodbApi<GunsMapEntity,String> {
|
||||||
|
|
|
@ -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;
|
package cn.stylefeng.roses.kernel.mongodb.starter;
|
||||||
|
|
||||||
import cn.stylefeng.roses.kernel.mongodb.api.MongoFileApi;
|
import cn.stylefeng.roses.kernel.mongodb.api.MongoFileApi;
|
||||||
|
@ -8,19 +32,32 @@ import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Mongodb模块自动配置
|
||||||
|
*
|
||||||
* @author huziyang
|
* @author huziyang
|
||||||
* @create 2021-03-20 16:24
|
* @date 2021/03/20 16:24
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class GunsMongodbAutoConfiguration {
|
public class GunsMongodbAutoConfiguration {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mongodb 数据存储
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/20 16:24
|
||||||
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public MongodbApi mongodbApi() {
|
public MongodbApi mongodbApi() {
|
||||||
return new GunsMapServiceImpl();
|
return new GunsMapServiceImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mongodb 文件管理
|
||||||
|
*
|
||||||
|
* @author huziyang
|
||||||
|
* @date 2021/03/20 16:24
|
||||||
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public MongoFileApi mongoFileApi() {
|
public MongoFileApi mongoFileApi() {
|
||||||
return new MongoFileServiceImpl();
|
return new MongoFileServiceImpl();
|
||||||
|
|
Loading…
Reference in New Issue