mirror of
https://github.com/pd4d10/git-touch.git
synced 2026-04-29 02:52:20 -05:00
feat(gitee): watch, star a repo (#157)
* feat(gitee): watch, star a repo * fix: pass in props as Tuple * feat: bitbucket branches * fix: use class instead of map
This commit is contained in:
committed by
GitHub
parent
2017014ffd
commit
c75288ef97
@@ -337,7 +337,15 @@ class AuthModel with ChangeNotifier {
|
||||
'${activeAccount.domain}/api/v5$p',
|
||||
headers: headers,
|
||||
);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
case 'PUT':
|
||||
{
|
||||
await http.put(
|
||||
'${activeAccount.domain}/api/v5$p',
|
||||
headers: headers,
|
||||
);
|
||||
return;
|
||||
}
|
||||
case 'POST':
|
||||
{
|
||||
@@ -357,6 +365,12 @@ class AuthModel with ChangeNotifier {
|
||||
);
|
||||
break;
|
||||
}
|
||||
case 'NO CONTENT':
|
||||
{
|
||||
res = await http.get('${activeAccount.domain}/api/v5$p',
|
||||
headers: headers);
|
||||
return res;
|
||||
}
|
||||
default:
|
||||
{
|
||||
res = await http.get('${activeAccount.domain}/api/v5$p',
|
||||
@@ -364,11 +378,8 @@ class AuthModel with ChangeNotifier {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (requestType != 'DELETE') {
|
||||
final info = json.decode(utf8.decode(res.bodyBytes));
|
||||
return info;
|
||||
}
|
||||
return;
|
||||
final info = json.decode(utf8.decode(res.bodyBytes));
|
||||
return info;
|
||||
}
|
||||
|
||||
Future<DataWithPage> fetchGiteeWithPage(String path,
|
||||
|
||||
@@ -144,3 +144,12 @@ class BbComment {
|
||||
factory BbComment.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbCommentFromJson(json);
|
||||
}
|
||||
|
||||
@JsonSerializable(fieldRename: FieldRename.snake)
|
||||
class BbBranch {
|
||||
String name;
|
||||
String type;
|
||||
BbBranch();
|
||||
factory BbBranch.fromJson(Map<String, dynamic> json) =>
|
||||
_$BbBranchFromJson(json);
|
||||
}
|
||||
|
||||
@@ -247,3 +247,14 @@ Map<String, dynamic> _$BbCommentToJson(BbComment instance) => <String, dynamic>{
|
||||
'content': instance.content,
|
||||
'user': instance.user,
|
||||
};
|
||||
|
||||
BbBranch _$BbBranchFromJson(Map<String, dynamic> json) {
|
||||
return BbBranch()
|
||||
..name = json['name'] as String
|
||||
..type = json['type'] as String;
|
||||
}
|
||||
|
||||
Map<String, dynamic> _$BbBranchToJson(BbBranch instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
'type': instance.type,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user