| GET | /notifications | Lấy danh sách các Notification mới nhất |
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports tvpl.api.ServiceModel
Imports tvpl.data.Constant
Imports tvpl.data.Models
Namespace Global
Namespace tvpl.api.ServiceModel
'''<Summary>
'''Lấy danh sách các Notification mới nhất của người dùng hiện tại
'''</Summary>
Public Partial Class GetNotificationFilter
Inherits PagingRequest
Implements IGet
Public Overridable Property Filter As NotificationFilter
End Class
Public Partial Class NotificationResponse
Implements IResponseRequest
Public Sub New()
Notifications = New List(Of Notification)
End Sub
Public Overridable Property Code As Integer
Public Overridable Property Message As String
Public Overridable Property Notifications As List(Of Notification)
Public Overridable Property UnreadCount As Integer
Public Overridable Property TotalCount As Integer
End Class
Public Partial Class PagingRequest
Public Overridable Property Page As Integer
Public Overridable Property Limit As Integer
End Class
End Namespace
Namespace tvpl.data.Constant
Public Enum NotificationFilter
Unread
All
End Enum
End Namespace
Namespace tvpl.data.Models
Public Partial Class Notification
Implements IMongoModel
Public Overridable Property Id As String
Public Overridable Property AccountId As Integer
<Required>
<StringLength(200)>
Public Overridable Property Title As String
Public Overridable Property Message As String
Public Overridable Property Payload As String
Public Overridable Property CreatedOn As Date
Public Overridable Property ReadOn As Nullable(Of Date)
Public Overridable Property PushOn As Nullable(Of Date)
Public Overridable Property DeletedOn As Nullable(Of Date)
End Class
End Namespace
End Namespace
VB.NET 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}