/// <summary> /// 构造函数,设置、查询URL、查询起始页、查询范围等 /// </summary> /// <param name="user">被爬取微博的用户</param> /// <param name="startPage">爬取起始页</param> /// <param name="queryRange">爬取范围</param> public FansAndFollowCrawler(RelateType type, int startPage, int queryRange) { Type = type; this.Name = Type + UserID; this.startPage = startPage; this.queryRange = queryRange; }
/// <summary> /// 构造函数,设置、查询URL、查询起始页、查询范围等 /// </summary> /// <param name="user">被爬取微博的用户</param> /// <param name="startPage">爬取起始页</param> /// <param name="queryRange">爬取范围</param> public FansAndFollowCrawler(RelateType type, int startPage, int queryRange) { Type = type; this.Name = Type + UserID; this.startPage = startPage; this.queryRange = queryRange; }
/// <summary> /// 更新关系条目 /// </summary> /// <param name="fromClientId">int 邀请客户端编号</param> /// <param name="toClientId">int 被邀请客户端编号</param> /// <param name="relateType">RelateType 关系类型</param> /// <returns>int 受影响的行数</returns> public static int Update(int fromClientId, int toClientId, RelateType relateType) { string sql = "UPDATE tc_client_relate SET relateType=IF(relateType>@2,@2,relateType) WHERE fromClientId=@0 AND toClientId=@1 "; using (MySqlADO ado = new MySqlADO()) { return(ado.NonQuery(sql, fromClientId, toClientId, (int)relateType)); } }
/// <summary> /// 创建关系条目 /// </summary> /// <param name="fromClientId">int 邀请客户端编号</param> /// <param name="toClientId">int 被邀请客户端编号</param> /// <param name="relateType">RelateType 关系类型</param> /// <returns>int 受影响的行数</returns> public static int Create(int fromClientId, int toClientId, RelateType relateType) { string sql = "INSERT INTO tc_client_relate (fromClientId, toClientId, relateType, openGId) VALUES(@0, @1, @2, @3) ON DUPLICATE KEY UPDATE fromClientId=VALUES(fromClientId), toClientId=VALUES(toClientId), relateType=VALUES(relateType), openGId=VALUES(openGId), updateTime=Now()"; using (MySqlADO ado = new MySqlADO()) { return(ado.NonQuery(sql, fromClientId, toClientId, (int)relateType, String.Empty)); } }
public RelateTypeWrapper(TYPE_ITEM_RELATE pRelateType) { eRelateType = RelateType.RelateType; this.pRelateType = pRelateType; }
public RelateTypeWrapper(RelateType eRelateType) { this.eRelateType = eRelateType; pRelateType = default(TYPE_ITEM_RELATE); }