diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/LocationInfoDAO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/LocationInfoDAO.java
similarity index 74%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/LocationInfoDAO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/LocationInfoDAO.java
index 7facc5f..39a744d 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/LocationInfoDAO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/LocationInfoDAO.java
@@ -1,9 +1,9 @@
-package top.zynorl.petplanet.sqlServer.dao;
+package top.zynorl.petplanet.post.sqlServer.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.LocationInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.LocationInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostCommentRelationDAO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostCommentRelationDAO.java
similarity index 73%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostCommentRelationDAO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostCommentRelationDAO.java
index 07e2265..1c38f22 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostCommentRelationDAO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostCommentRelationDAO.java
@@ -1,9 +1,9 @@
-package top.zynorl.petplanet.sqlServer.dao;
+package top.zynorl.petplanet.post.sqlServer.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PostCommentRelationDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostCommentRelationDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostInfoDAO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostInfoDAO.java
similarity index 71%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostInfoDAO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostInfoDAO.java
index 2440936..5e651d9 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostInfoDAO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostInfoDAO.java
@@ -1,9 +1,9 @@
-package top.zynorl.petplanet.sqlServer.dao;
+package top.zynorl.petplanet.post.sqlServer.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PostInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPermissionInfoDAO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostPermissionInfoDAO.java
similarity index 71%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPermissionInfoDAO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostPermissionInfoDAO.java
index 75c3d7e..a9ba12e 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPermissionInfoDAO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostPermissionInfoDAO.java
@@ -1,8 +1,9 @@
-package top.zynorl.petplanet.sqlServer.dao;
+package top.zynorl.petplanet.post.sqlServer.dao;
+
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PostPermissionInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostPermissionInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPetRelationDAO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostPetRelationDAO.java
similarity index 72%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPetRelationDAO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostPetRelationDAO.java
index 1a1e914..b3bf950 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPetRelationDAO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostPetRelationDAO.java
@@ -1,8 +1,9 @@
-package top.zynorl.petplanet.sqlServer.dao;
+package top.zynorl.petplanet.post.sqlServer.dao;
+
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PostPetRelationDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostPetRelationDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostTagInfoDAO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostTagInfoDAO.java
similarity index 72%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostTagInfoDAO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostTagInfoDAO.java
index 99e11b9..9921cc3 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostTagInfoDAO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/dao/PostTagInfoDAO.java
@@ -1,9 +1,9 @@
-package top.zynorl.petplanet.sqlServer.dao;
+package top.zynorl.petplanet.post.sqlServer.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PostTagInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostTagInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/CommentInfoDO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/CommentInfoDO.java
similarity index 96%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/CommentInfoDO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/CommentInfoDO.java
index e5362c6..7138392 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/CommentInfoDO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/CommentInfoDO.java
@@ -1,4 +1,4 @@
-package top.zynorl.petplanet.sqlServer.entity;
+package top.zynorl.petplanet.post.sqlServer.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/LocationInfoDO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/LocationInfoDO.java
similarity index 92%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/LocationInfoDO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/LocationInfoDO.java
index 8772354..997175e 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/LocationInfoDO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/LocationInfoDO.java
@@ -1,4 +1,4 @@
-package top.zynorl.petplanet.sqlServer.entity;
+package top.zynorl.petplanet.post.sqlServer.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -23,7 +23,7 @@
@ApiModel(value = "LocationInfo对象", description = "发布帖子时候的位置信息,从第三方接口中获取")
@Data
@Builder
-public class LocationInfoDO extends BaseTransactionalDO implements Serializable {
+public class LocationInfoDO implements Serializable {
private static final long serialVersionUID = 1L;
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostCommentRelationDO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostCommentRelationDO.java
similarity index 96%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostCommentRelationDO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostCommentRelationDO.java
index f8c0765..f92eef2 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostCommentRelationDO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostCommentRelationDO.java
@@ -1,4 +1,4 @@
-package top.zynorl.petplanet.sqlServer.entity;
+package top.zynorl.petplanet.post.sqlServer.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostInfoDO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostInfoDO.java
similarity index 97%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostInfoDO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostInfoDO.java
index e934a37..afa5458 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostInfoDO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostInfoDO.java
@@ -1,4 +1,4 @@
-package top.zynorl.petplanet.sqlServer.entity;
+package top.zynorl.petplanet.post.sqlServer.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostPermissionInfoDO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostPermissionInfoDO.java
similarity index 96%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostPermissionInfoDO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostPermissionInfoDO.java
index 982ce46..8fe2857 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostPermissionInfoDO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostPermissionInfoDO.java
@@ -1,4 +1,4 @@
-package top.zynorl.petplanet.sqlServer.entity;
+package top.zynorl.petplanet.post.sqlServer.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostPetRelationDO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostPetRelationDO.java
similarity index 95%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostPetRelationDO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostPetRelationDO.java
index 0aa71c7..fc56d47 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostPetRelationDO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostPetRelationDO.java
@@ -1,4 +1,4 @@
-package top.zynorl.petplanet.sqlServer.entity;
+package top.zynorl.petplanet.post.sqlServer.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostTagInfoDO.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostTagInfoDO.java
similarity index 95%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostTagInfoDO.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostTagInfoDO.java
index 26f63f6..2e66370 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/entity/PostTagInfoDO.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/PostTagInfoDO.java
@@ -1,4 +1,4 @@
-package top.zynorl.petplanet.sqlServer.entity;
+package top.zynorl.petplanet.post.sqlServer.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/ICommentInfoDBService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/ICommentInfoDBService.java
similarity index 67%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/ICommentInfoDBService.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/ICommentInfoDBService.java
index 91c0e7c..2ac998a 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/ICommentInfoDBService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/ICommentInfoDBService.java
@@ -1,8 +1,8 @@
-package top.zynorl.petplanet.sqlServer.service;
+package top.zynorl.petplanet.post.sqlServer.server;
import com.baomidou.mybatisplus.extension.service.IService;
-import top.zynorl.petplanet.sqlServer.entity.CommentInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.CommentInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/ILocationInfoDBService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/ILocationInfoDBService.java
similarity index 77%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/ILocationInfoDBService.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/ILocationInfoDBService.java
index 0810fb3..172ae5b 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/ILocationInfoDBService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/ILocationInfoDBService.java
@@ -1,7 +1,8 @@
-package top.zynorl.petplanet.sqlServer.service;
+package top.zynorl.petplanet.post.sqlServer.server;
+
import com.baomidou.mybatisplus.extension.service.IService;
-import top.zynorl.petplanet.sqlServer.entity.LocationInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.LocationInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostCommentRelationDBService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostCommentRelationDBService.java
similarity index 69%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostCommentRelationDBService.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostCommentRelationDBService.java
index 016cd52..2f9ee6c 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostCommentRelationDBService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostCommentRelationDBService.java
@@ -1,8 +1,7 @@
-package top.zynorl.petplanet.sqlServer.service;
-
+package top.zynorl.petplanet.post.sqlServer.server;
import com.baomidou.mybatisplus.extension.service.IService;
-import top.zynorl.petplanet.sqlServer.entity.PostCommentRelationDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostCommentRelationDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostInfoDBService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostInfoDBService.java
similarity index 67%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostInfoDBService.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostInfoDBService.java
index ba720ac..e1dab33 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostInfoDBService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostInfoDBService.java
@@ -1,8 +1,8 @@
-package top.zynorl.petplanet.sqlServer.service;
+package top.zynorl.petplanet.post.sqlServer.server;
import com.baomidou.mybatisplus.extension.service.IService;
-import top.zynorl.petplanet.sqlServer.entity.PostInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostPermissionInfoDBService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostPermissionInfoDBService.java
similarity index 67%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostPermissionInfoDBService.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostPermissionInfoDBService.java
index 093ec8f..8cda6eb 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostPermissionInfoDBService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostPermissionInfoDBService.java
@@ -1,8 +1,8 @@
-package top.zynorl.petplanet.sqlServer.service;
+package top.zynorl.petplanet.post.sqlServer.server;
import com.baomidou.mybatisplus.extension.service.IService;
-import top.zynorl.petplanet.sqlServer.entity.PostPermissionInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostPermissionInfoDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostPetRelationDBService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostPetRelationDBService.java
similarity index 67%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostPetRelationDBService.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostPetRelationDBService.java
index 697fd80..c7e9dd4 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostPetRelationDBService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostPetRelationDBService.java
@@ -1,7 +1,8 @@
-package top.zynorl.petplanet.sqlServer.service;
+package top.zynorl.petplanet.post.sqlServer.server;
+
import com.baomidou.mybatisplus.extension.service.IService;
-import top.zynorl.petplanet.sqlServer.entity.PostPetRelationDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostPetRelationDO;
/**
*
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostTagInfoDBService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostTagInfoDBService.java
similarity index 67%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostTagInfoDBService.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostTagInfoDBService.java
index e819aee..02af6b1 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/IPostTagInfoDBService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/IPostTagInfoDBService.java
@@ -1,7 +1,8 @@
-package top.zynorl.petplanet.sqlServer.service;
+package top.zynorl.petplanet.post.sqlServer.server;
+
import com.baomidou.mybatisplus.extension.service.IService;
-import top.zynorl.petplanet.sqlServer.entity.PostTagInfoDO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostTagInfoDO;
/**
*
diff --git a/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/CommentInfoDBServiceImpl.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/CommentInfoDBServiceImpl.java
new file mode 100644
index 0000000..2496a35
--- /dev/null
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/CommentInfoDBServiceImpl.java
@@ -0,0 +1,21 @@
+package top.zynorl.petplanet.post.sqlServer.server.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import top.zynorl.petplanet.post.sqlServer.dao.CommentInfoDAO;
+import top.zynorl.petplanet.post.sqlServer.entity.CommentInfoDO;
+import top.zynorl.petplanet.post.sqlServer.server.ICommentInfoDBService;
+
+/**
+ *
implements ICommentInfoDBService {
+
+}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/LocationInfoDBServiceImpl.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/LocationInfoDBServiceImpl.java
similarity index 66%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/LocationInfoDBServiceImpl.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/LocationInfoDBServiceImpl.java
index a3d2435..b7707bb 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/LocationInfoDBServiceImpl.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/LocationInfoDBServiceImpl.java
@@ -1,13 +1,12 @@
-package top.zynorl.petplanet.sqlServer.service.impl;
+package top.zynorl.petplanet.post.sqlServer.server.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
-import top.zynorl.petplanet.sqlServer.dao.LocationInfoDAO;
-import top.zynorl.petplanet.sqlServer.datasource.annotation.DataSourceSwitch;
-import top.zynorl.petplanet.sqlServer.entity.LocationInfoDO;
-import top.zynorl.petplanet.sqlServer.service.ILocationInfoDBService;
+import top.zynorl.petplanet.post.sqlServer.dao.LocationInfoDAO;
+import top.zynorl.petplanet.post.sqlServer.entity.LocationInfoDO;
+import top.zynorl.petplanet.post.sqlServer.server.ILocationInfoDBService;
/**
*
@@ -18,7 +17,6 @@
* @since 2024-01-02
*/
@Service
-@DataSourceSwitch(value = "postDataSource")
public class LocationInfoDBServiceImpl extends ServiceImpl implements ILocationInfoDBService {
@Override
public void deleteByTransactionId(String transactionId) {
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostCommentRelationDBServiceImpl.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostCommentRelationDBServiceImpl.java
similarity index 52%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostCommentRelationDBServiceImpl.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostCommentRelationDBServiceImpl.java
index 37a4e71..661a195 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostCommentRelationDBServiceImpl.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostCommentRelationDBServiceImpl.java
@@ -1,12 +1,11 @@
-package top.zynorl.petplanet.sqlServer.service.impl;
+package top.zynorl.petplanet.post.sqlServer.server.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
-import top.zynorl.petplanet.sqlServer.dao.PostCommentRelationDAO;
-import top.zynorl.petplanet.sqlServer.datasource.annotation.DataSourceSwitch;
-import top.zynorl.petplanet.sqlServer.entity.PostCommentRelationDO;
-import top.zynorl.petplanet.sqlServer.service.IPostCommentRelationDBService;
+import top.zynorl.petplanet.post.sqlServer.dao.PostCommentRelationDAO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostCommentRelationDO;
+import top.zynorl.petplanet.post.sqlServer.server.IPostCommentRelationDBService;
/**
*
@@ -17,7 +16,6 @@
* @since 2024-01-02
*/
@Service
-@DataSourceSwitch(value = "postDataSource")
public class PostCommentRelationDBServiceImpl extends ServiceImpl implements IPostCommentRelationDBService {
}
diff --git a/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostInfoDBServiceImpl.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostInfoDBServiceImpl.java
new file mode 100644
index 0000000..f3c8603
--- /dev/null
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostInfoDBServiceImpl.java
@@ -0,0 +1,21 @@
+package top.zynorl.petplanet.post.sqlServer.server.impl;
+
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import top.zynorl.petplanet.post.sqlServer.dao.PostInfoDAO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostInfoDO;
+import top.zynorl.petplanet.post.sqlServer.server.IPostInfoDBService;
+
+/**
+ *
+ * 帖子信息表 服务实现类
+ *
+ *
+ * @author zynorl/niuzy
+ * @since 2024-01-02
+ */
+@Service
+public class PostInfoDBServiceImpl extends ServiceImpl implements IPostInfoDBService {
+
+}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostPermissionInfoDBServiceImpl.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostPermissionInfoDBServiceImpl.java
similarity index 50%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostPermissionInfoDBServiceImpl.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostPermissionInfoDBServiceImpl.java
index 7e05b04..5c720d8 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostPermissionInfoDBServiceImpl.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostPermissionInfoDBServiceImpl.java
@@ -1,12 +1,11 @@
-package top.zynorl.petplanet.sqlServer.service.impl;
+package top.zynorl.petplanet.post.sqlServer.server.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
-import top.zynorl.petplanet.sqlServer.dao.PostPermissionInfoDAO;
-import top.zynorl.petplanet.sqlServer.datasource.annotation.DataSourceSwitch;
-import top.zynorl.petplanet.sqlServer.entity.PostPermissionInfoDO;
-import top.zynorl.petplanet.sqlServer.service.IPostPermissionInfoDBService;
+import top.zynorl.petplanet.post.sqlServer.dao.PostPermissionInfoDAO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostPermissionInfoDO;
+import top.zynorl.petplanet.post.sqlServer.server.IPostPermissionInfoDBService;
/**
*
@@ -17,7 +16,6 @@
* @since 2024-01-02
*/
@Service
-@DataSourceSwitch(value = "postDataSource")
public class PostPermissionInfoDBServiceImpl extends ServiceImpl implements IPostPermissionInfoDBService {
}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostPetRelationDBServiceImpl.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostPetRelationDBServiceImpl.java
similarity index 50%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostPetRelationDBServiceImpl.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostPetRelationDBServiceImpl.java
index bc9b55b..4f258b6 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostPetRelationDBServiceImpl.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostPetRelationDBServiceImpl.java
@@ -1,12 +1,11 @@
-package top.zynorl.petplanet.sqlServer.service.impl;
+package top.zynorl.petplanet.post.sqlServer.server.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
-import top.zynorl.petplanet.sqlServer.dao.PostPetRelationDAO;
-import top.zynorl.petplanet.sqlServer.datasource.annotation.DataSourceSwitch;
-import top.zynorl.petplanet.sqlServer.entity.PostPetRelationDO;
-import top.zynorl.petplanet.sqlServer.service.IPostPetRelationDBService;
+import top.zynorl.petplanet.post.sqlServer.dao.PostPetRelationDAO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostPetRelationDO;
+import top.zynorl.petplanet.post.sqlServer.server.IPostPetRelationDBService;
/**
*
@@ -17,7 +16,6 @@
* @since 2024-01-02
*/
@Service
-@DataSourceSwitch(value = "postDataSource")
public class PostPetRelationDBServiceImpl extends ServiceImpl implements IPostPetRelationDBService {
}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostTagInfoDBServiceImpl.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostTagInfoDBServiceImpl.java
similarity index 50%
rename from petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostTagInfoDBServiceImpl.java
rename to petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostTagInfoDBServiceImpl.java
index 5bb9d51..357a466 100644
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/service/impl/PostTagInfoDBServiceImpl.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/server/impl/PostTagInfoDBServiceImpl.java
@@ -1,12 +1,11 @@
-package top.zynorl.petplanet.sqlServer.service.impl;
+package top.zynorl.petplanet.post.sqlServer.server.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
-import top.zynorl.petplanet.sqlServer.dao.PostTagInfoDAO;
-import top.zynorl.petplanet.sqlServer.datasource.annotation.DataSourceSwitch;
-import top.zynorl.petplanet.sqlServer.entity.PostTagInfoDO;
-import top.zynorl.petplanet.sqlServer.service.IPostTagInfoDBService;
+import top.zynorl.petplanet.post.sqlServer.dao.PostTagInfoDAO;
+import top.zynorl.petplanet.post.sqlServer.entity.PostTagInfoDO;
+import top.zynorl.petplanet.post.sqlServer.server.IPostTagInfoDBService;
/**
*
@@ -17,7 +16,6 @@
* @since 2024-01-02
*/
@Service
-@DataSourceSwitch(value = "postDataSource")
public class PostTagInfoDBServiceImpl extends ServiceImpl implements IPostTagInfoDBService {
}
diff --git a/petplanet-post/src/main/java/top/zynorl/petplanet/post/transaction/PostPublishTransactionalService.java b/petplanet-post/src/main/java/top/zynorl/petplanet/post/transaction/PostPublishTransactionalService.java
index bfa3f08..20be248 100644
--- a/petplanet-post/src/main/java/top/zynorl/petplanet/post/transaction/PostPublishTransactionalService.java
+++ b/petplanet-post/src/main/java/top/zynorl/petplanet/post/transaction/PostPublishTransactionalService.java
@@ -1,21 +1,21 @@
package top.zynorl.petplanet.post.transaction;
import cn.hutool.core.lang.UUID;
-import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.kafka.core.KafkaTemplate;
+import org.springframework.kafka.support.SendResult;
import org.springframework.stereotype.Component;
-import org.springframework.transaction.annotation.Transactional;
-import top.zynorl.petplanet.common.enums.TransactionStatusEnum;
+import org.springframework.transaction.TransactionSystemException;
+import org.springframework.util.concurrent.ListenableFutureCallback;
import top.zynorl.petplanet.mongoserver.entity.PostMO;
import top.zynorl.petplanet.mongoserver.service.PostMOService;
import top.zynorl.petplanet.post.common.pojo.bo.req.PublishPostReqBO;
import top.zynorl.petplanet.post.common.pojo.converter.PostServiceConverter;
-import top.zynorl.petplanet.post.common.pojo.dto.PublishPostDTO;
-import top.zynorl.petplanet.sqlServer.entity.LocationInfoDO;
-import top.zynorl.petplanet.sqlServer.entity.TransactionRecordDO;
-import top.zynorl.petplanet.sqlServer.service.ILocationInfoDBService;
-import top.zynorl.petplanet.sqlServer.service.ITransactionRecordService;
+import top.zynorl.petplanet.post.common.pojo.dto.PublishPostFailedCallbackDTO;
+import top.zynorl.petplanet.post.common.pojo.dto.PublishPostTransactionDTO;
+import top.zynorl.petplanet.post.sqlServer.entity.LocationInfoDO;
+import top.zynorl.petplanet.post.sqlServer.server.ILocationInfoDBService;
import java.time.LocalDateTime;
@@ -33,13 +33,16 @@ public class PostPublishTransactionalService implements TCCTransactionalService<
@Autowired
private ILocationInfoDBService locationInfoDBService;
@Autowired
- private ITransactionRecordService transactionRecordService;
- @Autowired
private PostServiceConverter postServiceConverter;
+ @Autowired
+ private KafkaTemplate kafkaTemplate;
+ private static final String postPublishTopic = "post_publish";
+ private static String postId;
+ private static Long locationId;
private PostMO post = null;
private LocationInfoDO locationInfoDO = null;
- private final PublishPostDTO publishPostDTO = new PublishPostDTO();
+ private final PublishPostTransactionDTO publishPostDTO = new PublishPostTransactionDTO();
@Override
public boolean doProcess(PublishPostReqBO publishPostReqBO) {
@@ -50,7 +53,7 @@ public boolean doProcess(PublishPostReqBO publishPostReqBO) {
try {
confirm(transactionId, post, locationInfoDO);
} catch (Exception e) {
- cancel(transactionId);
+ cancel();
return false;
}
return true;
@@ -66,6 +69,7 @@ private boolean doTry(PublishPostReqBO publishPostReqBO) {
locationInfoDO = postServiceConverter.toLocationInfoDO(publishPostReqBO);
// 解构出user,跨服务保存到user服务中
publishPostDTO.setUserId(publishPostReqBO.getUserId());
+ publishPostDTO.setTopic(postPublishTopic);
} catch (Exception e) {
log.error("转化出错" + e.getMessage());
return false;
@@ -75,19 +79,38 @@ private boolean doTry(PublishPostReqBO publishPostReqBO) {
private void confirm(String transactionId, PostMO post, LocationInfoDO locationInfoDO) {
- String postId = postMOService.savePost(post);
- locationInfoDBService.save(locationInfoDO);
+ postId = postMOService.savePost(post);
+ boolean isOk = locationInfoDBService.save(locationInfoDO);
+ if(isOk){
+ locationId = locationInfoDO.getId();
+ }
+ publishPostDTO.setTransactionId(transactionId);
publishPostDTO.setPostId(postId);
- String jsonStr = JSONUtil.toJsonStr(publishPostDTO);
- TransactionRecordDO transactionRecordDO = TransactionRecordDO.builder()
- .status(TransactionStatusEnum.STARTED.getCode()).transactionId(transactionId).data(jsonStr).build();
- transactionRecordService.save(transactionRecordDO);
+ publishPostDTO.setLocationId(locationId);
+ kafkaTemplate.send(postPublishTopic, publishPostDTO).addCallback(new ListenableFutureCallback<>() {
+ @Override
+ public void onFailure(Throwable throwable) {
+ String Msg = String.format("事务id【%s】发送失败:%s, 本地事务回滚", publishPostDTO.getTransactionId(), throwable.getMessage());
+ log.error(Msg);
+ throw new TransactionSystemException(Msg);
+ }
+
+ @Override
+ public void onSuccess(SendResult stringObjectSendResult) {
+ String Msg = String.format("事务id【%s】发送成功, 本地事务回滚", publishPostDTO.getTransactionId());
+ log.info(Msg);
+ }
+ });
}
- private void cancel(String transactionId) {
- postMOService.deletePostByTransactionId(transactionId);
- locationInfoDBService.deleteByTransactionId(transactionId);
- transactionRecordService.deleteByTransactionId(transactionId);
+ private void cancel() {
+ postMOService.deletePostById(postId);
+ locationInfoDBService.removeById(locationId);
+ }
+
+ public void DoCancel(PublishPostFailedCallbackDTO publishPostFailedCallbackDTO) {
+ postMOService.deletePostById(publishPostFailedCallbackDTO.getPostId());
+ locationInfoDBService.removeById(publishPostFailedCallbackDTO.getLocationId());
}
}
diff --git a/petplanet-post/src/main/resources/application.properties b/petplanet-post/src/main/resources/application.properties
index 02309cf..054e49a 100644
--- a/petplanet-post/src/main/resources/application.properties
+++ b/petplanet-post/src/main/resources/application.properties
@@ -1,4 +1,4 @@
-##spring.main.allow-bean-definition-overriding=true
+spring.main.allow-bean-definition-overriding=true
#
#server.port=8882
#server.servlet.context-path =/post
diff --git a/petplanet-post/src/main/resources/application.yml b/petplanet-post/src/main/resources/application.yml
index 6d3f476..d329d63 100644
--- a/petplanet-post/src/main/resources/application.yml
+++ b/petplanet-post/src/main/resources/application.yml
@@ -1,4 +1,9 @@
spring:
+ datasource:
+ username: petplanet
+ password: petplanet
+ url: jdbc:mysql://124.220.36.202:3306/petplanet-user?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
+ driver-class-name: com.mysql.cj.jdbc.Driver
kafka:
bootstrap-servers: localhost:9092
producer:
@@ -6,9 +11,17 @@ spring:
batch-size: 16384
buffer-memory: 33554432
key-serializer: org.apache.kafka.common.serialization.StringSerializer
- value-serializer: top.zynorl.transaction.fund.payment.serializer.TransactionRecordSerializer
+ value-serializer: org.apache.kafka.common.serialization.StringDeserializer
properties:
linger.ms: 100
+ consumer:
+ group-id: mq-transaction-test
+ auto-offset-reset: earliest
+ enable-auto-commit: false
+ auto-commit-interval: 1000
+ key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
+ value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
+
application:
name: petplanet-post
cloud:
@@ -22,3 +35,9 @@ server:
port: 8882
servlet:
context-path: /post
+
+mybatis-plus:
+ mapper-locations: classpath:/mapper/*Mapper.xml
+ global-config:
+ db-config:
+ id-type: auto
diff --git a/petplanet-sqlServer/src/main/resources/mapper/CommentInfoDOMapper.xml b/petplanet-post/src/main/resources/mapper/CommentInfoDOMapper.xml
similarity index 67%
rename from petplanet-sqlServer/src/main/resources/mapper/CommentInfoDOMapper.xml
rename to petplanet-post/src/main/resources/mapper/CommentInfoDOMapper.xml
index 1138900..a552662 100644
--- a/petplanet-sqlServer/src/main/resources/mapper/CommentInfoDOMapper.xml
+++ b/petplanet-post/src/main/resources/mapper/CommentInfoDOMapper.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/petplanet-sqlServer/src/main/resources/mapper/LocationInfoDOMapper.xml b/petplanet-post/src/main/resources/mapper/LocationInfoDOMapper.xml
similarity index 67%
rename from petplanet-sqlServer/src/main/resources/mapper/LocationInfoDOMapper.xml
rename to petplanet-post/src/main/resources/mapper/LocationInfoDOMapper.xml
index e330b12..2a967ab 100644
--- a/petplanet-sqlServer/src/main/resources/mapper/LocationInfoDOMapper.xml
+++ b/petplanet-post/src/main/resources/mapper/LocationInfoDOMapper.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/petplanet-sqlServer/src/main/resources/mapper/PostCommentRelationDOMapper.xml b/petplanet-post/src/main/resources/mapper/PostCommentRelationDOMapper.xml
similarity index 65%
rename from petplanet-sqlServer/src/main/resources/mapper/PostCommentRelationDOMapper.xml
rename to petplanet-post/src/main/resources/mapper/PostCommentRelationDOMapper.xml
index c2240c1..c2eb4eb 100644
--- a/petplanet-sqlServer/src/main/resources/mapper/PostCommentRelationDOMapper.xml
+++ b/petplanet-post/src/main/resources/mapper/PostCommentRelationDOMapper.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/petplanet-sqlServer/src/main/resources/mapper/PostInfoDOMapper.xml b/petplanet-post/src/main/resources/mapper/PostInfoDOMapper.xml
similarity index 68%
rename from petplanet-sqlServer/src/main/resources/mapper/PostInfoDOMapper.xml
rename to petplanet-post/src/main/resources/mapper/PostInfoDOMapper.xml
index f46f03a..a8fcf36 100644
--- a/petplanet-sqlServer/src/main/resources/mapper/PostInfoDOMapper.xml
+++ b/petplanet-post/src/main/resources/mapper/PostInfoDOMapper.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/petplanet-sqlServer/src/main/resources/mapper/PostPermissionInfoDOMapper.xml b/petplanet-post/src/main/resources/mapper/PostPermissionInfoDOMapper.xml
similarity index 65%
rename from petplanet-sqlServer/src/main/resources/mapper/PostPermissionInfoDOMapper.xml
rename to petplanet-post/src/main/resources/mapper/PostPermissionInfoDOMapper.xml
index 6c9f038..0a700ca 100644
--- a/petplanet-sqlServer/src/main/resources/mapper/PostPermissionInfoDOMapper.xml
+++ b/petplanet-post/src/main/resources/mapper/PostPermissionInfoDOMapper.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/petplanet-sqlServer/src/main/resources/mapper/PostPetRelationDOMapper.xml b/petplanet-post/src/main/resources/mapper/PostPetRelationDOMapper.xml
similarity index 66%
rename from petplanet-sqlServer/src/main/resources/mapper/PostPetRelationDOMapper.xml
rename to petplanet-post/src/main/resources/mapper/PostPetRelationDOMapper.xml
index 19de62c..33690ce 100644
--- a/petplanet-sqlServer/src/main/resources/mapper/PostPetRelationDOMapper.xml
+++ b/petplanet-post/src/main/resources/mapper/PostPetRelationDOMapper.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/petplanet-sqlServer/src/main/resources/mapper/PostTagInfoDOMapper.xml b/petplanet-post/src/main/resources/mapper/PostTagInfoDOMapper.xml
similarity index 67%
rename from petplanet-sqlServer/src/main/resources/mapper/PostTagInfoDOMapper.xml
rename to petplanet-post/src/main/resources/mapper/PostTagInfoDOMapper.xml
index a04e1f9..67d54f1 100644
--- a/petplanet-sqlServer/src/main/resources/mapper/PostTagInfoDOMapper.xml
+++ b/petplanet-post/src/main/resources/mapper/PostTagInfoDOMapper.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/petplanet-sqlServer/.gitignore b/petplanet-sqlServer/.gitignore
deleted file mode 100644
index 549e00a..0000000
--- a/petplanet-sqlServer/.gitignore
+++ /dev/null
@@ -1,33 +0,0 @@
-HELP.md
-target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**/target/
-!**/src/test/**/target/
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### VS Code ###
-.vscode/
diff --git a/petplanet-sqlServer/pom.xml b/petplanet-sqlServer/pom.xml
deleted file mode 100644
index 3d71df4..0000000
--- a/petplanet-sqlServer/pom.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
- 4.0.0
-
- top.zynorl.petplanet
- petplanet
- 0.0.1-SNAPSHOT
-
- petplanet-sqlServer
- 0.0.1-SNAPSHOT
- petplanet-sqlServer
- petplanet-sqlServer
-
- 11
-
-
-
-
- org.springframework.boot
- spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
- mysql
- mysql-connector-java
-
-
-
- com.baomidou
- mybatis-plus-boot-starter
-
-
- log4j
- log4j
-
-
-
-
-
- io.springfox
- springfox-swagger2
-
-
- org.mapstruct
- mapstruct
-
-
-
-
- io.springfox
- springfox-swagger-ui
-
-
- org.projectlombok
- lombok
-
-
- org.springframework.boot
- spring-boot-starter-aop
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/PetplanetSqlServerApplication.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/PetplanetSqlServerApplication.java
deleted file mode 100644
index aef3d02..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/PetplanetSqlServerApplication.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package top.zynorl.petplanet.sqlServer;
-
-import org.mybatis.spring.annotation.MapperScan;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.EnableAspectJAutoProxy;
-
-@SpringBootApplication
-@MapperScan("top.zynorl.petplanet.sqlServer.dao")
-public class PetplanetSqlServerApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(PetplanetSqlServerApplication.class, args);
- }
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PetInfoDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PetInfoDAO.java
deleted file mode 100644
index 43b41db..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PetInfoDAO.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PetInfoDO;
-
-/**
- *
- * 宠物信息表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface PetInfoDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PictureInfoDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PictureInfoDAO.java
deleted file mode 100644
index 35fe518..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PictureInfoDAO.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PictureInfoDO;
-
-/**
- *
- * 图片信息表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface PictureInfoDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPictureRelationDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPictureRelationDAO.java
deleted file mode 100644
index a03b2ed..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/PostPictureRelationDAO.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.PostPictureRelationDO;
-
-/**
- *
- * 帖子与其图片集映射表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface PostPictureRelationDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/TransactionRecordDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/TransactionRecordDAO.java
deleted file mode 100644
index 435111b..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/TransactionRecordDAO.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.TransactionRecordDO;
-
-/**
- *
- * 事务记录表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-05
- */
-@Mapper
-public interface TransactionRecordDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserBlacklistDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserBlacklistDAO.java
deleted file mode 100644
index 4f10f53..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserBlacklistDAO.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.UserBlacklistDO;
-
-/**
- *
- * 用户黑名单表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface UserBlacklistDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserCommentRelationDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserCommentRelationDAO.java
deleted file mode 100644
index 193116e..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserCommentRelationDAO.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.UserCommentRelationDO;
-
-/**
- *
- * 用户与评论的关联表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface UserCommentRelationDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserFollowerDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserFollowerDAO.java
deleted file mode 100644
index 85706e1..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserFollowerDAO.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.UserFollowerDO;
-
-/**
- *
- * 用户粉丝表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface UserFollowerDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserInfoDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserInfoDAO.java
deleted file mode 100644
index 0286d14..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserInfoDAO.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import top.zynorl.petplanet.sqlServer.datasource.annotation.DataSourceSwitch;
-import top.zynorl.petplanet.sqlServer.entity.UserInfoDO;
-
-import java.util.List;
-
-/**
- *
- * 用户信息表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface UserInfoDAO extends BaseMapper {
-
- /**
- * 根据keyword模糊查询用户名,得到用户信息列表
- */
- List getUserInfoDOListByKeyword(@Param("keyword") String keyword);
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserPostRelationDAO.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserPostRelationDAO.java
deleted file mode 100644
index 4b9c524..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/dao/UserPostRelationDAO.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package top.zynorl.petplanet.sqlServer.dao;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-import top.zynorl.petplanet.sqlServer.entity.UserPostRelationDO;
-
-/**
- *
- * 用户与帖子的关联表 Mapper 接口
- *
- *
- * @author zynorl/niuzy
- * @since 2024-01-02
- */
-@Mapper
-public interface UserPostRelationDAO extends BaseMapper {
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/annotation/DataSourceSwitch.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/annotation/DataSourceSwitch.java
deleted file mode 100644
index 5091b5c..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/annotation/DataSourceSwitch.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package top.zynorl.petplanet.sqlServer.datasource.annotation;
-
-import java.lang.annotation.*;
-
-/**
- * Created by zynorl on 2024/1/15 13:55
- */
-@Documented
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface DataSourceSwitch {
- String value() default ""; // 数据源名称或标识符
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/config/MyBatisConfig.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/config/MyBatisConfig.java
deleted file mode 100644
index 388516b..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/config/MyBatisConfig.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package top.zynorl.petplanet.sqlServer.datasource.config;
-
-import org.apache.ibatis.session.SqlSessionFactory;
-import org.mybatis.spring.SqlSessionFactoryBean;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-import org.springframework.core.io.support.ResourcePatternResolver;
-
-import javax.sql.DataSource;
-
-/**
- * Created by zynorl on 2024/1/15 15:45
- */
-@Configuration
-public class MyBatisConfig {
- @Autowired
- private DataSource dynamicRoutingDataSource;
-
-
- @Bean
- public SqlSessionFactory sqlSessionFactory() throws Exception {
- SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
- factoryBean.setDataSource(dynamicRoutingDataSource);
- ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();
- Resource[] mappings = resourcePatternResolver.getResources("classpath:/mapper/*Mapper.xml");
- factoryBean.setMapperLocations(mappings); // 配置Mapping映射路径
- return factoryBean.getObject();
- }
-
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/context/DataSourceContextHolder.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/context/DataSourceContextHolder.java
deleted file mode 100644
index 90a18c0..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/context/DataSourceContextHolder.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package top.zynorl.petplanet.sqlServer.datasource.context;
-
-/**
- * Created by zynorl on 2024/1/15 14:22
- */
-public class DataSourceContextHolder {
- private static final ThreadLocal contextHolder = new ThreadLocal<>();
-
- public static void setDataSourceType(String dataSourceType) {
- contextHolder.set(dataSourceType);
- }
-
- public static String getDataSourceType() {
- return contextHolder.get();
- }
-
- public static void clearDataSourceType() {
- contextHolder.remove();
- }
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/dynamic/DataSourceBeanPostProcessor.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/dynamic/DataSourceBeanPostProcessor.java
deleted file mode 100644
index 79ce37e..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/dynamic/DataSourceBeanPostProcessor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package top.zynorl.petplanet.sqlServer.datasource.dynamic;
-
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.config.BeanPostProcessor;
-import org.springframework.stereotype.Component;
-import top.zynorl.petplanet.sqlServer.datasource.annotation.DataSourceSwitch;
-import top.zynorl.petplanet.sqlServer.datasource.context.DataSourceContextHolder;
-
-/**
- * Created by zynorl on 2024/1/16 11:38
- */
-@Component
-public class DataSourceBeanPostProcessor implements BeanPostProcessor {
- @Override
- public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
- Class> clazz = bean.getClass();
- DataSourceSwitch classLevelAnnotation = clazz.getAnnotation(DataSourceSwitch.class);
- if (classLevelAnnotation != null) {
- // 设置类级别的数据源
- String targetDataSource = classLevelAnnotation.value();
- DataSourceContextHolder.setDataSourceType(targetDataSource);
- }
- return bean;
- }
-
- @Override
- public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
- return bean;
- }
-}
diff --git a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/dynamic/DataSourceConfig.java b/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/dynamic/DataSourceConfig.java
deleted file mode 100644
index 5a69cda..0000000
--- a/petplanet-sqlServer/src/main/java/top/zynorl/petplanet/sqlServer/datasource/dynamic/DataSourceConfig.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package top.zynorl.petplanet.sqlServer.datasource.dynamic;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.jdbc.DataSourceBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
-import top.zynorl.petplanet.sqlServer.datasource.context.DataSourceContextHolder;
-
-import javax.sql.DataSource;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Created by zynorl on 2024/1/15 15:30
- */
-@Configuration
-public class DataSourceConfig {
-
- @Bean(name = "defaultDataSource")
- @ConfigurationProperties(prefix = "spring.datasource.db")
- public DataSource defaultDataSource() {
- return DataSourceBuilder.create().build();
- }
- @Bean(name = "userDataSource")
- @ConfigurationProperties(prefix = "spring.datasource.db1")
- public DataSource userDataSource() {
- return DataSourceBuilder.create().build();
- }
-
- @Bean(name = "postDataSource")
- @ConfigurationProperties(prefix = "spring.datasource.db2")
- public DataSource postDataSource() {
- return DataSourceBuilder.create().build();
- }
-
- @Bean(name = "petDataSource")
- @ConfigurationProperties(prefix = "spring.datasource.db3")
- public DataSource petDataSource() {
- return DataSourceBuilder.create().build();
- }
-
- // 实现自定义的RoutingDataSource
- @Bean
- public DataSource dynamicRoutingDataSource() {
- AbstractRoutingDataSource dataSource = new AbstractRoutingDataSource() {
- @Override
- protected Object determineCurrentLookupKey() {
- return DataSourceContextHolder.getDataSourceType();
- }
- };
- Map