diff --git a/february-patient-common/src/main/java/com/february/patient/domain/Review.java b/february-patient-common/src/main/java/com/february/patient/domain/Review.java new file mode 100644 index 0000000..b1e4828 --- /dev/null +++ b/february-patient-common/src/main/java/com/february/patient/domain/Review.java @@ -0,0 +1,125 @@ +package com.february.patient.domain; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 20:27 + **/ + +import java.util.Date; + +/** + * 评论表 + */ +public class Review { + /** + * 评论表id + */ + private Integer reviewId; + /** + * 评论者头像 + */ + private String reviewImg; + /** + * 评论者名称 + */ + private String reviewName; + /** + * 评论内容 + */ + private String reviewContent; + /** + * 评论时间 + */ + private Date reviewDate; + /** + * 点赞数 + */ + private Integer goodNum; + /** + * 点踩数 + */ + private Integer badNum; + /** + * 外键病友圈详情id + */ + private Integer patientCircleDetailId; + + public Integer getPatientCircleDetailId() { + return patientCircleDetailId; + } + + public void setPatientCircleDetailId(Integer patientCircleDetailId) { + this.patientCircleDetailId = patientCircleDetailId; + } + + public Integer getReviewId() { + return reviewId; + } + + public void setReviewId(Integer reviewId) { + this.reviewId = reviewId; + } + + public String getReviewImg() { + return reviewImg; + } + + public void setReviewImg(String reviewImg) { + this.reviewImg = reviewImg; + } + + public String getReviewName() { + return reviewName; + } + + public void setReviewName(String reviewName) { + this.reviewName = reviewName; + } + + public String getReviewContent() { + return reviewContent; + } + + public void setReviewContent(String reviewContent) { + this.reviewContent = reviewContent; + } + + public Date getReviewDate() { + return reviewDate; + } + + public void setReviewDate(Date reviewDate) { + this.reviewDate = reviewDate; + } + + public Integer getGoodNum() { + return goodNum; + } + + public void setGoodNum(Integer goodNum) { + this.goodNum = goodNum; + } + + public Integer getBadNum() { + return badNum; + } + + public void setBadNum(Integer badNum) { + this.badNum = badNum; + } + + @Override + public String toString() { + return "Review{" + + "reviewId=" + reviewId + + ", reviewImg='" + reviewImg + '\'' + + ", reviewName='" + reviewName + '\'' + + ", reviewContent='" + reviewContent + '\'' + + ", reviewDate=" + reviewDate + + ", goodNum=" + goodNum + + ", badNum=" + badNum + + '}'; + } +} diff --git a/february-patient-server/src/main/java/com/february/patient/controller/ReviewController.java b/february-patient-server/src/main/java/com/february/patient/controller/ReviewController.java new file mode 100644 index 0000000..4cc3ae6 --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/controller/ReviewController.java @@ -0,0 +1,28 @@ +package com.february.patient.controller; + +import com.february.patient.domain.Review; +import com.february.patient.service.ReviewService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 20:43 + **/ +@RestController +@RequestMapping("/review") +public class ReviewController { + @Autowired + private ReviewService reviewService; + @PostMapping("/findReviewListByPatientCircleDetailId") + public List findReviewListByPatientCircleDetailId(@RequestParam Integer patientCircleDetailId){ + return reviewService.findReviewListByPatientCircleDetailId(patientCircleDetailId); + } +} diff --git a/february-patient-server/src/main/java/com/february/patient/mapper/ReviewMapper.java b/february-patient-server/src/main/java/com/february/patient/mapper/ReviewMapper.java new file mode 100644 index 0000000..dcfc985 --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/mapper/ReviewMapper.java @@ -0,0 +1,16 @@ +package com.february.patient.mapper; + +import com.february.patient.domain.Review; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 20:43 + **/ +public interface ReviewMapper { + List findReviewListByPatientCircleDetailId(@Param("patientCircleDetailId") Integer patientCircleDetailId); +} diff --git a/february-patient-server/src/main/java/com/february/patient/service/ReviewService.java b/february-patient-server/src/main/java/com/february/patient/service/ReviewService.java new file mode 100644 index 0000000..cc6f2d0 --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/service/ReviewService.java @@ -0,0 +1,15 @@ +package com.february.patient.service; + +import com.february.patient.domain.Review; + +import java.util.List; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 20:44 + **/ +public interface ReviewService { + List findReviewListByPatientCircleDetailId(Integer patientCircleDetailId); +} diff --git a/february-patient-server/src/main/java/com/february/patient/service/impl/ReviewServiceImpl.java b/february-patient-server/src/main/java/com/february/patient/service/impl/ReviewServiceImpl.java new file mode 100644 index 0000000..fe74d12 --- /dev/null +++ b/february-patient-server/src/main/java/com/february/patient/service/impl/ReviewServiceImpl.java @@ -0,0 +1,25 @@ +package com.february.patient.service.impl; + +import com.february.patient.domain.Review; +import com.february.patient.mapper.ReviewMapper; +import com.february.patient.service.ReviewService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @program: february-patient-circle + * @description: + * @author: Mr.Wang + * @create: 2023-11-02 20:44 + **/ +@Service +public class ReviewServiceImpl implements ReviewService { + @Autowired + private ReviewMapper reviewMapper; + @Override + public List findReviewListByPatientCircleDetailId(Integer patientCircleDetailId) { + return reviewMapper.findReviewListByPatientCircleDetailId(patientCircleDetailId); + } +} diff --git a/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml b/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml index 4de53dc..4221ab9 100644 --- a/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml +++ b/february-patient-server/src/main/resources/mapper/patient/PatientMapper.xml @@ -10,12 +10,13 @@ - + diff --git a/february-patient-server/src/main/resources/mapper/patient/ReviewMapper.xml b/february-patient-server/src/main/resources/mapper/patient/ReviewMapper.xml new file mode 100644 index 0000000..feca142 --- /dev/null +++ b/february-patient-server/src/main/resources/mapper/patient/ReviewMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + +