Skip to main content

Analytics Service

Analytics service will handle all the analysis-service, including "like", "bookmark" and "read".

Endpoints

# Endpoints


Star article

This endpoint can add or delete star* to an article. star* refers to "like", "bookmark" or "read".

Request (StarReqDTO)

POST /star
{
"userId": "user2",
"articleId": "article2",
"type": 0,
"vote": 1
}

Response

{
"success": true,
"message": "",
"data": null
}

Get user article daily data

This endpoint can get a user's article daily read data.

Request (GetArticleDailyReqDTO)

POST /star/articles/daily
{
"userId": "user2"
}

Response (GetArticleDailyResDTO)

{
"success": true,
"message": "",
"data": [
{
"userId": "user2",
"articleId": "user2"
}
]
}

Star info

This endpoint can add or delete star* to an info. star* refers to "read".

Request (StarInfoReqDTO)

POST /star/info
{
"userId": "user2",
"infoId": "info2",
"type": 0,
"vote": 1
}

Response

{
"success": true,
"message": "",
"data": null
}

Filter article star

This endpoint can filter out the raw data via filter.

Request (FilterStarReqDTO)

POST /star/filter
{
"userIds": [
"user1",
"user2"
],
"articleIds": [
"article2"
],
"type": 0,
"startTime": "2024-05-10T16:00:00.000Z",
"endTime": "2024-07-15T08:00:00.000Z"
}

Response (FilterStarResDTO)

{
"success": true,
"message": "",
"data": [
{
"userId": "user2",
"articleId": "article2"
}
]
}

Filter info star

This endpoint can filter out the raw info data via filter.

Request (FilterInfoStarReqDTO)

POST /star/info/filter
{
"userIds": [
"user1",
"user2"
],
"infoIds": [
"info2"
],
"type": 0,
"startTime": "2024-05-10T16:00:00.000Z",
"endTime": "2024-07-15T08:00:00.000Z"
}

Response (FilterInfoStarResDTO)

{
"success": true,
"message": "",
"data": [
{
"userId": "user2",
"infoId": "info2"
}
]
}

Filter user data

This endpoint can filter out the user statistics.

Request (FilterUserDataReqDTO)

POST /star/users/statistics
{
"userIds": [
"user1",
"user2"
]
}

Response (FilterUserDataResDTO)

{
"success": true,
"message": "",
"data": [
{
"userId": "user2",
"like": 11,
"bookmark": 2,
"read": 45
}
]
}

Filter article data

This endpoint can filter out the article statistics.

Request (FilterArticleDataReqDTO)

POST /star/articles/statistics
{
"articleIds": [
"article2"
]
}

Response (FilterArticleDataResDTO)

{
"success": true,
"message": "",
"data": [
{
"articleId": "user2",
"like": 11,
"bookmark": 2,
"read": 45
}
]
}

Filter info data

This endpoint can filter out the info statistics.

Request (FilterInfoDataReqDTO)

POST /star/info/statistics
{
"infoIds": [
"info2"
]
}

Response (FilterInfoDataResDTO)

{
"success": true,
"message": "",
"data": [
{
"infoId": "info2",
"read": 45
}
]
}


Resources

StarReqDTO

properties
  • userId
    string
    required
    The id of the user.
  • articleId
    string
    required
    The identifier of the article.
  • type
    StarType
    required
    The type of star.
  • vote
    required
    The enum of the vote.

StarInfoReqDTO

properties
  • userId
    string
    required
    The id of the user.
  • infoId
    string
    required
    The identifier of the community info.
  • type
    StarType
    required
    The type of star. It only support 'read'
  • vote
    required
    The enum of the vote.

GetArticleDailyReqDTO

properties
  • userId
    string
    required
    The id of the user.

GetArticleDailyResDTO

properties
  • userId
    string
    required
    The id of the user.
  • articleId
    string
    required
    The identifier of the article.

FilterInfoStarReqDTO

properties
  • userIds
    array
    required
    The array of the user id.
  • infoIds
    array
    required
    The array of the community info id.
  • type
    StarType
    required
    The type of star. It is always 'read'
  • startTime
    datetime
    required
    YYYY-MM-DDThh:mm:ss.000Z
    The start time.
  • endTime
    datetime
    required
    YYYY-MM-DDThh:mm:ss.000Z
    The end time.

FilterInfoStarResDTO

properties
  • userId
    string
    required
    The id of the user.
  • infoId
    string
    required
    The identifier of the community info.

FilterArticleDataReqDTO

properties
  • articleIds
    array
    required
    The array of the article id.

FilterArticleDataResDTO

properties
  • articleId
    string
    The identifier of the article.
  • like
    number
    The number of like.
  • bookmark
    number
    The number of bookmark.
  • read
    number
    The number of read.

FilterStarReqDTO

properties
  • userIds
    array
    required
    The array of the user id.
  • articleIds
    array
    required
    The array of the article id.
  • type
    StarType
    required
    The type of star.
  • startTime
    datetime
    required
    YYYY-MM-DDThh:mm:ss.000Z
    The start time.
  • endTime
    datetime
    required
    YYYY-MM-DDThh:mm:ss.000Z
    The end time.

FilterStarResDTO

properties
  • userId
    string
    required
    The id of the user.
  • articleId
    string
    required
    The identifier of the article.

FilterUserDataReqDTO

properties
  • userIds
    array
    required
    The array of the user id.

FilterUserDataResDTO

properties
  • userId
    string
    The id of the user.
  • like
    number
    The number of like.
  • bookmark
    number
    The number of bookmark.
  • read
    number
    The number of read.

FilterInfoDataReqDTO

properties
  • infoIds
    array
    required
    The array of the info id.

FilterInfoDataResDTO

properties
  • articleId
    string
    The identifier of the community info.
  • read
    number
    The number of read.


StarType

NameValue
Like0
Bookmark1
Read2

VoteEnum

NameValue
Down0
Up1