个人资料修改

This commit is contained in:
why 2023-04-21 18:17:33 +08:00
parent f71c2f5bef
commit b5076f32d1
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}
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;
}
}