!9 【7.0.3】修改编码规范

Merge pull request !9 from William Hu/7.0.3-develop
pull/9/MERGE
stylefeng 2021-04-13 21:53:22 +08:00 committed by Gitee
commit e2f1b04ce3
15 changed files with 536 additions and 56 deletions

View File

@ -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.
*
* GunsAPACHE 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;
/** /**
* MongodbAPI
*
* @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);

View File

@ -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.
*
* GunsAPACHE 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;
/** /**
* Mongodbapimapguns_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();
} }

View File

@ -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.
*
* GunsAPACHE 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 {

View File

@ -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.
*
* GunsAPACHE 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;

View File

@ -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.
*
* GunsAPACHE 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";

View File

@ -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.
*
* GunsAPACHE 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);

View File

@ -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.
*
* GunsAPACHE 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

View File

@ -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.
*
* GunsAPACHE 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> {

View File

@ -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.
*
* GunsAPACHE 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);

View File

@ -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.
*
* GunsAPACHE 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

View File

@ -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.
*
* GunsAPACHE 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

View File

@ -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.
*
* GunsAPACHE 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> {

View File

@ -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.
*
* GunsAPACHE 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();

View File

@ -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.
*
* GunsAPACHE 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> {

View File

@ -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.
*
* GunsAPACHE 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();