/*********************************************************** **函数名 makeSig **输入: ** method 请求方法 "get" or "post" url_path openapi名称 params 请求参数 secret 密钥 **输出: ** **返回: 签名 **描述: 生成签名 ** **************************************************************/ string CSnsSigCheck::makeSig(string& method, string& url_path, map<string, string>& params, string& secret) { string source; transform(method.begin(),method.end(), method.begin(),::toupper); source.append(method); source.append("&"); source.append(url_encode(url_path)); source.append("&"); source.append(url_encode(join_params(params))); char* p_sig = oauth_sign_hmac_sha1_raw( source.c_str(), source.size(), secret.c_str(), secret.size()); if (p_sig == NULL) { return ""; } string sig = p_sig;; delete [] p_sig; p_sig = NULL; return sig; }
string session_impl::insert_sql(const std::shared_ptr<schema> &schema, const vector<string> &columns) const { ostringstream buf; buf << "INSERT INTO " << schema->table_name(); buf << "("; buf << join_csv(columns); buf << ") VALUES("; buf << join_params(columns, false); buf << ");"; return buf.str(); }