项目作者: StardustDL

项目描述 :
Loment is a light comment service.
高级语言: Go
项目地址: git://github.com/StardustDL/loment.git
创建时间: 2020-07-14T11:57:39Z
项目社区:https://github.com/StardustDL/loment

开源协议:Apache License 2.0

下载


loment

CI CD License Loment

Loment is a Light cOmMENT service.

API

  • 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
  • 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

Models

  1. type Comment struct {
  2. Id string
  3. CreationTime time.Time
  4. ModificationTime time.Time
  5. Content string
  6. Uri string
  7. Author string
  8. Email string
  9. Link string
  10. Extra string
  11. }
  12. type CommentQuery struct {
  13. Id string
  14. CreationTime time.Time
  15. ModificationTime time.Time
  16. Content string
  17. Uri string
  18. Author string
  19. Email string
  20. Link string
  21. Offset int
  22. Limit int
  23. }

SDK

For C#.

  1. dotnet add package Loment

API:

  1. public interface ILomentService
  2. {
  3. Task<string?> Create(Comment comment, CancellationToken cancellationToken = default);
  4. Task<IList<Comment>> Query(CommentQuery query, CancellationToken cancellationToken = default);
  5. Task<long> Count(CommentQuery query, CancellationToken cancellationToken = default);
  6. Task<Comment?> Get(string id, CancellationToken cancellationToken = default);
  7. Task<bool> Delete(string id, CancellationToken cancellationToken = default);
  8. Task<bool> Update(Comment comment, CancellationToken cancellationToken = default);
  9. }

Status