X Tutup
Skip to content

Commit ec13fe9

Browse files
committed
增加一些model
1 parent 2678196 commit ec13fe9

20 files changed

+685
-0
lines changed

lib/common/model/Branch.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import 'package:json_annotation/json_annotation.dart';
2+
3+
/**
4+
* Created by guoshuyu
5+
* Date: 2018-07-31
6+
*/
7+
8+
part 'Branch.g.dart';
9+
10+
@JsonSerializable()
11+
class Branch extends Object with _$BranchSerializerMixin {
12+
String name;
13+
String tarballUrl;
14+
@JsonKey(name: "zipball_url")
15+
String zipballUrl;
16+
@JsonKey(name: "tarball_url")
17+
18+
bool isBranch = true;
19+
20+
Branch(this.name, this.isBranch, this.tarballUrl, this.zipballUrl);
21+
22+
factory Branch.fromJson(Map<String, dynamic> json) => _$BranchFromJson(json);
23+
}

lib/common/model/Branch.g.dart

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import 'package:gsy_github_app_flutter/common/model/User.dart';
2+
import 'package:json_annotation/json_annotation.dart';
3+
4+
/**
5+
* Created by guoshuyu
6+
* Date: 2018-07-31
7+
*/
8+
9+
part 'CommitComment.g.dart';
10+
11+
@JsonSerializable()
12+
class CommitComment extends Object with _$CommitCommentSerializerMixin {
13+
int id;
14+
String body;
15+
String path;
16+
int position;
17+
int line;
18+
@JsonKey(name: "commit_id")
19+
String commitId;
20+
@JsonKey(name: "created_at")
21+
DateTime createdAt;
22+
@JsonKey(name: "updated_at")
23+
DateTime updatedAt;
24+
@JsonKey(name: "html_url")
25+
String htmlUrl;
26+
String url;
27+
User user;
28+
29+
CommitComment(
30+
this.id,
31+
this.body,
32+
this.path,
33+
this.position,
34+
this.line,
35+
this.commitId,
36+
this.createdAt,
37+
this.updatedAt,
38+
this.htmlUrl,
39+
this.url,
40+
this.user,
41+
);
42+
43+
factory CommitComment.fromJson(Map<String, dynamic> json) => _$CommitCommentFromJson(json);
44+
}

lib/common/model/CommitComment.g.dart

Lines changed: 54 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/common/model/CommitFile.dart

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import 'package:json_annotation/json_annotation.dart';
2+
3+
/**
4+
* Created by guoshuyu
5+
* Date: 2018-07-31
6+
*/
7+
8+
part 'CommitFile.g.dart';
9+
10+
@JsonSerializable()
11+
class CommitFile extends Object with _$CommitFileSerializerMixin {
12+
String sha;
13+
@JsonKey(name: "filename")
14+
String fileName;
15+
String status;
16+
int additions;
17+
int deletions;
18+
int changes;
19+
@JsonKey(name: "blob_url")
20+
String blobUrl;
21+
@JsonKey(name: "raw_url")
22+
String rawUrl;
23+
@JsonKey(name: "contents_url")
24+
String contentsUrl;
25+
String patch;
26+
27+
CommitFile(
28+
this.sha,
29+
this.fileName,
30+
this.status,
31+
this.additions,
32+
this.deletions,
33+
this.changes,
34+
this.blobUrl,
35+
this.rawUrl,
36+
this.contentsUrl,
37+
this.patch,
38+
);
39+
40+
factory CommitFile.fromJson(Map<String, dynamic> json) => _$CommitFileFromJson(json);
41+
}

lib/common/model/CommitFile.g.dart

Lines changed: 44 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import 'package:gsy_github_app_flutter/common/model/CommitGitUser.dart';
2+
import 'package:json_annotation/json_annotation.dart';
3+
4+
/**
5+
* Created by guoshuyu
6+
* Date: 2018-07-31
7+
*/
8+
9+
part 'CommitGitInfo.g.dart';
10+
11+
@JsonSerializable()
12+
class CommitGitInfo extends Object with _$CommitGitInfoSerializerMixin {
13+
String message;
14+
String url;
15+
@JsonKey(name: "comment_count")
16+
int commentCount;
17+
CommitGitUser author;
18+
CommitGitUser committer;
19+
20+
CommitGitInfo(
21+
this.message,
22+
this.url,
23+
this.commentCount,
24+
this.author,
25+
this.committer,
26+
);
27+
28+
factory CommitGitInfo.fromJson(Map<String, dynamic> json) => _$CommitGitInfoFromJson(json);
29+
}

lib/common/model/CommitGitInfo.g.dart

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:json_annotation/json_annotation.dart';
2+
3+
/**
4+
* Created by guoshuyu
5+
* Date: 2018-07-31
6+
*/
7+
8+
part 'CommitGitUser.g.dart';
9+
10+
@JsonSerializable()
11+
class CommitGitUser extends Object with _$CommitGitUserSerializerMixin {
12+
String name;
13+
String email;
14+
DateTime date;
15+
16+
CommitGitUser(this.name, this.email, this.date);
17+
18+
factory CommitGitUser.fromJson(Map<String, dynamic> json) => _$CommitGitUserFromJson(json);
19+
}

lib/common/model/CommitGitUser.g.dart

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
X Tutup