public static WeiboVo TransWeiboData(UserMicroBlogPB data) { var weiboInfo = new WeiboVo() { UserId = data.UserId, SceneId = data.SceneId, IsLike = data.Like == 1, IsComment = data.SelectState == 1, IsPublish = data.PubState == 1, CommentIndex = data.SelectIndex, CreateTime = data.CreateTime, //CommentContents = new List<string>(), }; // weiboInfo.IsPublish = weiboInfo.WeiboRuleInfo.weiboSceneInfo.NpcId == 0 ? v.PubState == 1 : true; string text = new AssetLoader().LoadTextSync(AssetLoader.GetPhoneDataPath(data.SceneId.ToString())); if (text == "") { return(null); } WeiboInfo info = JsonConvert.DeserializeObject <WeiboInfo>(text); weiboInfo.WeiboRuleInfo = info; return(weiboInfo); }
public void UpdateWeiboData(UserMicroBlogPB MicroBlog) { var smsItem = _userWeiboList.Find((item) => { return(item.SceneId == MicroBlog.SceneId); }); smsItem.IsLike = MicroBlog.Like == 1; smsItem.IsPublish = smsItem.WeiboRuleInfo.weiboSceneInfo.NpcId == 0 ? MicroBlog.PubState == 1 : true; }