using System;
using System.Collections.Generic;
using System.Text;
using JuSNS.Factory.ApiInterface;
using JuSNS.Model.ApiInterface;

namespace JuSNS.ApiInterface
{
    /// <summary>
    /// 开发者类
    /// </summary>
    public class Developer
    {
        static private IDeveloper dal;
        static Developer()
        {
            dal = DataAccess.CreateDeveloper();
        }
        /// <summary>
        /// 申请成为开发者
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <returns></returns>
        static public int RequestDeveloper(int UserID, out int isDev)
        {
            return dal.RequestDeveloper(UserID, out isDev);
        }
        /// <summary>
        /// 是否是开发者
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        static public bool IsDeveloper(int UserID)
        {
            return dal.IsDeveloper(UserID);
        }
        /// <summary>
        /// 是否开通开发者
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        static public bool IsEnabled(int UserID)
        {
            return dal.IsEnabled(UserID);
        }
        /// </summary>
        /// <param name="ID">开发者ID</param>
        /// <returns></returns>
        static public int DeleteDeveloper(int ID)
        {
            return dal.DeleteDeveloper(ID);
        }
        /// <summary>
        /// 通过开发者
        /// </summary>
        /// <param name="ID">开发者ID</param>
        /// <returns></returns>
        static public int PassDeveloper(int ID)
        {
            return dal.PassDeveloper(ID);
        }
        /// <summary>
        /// 关闭开发者
        /// </summary>
        /// <param name="ID">开发者ID</param>
        /// <returns></returns>
        static public int DisableDeveloper(int ID)
        {
            return dal.DisableDeveloper(ID);
        }
        /// <summary>
        /// 建立应用程序
        /// </summary>
        /// <param name="info">应用程序信息</param>
        /// <returns></returns>
        static public int CreateApp(AppInfo info)
        {
            return dal.CreateApp(info);
        }
        /// <summary>
        /// 编辑应用程序信息
        /// </summary>
        /// <param name="info">应用程序信息</param>
        /// <returns></returns>
        static public int EditApp(AppInfo info)
        {
            return dal.EditApp(info);
        }

        static public int EditAppAdmin(AppInfo info)
        {
            return dal.EditAppAdmin(info);
        }
        static public int DeleteApp(int userid, int appid)
        {
            return dal.DeleteApp(userid, appid);
        }
        /// <summary>
        /// 生成appkey
        /// </summary>
        /// <param name="AppID"></param>
        /// <returns></returns>
        static public int ResetAppKey(int AppID)
        {
            return dal.ResetAppKey(AppID);
        }
        /// <summary>
        /// 取得Appkey
        /// </summary>
        /// <param name="AppID"></param>
        /// <returns></returns>
        static public string GetAppKey(int AppID)
        {
            return dal.GetAppKey(AppID);
        }
    }
}
