| GET | /notifications | Lấy danh sách các Notification mới nhất |
|---|
import java.math.*
import java.util.*
import net.servicestack.client.*
/**
* Lấy danh sách các Notification mới nhất của người dùng hiện tại
*/
open class GetNotificationFilter : PagingRequest(), IGet
{
var filter:NotificationFilter? = null
}
open class PagingRequest
{
var page:Int? = null
var limit:Int? = null
}
enum class NotificationFilter
{
Unread,
All,
}
open class NotificationResponse : IResponseRequest
{
var code:Int? = null
var message:String? = null
var notifications:ArrayList<Notification> = ArrayList<Notification>()
var unreadCount:Int? = null
var totalCount:Int? = null
}
open class Notification : IMongoModel
{
var id:String? = null
var accountId:Int? = null
@Required()
@StringLength(200)
var title:String? = null
var message:String? = null
var payload:String? = null
var createdOn:Date? = null
var readOn:Date? = null
var pushOn:Date? = null
var deletedOn:Date? = null
}
Kotlin GetNotificationFilter DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /notifications HTTP/1.1 Host: etc-api.vsmlab.vn Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"code":0,"message":"String","notifications":[{"id":"String","accountId":0,"title":"String","message":"String","payload":"String","createdOn":"0001-01-01T00:00:00.0000000+07:06","readOn":"0001-01-01T00:00:00.0000000+07:06","pushOn":"0001-01-01T00:00:00.0000000+07:06","deletedOn":"0001-01-01T00:00:00.0000000+07:06"}],"unreadCount":0,"totalCount":0}