个人中心修改

This commit is contained in:
why 2023-04-24 15:34:50 +08:00
parent ffc44eb0b6
commit 7b12cce404
5 changed files with 24 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import com.kening.vordm.service.GuestInfoService;
import com.kening.vordm.service.ToolService;
import com.kening.vordm.vo.CenterDisasterInfo;
import com.kening.vordm.vo.DisasterInfoVo;
import com.kening.vordm.vo.UserVo;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@ -68,5 +69,10 @@ public class CenterController {
public R<Boolean> updatePassword(@RequestBody Map<String, String> param) {
return R.data(guestInfoService.updatePassword(param.get("originalPassword"), param.get("password"), param.get("email")));
}
@PostMapping("/updateAccount")
public R<Boolean> updateAccount(@RequestBody UserVo userVo) {
return R.data(guestInfoService.updateAccount(userVo));
}
}

View File

@ -18,4 +18,6 @@ public interface GuestInfoMapper extends BaseMapper<GuestInfo> {
UserVo getBladeUserByEmail(@Param("email") String email);
int updatePassword(String email, String password);
int updateAccount(UserVo userVo);
}

View File

@ -26,6 +26,12 @@
<update id="updatePassword">
update blade_user t set t.password = #{password} where t.email = #{email}
</update>
<update id="updateAccount">
update blade_user t set t.name = #{name}, t.real_name = #{realName}, t.organization = #{organization},
t.research_field = #{researchField}, t.occupation = #{occupation}, t.code = #{country}
where t.id = #{id}
</update>
<select id="getBladeUserByEmail" resultType="com.kening.vordm.vo.UserVo">
select * FROM blade_user

View File

@ -3,6 +3,7 @@ package com.kening.vordm.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.kening.vordm.entity.GuestInfo;
import com.kening.vordm.vo.UserVo;
/**
* @author G1393
@ -12,4 +13,6 @@ import com.kening.vordm.entity.GuestInfo;
public interface GuestInfoService extends IService<GuestInfo> {
Boolean updatePassword(String oldPassword, String password, String email);
Boolean updateAccount(UserVo userVo);
}

View File

@ -39,4 +39,11 @@ implements GuestInfoService {
}
}
@Override
public Boolean updateAccount(UserVo userVo) {
int i = this.baseMapper.updateAccount(userVo);
CacheUtil.clear(USER_CACHE);
return i>0;
}
}