易居住房信息之登录页面

一.实体类
package com.yiju.bean;

public class UserInfo {

public UserInfo() {
}
public UserInfo(int userId, String nickname, String truename, int gender, String city, long createTime) {
    this.userId = userId;
    this.nickname = nickname;
    this.truename = truename;
    this.gender = gender;
    this.city = city;
    this.createTime = createTime;
}

private int userId; //用户id
private String phone; //用户手机号,用于登录
private String password; //密码
private String email; //邮箱
private String nickname; //昵称
private String truename; //真实姓名
private int gender; //性别 0:男 1:女
private String province; //省份
private String city; //城市
private int isDelete; //是否删除 0:未删除 1:已删除
private long createTime; //创建时间
private long updateTime; //更新时间

public int getUserId() {
    return userId;
}

public void setUserId(int userId) {
    this.userId = userId;
}

public String getPhone() {
    return phone;
}

public void setPhone(String phone) {
    this.phone = phone;
}

public String getPassword() {
    return password;
}

public void setPassword(String password) {
    this.password = password;
}

public String getEmail() {
    return email;
}

public void setEmail(String email) {
    this.email = email;
}

public String getNickname() {
    return nickname;
}

public void setNickname(String nickname) {
    this.nickname = nickname;
}

public String getTruename() {
    return truename;
}

public void setTruename(String truename) {
    this.truename = truename;
}

public int getGender() {
    return gender;
}

public void setGender(int gender) {
    this.gender = gender;
}

public String getProvince() {
    return province;
}

public void setProvince(String province) {
    this.province = province;
}

public String getCity() {
    return city;
}

public void setCity(String city) {
    this.city = city;
}

public int getIsDelete() {
    return isDelete;
}

public void setIsDelete(int isDelete) {
    this.isDelete = isDelete;
}

public long getCreateTime() {
    return createTime;
}

public void setCreateTime(long createTime) {
    this.createTime = createTime;
}

public long getUpdateTime() {
    return updateTime;
}

public void setUpdateTime(long updateTime) {
    this.updateTime = updateTime;
}

@Override
public String toString() {
    return "UserInfo{" +
            "userId=" + userId +
            ", phone='" + phone + '\'' +
            ", password='" + password + '\'' +
            ", email='" + email + '\'' +
            ", nickname='" + nickname + '\'' +
            ", truename='" + truename + '\'' +
            ", gender=" + gender +
            ", province='" + province + '\'' +
            ", city='" + city + '\'' +
            ", isDelete=" + isDelete +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            '}';
}

}

二.UserInfoMapper.xml 配置文件

<?xml version="1.0" encoding="UTF-8"?> select * from tb_user where phone=#{phone}

三.定义接口方法

IUserDao

package com.yiju.dao;

import com.yiju.bean.UserInfo;

public interface IUserDao {
UserInfo findUserByPhone(String phone);
}

四.

package com.yiju.service;

import com.yiju.bean.UserInfo;

public interface IUserService {
UserInfo findByPhone(String phone);
}

五.页面跳转

package com.yiju.service.iml;

import com.yiju.bean.UserInfo;
import com.yiju.dao.IUserDao;
import com.yiju.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements IUserService {

@Autowired
private IUserDao userDao;

@Override
public UserInfo findByPhone(String phone) {
    return userDao.findUserByPhone(phone);
}

}

七.

@RequestMapping(“login2.do”)
@ResponseBody
public String login2(@Param(value=“phone”) String phone,
@Param(value= “password”) String password){
JSONObject jsonObject=new JSONObject();
UserInfo user = userService.findByPhone(phone);
if(user==null){
jsonObject.put(“result”,“0”);
}else if(!password.equals(user.getPassword())){
jsonObject.put(“result”,“1”);
}else {
jsonObject.put(“result”, “2”);
}
return jsonObject.toString();
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值