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": "描述"
    }
     */
    /// <summary>
    /// 限流方案  漏斗、令牌桶、sentinel
    /// 平台开放的OpenAIPs
    /// </summary>
    [TableName(Name = "OpenApi")]
    public class OpenApi : TableEntity
    {
        public OpenApi() {

            PartitionKey = "IES5-API";
        } 
        public string name { get; set; }
        public string url { get; set; }
        public string method { get; set; }
        public string descr { get; set; }
        public int auth { get; set; }

    }

    public class OpenApp : CosmosEntity {
        public string icon { get; set; }
        public string name { get; set; }
        public string descr { get; set; }
        public List<int> auths { get; set; } = new List<int>();
        public string school { get; set; }
        public string token { get; set; }
        /// <summary>
        /// 0禁用，1正常，2 token封禁
        /// </summary>
        public int status { get; set; }
        public OpenApp()
        {
            pk = "OpenApp";
        }
    }
}
