Loment is a Light cOmMENT service.
- Post
/
with Comment body: Create comment, return id - Post
/query
with CommentQuery body: Query comments, return list of comments -
- Post
/count
with CommentQuery body: Query and count comments, return the number of comments
- Post
- Get
/id
: Get comment by id, return comment - Delete
/id
: Delete comment by id, return if done - Put
/id
with Comment body: Update comment by id, return if done
type Comment struct {
Id string
CreationTime time.Time
ModificationTime time.Time
Content string
Uri string
Author string
Email string
Link string
Extra string
}
type CommentQuery struct {
Id string
CreationTime time.Time
ModificationTime time.Time
Content string
Uri string
Author string
Email string
Link string
Offset int
Limit int
}
For C#.
dotnet add package Loment
API:
public interface ILomentService
{
Task<string?> Create(Comment comment, CancellationToken cancellationToken = default);
Task<IList<Comment>> Query(CommentQuery query, CancellationToken cancellationToken = default);
Task<long> Count(CommentQuery query, CancellationToken cancellationToken = default);
Task<Comment?> Get(string id, CancellationToken cancellationToken = default);
Task<bool> Delete(string id, CancellationToken cancellationToken = default);
Task<bool> Update(Comment comment, CancellationToken cancellationToken = default);
}