[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:
Afonso Franco 2024-05-31 19:23:41 +01:00
parent e2c3d75223
commit 6f8219d991
Signed by: afonso
SSH key fingerprint: SHA256:PQTRDHPH3yALEGtHXnXBp3Orfcn21pK20t0tS1kHg54
12 changed files with 123 additions and 212 deletions

View file

@ -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,
}
}