Repository navigation
Expand file tree
/
Copy pathRepository.dart
More file actions
144 lines (107 loc) · 2.74 KB
/
Copy pathRepository.dart
File metadata and controls
144 lines (107 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import 'package:gsy_github_app_flutter/common/model/License.dart';
import 'package:gsy_github_app_flutter/common/model/RepositoryPermissions.dart';
import 'package:gsy_github_app_flutter/common/model/User.dart';
import 'package:json_annotation/json_annotation.dart';
/**
* Created by guoshuyu
* Date: 2018-07-31
*/
part 'Repository.g.dart';
@JsonSerializable()
class Repository {
int id;
int size;
String name;
@JsonKey(name: "full_name")
String fullName;
@JsonKey(name: "html_url")
String htmlUrl;
String description;
String language;
@JsonKey(name: "default_branch")
String defaultBranch;
@JsonKey(name: "created_at")
DateTime createdAt;
@JsonKey(name: "updated_at")
DateTime updatedAt;
@JsonKey(name: "pushed_at")
DateTime pushedAt;
@JsonKey(name: "git_url")
String gitUrl;
@JsonKey(name: "ssh_url")
String sshUrl;
@JsonKey(name: "clone_url")
String cloneUrl;
@JsonKey(name: "svn_url")
String svnUrl;
@JsonKey(name: "stargazers_count")
int stargazersCount;
@JsonKey(name: "watchers_count")
int watchersCount;
@JsonKey(name: "forks_count")
int forksCount;
@JsonKey(name: "open_issues_count")
int openIssuesCount;
@JsonKey(name: "subscribers_count")
int subscribersCount;
@JsonKey(name: "private")
bool private;
bool fork;
@JsonKey(name: "has_issues")
bool hasIssues;
@JsonKey(name: "has_projects")
bool hasProjects;
@JsonKey(name: "has_downloads")
bool hasDownloads;
@JsonKey(name: "has_wiki")
bool hasWiki;
@JsonKey(name: "has_pages")
bool hasPages;
User owner;
License license;
Repository parent;
RepositoryPermissions permissions;
List<String> topics;
///issue总数,不参加序列化
int allIssueCount;
Repository(
this.id,
this.size,
this.name,
this.fullName,
this.htmlUrl,
this.description,
this.language,
this.license,
this.defaultBranch,
this.createdAt,
this.updatedAt,
this.pushedAt,
this.gitUrl,
this.sshUrl,
this.cloneUrl,
this.svnUrl,
this.stargazersCount,
this.watchersCount,
this.forksCount,
this.openIssuesCount,
this.subscribersCount,
this.private,
this.fork,
this.hasIssues,
this.hasProjects,
this.hasDownloads,
this.hasWiki,
this.hasPages,
this.owner,
this.parent,
this.permissions,
this.topics,
);
/// A necessary factory constructor for creating a new User instance
/// from a map. We pass the map to the generated _$UserFromJson constructor.
/// The constructor is named after the source class, in this case User.
factory Repository.fromJson(Map<String, dynamic> json) => _$RepositoryFromJson(json);
Map<String, dynamic> toJson() => _$RepositoryToJson(this);
Repository.empty();
}