[PD2] Code almost all done. Need to add logout and change help message
Co-authored-by: tsousa111 <tiagao2001@hotmail.com>
This commit is contained in:
parent
e2c3d75223
commit
6f8219d991
12 changed files with 123 additions and 212 deletions
|
@ -4,21 +4,7 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
type Body interface{}
|
||||
|
||||
type (
|
||||
GetUserCert struct {
|
||||
UID string `json:"uid"`
|
||||
}
|
||||
|
||||
GetUnreadMsgsInfo struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"pageSize"`
|
||||
}
|
||||
|
||||
GetMsg struct {
|
||||
Num int `json:"num"`
|
||||
}
|
||||
|
||||
SendMsg struct {
|
||||
ToUID string `json:"to_uid"`
|
||||
|
@ -72,24 +58,6 @@ type (
|
|||
}
|
||||
)
|
||||
|
||||
func NewGetUserCert(UID string) GetUserCert {
|
||||
return GetUserCert{
|
||||
UID: UID,
|
||||
}
|
||||
}
|
||||
|
||||
func NewGetUnreadMsgsInfo(page int, pageSize int) GetUnreadMsgsInfo {
|
||||
return GetUnreadMsgsInfo{
|
||||
Page: page,
|
||||
PageSize: pageSize}
|
||||
}
|
||||
|
||||
func NewGetMsg(num int) GetMsg {
|
||||
return GetMsg{
|
||||
Num: num,
|
||||
}
|
||||
}
|
||||
|
||||
func NewSendMsg(toUID string, subject []byte, body []byte) SendMsg {
|
||||
return SendMsg{
|
||||
ToUID: toUID,
|
||||
|
@ -146,9 +114,3 @@ func NewAnswerGetMsg(fromUID, toUID string, subject []byte, body []byte, timesta
|
|||
Timestamp: timestamp,
|
||||
}
|
||||
}
|
||||
|
||||
func NewReportError(errorMessage string) ReportError {
|
||||
return ReportError{
|
||||
ErrorMessage: errorMessage,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue