MCPcopy Create free account
hub / github.com/bsxj97/flower-mall / update

Method update

src/main/java/com/controller/UserController.java:156–165  ·  view source on GitHub ↗

修改

(@RequestBody UserEntity user)

Source from the content-addressed store, hash-verified

154 * 修改
155 */
156 @RequestMapping("/update")
157 public R update(@RequestBody UserEntity user){
158// ValidatorUtils.validateEntity(user);
159 UserEntity u = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername()));
160 if(u!=null && u.getId()!=user.getId() && u.getUsername().equals(user.getUsername())) {
161 return R.error("用户名已存在。");
162 }
163 userService.updateById(user);//全部更新
164 return R.ok();
165 }
166
167 /**
168 * 删除

Callers 1

resetPassMethod · 0.45

Calls 3

getUsernameMethod · 0.95
getIdMethod · 0.95
getIdMethod · 0.45

Tested by

no test coverage detected