2019-01-22 11:52:05 +00:00
|
|
|
class Acticity {
|
2019-01-31 09:37:02 +00:00
|
|
|
constructor(json) {
|
2019-01-22 11:52:05 +00:00
|
|
|
this.repo_id = json.repo_id;
|
|
|
|
this.repo_name = json.repo_name;
|
|
|
|
this.obj_type = json.obj_type;
|
|
|
|
this.commit_id = json.commit_id;
|
|
|
|
this.path = json.path;
|
|
|
|
this.name = json.name;
|
|
|
|
this.author_email = json.author_email;
|
|
|
|
this.author_name = json.author_name;
|
|
|
|
this.author_contact_email = json.author_contact_email;
|
|
|
|
this.avatar_url = json.avatar_url;
|
|
|
|
this.time = json.time;
|
|
|
|
this.op_type = json.op_type;
|
2019-02-13 03:19:40 +00:00
|
|
|
this.createdFilesCount = 0;
|
|
|
|
this.createdFilesList = [];
|
2019-01-22 11:52:05 +00:00
|
|
|
if (json.op_type === 'clean-up-trash') {
|
|
|
|
this.days = json.days;
|
|
|
|
} else if (json.op_type === 'rename' && json.obj_type === 'repo') {
|
|
|
|
this.old_repo_name = json.old_repo_name;
|
|
|
|
} else if (json.op_type === 'move' && ['dir', 'file'].includes(json.obj_type)) {
|
|
|
|
this.old_path = json.old_path;
|
|
|
|
} else if (json.op_type === 'rename' && ['dir', 'file'].includes(json.obj_type)) {
|
|
|
|
this.old_path = json.old_path;
|
|
|
|
this.old_name = json.old_name;
|
2019-01-24 09:27:11 +00:00
|
|
|
} else if (json.obj_type === 'review') {
|
2019-01-22 11:52:05 +00:00
|
|
|
this.old_path = json.old_path;
|
|
|
|
this.review_id = json.review_id;
|
|
|
|
}
|
2019-01-31 09:37:02 +00:00
|
|
|
}
|
2019-01-22 11:52:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default Acticity;
|