diff --git a/doctor-modules/doctor-health/src/main/java/doctor/controller/UserVideoController.java b/doctor-modules/doctor-health/src/main/java/doctor/controller/UserVideoController.java index beaf89e..d46d52f 100644 --- a/doctor-modules/doctor-health/src/main/java/doctor/controller/UserVideoController.java +++ b/doctor-modules/doctor-health/src/main/java/doctor/controller/UserVideoController.java @@ -2,15 +2,13 @@ package doctor.controller; import doctor.common.core.domain.HealthR; import doctor.domain.dto.UserArchivesDto; -import doctor.domain.entity.UserAdoptCommentEntity; -import doctor.domain.entity.UserEntity; -import doctor.domain.entity.UserInfoCollectionEntity; -import doctor.domain.entity.UserWalletEntity; +import doctor.domain.entity.*; import doctor.domain.vo.*; import doctor.service.UserVideoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.util.List; import static com.github.pagehelper.page.PageMethod.startPage; @@ -96,9 +94,29 @@ public class UserVideoController { } //添加用户档案 @PostMapping("/addUserArchives") - public HealthR addUserArchives(@RequestBody UserArchivesDto userArchivesDto){ - userVideoService.addUserArchives(userArchivesDto); + public HealthR addUserArchives(@RequestBody UserArchivesEntity userArchivesEntity, @RequestHeader Integer userId){ + userVideoService.addUserArchives(userArchivesEntity,userId); + return HealthR.ok(); + } + //上传用户档案图片 + @PostMapping("/uploadArchivesPicture") + public HealthR uploadUserArchivesImg(@RequestParam Integer id){ + userVideoService.uploadUserArchivesImg(id); return HealthR.ok(); } + //用户关注医生列表 + @GetMapping("/findUserDoctorFollowList") + public HealthR> findUserDoctorFollowList(){ + List userDoctorFollowVos = userVideoService.findUserDoctorFollowList(); + return HealthR.ok(userDoctorFollowVos); + } + //查询用户任务列表 + @GetMapping("/findUserTaskList") + public HealthR> findUserTaskList(){ + List userTaskRecordVos = userVideoService.findUserTaskList(); + return HealthR.ok(userTaskRecordVos); + } +// //查询用户连续签到列表 +// @GetMapping("/findUserSign") } diff --git a/doctor-modules/doctor-health/src/main/java/doctor/domain/dto/UserTaskRecordDto.java b/doctor-modules/doctor-health/src/main/java/doctor/domain/dto/UserTaskRecordDto.java new file mode 100644 index 0000000..0234d1f --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/domain/dto/UserTaskRecordDto.java @@ -0,0 +1,25 @@ +package doctor.domain.dto; + +import lombok.Data; + +import java.util.Date; + +/** + * @ClassName : UserTaskRecordDto + * @Description : + * @Author : FJJ + * @Date: 2024-01-17 10:54 + */ +@Data +public class UserTaskRecordDto { + private Integer id; + private Integer userId; + private Integer taskId; + private String taskName; + private String taskType; + private String reward; + private Date taskTime; + private Integer status; + private Date createTime; + +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/domain/entity/TaskEntity.java b/doctor-modules/doctor-health/src/main/java/doctor/domain/entity/TaskEntity.java new file mode 100644 index 0000000..f187658 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/domain/entity/TaskEntity.java @@ -0,0 +1,20 @@ +package doctor.domain.entity; + +import lombok.Data; + +import java.util.Date; + +/** + * @ClassName : TaskEntity + * @Description : 任务表 + * @Author : FJJ + * @Date: 2024-01-17 10:59 + */ +@Data +public class TaskEntity { + private Integer id; + private String taskName; + private String taskType; + private String reward; + private Date createTime; +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/domain/entity/UserTaskRecordEntity.java b/doctor-modules/doctor-health/src/main/java/doctor/domain/entity/UserTaskRecordEntity.java new file mode 100644 index 0000000..60b0155 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/domain/entity/UserTaskRecordEntity.java @@ -0,0 +1,21 @@ +package doctor.domain.entity; + +import lombok.Data; + +import java.util.Date; + +/** + * @ClassName : UserTaskRecord + * @Description : 患者任务列表 + * @Author : FJJ + * @Date: 2024-01-17 10:47 + */ +@Data +public class UserTaskRecordEntity { + private Integer id; + private Integer userId; + private Integer taskId; + private Date taskTime; + private Integer status; + private long createTime; +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/domain/vo/UserTaskRecordVo.java b/doctor-modules/doctor-health/src/main/java/doctor/domain/vo/UserTaskRecordVo.java new file mode 100644 index 0000000..4619783 --- /dev/null +++ b/doctor-modules/doctor-health/src/main/java/doctor/domain/vo/UserTaskRecordVo.java @@ -0,0 +1,19 @@ +package doctor.domain.vo; + +import lombok.Data; + +/** + * @ClassName : UserTaskRecordVo + * @Description : 用户任务 + * @Author : FJJ + * @Date: 2024-01-17 10:50 + */ +@Data +public class UserTaskRecordVo { + private Integer id; + private String taskName; + private Integer taskType; + private Integer reward; + private Integer whetherFinish; + private Integer whetherReceive; +} diff --git a/doctor-modules/doctor-health/src/main/java/doctor/mapper/UserVideoMapper.java b/doctor-modules/doctor-health/src/main/java/doctor/mapper/UserVideoMapper.java index c5d9f75..f38152b 100644 --- a/doctor-modules/doctor-health/src/main/java/doctor/mapper/UserVideoMapper.java +++ b/doctor-modules/doctor-health/src/main/java/doctor/mapper/UserVideoMapper.java @@ -1,6 +1,7 @@ package doctor.mapper; import doctor.domain.dto.UserArchivesDto; +import doctor.domain.dto.UserTaskRecordDto; import doctor.domain.entity.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -35,5 +36,12 @@ public interface UserVideoMapper { List findUserArchives(@Param("userId") Integer userId); - void addUserArchives(UserArchivesDto userArchivesDto); + void addUserArchives(UserArchivesEntity userArchivesEntity, @Param("userId") Integer userId); + + void uploadUserArchivesImg(@Param("id") Integer id); + + + List findUserDoctorFollowList(); + + List findUserTaskList(); } diff --git a/doctor-modules/doctor-health/src/main/java/doctor/service/UserVideoService.java b/doctor-modules/doctor-health/src/main/java/doctor/service/UserVideoService.java index 402a398..ab5c4f2 100644 --- a/doctor-modules/doctor-health/src/main/java/doctor/service/UserVideoService.java +++ b/doctor-modules/doctor-health/src/main/java/doctor/service/UserVideoService.java @@ -2,6 +2,7 @@ package doctor.service; import doctor.domain.dto.UserArchivesDto; import doctor.domain.entity.UserAdoptCommentEntity; +import doctor.domain.entity.UserArchivesEntity; import doctor.domain.entity.UserEntity; import doctor.domain.entity.UserWalletEntity; import doctor.domain.vo.*; @@ -39,5 +40,11 @@ public interface UserVideoService { List findUserArchives(Integer userId); - void addUserArchives(UserArchivesDto userArchivesDto); + void addUserArchives(UserArchivesEntity userArchivesEntity, Integer userId); + + void uploadUserArchivesImg(Integer id); + + List findUserDoctorFollowList(); + + List findUserTaskList(); } diff --git a/doctor-modules/doctor-health/src/main/java/doctor/service/impl/UserVideoServiceImpl.java b/doctor-modules/doctor-health/src/main/java/doctor/service/impl/UserVideoServiceImpl.java index ce70aa8..cca8571 100644 --- a/doctor-modules/doctor-health/src/main/java/doctor/service/impl/UserVideoServiceImpl.java +++ b/doctor-modules/doctor-health/src/main/java/doctor/service/impl/UserVideoServiceImpl.java @@ -1,6 +1,7 @@ package doctor.service.impl; import doctor.domain.dto.UserArchivesDto; +import doctor.domain.dto.UserTaskRecordDto; import doctor.domain.entity.*; import doctor.domain.vo.*; import doctor.mapper.UserVideoMapper; @@ -74,6 +75,12 @@ public class UserVideoServiceImpl implements UserVideoService { userVideoMapper.addUserArchives(userArchivesDto); } + @Override + public List findUserTaskList() { + List userTaskRecordDtos=userVideoMapper.findUserTaskList(); + List userTaskRecordVoList = ConvertUtil.entityToVoList(userTaskRecordDtos, UserTaskRecordVo.class); + return userTaskRecordVoList; + } @Override public List findUserVideoBuyList() { @@ -92,5 +99,11 @@ public class UserVideoServiceImpl implements UserVideoService { return userVideoMapper.findUserWallet(); } + @Override + public List findUserDoctorFollowList() { + List userDoctorFollowEntityList=userVideoMapper.findUserDoctorFollowList(); + List userDoctorFollowVoList = ConvertUtil.entityToVoList(userDoctorFollowEntityList, UserDoctorFollowVo.class); + return userDoctorFollowVoList; + } } diff --git a/doctor-modules/doctor-health/src/main/resources/mapper/doctor/UserVideoMapper.xml b/doctor-modules/doctor-health/src/main/resources/mapper/doctor/UserVideoMapper.xml index f569431..8286cbf 100644 --- a/doctor-modules/doctor-health/src/main/resources/mapper/doctor/UserVideoMapper.xml +++ b/doctor-modules/doctor-health/src/main/resources/mapper/doctor/UserVideoMapper.xml @@ -30,6 +30,11 @@ create_time now() ); + + update user_archives + set picture = #{picture} + where id=#{id} + delete from user_video_collection @@ -70,4 +75,12 @@ create_time select * from user_archives where user_id=#{userId} + + +