Merge remote-tracking branch 'origin/fjj' into newMaster

# Conflicts:
#	doctor-modules/doctor-health/pom.xml
#	doctor-modules/doctor-health/src/main/java/doctor/convert/VideoConvert.java
newMaster
chenbingxuan 2024-01-18 10:01:20 +08:00
commit 037643567e
6 changed files with 127 additions and 10 deletions

View File

@ -55,8 +55,8 @@ public class UserVideoController {
//我的钱包
@GetMapping("/findUserWallet")
public HealthR<List<UserWalletEntity>> findUserWallet(){
List<UserWalletEntity> userWallets = userVideoService.findUserWallet();
public HealthR<List<UserWalletEntity>> findUserWallet(@RequestHeader Integer userId){
List<UserWalletEntity> userWallets = userVideoService.findUserWallet(userId);
return HealthR.ok(userWallets);
}
//用户消费记录
@ -124,7 +124,34 @@ public class UserVideoController {
List<SignEntity> signEntities = userVideoService.findUserSign(userId);
return HealthR.ok(signEntities);
}
// //根据用户ID查询用户信息
// @GetMapping("/getUserInfoById")
// public HealthR<>
//根据用户ID查询用户信息
@GetMapping("/getUserInfoById")
public HealthR<List<UserVo>> getUserInfoById(@RequestHeader Integer userId){
List<UserVo> userVos = userVideoService.getUserInfoById(userId);
return HealthR.ok(userVos);
}
//用户签到
@PostMapping("/addSign")
public HealthR addSign(){
userVideoService.addSign();
return HealthR.ok("签到成功");
}
//完善用户信息
@PutMapping("/perfectUserInfo")
public HealthR perfectUserInfo(@RequestParam Integer age,@RequestParam Integer height,@RequestParam Integer weight,@RequestHeader Integer userId ){
userVideoService.perfectUserInfo(age,height,weight,userId);
return HealthR.ok("完善成功");
}
//修改用户性别
@PutMapping("/updateUserSex")
public HealthR updateUserSex(@RequestParam Integer sex,@RequestHeader Integer userId){
userVideoService.updateUserSex(sex,userId);
return HealthR.ok("修改成功");
}
//修改用户昵称
@PutMapping("/modifyNickName")
public HealthR modifyNickName(@RequestParam String nickName,@RequestHeader Integer userId){
userVideoService.modifyNickName(nickName,userId);
return HealthR.ok("修改成功");
}
}

View File

@ -34,6 +34,7 @@ public class VideoController {
return HealthR.ok();
}
//评论列表
@GetMapping("/v1/findVideoCommentList")
public HealthR<List<VideoCommentVo>> findVideoCommentList(@RequestParam Integer videoId) {

View File

@ -5,6 +5,7 @@ import doctor.domain.dto.UserTaskRecordDto;
import doctor.domain.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;
@ -24,7 +25,7 @@ public interface UserVideoMapper {
void deleteVideoBuy(@Param("videoId") Integer videoId);
List<UserWalletEntity> findUserWallet();
List<UserWalletEntity> findUserWallet(Integer userId);
List<UserConsumptionRecordEntity> findUserConsumptionRecordList();
@ -46,4 +47,15 @@ public interface UserVideoMapper {
List<UserTaskRecordDto> findUserTaskList();
List<SignEntity> findUserSign(@Param("userId") Integer userId);
List<UserEntity> getUserInfoById(@Param("userId") Integer userId);
void perfectUserInfo(@Param("age") Integer age, @Param("height") Integer height, @Param("weight") Integer weight, @Param("userId") Integer userId);
void updateUserSex(@Param("sex") Integer sex, @Param("userId") Integer userId);
void modifyNickName(@Param("nickName") String nickName, @Param("userId") Integer userId);
// void addSign(SignEntity signEntity);
}

View File

@ -3,6 +3,7 @@ package doctor.service;
import doctor.domain.dto.UserArchivesDto;
import doctor.domain.entity.*;
import doctor.domain.vo.*;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;
@ -21,7 +22,7 @@ public interface UserVideoService {
void deleteVideoBuy(Integer videoId);
List<UserWalletEntity> findUserWallet();
List<UserWalletEntity> findUserWallet(Integer userId);
List<UserVideoCollectionVo> findVideoCollectionList(Integer userId);
@ -46,4 +47,14 @@ public interface UserVideoService {
List<UserTaskRecordVo> findUserTaskList();
List<SignEntity> findUserSign(Integer userId);
List<UserVo> getUserInfoById(Integer userId);
void addSign();
void perfectUserInfo(Integer age, Integer height, Integer weight, Integer userId);
void updateUserSex(Integer sex, Integer userId);
void modifyNickName(String nickName, Integer userId);
}

View File

@ -9,6 +9,7 @@ import doctor.service.UserVideoService;
import doctor.util.ConvertUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.List;
@ -100,6 +101,33 @@ public class UserVideoServiceImpl implements UserVideoService {
return userEntityList;
}
@Override
public List<UserVo> getUserInfoById(Integer userId) {
List<UserEntity> userEntities=userVideoMapper.getUserInfoById(userId);
List<UserVo> userVos = ConvertUtil.entityToVoList(userEntities, UserVo.class);
return userVos;
}
@Override
public void addSign() {
// userVideoMapper.addSign(signEntity);
}
@Override
public void perfectUserInfo(Integer age, Integer height, Integer weight, Integer userId) {
userVideoMapper.perfectUserInfo(age,height,weight,userId);
}
@Override
public void updateUserSex(Integer sex, Integer userId) {
userVideoMapper.updateUserSex(sex,userId);
}
@Override
public void modifyNickName(String nickName, Integer userId) {
userVideoMapper.modifyNickName(nickName,userId);
}
@Override
public List<UserVideoBuyVo> findUserVideoBuyList() {
@ -114,8 +142,8 @@ public class UserVideoServiceImpl implements UserVideoService {
}
@Override
public List<UserWalletEntity> findUserWallet() {
return userVideoMapper.findUserWallet();
public List<UserWalletEntity> findUserWallet(Integer userId) {
return userVideoMapper.findUserWallet(userId);
}

View File

@ -30,11 +30,45 @@ create_time
now()
);
</insert>
<!-- <insert id="addSign">-->
<!-- insert into sign (-->
<!-- user_id,-->
<!--sign_time,-->
<!--sign_num,-->
<!--sign_reward,-->
<!--create_time-->
<!-- )-->
<!-- values (-->
<!-- #{userId},-->
<!-- now(),-->
<!-- sign_num+1,-->
<!-- #{signReward},-->
<!-- now()-->
<!-- );-->
<!-- </insert>-->
<update id="uploadUserArchivesImg">
update user_archives
set picture = #{picture}
where id=#{id}
</update>
<update id="perfectUserInfo">
update user
set age = #{age},
height = #{height},
weight = #{weight}
where id = #{userId}
</update>
<update id="updateUserSex">
update user
set sex = #{sex}
where id = #{userId}
</update>
<update id="modifyNickName">
update user
set nick_name = #{nickName}
where id = #{userId}
</update>
<delete id="cancelVideoCollection">
delete
from user_video_collection
@ -54,7 +88,7 @@ create_time
</select>
<select id="findUserWallet" resultType="doctor.domain.entity.UserWalletEntity">
select *
from user_wallet
from user_wallet where user_id=#{userId}
</select>
<select id="findUserConsumptionRecordList" resultType="doctor.domain.entity.UserConsumptionRecordEntity">
select *
@ -86,5 +120,9 @@ create_time
select *
from sign where user_id=#{userId}
</select>
<select id="getUserInfoById" resultType="doctor.domain.entity.UserEntity">
select *
from user where id=#{userId}
</select>
</mapper>