删除接口

master
jiakun.lin 4 years ago
parent bff29c3608
commit 032cee85a1
  1. 24
      src/main/java/com/yipin/liuwanr/controller/UserController.java
  2. 4
      src/main/java/com/yipin/liuwanr/mapper/UserMapper.java
  3. 14
      src/main/java/com/yipin/liuwanr/service/UserService.java

@ -556,4 +556,28 @@ public class UserController {
}
return resp;
}
/**
* 查询邮箱是否存在
*/
@GetMapping("/queryEmail")
Response queryEmail(@RequestParam String email) {
Response resp = new Response();
if (email==null||email=="") {//前台传来的值是否为空
resp.setStatus(300);
resp.setErrmessage("邮箱为空!查询失败!");
}else {
HashMap<String, Object> ret = userService.queryEmail(email);
int status = (int) ret.get("retcode");
if (200 == status) {
resp.setStatus(status);
resp.setMessage(ret.get("retvalue"));
} else {
resp.setStatus(status);
resp.setErrmessage(ret.get("retvalue").toString());
}
}
return resp;
}
}

@ -286,4 +286,8 @@ public interface UserMapper {
@Update("update user set lastTimeOfLanding=#{time},logInNumber=#{logInNumber} where userId=#{userId}")
void updateUserQ(@Param("time")String time,@Param("logInNumber") Integer logInNumber,@Param("userId") Integer userId);
//查询用户邮箱
@Select("SELECT u.email,u.userId from hr_user_info u where isdel = 0 and email = #{email}")
List<UserInfo> queryEmail(String email);
}

@ -423,4 +423,18 @@ public class UserService {
}
return resp;
}
public HashMap<String, Object> queryEmail(String email) {
HashMap<String, Object> resp = new HashMap<String, Object>();
try {
resp.put("retvalue", userMapper.queryEmail(email));
resp.put("retcode", 200);
} catch (RuntimeException e) {
logger.error(e.getMessage());
resp.put("retcode", 500);
resp.put("retvalue", "查询手机号失败!");
return resp;
}
return resp;
}
}

Loading…
Cancel
Save