2025-04-30 17:36:24 +08:00

35 lines
1.2 KiB
C++

// Copyright (c) 2022 NetEase, Inc. All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.
#ifndef NIMRESULT_H
#define NIMRESULT_H
#include "flutter/encodable_value.h"
using namespace flutter;
class NimResult {
public:
static EncodableValue getErrorResult(int code, const std::string& msg);
static EncodableValue getErrorResult(int code, const std::string& msg,
const flutter::EncodableMap& data);
static EncodableValue getSuccessResult();
static EncodableValue getSuccessResult(bool data);
static EncodableValue getSuccessResult(int32_t data);
static EncodableValue getSuccessResult(int64_t data);
static EncodableValue getSuccessResult(const std::string& data);
static EncodableValue getSuccessResult(const flutter::EncodableValue& data);
static EncodableValue getSuccessResult(const flutter::EncodableMap& data);
static EncodableValue getSuccessResult(const flutter::EncodableList& data);
static EncodableValue getSuccessResult(const std::string& msg,
const flutter::EncodableMap& data);
};
#endif // NIMRESULT_H