个人中心修改
This commit is contained in:
parent
ffc44eb0b6
commit
7b12cce404
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue