/// <summary> /// 获取指定主题id的pushfeed日志的信息 /// (当论坛删除某主题时,需要调用该方法以判断该主题是否有feed到云平台,如果有该主题的信息, /// 则需要使用日志中记录的作者accessToken和accessSecret值来调用云平台接口,删除之前的feed) /// </summary> /// <param name="tid"></param> /// <returns></returns> public static TopicPushFeedInfo GetTopicPushFeedLog(int tid) { IDataReader reader = DatabaseProvider.GetInstance().GetTopicPushFeedLog(tid); TopicPushFeedInfo feedInfo = null; if (reader.Read()) { feedInfo = new TopicPushFeedInfo(); feedInfo.TopicId = TypeConverter.ObjectToInt(reader["tid"]); feedInfo.Uid = TypeConverter.ObjectToInt(reader["uid"]); feedInfo.AuthorToken = reader["authortoken"].ToString(); feedInfo.AuthorSecret = reader["authorsecret"].ToString(); reader.Close(); } return feedInfo; }
/// <summary> /// 创建主题pushfeed到云平台的日志 /// </summary> /// <param name="feedInfo"></param> /// <returns></returns> public static int CreateTopicPushFeedLog(TopicPushFeedInfo feedInfo) { return DatabaseProvider.GetInstance().CreateTopicPushFeedLog(feedInfo); }
/// <summary> /// 创建主题pushfeed到云平台的日志 /// </summary> /// <param name="feedInfo"></param> /// <returns></returns> public int CreateTopicPushFeedLog(TopicPushFeedInfo feedInfo) { DbParameter[] parms = { DbHelper.MakeInParam("@tid",(DbType)SqlDbType.Int,4,feedInfo.TopicId), DbHelper.MakeInParam("@uid",(DbType)SqlDbType.Int,4,feedInfo.Uid), DbHelper.MakeInParam("@token",(DbType)SqlDbType.Char,16,feedInfo.AuthorToken), DbHelper.MakeInParam("@secret",(DbType)SqlDbType.Char,16,feedInfo.AuthorSecret) }; return DbHelper.ExecuteNonQuery(CommandType.StoredProcedure, string.Format("{0}createfeedlog", BaseConfigs.GetTablePrefix), parms); }