cbx
parent
228cef25a8
commit
61d82c1018
|
@ -2,15 +2,13 @@ package doctor.controller;
|
||||||
|
|
||||||
import doctor.common.core.domain.HealthR;
|
import doctor.common.core.domain.HealthR;
|
||||||
import doctor.domain.dto.UserArchivesDto;
|
import doctor.domain.dto.UserArchivesDto;
|
||||||
import doctor.domain.entity.UserAdoptCommentEntity;
|
import doctor.domain.entity.*;
|
||||||
import doctor.domain.entity.UserEntity;
|
|
||||||
import doctor.domain.entity.UserInfoCollectionEntity;
|
|
||||||
import doctor.domain.entity.UserWalletEntity;
|
|
||||||
import doctor.domain.vo.*;
|
import doctor.domain.vo.*;
|
||||||
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 javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.github.pagehelper.page.PageMethod.startPage;
|
import static com.github.pagehelper.page.PageMethod.startPage;
|
||||||
|
@ -96,9 +94,29 @@ public class UserVideoController {
|
||||||
}
|
}
|
||||||
//添加用户档案
|
//添加用户档案
|
||||||
@PostMapping("/addUserArchives")
|
@PostMapping("/addUserArchives")
|
||||||
public HealthR addUserArchives(@RequestBody UserArchivesDto userArchivesDto){
|
public HealthR addUserArchives(@RequestBody UserArchivesEntity userArchivesEntity, @RequestHeader Integer userId){
|
||||||
userVideoService.addUserArchives(userArchivesDto);
|
userVideoService.addUserArchives(userArchivesEntity,userId);
|
||||||
|
return HealthR.ok();
|
||||||
|
}
|
||||||
|
//上传用户档案图片
|
||||||
|
@PostMapping("/uploadArchivesPicture")
|
||||||
|
public HealthR uploadUserArchivesImg(@RequestParam Integer id){
|
||||||
|
userVideoService.uploadUserArchivesImg(id);
|
||||||
return HealthR.ok();
|
return HealthR.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//用户关注医生列表
|
||||||
|
@GetMapping("/findUserDoctorFollowList")
|
||||||
|
public HealthR<List<UserDoctorFollowVo>> findUserDoctorFollowList(){
|
||||||
|
List<UserDoctorFollowVo> userDoctorFollowVos = userVideoService.findUserDoctorFollowList();
|
||||||
|
return HealthR.ok(userDoctorFollowVos);
|
||||||
|
}
|
||||||
|
//查询用户任务列表
|
||||||
|
@GetMapping("/findUserTaskList")
|
||||||
|
public HealthR<List<UserTaskRecordVo>> findUserTaskList(){
|
||||||
|
List<UserTaskRecordVo> userTaskRecordVos = userVideoService.findUserTaskList();
|
||||||
|
return HealthR.ok(userTaskRecordVos);
|
||||||
|
}
|
||||||
|
// //查询用户连续签到列表
|
||||||
|
// @GetMapping("/findUserSign")
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package doctor.mapper;
|
package doctor.mapper;
|
||||||
|
|
||||||
import doctor.domain.dto.UserArchivesDto;
|
import doctor.domain.dto.UserArchivesDto;
|
||||||
|
import doctor.domain.dto.UserTaskRecordDto;
|
||||||
import doctor.domain.entity.*;
|
import doctor.domain.entity.*;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@ -35,5 +36,12 @@ public interface UserVideoMapper {
|
||||||
|
|
||||||
List<UserArchivesEntity> findUserArchives(@Param("userId") Integer userId);
|
List<UserArchivesEntity> findUserArchives(@Param("userId") Integer userId);
|
||||||
|
|
||||||
void addUserArchives(UserArchivesDto userArchivesDto);
|
void addUserArchives(UserArchivesEntity userArchivesEntity, @Param("userId") Integer userId);
|
||||||
|
|
||||||
|
void uploadUserArchivesImg(@Param("id") Integer id);
|
||||||
|
|
||||||
|
|
||||||
|
List<UserDoctorFollowEntity> findUserDoctorFollowList();
|
||||||
|
|
||||||
|
List<UserTaskRecordDto> findUserTaskList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package doctor.service;
|
||||||
|
|
||||||
import doctor.domain.dto.UserArchivesDto;
|
import doctor.domain.dto.UserArchivesDto;
|
||||||
import doctor.domain.entity.UserAdoptCommentEntity;
|
import doctor.domain.entity.UserAdoptCommentEntity;
|
||||||
|
import doctor.domain.entity.UserArchivesEntity;
|
||||||
import doctor.domain.entity.UserEntity;
|
import doctor.domain.entity.UserEntity;
|
||||||
import doctor.domain.entity.UserWalletEntity;
|
import doctor.domain.entity.UserWalletEntity;
|
||||||
import doctor.domain.vo.*;
|
import doctor.domain.vo.*;
|
||||||
|
@ -39,5 +40,11 @@ public interface UserVideoService {
|
||||||
|
|
||||||
List<UserArchivesVo> findUserArchives(Integer userId);
|
List<UserArchivesVo> findUserArchives(Integer userId);
|
||||||
|
|
||||||
void addUserArchives(UserArchivesDto userArchivesDto);
|
void addUserArchives(UserArchivesEntity userArchivesEntity, Integer userId);
|
||||||
|
|
||||||
|
void uploadUserArchivesImg(Integer id);
|
||||||
|
|
||||||
|
List<UserDoctorFollowVo> findUserDoctorFollowList();
|
||||||
|
|
||||||
|
List<UserTaskRecordVo> findUserTaskList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package doctor.service.impl;
|
package doctor.service.impl;
|
||||||
|
|
||||||
import doctor.domain.dto.UserArchivesDto;
|
import doctor.domain.dto.UserArchivesDto;
|
||||||
|
import doctor.domain.dto.UserTaskRecordDto;
|
||||||
import doctor.domain.entity.*;
|
import doctor.domain.entity.*;
|
||||||
import doctor.domain.vo.*;
|
import doctor.domain.vo.*;
|
||||||
import doctor.mapper.UserVideoMapper;
|
import doctor.mapper.UserVideoMapper;
|
||||||
|
@ -74,6 +75,12 @@ public class UserVideoServiceImpl implements UserVideoService {
|
||||||
userVideoMapper.addUserArchives(userArchivesDto);
|
userVideoMapper.addUserArchives(userArchivesDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserTaskRecordVo> findUserTaskList() {
|
||||||
|
List<UserTaskRecordDto> userTaskRecordDtos=userVideoMapper.findUserTaskList();
|
||||||
|
List<UserTaskRecordVo> userTaskRecordVoList = ConvertUtil.entityToVoList(userTaskRecordDtos, UserTaskRecordVo.class);
|
||||||
|
return userTaskRecordVoList;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UserVideoBuyVo> findUserVideoBuyList() {
|
public List<UserVideoBuyVo> findUserVideoBuyList() {
|
||||||
|
@ -92,5 +99,11 @@ public class UserVideoServiceImpl implements UserVideoService {
|
||||||
return userVideoMapper.findUserWallet();
|
return userVideoMapper.findUserWallet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<UserDoctorFollowVo> findUserDoctorFollowList() {
|
||||||
|
List<UserDoctorFollowEntity> userDoctorFollowEntityList=userVideoMapper.findUserDoctorFollowList();
|
||||||
|
List<UserDoctorFollowVo> userDoctorFollowVoList = ConvertUtil.entityToVoList(userDoctorFollowEntityList, UserDoctorFollowVo.class);
|
||||||
|
return userDoctorFollowVoList;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,11 @@ create_time
|
||||||
now()
|
now()
|
||||||
);
|
);
|
||||||
</insert>
|
</insert>
|
||||||
|
<update id="uploadUserArchivesImg">
|
||||||
|
update user_archives
|
||||||
|
set picture = #{picture}
|
||||||
|
where id=#{id}
|
||||||
|
</update>
|
||||||
<delete id="cancelVideoCollection">
|
<delete id="cancelVideoCollection">
|
||||||
delete
|
delete
|
||||||
from user_video_collection
|
from user_video_collection
|
||||||
|
@ -70,4 +75,12 @@ create_time
|
||||||
select *
|
select *
|
||||||
from user_archives where user_id=#{userId}
|
from user_archives where user_id=#{userId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findUserDoctorFollowList" resultType="doctor.domain.entity.UserDoctorFollowEntity">
|
||||||
|
select *
|
||||||
|
from user_doctor_follow
|
||||||
|
</select>
|
||||||
|
<select id="findUserTaskList" resultType="doctor.domain.dto.UserTaskRecordDto">
|
||||||
|
SELECT user_task_record.*,task.task_name,task.task_type,task.reward FROM user_task_record LEFT JOIN task ON user_task_record.task_id=task.id
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue