private UserTaoOAuth GetUserTaoOAuth(Dictionary <string, string> dict) { var taoOAuth = new UserTaoOAuth(); UpdateUserTaoOAuth(taoOAuth, dict); return(taoOAuth); }
internal ApiResult Traderate(long tid, UserTaoOAuth taoOAuth) { ITopClient client = new DefaultTopClient(url_api, AppKey, AppSecret); TraderateAddRequest req = new TraderateAddRequest(); req.Tid = tid; //req.Oid = 1234L; req.Result = "good"; req.Role = "seller"; //req.Content = "好评!"; req.Anony = false; TraderateAddResponse rsp = client.Execute(req, taoOAuth.access_token); return(new ApiResult(!rsp.IsError, rsp.ErrMsg + " " + rsp.SubErrMsg)); }
private void UpdateUserTaoOAuth(UserTaoOAuth taoOAuth, Dictionary <string, string> dict) { if (taoOAuth.taobao_user_nick == null) { taoOAuth.taobao_user_nick = dict["visitor_nick"]; } taoOAuth.access_token = dict["access_token"]; taoOAuth.expires_in = int.Parse(dict["expires_in"]); taoOAuth.r1_expires_in = int.Parse(dict["r1_expires_in"]); taoOAuth.r2_expires_in = int.Parse(dict["r2_expires_in"]); taoOAuth.refresh_token = dict["refresh_token"]; taoOAuth.re_expires_in = int.Parse(dict["re_expires_in"]); taoOAuth.token_type = "Bearer"; taoOAuth.w1_expires_in = int.Parse(dict["w1_expires_in"]); taoOAuth.w2_expires_in = int.Parse(dict["w2_expires_in"]); taoOAuth.UpdateAt = DateTime.Now; }