114 lines
2.9 KiB
C#
114 lines
2.9 KiB
C#
using Api.Framework.Enums;
|
|
using Api.Framework.SDK;
|
|
using Api.Framework.Tools;
|
|
using Api.Framework.Tools;
|
|
using SqlSugar;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Api.Framework.Model
|
|
{
|
|
/// <summary>
|
|
/// 机器人信息
|
|
/// </summary>
|
|
public class fl_robot_info : base_model
|
|
{
|
|
public override string ToString()
|
|
{
|
|
return $"{nick}({name})";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 平台类型
|
|
/// </summary>
|
|
public ChatType type { get; set; }
|
|
|
|
/// <summary>
|
|
/// 机器人账号
|
|
/// </summary>
|
|
public string name { get; set; }
|
|
|
|
private string _nick;
|
|
/// <summary>
|
|
/// 机器人昵称
|
|
/// </summary>
|
|
[SugarColumn(IsNullable = true)]
|
|
public string nick
|
|
{
|
|
get
|
|
{
|
|
return Util.RemoveEmoji(_nick);
|
|
}
|
|
set
|
|
{
|
|
_nick = value;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 授权编号
|
|
/// </summary>
|
|
public string uin { get; set; }
|
|
[SugarColumn(IsNullable = true, ColumnDataType = "text")]
|
|
public string remark { get; set; }
|
|
/// <summary>
|
|
/// token
|
|
/// </summary>
|
|
[SugarColumn(IsNullable = true, ColumnDataType = "text")]
|
|
public string token { get; set; }
|
|
/// <summary>
|
|
/// 是否登录
|
|
/// </summary>
|
|
public bool is_login { get; set; }
|
|
/// <summary>
|
|
/// 创建时间
|
|
/// </summary>
|
|
public DateTime crt_time { get; set; }
|
|
/// <summary>
|
|
/// 到期时间
|
|
/// </summary>
|
|
public string end_time { get; set; }
|
|
/// <summary>
|
|
/// 是否接收消息
|
|
/// </summary>
|
|
public SwitchType is_receives { get; set; }
|
|
/// <summary>
|
|
/// 离线通知
|
|
/// </summary>
|
|
public SwitchType off_line_tip { get; set; }
|
|
|
|
/// <summary>
|
|
/// 离线自动重登
|
|
/// </summary>
|
|
public SwitchType off_line_auto_login { get; set; }
|
|
|
|
public fl_robot_info()
|
|
{
|
|
this.uin = string.Empty;
|
|
this.crt_time = DateTime.Now;
|
|
this.end_time = string.Empty;
|
|
this.token = string.Empty;
|
|
this.name = string.Empty;
|
|
this.remark = string.Empty;
|
|
this.is_receives = SwitchType.开启;
|
|
this.off_line_tip = SwitchType.开启;
|
|
this.off_line_auto_login = SwitchType.开启;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取token
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public object GetToken()
|
|
{
|
|
if (!string.IsNullOrEmpty(token))
|
|
{
|
|
return CsharpHttpHelper.HttpExtend.JsonToDictionary(token);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
}
|