123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- using System;
- using WingServerCommon.Log;
- using WingServerCommon.Interfaces.OpLog;
- namespace WingServerCommon.Interfaces.Cache
- {
- public interface ITokensManager : IBaseCacheManager<Token>
- {
- }
- public class TokensManager : CacheManager<Token>, ITokensManager
- {
- public TokensManager() : base()
- {
- }
- }
- /// <summary>
- /// Internal Server token, just used in server session module
- /// </summary>
- public class Token : ICacheObject
- {
- public Token()
- {
- }
- /// <summary>
- /// The token version
- /// </summary>
- /// <value></value>
- public int Version { get; set; }
- /// <summary>
- /// The token string value
- /// </summary>
- /// <value></value>
- public string Code { get; set; }
- /// <summary>
- /// The Account Type of logined client
- /// </summary>
- /// <value></value>
- public int AccountType { get; set; }
- /// <summary>
- /// The Account name
- /// </summary>
- /// <value></value>
- public string AccountName { get; set; } = string.Empty;
- /// <summary>
- /// The plateform the account logined
- /// </summary>
- /// <value></value>
- public int Platform { get; set; }
- /// <summary>
- /// The login source of account
- /// </summary>
- /// <value></value>
- public int LoginSource { get; set; }
- /// <summary>
- /// The Client Id(User code , admin code or device code)
- /// </summary>
- /// <value></value>
- public string ClientId { get; set; }
- /// <summary>
- /// The Login server url
- /// </summary>
- /// <value></value>
- public string LoginServer { get; set; }
- /// <summary>
- /// Token create time
- /// </summary>
- /// <value></value>
- public DateTime CreateTime { get; set; }
- /// <summary>
- /// Token expiretion time
- /// </summary>
- /// <value></value>
- public DateTime Expiration { get; set; }
- /// <summary>
- /// The client ip address
- /// </summary>
- /// <value></value>
- public long IpValue { get; set; }
- /// <summary>
- /// The token online state
- /// </summary>
- /// <value></value>
- public bool IsOnline { get; set; }
- /// <summary>
- /// 安装版本
- /// </summary>
- /// <value></value>
- public string InstallVersion { get; set; }
- /// <summary>
- /// 是否老平台
- /// </summary>
- /// <value></value>
- public bool IsOldPlatform { get; set; }
- /// <summary>
- /// 老超声机连接方式
- /// </summary>
- /// <value></value>
- public int ProxyType { get; set; }
- public override string ToString()
- {
- return $"Token:{Code}|AccountType:{AccountType}|AccountName:{AccountName}|Platform:{Platform}|LoginSource:{LoginSource}|ClientId:{ClientId}|LoginServer:{LoginServer}|InstallVersion:{InstallVersion}|IsOldPlatform:{IsOldPlatform}|ProxyType:{ProxyType}";
- }
- }
- }
|