后台接口1
parent
227ba63d99
commit
a49d47c6ae
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,15 +1,21 @@
|
||||||
package doctor.controller;
|
package doctor.controller;
|
||||||
|
|
||||||
|
import doctor.common.core.domain.HealthR;
|
||||||
import doctor.common.core.domain.R;
|
import doctor.common.core.domain.R;
|
||||||
import doctor.domain.entity.UserVideoBuy;
|
import doctor.domain.entity.UserVideoBuyEntity;
|
||||||
import doctor.domain.entity.UserVideoCollection;
|
import doctor.domain.entity.UserVideoCollectionEntity;
|
||||||
import doctor.domain.entity.UserWallet;
|
import doctor.domain.entity.UserWalletEntity;
|
||||||
|
import doctor.domain.vo.UserVideoBuyVo;
|
||||||
|
import doctor.domain.vo.UserVideoCollectionVo;
|
||||||
import doctor.service.UserVideoService;
|
import doctor.service.UserVideoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.github.pagehelper.page.PageMethod.startPage;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : UserVideoController
|
* @ClassName : UserVideoController
|
||||||
* @Description : 用户视频
|
* @Description : 用户视频
|
||||||
|
@ -24,34 +30,36 @@ public class UserVideoController {
|
||||||
|
|
||||||
//用户视频收藏列表
|
//用户视频收藏列表
|
||||||
@GetMapping("/findVideoCollectionList")
|
@GetMapping("/findVideoCollectionList")
|
||||||
public R<List<UserVideoCollection>>findVideoCollectionList(){
|
public HealthR<List<UserVideoCollectionVo>> findVideoCollectionList(@RequestParam Integer page,@RequestParam Integer count){
|
||||||
List<UserVideoCollection> userVideoCollectionList =userVideoService.findVideoCollectionList();
|
startPage(page,count);
|
||||||
return R.ok(userVideoCollectionList);
|
List<UserVideoCollectionVo> userVideoCollectionVos=userVideoService.findVideoCollectionList();
|
||||||
|
return HealthR.ok(userVideoCollectionVos);
|
||||||
}
|
}
|
||||||
//用户取消视频收藏
|
//用户取消视频收藏
|
||||||
@GetMapping("/cancelVideoCollection/{id}")
|
@GetMapping("/cancelVideoCollection/{id}")
|
||||||
public R cancelVideoCollection(@PathVariable Integer id){
|
public HealthR cancelVideoCollection(@PathVariable Integer id){
|
||||||
userVideoService.cancelVideoCollection(id);
|
userVideoService.cancelVideoCollection(id);
|
||||||
return R.ok();
|
return HealthR.ok();
|
||||||
}
|
}
|
||||||
//用户购买视频列表
|
//用户购买视频列表
|
||||||
@GetMapping("/findUserVideoBuyList")
|
@GetMapping("/findUserVideoBuyList")
|
||||||
public R<List<UserVideoBuy>>findUserVideoBuyList(){
|
public HealthR<List<UserVideoBuyVo>>findUserVideoBuyList(@RequestParam Integer page, @RequestParam Integer count){
|
||||||
List<UserVideoBuy> userVideoBuys =userVideoService.findUserVideoBuyList();
|
startPage(page,count);
|
||||||
return R.ok(userVideoBuys);
|
List<UserVideoBuyVo> userVideoCollectionVos =userVideoService.findUserVideoBuyList();
|
||||||
|
return HealthR.ok(userVideoCollectionVos);
|
||||||
}
|
}
|
||||||
//用户删除购买的视频
|
//用户删除购买的视频
|
||||||
@DeleteMapping("/deleteVideoBuy/{id}")
|
@DeleteMapping("/deleteVideoBuy/{id}")
|
||||||
public R deleteVideoBuy(@PathVariable Integer id){
|
public HealthR deleteVideoBuy(@PathVariable Integer id){
|
||||||
userVideoService.deleteVideoBuy(id);
|
userVideoService.deleteVideoBuy(id);
|
||||||
return R.ok();
|
return HealthR.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
//我的钱包
|
//我的钱包
|
||||||
@GetMapping("/findUserWallet")
|
@GetMapping("/findUserWallet")
|
||||||
public R<List<UserWallet>> findUserWallet(){
|
public HealthR<List<UserWalletEntity>> findUserWallet(){
|
||||||
List<UserWallet> userWallets = userVideoService.findUserWallet();
|
List<UserWalletEntity> userWallets = userVideoService.findUserWallet();
|
||||||
return R.ok(userWallets);
|
return HealthR.ok(userWallets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package doctor.controller;
|
package doctor.controller;
|
||||||
|
|
||||||
|
import doctor.common.core.domain.HealthR;
|
||||||
import doctor.common.core.domain.R;
|
import doctor.common.core.domain.R;
|
||||||
import doctor.domain.entity.*;
|
import doctor.domain.entity.*;
|
||||||
import doctor.service.VideoService;
|
import doctor.service.VideoService;
|
||||||
|
@ -20,22 +21,22 @@ public class VideoController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoService videoService;
|
private VideoService videoService;
|
||||||
//收藏健康讲堂视频列表
|
//收藏健康讲堂视频列表
|
||||||
@PostMapping("/verify/v1/addUserVideoCollection")
|
@PostMapping("/verify/v1/addUserVideoCollection/{videoId}")
|
||||||
public R addUserVideoCollection(@RequestBody UserVideoCollection userVideoCollection){
|
public HealthR addUserVideoCollection(@RequestParam Integer videoId){
|
||||||
videoService.addUserVideoCollection(userVideoCollection);
|
videoService.addUserVideoCollection(videoId);
|
||||||
return R.ok();
|
return HealthR.ok();
|
||||||
}
|
}
|
||||||
//购买健康讲堂视频
|
//购买健康讲堂视频
|
||||||
@PostMapping("/verify/v1/videoBuy")
|
@PostMapping("/verify/v1/videoBuy")
|
||||||
public R videoBuy(@RequestBody UserVideoBuy userVideoBuy){
|
public HealthR videoBuy(@RequestParam Integer videoId, @RequestParam Integer price){
|
||||||
videoService.videoBuy(userVideoBuy);
|
videoService.videoBuy(videoId,price);
|
||||||
return R.ok();
|
return HealthR.ok();
|
||||||
}
|
|
||||||
//视频评论列表
|
|
||||||
@GetMapping("/v1/findVideoCommentList")
|
|
||||||
public R<List<VideoComment>> findVideoCommentList(){
|
|
||||||
List<VideoComment> videoCommentList = videoService.findVideoCommentList();
|
|
||||||
return R.ok(videoCommentList);
|
|
||||||
}
|
}
|
||||||
|
// //视频评论列表
|
||||||
|
// @GetMapping("/v1/findVideoCommentList")
|
||||||
|
// public R<List<VideoCommentEntity>> findVideoCommentList(){
|
||||||
|
// List<VideoCommentEntity> videoCommentList = videoService.findVideoCommentList();
|
||||||
|
// return R.ok(videoCommentList);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
import java.security.Timestamp;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
public class DoctorUser {
|
public class DoctorUserEntity {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private String phone;
|
private String phone;
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,16 +1,14 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : User
|
* @ClassName : UserEntity
|
||||||
* @Description : 用户表
|
* @Description : 用户表
|
||||||
* @Author : FJJ
|
* @Author : FJJ
|
||||||
* @Date: 2024-01-10 20:46
|
* @Date: 2024-01-10 20:46
|
||||||
*/
|
*/
|
||||||
public class User {
|
public class UserEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private String phone;
|
private String phone;
|
||||||
private String pwd;
|
private String pwd;
|
|
@ -1,12 +1,12 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : UserVideoBuy
|
* @ClassName : UserVideoBuyEntity
|
||||||
* @Description : 用户购买视频表
|
* @Description : 用户购买视频表
|
||||||
* @Author : FJJ
|
* @Author : FJJ
|
||||||
* @Date: 2024-01-10 15:20
|
* @Date: 2024-01-10 15:20
|
||||||
*/
|
*/
|
||||||
public class UserVideoBuy {
|
public class UserVideoBuyEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
private Integer videoId;
|
private Integer videoId;
|
||||||
|
@ -44,13 +44,13 @@ public class UserVideoBuy {
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserVideoBuy(Integer id, Integer userId, Integer videoId, Long createTime) {
|
public UserVideoBuyEntity(Integer id, Integer userId, Integer videoId, Long createTime) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.videoId = videoId;
|
this.videoId = videoId;
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserVideoBuy() {
|
public UserVideoBuyEntity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,18 +1,13 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
import io.swagger.models.auth.In;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : UserVideoCollection
|
* @ClassName : UserVideoCollectionEntity
|
||||||
* @Description : 用户视频收藏表
|
* @Description : 用户视频收藏表
|
||||||
* @Author : FJJ
|
* @Author : FJJ
|
||||||
* @Date: 2024-01-10 14:28
|
* @Date: 2024-01-10 14:28
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class UserVideoCollection {
|
public class UserVideoCollectionEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
private Integer videoId;
|
private Integer videoId;
|
||||||
|
@ -50,13 +45,13 @@ public class UserVideoCollection {
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserVideoCollection(Integer id, Integer userId, Integer videoId, Long createTime) {
|
public UserVideoCollectionEntity(Integer id, Integer userId, Integer videoId, Long createTime) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.videoId = videoId;
|
this.videoId = videoId;
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserVideoCollection() {
|
public UserVideoCollectionEntity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,16 +1,12 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : UserWallet
|
* @ClassName : UserWalletEntity
|
||||||
* @Description : 用户钱包
|
* @Description : 用户钱包
|
||||||
* @Author : FJJ
|
* @Author : FJJ
|
||||||
* @Date: 2024-01-10 20:30
|
* @Date: 2024-01-10 20:30
|
||||||
*/
|
*/
|
||||||
public class UserWallet {
|
public class UserWalletEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
private Integer balance;
|
private Integer balance;
|
|
@ -1,16 +1,14 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : VideoComment
|
* @ClassName : VideoCommentEntity
|
||||||
* @Description : 评论表
|
* @Description : 评论表
|
||||||
* @Author : FJJ
|
* @Author : FJJ
|
||||||
* @Date: 2024-01-10 21:54
|
* @Date: 2024-01-10 21:54
|
||||||
*/
|
*/
|
||||||
public class VideoComment {
|
public class VideoCommentEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
private Integer userId;
|
private Integer userId;
|
|
@ -1,16 +1,14 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : VideoCount
|
* @ClassName : VideoCountEntity
|
||||||
* @Description : 视频数
|
* @Description : 视频数
|
||||||
* @Author : FJJ
|
* @Author : FJJ
|
||||||
* @Date: 2024-01-10 16:24
|
* @Date: 2024-01-10 16:24
|
||||||
*/
|
*/
|
||||||
public class VideoCount {
|
public class VideoCountEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer videoId;
|
private Integer videoId;
|
||||||
private Integer buyNum;
|
private Integer buyNum;
|
|
@ -1,16 +1,12 @@
|
||||||
package doctor.domain.entity;
|
package doctor.domain.entity;
|
||||||
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName : Video
|
* @ClassName : VideoEntity
|
||||||
* @Description : 健康课堂视频表
|
* @Description : 健康课堂视频表
|
||||||
* @Author : FJJ
|
* @Author : FJJ
|
||||||
* @Date: 2024-01-10 15:59
|
* @Date: 2024-01-10 15:59
|
||||||
*/
|
*/
|
||||||
public class Video {
|
public class VideoEntity {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private String title;
|
private String title;
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
|
@ -93,7 +89,7 @@ public class Video {
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Video(Integer id, String title, Integer categoryId, String shearUrl, String abstracts, String originalUrl, Integer duration, Integer price, Long createTime) {
|
public VideoEntity(Integer id, String title, Integer categoryId, String shearUrl, String abstracts, String originalUrl, Integer duration, Integer price, Long createTime) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.categoryId = categoryId;
|
this.categoryId = categoryId;
|
||||||
|
@ -105,6 +101,6 @@ public class Video {
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Video() {
|
public VideoEntity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,10 +3,11 @@ package doctor.mapper;
|
||||||
import doctor.system.api.domain.Department;
|
import doctor.system.api.domain.Department;
|
||||||
import doctor.system.api.domain.Doctor;
|
import doctor.system.api.domain.Doctor;
|
||||||
import doctor.system.api.domain.User;
|
import doctor.system.api.domain.User;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
|
||||||
@MapperScan
|
@Mapper
|
||||||
public interface DoctorUserMapper {
|
public interface DoctorUserMapper {
|
||||||
User selectUserByEmail(@Param("email") String email);
|
User selectUserByEmail(@Param("email") String email);
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
|
@ -1,8 +1,8 @@
|
||||||
package doctor.mapper;
|
package doctor.mapper;
|
||||||
|
|
||||||
import doctor.domain.entity.UserVideoBuy;
|
import doctor.domain.entity.UserVideoBuyEntity;
|
||||||
import doctor.domain.entity.UserVideoCollection;
|
import doctor.domain.entity.UserVideoCollectionEntity;
|
||||||
import doctor.domain.entity.UserWallet;
|
import doctor.domain.entity.UserWalletEntity;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface UserVideoMapper {
|
public interface UserVideoMapper {
|
||||||
List<UserVideoCollection> findVideoCollectionList();
|
List<UserVideoCollectionEntity> findVideoCollectionList();
|
||||||
|
|
||||||
void cancelVideoCollection(@Param("id") Integer id);
|
void cancelVideoCollection(@Param("id") Integer id);
|
||||||
|
|
||||||
List<UserVideoBuy> findUserVideoBuyList();
|
List<UserVideoBuyEntity> findUserVideoBuyList();
|
||||||
|
|
||||||
void deleteVideoBuy(@Param("id") Integer id);
|
void deleteVideoBuy(@Param("id") Integer id);
|
||||||
|
|
||||||
List<UserWallet> findUserWallet();
|
List<UserWalletEntity> findUserWallet();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,24 +16,23 @@ import java.util.List;
|
||||||
public interface VideoMapper {
|
public interface VideoMapper {
|
||||||
|
|
||||||
|
|
||||||
void addUserVideoCollection(UserVideoCollection 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);
|
||||||
|
|
||||||
User FindById(@Param("userId") Integer userId);
|
UserEntity FindById(@Param("userId") Integer userId);
|
||||||
|
|
||||||
UserWallet FindUserWallet(@Param("id") Integer id);
|
UserWalletEntity FindUserWallet(@Param("id") Integer id);
|
||||||
|
|
||||||
Video findByVideoId(@Param("videoId") Integer videoId);
|
|
||||||
|
|
||||||
void updateUserWallet(@Param("newblance") int newblance, @Param("id") Integer id);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
package doctor.service;
|
package doctor.service;
|
||||||
|
|
||||||
import doctor.domain.entity.UserVideoBuy;
|
import doctor.domain.entity.UserVideoBuyEntity;
|
||||||
import doctor.domain.entity.UserVideoCollection;
|
import doctor.domain.entity.UserVideoCollectionEntity;
|
||||||
import doctor.domain.entity.UserWallet;
|
import doctor.domain.entity.UserWalletEntity;
|
||||||
|
import doctor.domain.vo.UserVideoBuyVo;
|
||||||
|
import doctor.domain.vo.UserVideoCollectionVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -13,13 +15,15 @@ import java.util.List;
|
||||||
* @Date: 2024-01-10 14:33
|
* @Date: 2024-01-10 14:33
|
||||||
*/
|
*/
|
||||||
public interface UserVideoService {
|
public interface UserVideoService {
|
||||||
List<UserVideoCollection> findVideoCollectionList();
|
|
||||||
|
|
||||||
void cancelVideoCollection(Integer id);
|
void cancelVideoCollection(Integer id);
|
||||||
|
|
||||||
List<UserVideoBuy> findUserVideoBuyList();
|
List<UserVideoBuyVo> findUserVideoBuyList();
|
||||||
|
|
||||||
void deleteVideoBuy(Integer id);
|
void deleteVideoBuy(Integer id);
|
||||||
|
|
||||||
List<UserWallet> findUserWallet();
|
List<UserWalletEntity> findUserWallet();
|
||||||
|
|
||||||
|
List<UserVideoCollectionVo> findVideoCollectionList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,10 +12,10 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface VideoService {
|
public interface VideoService {
|
||||||
|
|
||||||
void addUserVideoCollection(UserVideoCollection userVideoCollection);
|
void addUserVideoCollection(Integer videoId);
|
||||||
|
|
||||||
|
|
||||||
void videoBuy(UserVideoBuy userVideoBuy);
|
void videoBuy(Integer videoId,Integer price);
|
||||||
|
|
||||||
|
|
||||||
List<VideoComment> findVideoCommentList();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,11 @@
|
||||||
package doctor.service.impl;
|
package doctor.service.impl;
|
||||||
|
|
||||||
import doctor.domain.entity.UserVideoBuy;
|
import doctor.ConvertUtil;
|
||||||
import doctor.domain.entity.UserVideoCollection;
|
import doctor.domain.entity.UserVideoBuyEntity;
|
||||||
import doctor.domain.entity.UserWallet;
|
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.mapper.UserVideoMapper;
|
||||||
import doctor.service.UserVideoService;
|
import doctor.service.UserVideoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -20,9 +23,13 @@ import java.util.List;
|
||||||
public class UserVideoServiceImpl implements UserVideoService {
|
public class UserVideoServiceImpl implements UserVideoService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserVideoMapper userVideoMapper;
|
private UserVideoMapper userVideoMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserVideoCollection> findVideoCollectionList() {
|
public List<UserVideoCollectionVo> findVideoCollectionList() {
|
||||||
return userVideoMapper.findVideoCollectionList();
|
List<UserVideoCollectionEntity> userVideoCollectionEntityList=userVideoMapper.findVideoCollectionList();
|
||||||
|
List<UserVideoCollectionVo> userVideoCollectionVoList = ConvertUtil.entityToVoList(userVideoCollectionEntityList, UserVideoCollectionVo.class);
|
||||||
|
return userVideoCollectionVoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,8 +38,10 @@ public class UserVideoServiceImpl implements UserVideoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserVideoBuy> findUserVideoBuyList() {
|
public List<UserVideoBuyVo> findUserVideoBuyList() {
|
||||||
return userVideoMapper.findUserVideoBuyList();
|
List<UserVideoBuyEntity> userVideoCollectionEntityList=userVideoMapper.findUserVideoBuyList();
|
||||||
|
List<UserVideoBuyVo> userVideoBuyList = ConvertUtil.entityToVoList(userVideoCollectionEntityList, UserVideoBuyVo.class);
|
||||||
|
return userVideoBuyList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -41,7 +50,9 @@ public class UserVideoServiceImpl implements UserVideoService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserWallet> findUserWallet() {
|
public List<UserWalletEntity> findUserWallet() {
|
||||||
return userVideoMapper.findUserWallet();
|
return userVideoMapper.findUserWallet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package doctor.service.impl;
|
package doctor.service.impl;
|
||||||
|
|
||||||
|
import doctor.common.core.utils.JwtUtils;
|
||||||
import doctor.domain.entity.*;
|
import doctor.domain.entity.*;
|
||||||
import doctor.mapper.VideoMapper;
|
import doctor.mapper.VideoMapper;
|
||||||
import doctor.service.VideoService;
|
import doctor.service.VideoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,39 +20,38 @@ import java.util.List;
|
||||||
public class VideoServiceImpl implements VideoService {
|
public class VideoServiceImpl implements VideoService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoMapper videoMapper;
|
private VideoMapper videoMapper;
|
||||||
|
@Autowired
|
||||||
|
private HttpServletRequest request;
|
||||||
@Override
|
@Override
|
||||||
public void addUserVideoCollection(UserVideoCollection 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());
|
VideoEntity video = videoMapper.findById(videoId);
|
||||||
VideoCount videoCount = videoMapper.FindVideoId(video.getId());
|
VideoCountEntity videoCount = videoMapper.FindVideoId(video.getId());
|
||||||
videoMapper.updateVideoCount(videoCount);
|
videoMapper.updateVideoCount(videoCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void videoBuy(UserVideoBuy userVideoBuy) {
|
public void videoBuy(Integer videoId,Integer price) {
|
||||||
|
//获取用户id
|
||||||
|
String token = request.getHeader("token");
|
||||||
|
Integer userId = Integer.valueOf(JwtUtils.getUserId(token));
|
||||||
//查询用户信息
|
//查询用户信息
|
||||||
User user = videoMapper.FindById(userVideoBuy.getUserId());
|
UserEntity user = videoMapper.FindById(userId);
|
||||||
//查询视频信息
|
|
||||||
Video video = videoMapper.findByVideoId(userVideoBuy.getVideoId());
|
|
||||||
//查询用户钱包
|
//查询用户钱包
|
||||||
UserWallet userWallet = videoMapper.FindUserWallet(user.getId());
|
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();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
|
@ -6,22 +6,22 @@
|
||||||
<delete id="cancelVideoCollection">
|
<delete id="cancelVideoCollection">
|
||||||
delete
|
delete
|
||||||
from user_video_collection
|
from user_video_collection
|
||||||
where id = #{id}
|
where video_id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
<delete id="deleteVideoBuy">
|
<delete id="deleteVideoBuy">
|
||||||
delete
|
delete
|
||||||
from user_video_buy
|
from user_video_buy
|
||||||
where id = #{id}
|
where video_id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
<select id="findVideoCollectionList" resultType="doctor.domain.entity.UserVideoCollection">
|
<select id="findVideoCollectionList" resultType="doctor.domain.entity.UserVideoCollectionEntity">
|
||||||
select *
|
select *
|
||||||
from user_video_collection
|
from user_video_collection
|
||||||
</select>
|
</select>
|
||||||
<select id="findUserVideoBuyList" resultType="doctor.domain.entity.UserVideoBuy">
|
<select id="findUserVideoBuyList" resultType="doctor.domain.entity.UserVideoBuyEntity">
|
||||||
select *
|
select *
|
||||||
from user_video_buy
|
from user_video_buy
|
||||||
</select>
|
</select>
|
||||||
<select id="findUserWallet" resultType="doctor.domain.entity.UserWallet">
|
<select id="findUserWallet" resultType="doctor.domain.entity.UserWalletEntity">
|
||||||
select *
|
select *
|
||||||
from user_wallet
|
from user_wallet
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -24,38 +24,29 @@
|
||||||
where id=#{id}
|
where id=#{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="findById" resultType="doctor.domain.entity.Video">
|
<select id="findById" resultType="doctor.domain.entity.VideoEntity">
|
||||||
SELECT user_video_collection.*
|
SELECT user_video_collection.*
|
||||||
FROM user_video_collection
|
FROM user_video_collection
|
||||||
LEFT JOIN video ON user_video_collection.video_id = video.id
|
LEFT JOIN video ON user_video_collection.video_id = video.id
|
||||||
WHERE video.id = #{videoId}
|
WHERE video.id = #{videoId}
|
||||||
</select>
|
</select>
|
||||||
<select id="FindVideoId" resultType="doctor.domain.entity.VideoCount">
|
<select id="FindVideoId" resultType="doctor.domain.entity.VideoCountEntity">
|
||||||
select *
|
select *
|
||||||
from video_count
|
from video_count
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="FindById" resultType="doctor.domain.entity.User">
|
<select id="FindById" resultType="doctor.domain.entity.UserEntity">
|
||||||
SELECT user.*
|
SELECT user.*
|
||||||
FROM user_video_buy
|
FROM user_video_buy
|
||||||
LEFT JOIN user ON user.id = user_video_buy.user_id
|
LEFT JOIN user ON user.id = user_video_buy.user_id
|
||||||
WHERE user_video_buy.user_id = #{userId}
|
WHERE user_video_buy.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
<select id="FindUserWallet" resultType="doctor.domain.entity.UserWallet">
|
<select id="FindUserWallet" resultType="doctor.domain.entity.UserWalletEntity">
|
||||||
SELECT user.*
|
SELECT user.*
|
||||||
FROM user_wallet
|
FROM user_wallet
|
||||||
LEFT JOIN user ON user.id = user_wallet.user_id
|
LEFT JOIN user ON user.id = user_wallet.user_id
|
||||||
WHERE user_wallet.user_id==#{id}
|
WHERE user_wallet.user_id==#{id}
|
||||||
</select>
|
</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>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue