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
stringrequiredThe id of the user.
articleId
stringrequiredThe identifier of the article.
The type of star.
The enum of the vote.
StarInfoReqDTO
properties
userId
stringrequiredThe id of the user.
infoId
stringrequiredThe identifier of the community info.
The type of star. It only support 'read'
The enum of the vote.
GetArticleDailyReqDTO
properties
userId
stringrequiredThe id of the user.
GetArticleDailyResDTO
properties
userId
stringrequiredThe id of the user.
articleId
stringrequiredThe identifier of the article.
FilterInfoStarReqDTO
properties
userIds
arrayrequiredThe array of the user id.
infoIds
arrayrequiredThe array of the community info id.
The type of star. It is always 'read'
startTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe start time.
endTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe end time.
FilterInfoStarResDTO
properties
userId
stringrequiredThe id of the user.
infoId
stringrequiredThe identifier of the community info.
FilterArticleDataReqDTO
properties
articleIds
arrayrequiredThe array of the article id.
FilterArticleDataResDTO
properties
articleId
stringThe identifier of the article.
like
numberThe number of like.
bookmark
numberThe number of bookmark.
read
numberThe number of read.
FilterStarReqDTO
properties
userIds
arrayrequiredThe array of the user id.
articleIds
arrayrequiredThe array of the article id.
The type of star.
startTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe start time.
endTime
datetimerequiredYYYY-MM-DDThh:mm:ss.000ZThe end time.
FilterStarResDTO
properties
userId
stringrequiredThe id of the user.
articleId
stringrequiredThe identifier of the article.
FilterUserDataReqDTO
properties
userIds
arrayrequiredThe array of the user id.
FilterUserDataResDTO
properties
userId
stringThe id of the user.
like
numberThe number of like.
bookmark
numberThe number of bookmark.
read
numberThe number of read.
FilterInfoDataReqDTO
properties
infoIds
arrayrequiredThe array of the info id.
FilterInfoDataResDTO
properties
articleId
stringThe identifier of the community info.
read
numberThe number of read.
StarType
Name | Value |
---|---|
Like | 0 |
Bookmark | 1 |
Read | 2 |
VoteEnum
Name | Value |
---|---|
Down | 0 |
Up | 1 |