mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-11-29 08:33:21 +00:00
30 lines
672 B
Go
30 lines
672 B
Go
package api
|
|
|
|
import (
|
|
"Gwen/model"
|
|
"time"
|
|
)
|
|
|
|
type WebClientPeerPayload struct {
|
|
ViewStyle string `json:"view-style"`
|
|
Tm int64 `json:"tm"`
|
|
Info WebClientPeerInfoPayload `json:"info"`
|
|
}
|
|
|
|
type WebClientPeerInfoPayload struct {
|
|
Username string `json:"username"`
|
|
Hostname string `json:"hostname"`
|
|
Platform string `json:"platform"`
|
|
}
|
|
|
|
func (wcpp *WebClientPeerPayload) FromAddressBook(a *model.AddressBook) {
|
|
wcpp.ViewStyle = "shrink"
|
|
//24小时前
|
|
wcpp.Tm = time.Now().Add(-time.Hour * 24).UnixNano()
|
|
wcpp.Info = WebClientPeerInfoPayload{
|
|
Username: a.Username,
|
|
Hostname: a.Hostname,
|
|
Platform: a.Platform,
|
|
}
|
|
}
|