using Microsoft.Azure.Cosmos.Table;
using System;
using System.Collections.Generic;
using System.Text;
using TEAMModelOS.SDK.Context.Attributes.Azure;
namespace TEAMModelOS.SDK.Models
{
/*
{
"id":"uuid",
"code":"base",
"pk":"Api",
"name": "学校基本信息",
"url": "school/get",
"method": "GET/POST",
"descr": "描述"
}
*/
///
/// 限流方案 漏斗、令牌桶、sentinel
/// 平台开放的OpenAIPs
///
[TableName(Name = "IESOpenApi")]
public class OpenApi : TableEntity
{
public OpenApi() {
}
///
/// 英文接口名称
///
public string ename { get; set; }
///
/// 繁体中文接口名称
///
public string tname { get; set; }
///
/// 简体中文接口名称
///
public string name { get; set; }
///
/// 接口url
///
public string url { get; set; }
///
/// 请求方法
///
public string method { get; set; }
///
/// 开放的api接口
///
public string descr { get; set; }
public int auth { get; set; }
///
/// R读取
/// W写入
/// D删除
/// L列表
/// N通知
///
public string type { get; set; }
///
/// minute 分钟,表示按分钟限流,多少分钟内只能访问多少次,
/// hour 小时,表示按小时限流,多少小时内只能访问多少次,
/// day 天数,表示按天数限流,多少天数内只能访问多少次,
///
public string policy { get; set; }
///
/// policy 策略,分钟,小时,天数对应的时长
///
public int duration { get; set; }
///
/// policy 策略,分钟,小时,天数对应的时长(duration) 可以访问的次数
///
public int times { get; set; }
///
/// 是否免费调用
///
///public bool free { get; set; }
///
/// 每次调用花费多少钱
///
///public decimal cost { get; set; }
}
[TableName(Name = "IESOpenApi")]
public class WebHook : TableEntity
{
public WebHook()
{
//RowKey= auth
PartitionKey = "IES5-WEBHOOK";
}
///
/// 英文接口名称
///
public string ename { get; set; }
///
/// 繁体中文接口名称
///
public string tname { get; set; }
///
/// 接口名称
///
public string name { get; set; }
///
/// 接口url
///
public string url { get; set; }
///
/// 请求方法
///
public string method { get; set; }
///
/// 开放的api接口
///
public string descr { get; set; }
public int auth { get; set; }
///
/// R读取
/// W写入
/// D删除
/// L列表
/// N通知
///
public string type { get; set; }
public string notice { get; set; }
}
public class DefaultApp : CosmosEntity
{
///
/// 0禁用,1正常,2 token封禁
///
public int status { get; set; }
public DefaultApp()
{
pk = "OpenApp";
}
///
/// 图标
///
public string icon { get; set; }
///
/// 应用名称
///
public string name { get; set; }
///
/// 应用描述
///
public string descr { get; set; }
///
/// 授权信息
///
public List auths { get; set; } = new List();
}
public class OpenApp : CosmosEntity {
///
/// 图标
///
public string icon { get; set; }
///
/// 应用名称
///
public string name { get; set; }
///
/// 应用描述
///
public string descr { get; set; }
///
/// 授权信息
///
public List auths { get; set; } = new List();
public List apiInfos { get; set; } = new List();
public List webhooks { get; set; } = new List();
///
/// 学校编码
///
public string school { get; set; }
///
/// 生成的token
///
public string token { get; set; }
public string jti { get; set; }
///
/// domain的域名
///
public string domain { get; set; }
///
///webhook
///
public string webhookToken { get; set; }
///
/// 0禁用,1正常,2 token封禁
///
public int status { get; set; }
public OpenApp()
{
pk = "OpenApp";
}
}
public class ApiInfo {
///
/// minute 分钟,表示按分钟限流,多少分钟内只能访问多少次,
/// hour 小时,表示按小时限流,多少小时内只能访问多少次,
/// day 天数,表示按天数限流,多少天数内只能访问多少次,
///
public string policy { get; set; }
///
/// policy 策略,分钟,小时,天数对应的时长
///
public int duration { get; set; }
///
/// policy 策略,分钟,小时,天数对应的时长(duration) 可以访问的次数
///
public int times { get; set; }
public int auth { get; set; }
}
}