From d332bb90d20f3fdaf4750fe2d3e7ad43ec77e752 Mon Sep 17 00:00:00 2001 From: datang Date: Fri, 2 Sep 2022 17:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E9=99=A4=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/api.dart | 30 +++++++++++++++- lib/model/exclude_phone_model.dart | 22 ++++++++++++ lib/model/exclude_phone_model.g.dart | 19 ++++++++++ lib/model/login_info_model.dart | 52 +++++++++++++--------------- 4 files changed, 94 insertions(+), 29 deletions(-) create mode 100644 lib/model/exclude_phone_model.dart create mode 100644 lib/model/exclude_phone_model.g.dart diff --git a/lib/constants/api.dart b/lib/constants/api.dart index da42ee8..a2aba97 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -29,26 +29,37 @@ class API { static _App app = _App(); static _Pay pay = _Pay(); + static _Exclude exclude = _Exclude(); } + class _App { ///用户登录 String get login => '/app/login'; + ///退出登录 String get logout => '/app/login/logout'; + ///发送验证码 String get captcha => '/app/captcha'; + ///用户信息 String get info => '/app/user/info'; + ///短信标签 String get addTag => '/app/user/addTag'; + ///自定义短信 String get content => '/app/user/content'; + ///删除自定义短信 String get delete => '/app/user/content/delete'; + ///选择自定义短信 String get checked => '/app/user/content/checked'; + ///查找短信 String get find => '/app/user/content/find'; + ///更新VIP状态(已合并至用户信息) String get updateVip => '/app/user/updateVip'; } @@ -56,10 +67,27 @@ class _App { class _Pay { ///微信支付 String get wxpay => '/app/pay/wxpay'; + ///支付宝支付 String get alipay => '/app/pay/alipay'; + ///微信支付回调 String get wxCallback => '/callback/wxpay/notify'; + ///支付宝支付回调 String get aliCallback => '/callback/alipay/notify'; -} \ No newline at end of file +} + +class _Exclude { + ///添加手机号 + String get add => '/app/exclude/add'; + + ///删除手机号 + String get delete => '/app/exclude/delete'; + + ///修改手机号 + String get update => '/app/exclude/update'; + + ///查看手机号列表 + String get find => '/app/exclude/find'; +} diff --git a/lib/model/exclude_phone_model.dart b/lib/model/exclude_phone_model.dart new file mode 100644 index 0000000..6658eeb --- /dev/null +++ b/lib/model/exclude_phone_model.dart @@ -0,0 +1,22 @@ +import 'package:json_annotation/json_annotation.dart'; +import 'package:equatable/equatable.dart'; +part 'exclude_phone_model.g.dart'; + + +@JsonSerializable() +class ExcludePhoneModel extends Equatable{ + final int id; + final String phone; + final String remark; + factory ExcludePhoneModel.fromJson(Map json) =>_$ExcludePhoneModelFromJson(json); + Map toJson()=> _$ExcludePhoneModelToJson(this); + + const ExcludePhoneModel({ + required this.id, + required this.phone, + required this.remark, + }); + + @override + List get props => [id,phone,remark]; +} \ No newline at end of file diff --git a/lib/model/exclude_phone_model.g.dart b/lib/model/exclude_phone_model.g.dart new file mode 100644 index 0000000..745bc36 --- /dev/null +++ b/lib/model/exclude_phone_model.g.dart @@ -0,0 +1,19 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'exclude_phone_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +ExcludePhoneModel _$ExcludePhoneModelFromJson(Map json) => ExcludePhoneModel( + id: json['id'] as int, + phone: json['phone'] as String, + remark: json['remark'] as String, + ); + +Map _$ExcludePhoneModelToJson(ExcludePhoneModel instance) => { + 'id': instance.id, + 'phone': instance.phone, + 'remark': instance.remark, + }; \ No newline at end of file diff --git a/lib/model/login_info_model.dart b/lib/model/login_info_model.dart index 6e9b19a..29bb041 100644 --- a/lib/model/login_info_model.dart +++ b/lib/model/login_info_model.dart @@ -1,41 +1,37 @@ import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; -part 'login_info_model.g.dart'; +part 'login_info_model.g.dart'; @JsonSerializable() class LoginInfo extends Equatable { - final String token; - final User user; + final String token; + final User user; - factory LoginInfo.fromJson(Map json) => - _$LoginInfoFromJson(json); + factory LoginInfo.fromJson(Map json) => + _$LoginInfoFromJson(json); - const LoginInfo({ - required this.token, - required this.user, - }); + const LoginInfo({ + required this.token, + required this.user, + }); - @override - List get props => [token, user]; + @override + List get props => [token, user]; } @JsonSerializable() class User extends Equatable { - final int id; - final String name; - - const User({ - required this.id, - required this.name, - }); - - factory User.fromJson(Map json) => _$UserFromJson(json); - - @override - List get props => - [ - id, - name, - ]; -} \ No newline at end of file + final int id; + final String name; + + const User({ + required this.id, + required this.name, + }); + + factory User.fromJson(Map json) => _$UserFromJson(json); + + @override + List get props => [id, name]; +}