Merge remote-tracking branch 'origin/dev1/user_model'

This commit is contained in:
wangjinlei
2023-10-20 15:15:48 +08:00
7 changed files with 37 additions and 37 deletions

View File

@@ -119,7 +119,6 @@ public class MyUserController {
* 保存 * 保存
*/ */
@RequestMapping("/save") @RequestMapping("/save")
// @RequiresPermissions("book:user:save")
public R save(@RequestBody MyUserEntity user){ public R save(@RequestBody MyUserEntity user){
String password = user.getPassword(); String password = user.getPassword();
String saltMD5 = MD5Utils.getSaltMD5(password); String saltMD5 = MD5Utils.getSaltMD5(password);
@@ -130,24 +129,33 @@ public class MyUserController {
} }
/** /**
* 修改 * 修改用户信息
*/ */
@RequestMapping("/update") @RequestMapping("/update")
// @RequiresPermissions("book:user:update")
public R update(@RequestBody MyUserEntity user){ public R update(@RequestBody MyUserEntity user){
System.out.println(user.toString());
if (!StringUtils.isEmpty(user.getPassword())) { userService.updateById(user);
String password = user.getPassword();
String saltMD5 = MD5Utils.getSaltMD5(password);
user.setPassword(saltMD5);
userService.updateById(user);
}else{
userService.update(user);
}
return R.ok(); return R.ok();
} }
/**
* 修改用户密码
* @param user
* @return
*/
@RequestMapping("/updateUserPassword")
public R updateUserPassword(@RequestBody MyUserEntity user){
String password = user.getPassword();
if(password.equals(null)){
return R.error("密码不能为空");
}
String saltMD5 = MD5Utils.getSaltMD5(password);
user.setPassword(saltMD5);
userService.updateById(user);
return R.ok();
}
/** /**
* 删除 * 删除
*/ */

View File

@@ -14,6 +14,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface MyUserDao extends BaseMapper<MyUserEntity> { public interface MyUserDao extends BaseMapper<MyUserEntity> {
void update(MyUserEntity user);
} }

View File

@@ -42,7 +42,6 @@ public interface MyUserService extends IService<MyUserEntity> {
//电子书购买 //电子书购买
String buyEbook(String userId, String bookId,String couponId); String buyEbook(String userId, String bookId,String couponId);
void update (MyUserEntity user);
//第三方微信登录 //第三方微信登录
R getUserInfoByApp(UserAppAuthorEntity userAppAuthorEntity); R getUserInfoByApp(UserAppAuthorEntity userAppAuthorEntity);

View File

@@ -352,16 +352,6 @@ public class MyUserServiceImpl extends ServiceImpl<MyUserDao, MyUserEntity> impl
return "购买成功!"; return "购买成功!";
} }
/**
* 更新
*
* @param user
*/
@Override
public void update(MyUserEntity user) {
myUserDao.update(user);
}
/** /**
* 微信授权登录 * 微信授权登录

View File

@@ -3,9 +3,9 @@ spring:
redis: redis:
open: false # 是否开启redis缓存 true开启 false关闭 open: false # 是否开启redis缓存 true开启 false关闭
database: 0 database: 0
host: 127.0.0.1 host: 39.106.36.183
port: 6379 port: 6379
# password: Jgll2015 # 密码(默认为空) password: Jgll2015 # 密码(默认为空)
timeout: 6000000ms # 连接超时时长(毫秒) timeout: 6000000ms # 连接超时时长(毫秒)
jedis: jedis:
pool: pool:

View File

@@ -27,15 +27,5 @@
</resultMap> </resultMap>
<update id="update">
update user
<set>
age = #{age}, sex = #{sex} ,avatar=#{avatar} ,nickname =#{nickname}
</set>
where id = #{id}
</update>
</mapper> </mapper>

View File

@@ -1,5 +1,6 @@
package com; package com;
import com.peanut.common.utils.MD5Utils;
import com.peanut.modules.pay.weChatPay.config.WechatPayConfig; import com.peanut.modules.pay.weChatPay.config.WechatPayConfig;
import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo; import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo;
import org.junit.Test; import org.junit.Test;
@@ -41,5 +42,18 @@ public class VxApiTest {
System.out.println(wechatPaymentInfo.toString()); System.out.println(wechatPaymentInfo.toString());
} }
@Test
public void mmm(){
String saltMD5 = MD5Utils.getSaltMD5("29698073wjl");
System.out.println(saltMD5);
}
@Test
public void mmmm(){
// boolean saltverifyMD5 = MD5Utils.getSaltverifyMD5("29698073wjl", "15af9ed9b06a442b90b09e78d21a3635890e24196db1a61e");
boolean saltverifyMD5 = MD5Utils.getSaltverifyMD5("29698073wjl", "f33643591f4e942d3918f582555719247f6e90131ea1dc0a");
System.out.println(saltverifyMD5);
}
} }