Exemplo n.º 1
0
        /// <summary>
        /// 获取指定用户的推荐宝贝信息
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <returns>其推荐宝贝信息 若无推荐宝贝则返回结果内容为空</returns>
        public static TaobaoItem getRecommend(string userID)
        {
            User user = userDb.GetById(userID);

            if (user == null)
#if DEBUG
            { throw new Exception(); }
#else
            { return(new TaobaoItem()); }
#endif
            TaobaoItem item = user.recommednItem;

            userDb.Update(user);

            return(item);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 初始化成员变量
 /// </summary>
 /// <param name="_users"></param>
 /// <param name="_item"></param>
 public SetRecommendInfo(IEnumerable <User> _users, TaobaoItem _item)
 {
     users = _users;
     item  = _item;
 }