-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[add] [post] module集成mybatisPlus,post publish 映射VO
- Loading branch information
Showing
83 changed files
with
3,035 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
petplanet-post/src/main/java/top/zynorl/petplanet/post/common/pojo/bo/PublishPostReqBO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package top.zynorl.petplanet.post.common.pojo.bo; | ||
|
||
import lombok.Data; | ||
import top.zynorl.petplanet.post.common.pojo.req.PublishPostReq; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @version 1.0 | ||
* @Author niuzy | ||
* @Date 2024/01/02 | ||
**/ | ||
@Data | ||
public class PublishPostReqBO { | ||
private String username; | ||
private String title; | ||
private String content; | ||
private List<String> pictures; | ||
private List<String> videos; | ||
private String tag; | ||
private String ip; | ||
private String permission; | ||
private String publicType; | ||
private Long editTime; | ||
private Long createTime; | ||
private PublishPostReq.LocationReq locationReq; | ||
|
||
@Data | ||
public static class LocationReq{ | ||
private String name; | ||
private String address; | ||
private String nation; | ||
private String province; | ||
private String city; | ||
private String district; | ||
private Double lat; | ||
private Double lng; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...rc/main/java/top/zynorl/petplanet/post/common/pojo/converter/PostControllerConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package top.zynorl.petplanet.post.common.pojo.converter; | ||
|
||
import org.mapstruct.Mapper; | ||
import top.zynorl.petplanet.common.converter.BaseConverter; | ||
import top.zynorl.petplanet.common.converter.ConverterConfig; | ||
import top.zynorl.petplanet.post.common.pojo.bo.PublishPostReqBO; | ||
import top.zynorl.petplanet.post.common.pojo.req.PublishPostReq; | ||
|
||
/** | ||
* @version 1.0 | ||
* @Author niuzy | ||
* @Date 2024/01/02 | ||
**/ | ||
@Mapper(config = ConverterConfig.class) | ||
public interface PostControllerConverter extends BaseConverter { | ||
PublishPostReqBO toPublishPostReqBO(PublishPostReq publishPostReq); | ||
} |
38 changes: 38 additions & 0 deletions
38
petplanet-post/src/main/java/top/zynorl/petplanet/post/common/pojo/req/PublishPostReq.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package top.zynorl.petplanet.post.common.pojo.req; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @version 1.0 | ||
* @Author niuzy | ||
* @Date 2024/01/02 | ||
**/ | ||
@Data | ||
public class PublishPostReq { | ||
private String title; | ||
private String content; | ||
private List<String> pictures; | ||
private List<String> videos; | ||
private String tag; | ||
private String ip; | ||
private String permission; | ||
private String publicType; | ||
private Long editTime; | ||
private Long createTime; | ||
private LocationReq locationReq; | ||
|
||
@Data | ||
public static class LocationReq{ | ||
private String name; | ||
private String address; | ||
private String nation; | ||
private String province; | ||
private String city; | ||
private String district; | ||
private Double lat; | ||
private Double lng; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
petplanet-post/src/main/java/top/zynorl/petplanet/post/controller/PostController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package top.zynorl.petplanet.post.controller; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import top.zynorl.petplanet.post.common.pojo.bo.PublishPostReqBO; | ||
import top.zynorl.petplanet.post.common.pojo.req.PublishPostReq; | ||
import top.zynorl.petplanet.post.common.pojo.converter.PostControllerConverter; | ||
|
||
/** | ||
* @version 1.0 | ||
* @Author niuzy | ||
* @Date 2024/01/02 | ||
**/ | ||
@RestController | ||
@RequestMapping("/post") | ||
public class PostController { | ||
@Autowired | ||
private PostControllerConverter postControllerConverter; | ||
@RequestMapping("/publish") | ||
public void publish(@RequestBody PublishPostReq publishPostReq){ | ||
// TODO 获取登录人信息 | ||
PublishPostReqBO publishPostReqBO = postControllerConverter.toPublishPostReqBO(publishPostReq); | ||
|
||
|
||
} | ||
} |
183 changes: 183 additions & 0 deletions
183
petplanet-post/src/main/java/top/zynorl/petplanet/post/sqlServer/entity/CommentInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
package top.zynorl.petplanet.post.sqlServer.entity; | ||
|
||
import com.baomidou.mybatisplus.annotation.TableName; | ||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
|
||
/** | ||
* <p> | ||
* 评论信息表 | ||
* </p> | ||
* | ||
* @author zynorl/niuzy | ||
* @since 2024-01-02 | ||
*/ | ||
@TableName("comment_info") | ||
@ApiModel(value = "CommentInfo对象", description = "评论信息表") | ||
public class CommentInfo implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private Long id; | ||
|
||
@ApiModelProperty("帖子ID") | ||
private Long postId; | ||
|
||
@ApiModelProperty("评论人的ID") | ||
private Long userId; | ||
|
||
@ApiModelProperty("评论人名称") | ||
private String username; | ||
|
||
@ApiModelProperty("评论的内容") | ||
private String text; | ||
|
||
@ApiModelProperty("点赞数") | ||
private Integer likeNum; | ||
|
||
@ApiModelProperty("回复数") | ||
private Integer replyNum; | ||
|
||
@ApiModelProperty("0:不可见,1:可见") | ||
private Byte status; | ||
|
||
@ApiModelProperty("发表ip") | ||
private String ip; | ||
|
||
@ApiModelProperty("上级ID,如果为0表示文章的顶级评论") | ||
private Long parentId; | ||
|
||
@ApiModelProperty("评论的创建时间") | ||
private LocalDateTime createTime; | ||
|
||
@ApiModelProperty("评论的更新时间") | ||
private LocalDateTime updateTime; | ||
|
||
@ApiModelProperty("1表示删除,实现逻辑删除") | ||
private Byte isDelete; | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public Long getPostId() { | ||
return postId; | ||
} | ||
|
||
public void setPostId(Long postId) { | ||
this.postId = postId; | ||
} | ||
|
||
public Long getUserId() { | ||
return userId; | ||
} | ||
|
||
public void setUserId(Long userId) { | ||
this.userId = userId; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
|
||
public Integer getLikeNum() { | ||
return likeNum; | ||
} | ||
|
||
public void setLikeNum(Integer likeNum) { | ||
this.likeNum = likeNum; | ||
} | ||
|
||
public Integer getReplyNum() { | ||
return replyNum; | ||
} | ||
|
||
public void setReplyNum(Integer replyNum) { | ||
this.replyNum = replyNum; | ||
} | ||
|
||
public Byte getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(Byte status) { | ||
this.status = status; | ||
} | ||
|
||
public String getIp() { | ||
return ip; | ||
} | ||
|
||
public void setIp(String ip) { | ||
this.ip = ip; | ||
} | ||
|
||
public Long getParentId() { | ||
return parentId; | ||
} | ||
|
||
public void setParentId(Long parentId) { | ||
this.parentId = parentId; | ||
} | ||
|
||
public LocalDateTime getCreateTime() { | ||
return createTime; | ||
} | ||
|
||
public void setCreateTime(LocalDateTime createTime) { | ||
this.createTime = createTime; | ||
} | ||
|
||
public LocalDateTime getUpdateTime() { | ||
return updateTime; | ||
} | ||
|
||
public void setUpdateTime(LocalDateTime updateTime) { | ||
this.updateTime = updateTime; | ||
} | ||
|
||
public Byte getIsDelete() { | ||
return isDelete; | ||
} | ||
|
||
public void setIsDelete(Byte isDelete) { | ||
this.isDelete = isDelete; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CommentInfo{" + | ||
"id = " + id + | ||
", postId = " + postId + | ||
", userId = " + userId + | ||
", username = " + username + | ||
", text = " + text + | ||
", likeNum = " + likeNum + | ||
", replyNum = " + replyNum + | ||
", status = " + status + | ||
", ip = " + ip + | ||
", parentId = " + parentId + | ||
", createTime = " + createTime + | ||
", updateTime = " + updateTime + | ||
", isDelete = " + isDelete + | ||
"}"; | ||
} | ||
} |
Oops, something went wrong.