Skip to content

Internship project at TESO using Spring, Thrift, REST, MySQL

Notifications You must be signed in to change notification settings

noradomi/TESO-MICROSERVICES

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

TESO-MICROSERVICES

Mô tả các chức năng

1. Crawl comic

Crawl data comic từ truyenfull.vn

  • URL

    /comics/crawl

  • Method:

    GET

  • URL Params

    sl=[1-~] unsigned integer default:1 -> số lượng comic cần crawl

    url=[1-~] unsigned integer default:'truyen-hot' -> danh mục muốn crawl

  • Success Response:

    11

  • Sample Call:

    GET /comics/crawl
    GET /comics/crawl?sl=2&url=truyen-moi

2. Get all comic

Lấy tất cả các truyện có phân trang và sort theo properties.

  • URL

    /comics

  • Method:

    GET

  • Success Response:

  • Error Response: Content:

      {
        "StatusCode": 1000,
        "Message": "Page and MaxLength is inValid! (page > 0,1 <= maxLength <= 100 "
      }
      or
      {
        "StatusCode": 1000,
        "Message": "Query parameter is invalid : sort_by = IDD is not a field of class."
      }
    
  • Sample Call:

    GET /comics?page=1&limit=10&sort_by=name&order_by=asc

3. Search a comic

Tìm kiếm một comic + multiquery (:equal,>,<)

  • URL

    /comics/search

  • Method:

    GET

  • Data Params

    Required:

    `query`
    
  • Success Response: 13

  • Error Response:

    • Code: 400 Bad Request

      Content:

      {
          "StatusCode": 1000,
          "Message": "Query parameter is invalid : sort_by = aaaa is not a field of class."
      }
      

      OR

      {
          "StatusCode": 1000,
          "Message": "Query parameter is invalid (order_by = {asc,desc})"
      }
      
  • Code: 404 NotFound

      {
          "StatusCode": 404,
          "Message": "Data Empty"
      }
    
  • Sample Call:

    GET /comics/search?page=1&limit=50000&sort_by=name&order_by=a&query=name:Yêu,vote_count>15

4. CRUD Comic

Thêm, Sửa, Xóa 1 comic

  • ADD COMIC

    14

  • UPDATE COMIC

    15

  • DELETE COMIC

    16

5. Get Top Rated Comics

Lấy 10 comic có rating cao nhất

  • URL

    /comics/top_rated

  • Method:

    GET

  • Success Response:

    17

  • Sample Call:

    GET comics/top_rated

6. Get Latest Comics

Lấy các Comic mới nhất (có pagination và sorting)

  • URL

    comics/latest

  • Method:

    GET

  • Success Response:

    18

  • Error Response:

    Như trên

  • Sample Call:

    GET comics/latest?page=1&limit=10&sort_by=rating&order_by=asc

7. Get finished comics

Lấy các Comics đã hoàn thành (có pagination và sorting) Các params như trên.

19

8. Get hot comics

Lấy các Comics hot (có pagination và sorting)

20

9. Get a specified Comic

Lấy thông tin chi tiết của 1 comic bằng id

  • URL

    /comics/{id}

  • Method:

    GET

  • Success Response:

    21

  • Error Response:

    • Code: 404 Not Found
      Content: 22

10. Get categories of comic

Lấy các thể loại của comic

  • URL

    /comics/{id}/category

  • Method:

    GET

  • Success Response:

    23

11. Redis Caching - Get Chapters Of Comic

Lấy các chapters của Comic (có pagination) + redis cache

  • URL

    /comics/{id}/chapters

  • Method:

    GET

  • Success Response:

    24

  • Redis Cache

    Lưu chapters của 10 comic có số vote_count cao nhất vào redis sử dụng Hash:

    • key: Id comic
    • field: Id chapter
    • value: chapter

    25

  • Cập nhật cache:

    Mỗi lần restart lại server sẽ update lại cache. 26

About

Internship project at TESO using Spring, Thrift, REST, MySQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published