using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace JuSNS.Factory
{
    /// <summary>
    /// Api用户接口
    /// </summary>
    public interface IApiUser
    {
        /// <summary>
        /// 取得字段属性
        /// </summary>
        /// <param name="Field">字段名称</param>
        /// <param name="UserID">用户ID</param>
        /// <returns></returns>
        string GetProperty(int UserID,string Field);
        /// <summary>
        /// 取得所有的字段属性
        /// </summary>
        /// <param name="Fields">字段名称</param>
        /// <param name="UserID">用户ID</param>
        /// <returns></returns>
        Dictionary<string, string> GetAllProperty(int UserID,string[] Fields);
        /// <summary>
        /// 是否有这个字段
        /// </summary>
        /// <param name="Field">字段名称</param>
        /// <returns></returns>
        bool HasField(string Field);
        /// <summary>
        /// 取得所有字段名称
        /// </summary>
        /// <returns></returns>
        string[] GetFields();
        /// <summary>
        /// 设置某个字段的值
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <param name="Field"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        int SetField(int UserID,string Field, object value);
    }
    public sealed partial class DataAccess
    {
        public static IApiUser CreateApiUser()
        {
            string className = path + ".ApiUser";
            return (IApiUser)Assembly.Load(path).CreateInstance(className);
        }
    }
}
