package com.hs.admin.service;

import com.hs.admin.model.DicOrg;
import com.hs.admin.model.SysUser;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

public interface LoginService {


    LoginInfo login(String loginName,String password,String ip);

    String refreshToken(String oldToken);

    @ApiModel(description = "登录信息")
    class LoginInfo {
        @ApiModelProperty("token")
        private String token;
        @ApiModelProperty("用户信息")
        private SysUser user;
        @ApiModelProperty("用户机构信息")
        private List<DicOrg> org;

        public LoginInfo() {
        }

        public LoginInfo(String token,SysUser user,List<DicOrg> org) {
            this.token = token;
            this.user = user;
            this.org = org;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public SysUser getUser() {
            return user;
        }

        public void setUser(SysUser user) {
            this.user = user;
        }

        public List<DicOrg> getOrg() {
            return org;
        }

        public void setOrg(List<DicOrg> org) {
            this.org = org;
        }

        @Override
        public String toString() {
            return "LoginInfo{" +
                    "token='" + token + '\'' +
                    ", user=" + user +
                    ", org=" + org +
                    '}';
        }
    }
}
