Files
wechat_kit/example/lib/api/model/wechat_api_resp.dart
2021-07-21 11:09:19 +08:00

30 lines
943 B
Dart
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'dart:convert';
import 'package:json_annotation/json_annotation.dart';
abstract class WechatApiResp {
const WechatApiResp({
required this.errcode,
this.errmsg,
});
/// 成功
static const int ERRORCODE_SUCCESS = 0;
/// -1 系统繁忙,此时请开发者稍候再试
/// 0 请求成功
/// 40001 AppSecret错误或者AppSecret不属于这个公众号请开发者确认AppSecret的正确性
/// 40002 请确保grant_type字段值为client_credential
/// 40164 调用接口的IP地址不在白名单中请在接口IP白名单中进行设置。小程序及小游戏调用不要求IP地址在白名单内。
@JsonKey(defaultValue: ERRORCODE_SUCCESS)
final int errcode;
final String? errmsg;
bool get isSuccessful => errcode == ERRORCODE_SUCCESS;
Map<String, dynamic> toJson();
@override
String toString() => const JsonEncoder.withIndent(' ').convert(toJson());
}