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
{
///
/// 机器人信息
///
public class fl_robot_info : base_model
{
public override string ToString()
{
return $"{nick}({name})";
}
///
/// 平台类型
///
public ChatType type { get; set; }
///
/// 机器人账号
///
public string name { get; set; }
private string _nick;
///
/// 机器人昵称
///
[SugarColumn(IsNullable = true)]
public string nick
{
get
{
return Util.RemoveEmoji(_nick);
}
set
{
_nick = value;
}
}
///
/// 授权编号
///
public string uin { get; set; }
[SugarColumn(IsNullable = true, ColumnDataType = "text")]
public string remark { get; set; }
///
/// token
///
[SugarColumn(IsNullable = true, ColumnDataType = "text")]
public string token { get; set; }
///
/// 是否登录
///
public bool is_login { get; set; }
///
/// 创建时间
///
public DateTime crt_time { get; set; }
///
/// 到期时间
///
public string end_time { get; set; }
///
/// 是否接收消息
///
public SwitchType is_receives { get; set; }
///
/// 离线通知
///
public SwitchType off_line_tip { get; set; }
///
/// 离线自动重登
///
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.开启;
}
///
/// 获取token
///
///
public object GetToken()
{
if (!string.IsNullOrEmpty(token))
{
return CsharpHttpHelper.HttpExtend.JsonToDictionary(token);
}
return null;
}
}
}