2020-08-05 23:59:10 +02:00
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
|
2020-08-09 00:27:13 +02:00
|
|
|
import '../models/comment.dart';
|
2020-08-06 22:06:53 +02:00
|
|
|
import 'main.dart';
|
2020-08-05 23:59:10 +02:00
|
|
|
|
2020-08-06 22:06:53 +02:00
|
|
|
extension CommentEndpoint on V1 {
|
2020-08-05 23:59:10 +02:00
|
|
|
/// POST /comment
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#create-comment
|
2020-08-09 00:27:13 +02:00
|
|
|
Future<CommentView> createComment({
|
2020-08-05 23:59:10 +02:00
|
|
|
@required String content,
|
|
|
|
int parentId,
|
|
|
|
@required int postId,
|
|
|
|
int formId,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// PUT /comment
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#edit-comment
|
2020-08-09 00:27:13 +02:00
|
|
|
Future<CommentView> editComment({
|
2020-08-05 23:59:10 +02:00
|
|
|
@required String content,
|
|
|
|
@required int editId,
|
|
|
|
String formId,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /comment/delete
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#delete-comment
|
|
|
|
/// Only the creator can delete the comment
|
2020-08-09 00:27:13 +02:00
|
|
|
Future<CommentView> deleteComment({
|
2020-08-05 23:59:10 +02:00
|
|
|
@required int editId,
|
|
|
|
@required bool deleted,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /comment/remove
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#remove-comment
|
|
|
|
/// Only a mod or admin can remove the comment
|
2020-08-09 00:27:13 +02:00
|
|
|
Future<CommentView> removeComment({
|
2020-08-05 23:59:10 +02:00
|
|
|
@required int editId,
|
|
|
|
@required bool removed,
|
|
|
|
String reason,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /comment/mark_as_read
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#mark-comment-as-read
|
2020-08-09 00:27:13 +02:00
|
|
|
Future<CommentView> markCommentAsRead({
|
2020-08-05 23:59:10 +02:00
|
|
|
@required int editId,
|
|
|
|
@required bool read,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /comment/save
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#save-comment
|
2020-08-09 00:27:13 +02:00
|
|
|
Future<CommentView> saveComment({
|
2020-08-05 23:59:10 +02:00
|
|
|
@required int commentId,
|
|
|
|
@required bool save,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /comment/like
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#create-comment-like
|
2020-08-09 00:27:13 +02:00
|
|
|
Future<CommentView> createCommentLike({
|
2020-08-05 23:59:10 +02:00
|
|
|
@required int commentId,
|
2020-08-08 23:24:34 +02:00
|
|
|
@required Vote score,
|
2020-08-05 23:59:10 +02:00
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
}
|