You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
946 B
32 lines
946 B
3 years ago
|
import 'package:bytedesk_kefu/model/wechatId.dart';
|
||
|
import 'package:bytedesk_kefu/model/wechatUserinfo.dart';
|
||
|
import 'package:equatable/equatable.dart';
|
||
|
|
||
|
class WeChatResult extends Equatable {
|
||
|
//
|
||
|
final String? message;
|
||
|
final int? statusCode;
|
||
|
final WechatId? wechatId;
|
||
|
final WechatUserinfo? wechatUserinfo;
|
||
|
|
||
|
WeChatResult(
|
||
|
{this.message, this.statusCode, this.wechatId, this.wechatUserinfo})
|
||
|
: super();
|
||
|
|
||
|
static WeChatResult fromJson(dynamic json) {
|
||
|
return WeChatResult(
|
||
|
message: json["message"],
|
||
|
statusCode: json["status_code"],
|
||
|
wechatId: json["status_code"] == 200
|
||
|
? WechatId.fromJson(json['data'])
|
||
|
: null, // 此微信已经绑定
|
||
|
wechatUserinfo: json["status_code"] == 201
|
||
|
? WechatUserinfo.fromJson(json['data'])
|
||
|
: null // 此微信首次登录
|
||
|
);
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
List<Object> get props => [this.wechatUserinfo!.openid!];
|
||
|
}
|