package com.yyrh.core.entity;

import org.json.JSONObject;

/**
 * @author #Suyghur.
 * Created on 2021/10/19
 */
public class Session {

    public String userId = "";
    public String userName = "";
    public String pwd = "";

    public void reset() {
        userId = "";
        userName = "";
        pwd = "";
    }

    public JSONObject toJsonObject() {
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("user_id", userId);
            jsonObject.put("user_name", userName);
            jsonObject.put("pwd", pwd);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return jsonObject;
    }

    @Override
    public String toString() {
        return "Session{" +
                "userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", pwd='" + pwd + '\'' +
                '}';
    }
}
