Add InTransaction(), fix param storage

This commit is contained in:
flamingcow
2019-05-09 23:36:31 -07:00
parent 8bd0813161
commit b5b0cbd599
2 changed files with 13 additions and 3 deletions

View File

@@ -33,14 +33,14 @@ uint16_t Request::RequestId() {
}
void Request::AddParam(const std::string_view& key, const std::string_view& value) {
params_.try_emplace(std::string(key), std::string(value));
params_.try_emplace(key, value);
}
void Request::SetBody(const std::string_view& body) {
body_ = body;
}
const std::string_view& Request::GetParam(const std::string& key) {
const std::string_view& Request::GetParam(const std::string_view& key) {
auto iter = params_.find(key);
if (iter == params_.end()) {
static const std::string_view none;