[PD2] Client done except jwt token, login and register functions

This commit is contained in:
Afonso Franco 2024-05-30 21:02:28 +01:00
parent c94831d0a2
commit 78031d8e70
Signed by: afonso
SSH key fingerprint: SHA256:PQTRDHPH3yALEGtHXnXBp3Orfcn21pK20t0tS1kHg54
16 changed files with 698 additions and 337 deletions

View file

@ -31,6 +31,10 @@ type (
Certificate []byte `json:"certificate"`
}
StoreUserCert struct {
Certificate []byte `json:"certificate"`
}
AnswerGetUnreadMsgsInfo struct {
Page int `json:"page"`
NumPages int `json:"num_pages"`
@ -59,8 +63,8 @@ type (
}
PostLogin struct {
UID string `json:"uid"`
Password string `json:"password"`
UID string `json:"uid"`
Password string `json:"password"`
}
ReportError struct {
@ -113,19 +117,24 @@ func NewMsgInfo(num int, fromUID string, subject []byte, timestamp time.Time) Ms
}
}
func NewPostRegister(UID string,Password string,Certificate []byte) PostRegister {
return PostRegister{
UID: UID,
Password: Password,
Certificate: Certificate,
}
func NewPostRegister(UID string, Password string, Certificate []byte) PostRegister {
return PostRegister{
UID: UID,
Password: Password,
Certificate: Certificate,
}
}
func NewStoreUserCert(certificate []byte) StoreUserCert {
return StoreUserCert{
Certificate: certificate,
}
}
func NewPostLogin(UID string,Password string) PostLogin {
return PostLogin{
UID: UID,
Password: Password,
}
func NewPostLogin(UID string, Password string) PostLogin {
return PostLogin{
UID: UID,
Password: Password,
}
}
func NewAnswerGetMsg(fromUID, toUID string, subject []byte, body []byte, timestamp time.Time, last bool) AnswerGetMsg {