package com.sys.model;

import java.util.Date;

public class Oauth2User {
    private Long id;

    private String username;

    private String password;

    private String salt;

    private String accessToken;

    private Date accessTokenTime;

    private String oauthCode;

    private Date oauthCodeTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken == null ? null : accessToken.trim();
    }

    public Date getAccessTokenTime() {
        return accessTokenTime;
    }

    public void setAccessTokenTime(Date accessTokenTime) {
        this.accessTokenTime = accessTokenTime;
    }

    public String getOauthCode() {
        return oauthCode;
    }

    public void setOauthCode(String oauthCode) {
        this.oauthCode = oauthCode == null ? null : oauthCode.trim();
    }

    public Date getOauthCodeTime() {
        return oauthCodeTime;
    }

    public void setOauthCodeTime(Date oauthCodeTime) {
        this.oauthCodeTime = oauthCodeTime;
    }
    public String toOauthString(){
        String result = "{\"openId\":\""+id+"\",\"username\":\""+username+"\"}";
        return result;
    }
}