From 901b6b8b1f9e930e574c478e73f17334e0373dfd Mon Sep 17 00:00:00 2001 From: Pancaihua <75729660@qq.com> Date: Mon, 29 Jul 2024 11:13:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=9F=A5=E8=AF=86=E5=88=86?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/bpm/enums/ErrorCodeConstants.java | 2 + .../admin/knows/CommentController.java | 96 +++++++++++++++++++ .../admin/knows/KnowledgeController.java | 10 +- .../admin/knows/vo/CommentPageReqVO.java | 28 ++++++ .../admin/knows/vo/CommentRespVO.java | 31 ++++++ .../admin/knows/vo/CommentSaveReqVO.java | 20 ++++ .../bpm/dal/mysql/knows/CommentMapper.java | 12 ++- .../bpm/service/knows/CommentService.java | 56 +++++++++++ .../bpm/service/knows/CommentServiceImpl.java | 73 ++++++++++++++ .../src/test/resources/sql/clean.sql | 1 + .../src/test/resources/sql/create_tables.sql | 13 +++ .../src/main/resources/application-local.yaml | 1 + 12 files changed, 331 insertions(+), 12 deletions(-) create mode 100644 yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/CommentController.java create mode 100644 yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentPageReqVO.java create mode 100644 yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentRespVO.java create mode 100644 yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentSaveReqVO.java create mode 100644 yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentService.java create mode 100644 yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentServiceImpl.java diff --git a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java index 447c933..ffdd554 100644 --- a/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java +++ b/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/ErrorCodeConstants.java @@ -83,4 +83,6 @@ public interface ErrorCodeConstants { ErrorCode KNOWTYPE_PARENT_IS_CHILD = new ErrorCode(1_009_015_005, "不能设置自己的子Knowtype为父Knowtype"); // ========== 知识发布 1_009_016_000 ========== ErrorCode KNOWLEDGE_NOT_EXISTS = new ErrorCode(1_009_016_000, "知识发布不存在"); + // ========== 评论 1_009_017_000 ========== + ErrorCode COMMENT_NOT_EXISTS = new ErrorCode(1_009_017_000, "评论不存在"); } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/CommentController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/CommentController.java new file mode 100644 index 0000000..3c180a9 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/CommentController.java @@ -0,0 +1,96 @@ +package cn.iocoder.yudao.module.bpm.controller.admin.knows; + +import org.springframework.web.bind.annotation.*; + +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Operation; + +import java.util.*; +import java.io.IOException; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; + +import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; +import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; + +import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*; +import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO; +import cn.iocoder.yudao.module.bpm.service.knows.CommentService; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; + +@Tag(name = "管理后台 - 评论") +@RestController +@RequestMapping("/bpm/comment") +@Validated +public class CommentController { + + @Resource + private CommentService commentService; + + @PostMapping("/create") + @Operation(summary = "创建评论") + @PreAuthorize("@ss.hasPermission('bpm:comment:create')") + public CommonResult createComment(@Valid @RequestBody CommentSaveReqVO createReqVO) { + return success(commentService.createComment(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新评论") + @PreAuthorize("@ss.hasPermission('bpm:comment:update')") + public CommonResult updateComment(@Valid @RequestBody CommentSaveReqVO updateReqVO) { + commentService.updateComment(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除评论") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('bpm:comment:delete')") + public CommonResult deleteComment(@RequestParam("id") Long id) { + commentService.deleteComment(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得评论") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('bpm:comment:query')") + public CommonResult getComment(@RequestParam("id") Long id) { + CommentDO comment = commentService.getComment(id); + return success(BeanUtils.toBean(comment, CommentRespVO.class)); + } + + @GetMapping("/page") + @Operation(summary = "获得评论分页") + @PreAuthorize("@ss.hasPermission('bpm:comment:query')") + public CommonResult> getCommentPage(@Valid CommentPageReqVO pageReqVO) { + PageResult pageResult = commentService.getCommentPage(pageReqVO); + return success(BeanUtils.toBean(pageResult, CommentRespVO.class)); + } + + @GetMapping("/export-excel") + @Operation(summary = "导出评论 Excel") + @PreAuthorize("@ss.hasPermission('bpm:comment:export')") + @ApiAccessLog(operateType = EXPORT) + public void exportCommentExcel(@Valid CommentPageReqVO pageReqVO, + HttpServletResponse response) throws IOException { + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); + List list = commentService.getCommentPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "评论.xls", "数据", CommentRespVO.class, + BeanUtils.toBean(list, CommentRespVO.class)); + } + +} diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/KnowledgeController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/KnowledgeController.java index a1ce8e6..193f988 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/KnowledgeController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/KnowledgeController.java @@ -1,19 +1,13 @@ package cn.iocoder.yudao.module.bpm.controller.admin.knows; import cn.hutool.core.collection.CollUtil; -import cn.iocoder.yudao.framework.common.util.number.NumberUtils; -import cn.iocoder.yudao.framework.common.util.spring.SpringUtils; import cn.iocoder.yudao.module.bpm.convert.knows.KnowledgeConvert; import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowtypeDO; import cn.iocoder.yudao.module.bpm.service.knows.KnowtypeService; import cn.iocoder.yudao.module.system.api.user.AdminUserApi; -import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; -import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.dept.DeptService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; -import cn.iocoder.yudao.module.system.service.user.AdminUserServiceImpl; -import io.reactivex.rxjava3.core.Single; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import org.springframework.security.access.prepost.PreAuthorize; @@ -22,7 +16,7 @@ import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Operation; import java.io.IOException; import java.util.*; -import java.util.stream.Stream; + import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult; @@ -36,8 +30,6 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertListByFlatMap; -import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet; import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*; import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.KnowledgeDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentPageReqVO.java new file mode 100644 index 0000000..d3f8aaf --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentPageReqVO.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.bpm.controller.admin.knows.vo; + +import lombok.*; +import java.util.*; +import io.swagger.v3.oas.annotations.media.Schema; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 评论分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class CommentPageReqVO extends PageParam { + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + + @Schema(description = "类型id", example = "6659") + private Long knowId; + + @Schema(description = "内容") + private String content; + +} \ No newline at end of file diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentRespVO.java new file mode 100644 index 0000000..9729d7a --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentRespVO.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.bpm.controller.admin.knows.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; +import org.springframework.format.annotation.DateTimeFormat; +import java.time.LocalDateTime; +import com.alibaba.excel.annotation.*; + +@Schema(description = "管理后台 - 评论 Response VO") +@Data +@ExcelIgnoreUnannotated +public class CommentRespVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5346") + @ExcelProperty("id") + private Long id; + + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "类型id", example = "6659") + @ExcelProperty("类型id") + private Long knowId; + + @Schema(description = "内容") + @ExcelProperty("内容") + private String content; + +} \ No newline at end of file diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentSaveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentSaveReqVO.java new file mode 100644 index 0000000..b3776c2 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/knows/vo/CommentSaveReqVO.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.bpm.controller.admin.knows.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.*; +import java.util.*; + +@Schema(description = "管理后台 - 评论新增/修改 Request VO") +@Data +public class CommentSaveReqVO { + + @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "5346") + private Long id; + + @Schema(description = "类型id", example = "6659") + private Long knowId; + + @Schema(description = "内容") + private String content; + +} diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/knows/CommentMapper.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/knows/CommentMapper.java index 16487cb..1c6d36f 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/knows/CommentMapper.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/mysql/knows/CommentMapper.java @@ -3,11 +3,11 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.knows; import java.util.*; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO; import org.apache.ibatis.annotations.Mapper; +import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*; /** * 评论 Mapper @@ -24,5 +24,11 @@ public interface CommentMapper extends BaseMapperX { default int deleteByKnowId(Long knowId) { return delete(CommentDO::getKnowId, knowId); } - -} \ No newline at end of file + default PageResult selectPage(CommentPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .betweenIfPresent(CommentDO::getCreateTime, reqVO.getCreateTime()) + .eqIfPresent(CommentDO::getKnowId, reqVO.getKnowId()) + .eqIfPresent(CommentDO::getContent, reqVO.getContent()) + .orderByDesc(CommentDO::getId)); + } +} diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentService.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentService.java new file mode 100644 index 0000000..7d7fe43 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentService.java @@ -0,0 +1,56 @@ +package cn.iocoder.yudao.module.bpm.service.knows; + +import java.util.*; +import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*; +import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; + +import javax.validation.Valid; + +/** + * 评论 Service 接口 + * + * @author pch + */ +public interface CommentService { + + /** + * 创建评论 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createComment(@Valid CommentSaveReqVO createReqVO); + + /** + * 更新评论 + * + * @param updateReqVO 更新信息 + */ + void updateComment(@Valid CommentSaveReqVO updateReqVO); + + /** + * 删除评论 + * + * @param id 编号 + */ + void deleteComment(Long id); + + /** + * 获得评论 + * + * @param id 编号 + * @return 评论 + */ + CommentDO getComment(Long id); + + /** + * 获得评论分页 + * + * @param pageReqVO 分页查询 + * @return 评论分页 + */ + PageResult getCommentPage(CommentPageReqVO pageReqVO); + +} diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentServiceImpl.java new file mode 100644 index 0000000..50baa37 --- /dev/null +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/knows/CommentServiceImpl.java @@ -0,0 +1,73 @@ +package cn.iocoder.yudao.module.bpm.service.knows; + +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; +import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; +import java.util.*; +import cn.iocoder.yudao.module.bpm.controller.admin.knows.vo.*; +import cn.iocoder.yudao.module.bpm.dal.dataobject.knows.CommentDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; + +import cn.iocoder.yudao.module.bpm.dal.mysql.knows.CommentMapper; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.*; + +/** + * 评论 Service 实现类 + * + * @author pch + */ +@Service +@Validated +public class CommentServiceImpl implements CommentService { + + @Resource + private CommentMapper commentMapper; + + @Override + public Long createComment(CommentSaveReqVO createReqVO) { + // 插入 + CommentDO comment = BeanUtils.toBean(createReqVO, CommentDO.class); + commentMapper.insert(comment); + // 返回 + return comment.getId(); + } + + @Override + public void updateComment(CommentSaveReqVO updateReqVO) { + // 校验存在 + validateCommentExists(updateReqVO.getId()); + // 更新 + CommentDO updateObj = BeanUtils.toBean(updateReqVO, CommentDO.class); + commentMapper.updateById(updateObj); + } + + @Override + public void deleteComment(Long id) { + // 校验存在 + validateCommentExists(id); + // 删除 + commentMapper.deleteById(id); + } + + private void validateCommentExists(Long id) { + if (commentMapper.selectById(id) == null) { + throw exception(COMMENT_NOT_EXISTS); + } + } + + @Override + public CommentDO getComment(Long id) { + return commentMapper.selectById(id); + } + + @Override + public PageResult getCommentPage(CommentPageReqVO pageReqVO) { + return commentMapper.selectPage(pageReqVO); + } + +} diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/clean.sql b/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/clean.sql index 2be640a..3e1b69f 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/clean.sql +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/clean.sql @@ -3,3 +3,4 @@ DELETE FROM "bpm_user_group"; DELETE FROM "bpm_category"; DELETE FROM "des_knowtype"; DELETE FROM "des_knowledge"; +DELETE FROM "des_comment"; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/create_tables.sql b/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/create_tables.sql index 84f19fa..0cfddc9 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/test/resources/sql/create_tables.sql @@ -72,3 +72,16 @@ CREATE TABLE IF NOT EXISTS "des_knowledge" ( "tenant_id" bigint NOT NULL, PRIMARY KEY ("id") ) COMMENT '知识表'; +-- 将该建表 SQL 语句,添加到 yudao-module-bpm-biz 模块的 test/resources/sql/create_tables.sql 文件里 +CREATE TABLE IF NOT EXISTS "des_comment" ( + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "creator" varchar DEFAULT '', + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updater" varchar DEFAULT '', + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + "deleted" bit NOT NULL DEFAULT FALSE, + "tenant_id" bigint NOT NULL, + "know_id" bigint, + "content" varchar, + PRIMARY KEY ("id") + ) COMMENT '评论表'; diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 0bc4693..ab97d1c 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -47,6 +47,7 @@ spring: datasource: master: url: jdbc:mysql://192.168.1.102:3306/yudao-vue?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 + # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例