Merge remote-tracking branch 'origin/master'

# Conflicts:
#	doctor-modules/doctor-health/src/main/java/doctor/controller/UserVideoController.java
#	doctor-modules/doctor-health/src/main/java/doctor/controller/VideoController.java
cbx
chenbingxuan 2024-01-13 09:40:30 +08:00
commit f7719d93c1
40 changed files with 784 additions and 393 deletions

View File

@ -20,10 +20,6 @@ public class Doctor {
private String personalProfile;
private String goodField;
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
private Department department;
public Department getDepartment() {
@ -34,6 +30,10 @@ public class Doctor {
this.department = department;
}
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime;
public Integer getId() {
return id;
}
@ -86,8 +86,8 @@ public class Doctor {
return pwd;
}
public void setPwd(String password) {
this.pwd = password;
public void setPwd(String pwd) {
this.pwd = pwd;
}
public String getName() {

View File

@ -15,11 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -51,6 +51,10 @@ public class Constants
*
*/
public static final Integer SUCCESS = 200;
/**
*
*/
/**
*

View File

@ -15,11 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -15,11 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -15,11 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -0,0 +1,53 @@
package doctor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* @Author ifredom
* @Description : Entity - Vo
* @Date 2022/5/10 15:59
* @Param [params]
**/
public class ConvertUtil {
public static final Logger logger = LoggerFactory.getLogger(ConvertUtil.class);
public static <T> T entityToVo(Object source, Class<T> target) {
if (source == null) {
return null;
}
T targetObject = null;
try {
targetObject = target.newInstance();
BeanUtils.copyProperties(source, targetObject);
} catch (Exception e) {
e.printStackTrace();
}
return targetObject;
}
public static <T> List<T> entityToVoList(Collection<?> sourceList, Class<T> target) {
if (sourceList == null) {
return null;
}
List<T> targetList = new ArrayList<>(sourceList.size());
try {
for (Object source : sourceList) {
T targetObject = target.newInstance();
BeanUtils.copyProperties(source, targetObject);
targetList.add(targetObject);
}
} catch (Exception e) {
logger.error("convert error ", e);
}
return targetList;
}
}

View File

@ -0,0 +1,35 @@
package doctor.controller;
import doctor.common.core.domain.HealthR;
import doctor.domain.vo.InquiryDetailsRecordVo;
import doctor.service.InquiryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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;
import static com.github.pagehelper.page.PageMethod.startPage;
/**
* @ClassName : InquiryController
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 19:09
*/
@RestController
@RequestMapping("/user/inquiry/verify/v1")
public class InquiryController {
@Autowired
private InquiryService inquiryService;
//历史问诊记录列表
@GetMapping("/findHistoryInquiryRecord")
public HealthR<List<InquiryDetailsRecordVo>> findHistoryInquiryRecord(@RequestParam Integer page,@RequestParam Integer count){
startPage(page,count);
List<InquiryDetailsRecordVo> inquiryDetailsRecordVoList = inquiryService.findHistoryInquiryRecord();
return HealthR.ok(inquiryDetailsRecordVoList);
}
}

View File

@ -1,16 +1,20 @@
package doctor.controller;
import doctor.common.core.domain.HealthR;
import doctor.common.core.domain.R;
import doctor.domain.entity.UserVideoBuyEntity;
import doctor.domain.entity.UserVideoCollectionEntity;
import doctor.domain.entity.UserWalletEntity;
import doctor.domain.vo.UserVideoBuyVo;
import doctor.domain.vo.UserVideoCollectionVo;
import doctor.service.UserVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import static com.github.pagehelper.page.PageMethod.startPage;
/**
* @ClassName : UserVideoController
* @Description :
@ -25,9 +29,10 @@ public class UserVideoController {
//用户视频收藏列表
@GetMapping("/findVideoCollectionList")
public HealthR<List<UserVideoCollectionEntity>>findVideoCollectionList(){
List<UserVideoCollectionEntity> userVideoCollectionList =userVideoService.findVideoCollectionList();
return HealthR.ok(userVideoCollectionList);
public HealthR<List<UserVideoCollectionVo>> findVideoCollectionList(@RequestParam Integer page,@RequestParam Integer count){
startPage(page,count);
List<UserVideoCollectionVo> userVideoCollectionVos=userVideoService.findVideoCollectionList();
return HealthR.ok(userVideoCollectionVos);
}
//用户取消视频收藏
@GetMapping("/cancelVideoCollection/{id}")
@ -37,9 +42,10 @@ public class UserVideoController {
}
//用户购买视频列表
@GetMapping("/findUserVideoBuyList")
public HealthR<List<UserVideoBuyEntity>>findUserVideoBuyList(){
List<UserVideoBuyEntity> userVideoBuys =userVideoService.findUserVideoBuyList();
return HealthR.ok(userVideoBuys);
public HealthR<List<UserVideoBuyVo>>findUserVideoBuyList(@RequestParam Integer page, @RequestParam Integer count){
startPage(page,count);
List<UserVideoBuyVo> userVideoCollectionVos =userVideoService.findUserVideoBuyList();
return HealthR.ok(userVideoCollectionVos);
}
//用户删除购买的视频
@DeleteMapping("/deleteVideoBuy/{id}")

View File

@ -21,22 +21,22 @@ public class VideoController {
@Autowired
private VideoService videoService;
//收藏健康讲堂视频列表
@PostMapping("/verify/v1/addUserVideoCollection")
public HealthR addUserVideoCollection(@RequestBody UserVideoCollectionEntity userVideoCollection){
videoService.addUserVideoCollection(userVideoCollection);
@PostMapping("/verify/v1/addUserVideoCollection/{videoId}")
public HealthR addUserVideoCollection(@RequestParam Integer videoId){
videoService.addUserVideoCollection(videoId);
return HealthR.ok();
}
//购买健康讲堂视频
@PostMapping("/verify/v1/videoBuy")
public HealthR videoBuy(@RequestBody UserVideoBuyEntity userVideoBuy){
videoService.videoBuy(userVideoBuy);
public HealthR videoBuy(@RequestParam Integer videoId, @RequestParam Integer price){
videoService.videoBuy(videoId,price);
return HealthR.ok();
}
//视频评论列表
@GetMapping("/v1/findVideoCommentList")
public HealthR<List<VideoComment>> findVideoCommentList(){
List<VideoComment> videoCommentList = videoService.findVideoCommentList();
return HealthR.ok(videoCommentList);
}
// //视频评论列表
// @GetMapping("/v1/findVideoCommentList")
// public R<List<VideoCommentEntity>> findVideoCommentList(){
// List<VideoCommentEntity> videoCommentList = videoService.findVideoCommentList();
// return R.ok(videoCommentList);
// }
}

View File

@ -0,0 +1,106 @@
package doctor.domain.entity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @ClassName : InquiryDetailsRecordEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 17:26
*/
public class InquiryDetailsRecordEntity {
private Integer id;
private Integer inquiryId;
private Integer userId;
private Integer friendId;
private String askContent;
private String askImage;
private String voiceChat;
private Integer direction;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date askTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getInquiryId() {
return inquiryId;
}
public void setInquiryId(Integer inquiryId) {
this.inquiryId = inquiryId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getFriendId() {
return friendId;
}
public void setFriendId(Integer friendId) {
this.friendId = friendId;
}
public String getAskContent() {
return askContent;
}
public void setAskContent(String askContent) {
this.askContent = askContent;
}
public String getAskImage() {
return askImage;
}
public void setAskImage(String askImage) {
this.askImage = askImage;
}
public String getVoiceChat() {
return voiceChat;
}
public void setVoiceChat(String voiceChat) {
this.voiceChat = voiceChat;
}
public Integer getDirection() {
return direction;
}
public void setDirection(Integer direction) {
this.direction = direction;
}
public Date getAskTime() {
return askTime;
}
public void setAskTime(Date askTime) {
this.askTime = askTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -0,0 +1,75 @@
package doctor.domain.entity;
import java.util.Date;
/**
* @ClassName : SickCircleCommentEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 19:57
*/
public class SickCircleCommentEntity {
private Integer id;
private Integer sickCircleId;
private Integer userId;
private String content;
private Date commentTime;
private Integer whetherDoctor;
private Long createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getSickCircleId() {
return sickCircleId;
}
public void setSickCircleId(Integer sickCircleId) {
this.sickCircleId = sickCircleId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCommentTime() {
return commentTime;
}
public void setCommentTime(Date commentTime) {
this.commentTime = commentTime;
}
public Integer getWhetherDoctor() {
return whetherDoctor;
}
public void setWhetherDoctor(Integer whetherDoctor) {
this.whetherDoctor = whetherDoctor;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
}

View File

@ -1,16 +1,20 @@
package doctor.domain.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
/**
* @BelongsProject: Medical_Treatment
* @BelongsPackage: doctor.entity
* @Author: jpz
* @CreateTime: 2024/1/8 20:59
* @ClassName : UserEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 20:46
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserEntity {
private Integer id;
private String phone;
@ -21,121 +25,11 @@ public class UserEntity {
private String headPic;
private Integer sex;
private Integer age;
private Integer height;
private Integer weight;
private String height;
private String weight;
private String invitationCode;
private Date updateTime;
private Date createTime;
private Long createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getNickName() {
return nickName;
}
public void setNickName(String nickName) {
this.nickName = nickName;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getHeadPic() {
return headPic;
}
public void setHeadPic(String headPic) {
this.headPic = headPic;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public String getInvitationCode() {
return invitationCode;
}
public void setInvitationCode(String invitationCode) {
this.invitationCode = invitationCode;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -1,7 +1,7 @@
package doctor.domain.entity;
/**
* @ClassName : UserVideoBuy
* @ClassName : UserVideoBuyEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 15:20

View File

@ -1,7 +1,7 @@
package doctor.domain.entity;
/**
* @ClassName : UserVideoCollection
* @ClassName : UserVideoCollectionEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 14:28

View File

@ -1,7 +1,7 @@
package doctor.domain.entity;
/**
* @ClassName : UserWallet
* @ClassName : UserWalletEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 20:30

View File

@ -1,26 +0,0 @@
package doctor.domain.entity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @ClassName : Video
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 15:59
*/
@Data
public class Video {
private Integer id;
private String title;
private Integer categoryId;
private String shearUrl;
private String abstracts;
private String originalUrl;
private Integer duration;
private Integer price;
private Long createTime;
}

View File

@ -1,60 +0,0 @@
package doctor.domain.entity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @ClassName : VideoComment
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 21:54
*/
public class VideoComment {
private Integer id;
private Integer userId;
private Integer videoId;
private String content;
private Date createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getVideoId() {
return videoId;
}
public void setVideoId(Integer videoId) {
this.videoId = videoId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -1,22 +1,58 @@
package doctor.domain.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@AllArgsConstructor
@NoArgsConstructor
/**
* @ClassName : VideoCommentEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 21:54
*/
public class VideoCommentEntity {
private Integer id;
private Integer userId;
private Integer videoId;
private String content;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getVideoId() {
return videoId;
}
public void setVideoId(Integer videoId) {
this.videoId = videoId;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -1,70 +0,0 @@
package doctor.domain.entity;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* @ClassName : VideoCount
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 16:24
*/
public class VideoCount {
private Integer id;
private Integer videoId;
private Integer buyNum;
private Integer collectionNum;
private Integer commentNum;
private Date createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getVideoId() {
return videoId;
}
public void setVideoId(Integer videoId) {
this.videoId = videoId;
}
public Integer getBuyNum() {
return buyNum;
}
public void setBuyNum(Integer buyNum) {
this.buyNum = buyNum;
}
public Integer getCollectionNum() {
return collectionNum;
}
public void setCollectionNum(Integer collectionNum) {
this.collectionNum = collectionNum;
}
public Integer getCommentNum() {
return commentNum;
}
public void setCommentNum(Integer commentNum) {
this.commentNum = commentNum;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
}

View File

@ -1,5 +1,11 @@
package doctor.domain.entity;
/**
* @ClassName : VideoEntity
* @Description :
* @Author : FJJ
* @Date: 2024-01-10 15:59
*/
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -20,7 +26,5 @@ public class VideoEntity {
private String originalUrl;
private Integer duration;
private Integer price;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private Date createTime;
private Long createTime;
}

View File

@ -0,0 +1,100 @@
package doctor.domain.vo;
/**
* @ClassName : InquiryDetailsRecordVo
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 19:02
*/
public class InquiryDetailsRecordVo {
private Integer recordId;
private Integer doctorId;
private String imagePic;
private String doctorName;
private String department;
private String jobTitle;
private Integer evaluateStatus;
private String userName;
private String jiGuangPwd;
private Long inquiryTime;
public Integer getRecordId() {
return recordId;
}
public void setRecordId(Integer recordId) {
this.recordId = recordId;
}
public Integer getDoctorId() {
return doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public String getImagePic() {
return imagePic;
}
public void setImagePic(String imagePic) {
this.imagePic = imagePic;
}
public String getDoctorName() {
return doctorName;
}
public void setDoctorName(String doctorName) {
this.doctorName = doctorName;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getJobTitle() {
return jobTitle;
}
public void setJobTitle(String jobTitle) {
this.jobTitle = jobTitle;
}
public Integer getEvaluateStatus() {
return evaluateStatus;
}
public void setEvaluateStatus(Integer evaluateStatus) {
this.evaluateStatus = evaluateStatus;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getJiGuangPwd() {
return jiGuangPwd;
}
public void setJiGuangPwd(String jiGuangPwd) {
this.jiGuangPwd = jiGuangPwd;
}
public Long getInquiryTime() {
return inquiryTime;
}
public void setInquiryTime(Long inquiryTime) {
this.inquiryTime = inquiryTime;
}
}

View File

@ -0,0 +1,11 @@
package doctor.domain.vo;
/**
* @ClassName : UserArchivesVo
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 18:52
*/
public class UserArchivesVo {
private Integer recordId;
}

View File

@ -0,0 +1,64 @@
package doctor.domain.vo;
/**
* @ClassName : UserVideoBuyVo
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 16:37
*/
public class UserVideoBuyVo {
private Integer id;
private Integer videoId;
private String title;
private String original;
private Integer duration;
private Long createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getVideoId() {
return videoId;
}
public void setVideoId(Integer videoId) {
this.videoId = videoId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getOriginal() {
return original;
}
public void setOriginal(String original) {
this.original = original;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
}

View File

@ -0,0 +1,91 @@
package doctor.domain.vo;
/**
* @ClassName : UserVideoCollectionVo
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 16:11
*/
public class UserVideoCollectionVo {
private Integer id;
private String title;
private String shearUrl;
private String original;
private Integer price;
private Integer duration;
private Integer whetherBuy;
private Integer buyNum;
private Long createTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getShearUrl() {
return shearUrl;
}
public void setShearUrl(String shearUrl) {
this.shearUrl = shearUrl;
}
public String getOriginal() {
return original;
}
public void setOriginal(String original) {
this.original = original;
}
public Integer getPrice() {
return price;
}
public void setPrice(Integer price) {
this.price = price;
}
public Integer getDuration() {
return duration;
}
public void setDuration(Integer duration) {
this.duration = duration;
}
public Integer getWhetherBuy() {
return whetherBuy;
}
public void setWhetherBuy(Integer whetherBuy) {
this.whetherBuy = whetherBuy;
}
public Integer getBuyNum() {
return buyNum;
}
public void setBuyNum(Integer buyNum) {
this.buyNum = buyNum;
}
public Long getCreateTime() {
return createTime;
}
public void setCreateTime(Long createTime) {
this.createTime = createTime;
}
}

View File

@ -0,0 +1,17 @@
package doctor.mapper;
import doctor.domain.entity.InquiryDetailsRecordEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @ClassName : InquiryMapper
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 19:18
*/
@Mapper
public interface InquiryMapper {
List<InquiryDetailsRecordEntity> findHistoryInquiryRecord();
}

View File

@ -16,24 +16,23 @@ import java.util.List;
public interface VideoMapper {
void addUserVideoCollection(UserVideoCollectionEntity userVideoCollection);
void addUserVideoCollection(@Param("userId") Integer userId, @Param("videoId") Integer videoId);
Video findById(@Param("videoId") Integer videoId);
VideoEntity findById(@Param("videoId") Integer videoId);
VideoCount FindVideoId(@Param("id") Integer id);
VideoCountEntity FindVideoId(@Param("id") Integer id);
void updateVideoCount(VideoCount videoCount);
void updateVideoCount(VideoCountEntity videoCount);
UserEntity FindById(@Param("userId") Integer userId);
UserWalletEntity FindUserWallet(@Param("id") Integer id);
Video findByVideoId(@Param("videoId") Integer videoId);
void updateUserWallet(@Param("newblance") int newblance, @Param("id") Integer id);
List<VideoComment> findVideoCommentList();
// UserWallet FindById(@Param("userId") Integer userId);
// UserWalletEntity FindById(@Param("userId") Integer userId);
}

View File

@ -0,0 +1,15 @@
package doctor.service;
import doctor.domain.vo.InquiryDetailsRecordVo;
import java.util.List;
/**
* @ClassName : InquiryService
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 19:18
*/
public interface InquiryService {
List<InquiryDetailsRecordVo> findHistoryInquiryRecord();
}

View File

@ -3,6 +3,8 @@ package doctor.service;
import doctor.domain.entity.UserVideoBuyEntity;
import doctor.domain.entity.UserVideoCollectionEntity;
import doctor.domain.entity.UserWalletEntity;
import doctor.domain.vo.UserVideoBuyVo;
import doctor.domain.vo.UserVideoCollectionVo;
import java.util.List;
@ -13,13 +15,15 @@ import java.util.List;
* @Date: 2024-01-10 14:33
*/
public interface UserVideoService {
List<UserVideoCollectionEntity> findVideoCollectionList();
void cancelVideoCollection(Integer id);
List<UserVideoBuyEntity> findUserVideoBuyList();
List<UserVideoBuyVo> findUserVideoBuyList();
void deleteVideoBuy(Integer id);
List<UserWalletEntity> findUserWallet();
List<UserVideoCollectionVo> findVideoCollectionList();
}

View File

@ -12,10 +12,10 @@ import java.util.List;
*/
public interface VideoService {
void addUserVideoCollection(UserVideoCollectionEntity userVideoCollection);
void addUserVideoCollection(Integer videoId);
void videoBuy(UserVideoBuyEntity userVideoBuy);
void videoBuy(Integer videoId,Integer price);
List<VideoComment> findVideoCommentList();
}

View File

@ -0,0 +1,29 @@
package doctor.service.impl;
import doctor.ConvertUtil;
import doctor.domain.entity.InquiryDetailsRecordEntity;
import doctor.domain.vo.InquiryDetailsRecordVo;
import doctor.mapper.InquiryMapper;
import doctor.service.InquiryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @ClassName : InquiryServiceImpl
* @Description :
* @Author : FJJ
* @Date: 2024-01-12 19:19
*/
@Service
public class InquiryServiceImpl implements InquiryService {
@Autowired
private InquiryMapper inquiryMapper;
@Override
public List<InquiryDetailsRecordVo> findHistoryInquiryRecord() {
List<InquiryDetailsRecordEntity> inquiryDetailsRecordEntity = inquiryMapper.findHistoryInquiryRecord();
List<InquiryDetailsRecordVo> inquiryDetailsRecordVos = ConvertUtil.entityToVoList(inquiryDetailsRecordEntity, InquiryDetailsRecordVo.class);
return inquiryDetailsRecordVos;
}
}

View File

@ -1,8 +1,11 @@
package doctor.service.impl;
import doctor.ConvertUtil;
import doctor.domain.entity.UserVideoBuyEntity;
import doctor.domain.entity.UserVideoCollectionEntity;
import doctor.domain.entity.UserWalletEntity;
import doctor.domain.vo.UserVideoBuyVo;
import doctor.domain.vo.UserVideoCollectionVo;
import doctor.mapper.UserVideoMapper;
import doctor.service.UserVideoService;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,9 +23,13 @@ import java.util.List;
public class UserVideoServiceImpl implements UserVideoService {
@Autowired
private UserVideoMapper userVideoMapper;
@Override
public List<UserVideoCollectionEntity> findVideoCollectionList() {
return userVideoMapper.findVideoCollectionList();
public List<UserVideoCollectionVo> findVideoCollectionList() {
List<UserVideoCollectionEntity> userVideoCollectionEntityList=userVideoMapper.findVideoCollectionList();
List<UserVideoCollectionVo> userVideoCollectionVoList = ConvertUtil.entityToVoList(userVideoCollectionEntityList, UserVideoCollectionVo.class);
return userVideoCollectionVoList;
}
@Override
@ -31,8 +38,10 @@ public class UserVideoServiceImpl implements UserVideoService {
}
@Override
public List<UserVideoBuyEntity> findUserVideoBuyList() {
return userVideoMapper.findUserVideoBuyList();
public List<UserVideoBuyVo> findUserVideoBuyList() {
List<UserVideoBuyEntity> userVideoCollectionEntityList=userVideoMapper.findUserVideoBuyList();
List<UserVideoBuyVo> userVideoBuyList = ConvertUtil.entityToVoList(userVideoCollectionEntityList, UserVideoBuyVo.class);
return userVideoBuyList;
}
@Override
@ -44,4 +53,6 @@ public class UserVideoServiceImpl implements UserVideoService {
public List<UserWalletEntity> findUserWallet() {
return userVideoMapper.findUserWallet();
}
}

View File

@ -1,11 +1,13 @@
package doctor.service.impl;
import doctor.common.core.utils.JwtUtils;
import doctor.domain.entity.*;
import doctor.mapper.VideoMapper;
import doctor.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
@ -18,39 +20,38 @@ import java.util.List;
public class VideoServiceImpl implements VideoService {
@Autowired
private VideoMapper videoMapper;
@Autowired
private HttpServletRequest request;
@Override
public void addUserVideoCollection(UserVideoCollectionEntity userVideoCollection) {
public void addUserVideoCollection(Integer videoId) {
//获取用户id
String token = request.getHeader("token");
Integer userId = Integer.valueOf(JwtUtils.getUserId(token));
// 添加收藏
videoMapper.addUserVideoCollection(userVideoCollection);
videoMapper.addUserVideoCollection(userId,videoId);
// 更新视频收藏数
Video video = videoMapper.findById(userVideoCollection.getVideoId());
VideoCount videoCount = videoMapper.FindVideoId(video.getId());
VideoEntity video = videoMapper.findById(videoId);
VideoCountEntity videoCount = videoMapper.FindVideoId(video.getId());
videoMapper.updateVideoCount(videoCount);
}
@Override
public void videoBuy(UserVideoBuyEntity userVideoBuy) {
public void videoBuy(Integer videoId,Integer price) {
//获取用户id
String token = request.getHeader("token");
Integer userId = Integer.valueOf(JwtUtils.getUserId(token));
//查询用户信息
UserEntity user = videoMapper.FindById(userVideoBuy.getUserId());
//查询视频信息
Video video = videoMapper.findByVideoId(userVideoBuy.getVideoId());
UserEntity user = videoMapper.FindById(userId);
//查询用户钱包
UserWalletEntity userWallet = videoMapper.FindUserWallet(user.getId());
//判断用户钱包是否足够
if (userWallet.getBalance() >= video.getPrice()) {
if (userWallet.getBalance() >= price) {
//更新用户钱包
int newblance=userWallet.getBalance() - video.getPrice();
int newblance = userWallet.getBalance() -price;
//更新用户钱包
videoMapper.updateUserWallet(newblance,userWallet.getId());
videoMapper.updateUserWallet(newblance, userWallet.getId());
}
}
}
@Override
public List<VideoComment> findVideoCommentList() {
return videoMapper.findVideoCommentList();
}
}

View File

@ -15,24 +15,13 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
mail:
host: smtp.qq.com
port: 587
username: 3581044601@qq.com
password: bwscqgqpkagjciih
default-encoding: UTF8
properties:
mail:
smtp:
socketFactoryClass: javax.net.ssl.SSLSocketFactory
debug: true

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="doctor.mapper.InquiryMapper">
<select id="findHistoryInquiryRecord" resultType="doctor.domain.entity.InquiryDetailsRecordEntity">
select *
from inquiry_details_record
</select>
</mapper>

View File

@ -6,12 +6,12 @@
<delete id="cancelVideoCollection">
delete
from user_video_collection
where id = #{id}
where video_id = #{id}
</delete>
<delete id="deleteVideoBuy">
delete
from user_video_buy
where id = #{id}
where video_id = #{id}
</delete>
<select id="findVideoCollectionList" resultType="doctor.domain.entity.UserVideoCollectionEntity">
select *

View File

@ -24,13 +24,13 @@
where id=#{id}
</update>
<select id="findById" resultType="doctor.domain.entity.Video">
<select id="findById" resultType="doctor.domain.entity.VideoEntity">
SELECT user_video_collection.*
FROM user_video_collection
LEFT JOIN video ON user_video_collection.video_id = video.id
WHERE video.id = #{videoId}
</select>
<select id="FindVideoId" resultType="doctor.domain.entity.VideoCount">
<select id="FindVideoId" resultType="doctor.domain.entity.VideoCountEntity">
select *
from video_count
where id = #{id}
@ -47,15 +47,6 @@
LEFT JOIN user ON user.id = user_wallet.user_id
WHERE user_wallet.user_id==#{id}
</select>
<select id="findByVideoId" resultType="doctor.domain.entity.Video">
SELECT user_video_buy.*
FROM user_video_buy
LEFT JOIN video ON video.id = user_video_buy.video_id
WHERE video.video.id = #{videoId}
</select>
<select id="findVideoCommentList" resultType="doctor.domain.entity.VideoComment">
select *
from video_comment
</select>
</mapper>

View File

@ -15,11 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -15,11 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置

View File

@ -15,11 +15,11 @@ spring:
discovery:
# 服务注册地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
config:
# 配置中心地址
server-addr: 101.34.77.101:8848
namespace: 9de208a6-cb30-41ae-a880-78196c99c050
namespace: 09dff3e2-9790-4d4f-beb6-9baeb01ae040
# 配置文件格式
file-extension: yml
# 共享配置