using System;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using JuSNS.Model;

namespace JuSNS.Factory
{
    public interface IHomeIndex
    {

        /// <summary>
        /// 得到一个数据的名称
        /// </summary>
        /// <param name="InfoID">数据的ID</param>
        /// <param name="Flag">1群组,2为用户,3相册,4照片,5日志,6日志评论,7群主题，8分享评论,9日志,10电影,11心情日记,12用户发表的心情日记,13网页</param>
        /// <returns></returns>
        //string GetIdName(int InfoID, string Flag);

        /// <summary>
        /// 打招呼
        /// </summary>
        /// <param name="UserID">被打招呼的人</param>
        /// <returns></returns>
        IDataReader GetPoke(int UserID);

        /// <summary>
        /// 更新打招呼状态
        /// </summary>
        /// <param name="fID">好友ID</param>
        /// <param name="uID">用户ID</param>
        /// <param name="Flag">0回复，1忽略</param>
        void UpdatePoke(int fID, int uID, int Flag);

        /// <summary>
        /// 回复招呼状态
        /// </summary>
        /// <param name="fID">好友ID</param>
        /// <param name="uID">用户ID</param>
        void updateRePoke(int fID, int uID);

        /// <summary>
        /// 获取好友请求数量
        /// </summary>
        /// <param name="UserID">被请求的用户ID</param>
        /// <returns></returns>
        int FriendRequest(int UserID, int Type);

        /// <summary>
        /// 获取通知数量（未读）
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        int NoticeInfo(int UserID);

        /// <summary>
        /// 获取10天内即将过生日的好友
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        DataTable FriendBirthday(int UserID);

        /// <summary>
        /// 得到电影图片
        /// </summary>
        /// <param name="MovieID"></param>
        /// <returns></returns>
        string GetMoviePic(int MovieID);

        /// <summary>
        /// 拜访与被拜访
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="boundNum">必须大于这个数量才返回相应的数据</param>
        /// <param name="topNum">获取数量</param>
        /// <returns></returns>
        List<VisitInfo>[] Visit(int userId, int boundNum, int topNum);

        List<UserInfo>[] FindFriend(int userId,int Sex);

        List<UserInfo>[] FindNewReg(int userId, int Sex, int Num);

        /// <summary>
        /// 取得动态
        /// </summary>
        /// <param name="UserId">用户ＩＤ</param>
        /// <param name="num">最多条数</param>
        /// <param name="dynType">动态类型</param>
        /// <returns></returns>
        List<UserLogInfo> DynList(int UserId, int num, string dynType,int Flag);
    }

    public sealed partial class DataAccess
    {
        public static IHomeIndex CreateHomeIndex()
        {
            string className = path + ".HomeIndex";
            return (IHomeIndex)Assembly.Load(path).CreateInstance(className);
        }
    }
}