[PD2] Gateway login, logout and auth middleware done.
Co-authored-by: tsousa111 <tiagao2001@hotmail.com>
This commit is contained in:
parent
aa90bfddce
commit
69559f41ca
7 changed files with 277 additions and 28 deletions
|
@ -53,10 +53,16 @@ type (
|
|||
}
|
||||
|
||||
PostRegister struct {
|
||||
UID string `json:"uid"`
|
||||
Password string `json:"password"`
|
||||
Certificate []byte `json:"certificate"`
|
||||
}
|
||||
|
||||
PostLogin struct {
|
||||
UID string `json:"uid"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
ReportError struct {
|
||||
ErrorMessage string `json:"error"`
|
||||
}
|
||||
|
@ -107,6 +113,21 @@ 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 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 {
|
||||
return AnswerGetMsg{
|
||||
FromUID: fromUID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue