mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2025-11-29 08:33:21 +00:00
41 lines
791 B
Go
41 lines
791 B
Go
package api
|
|
|
|
import (
|
|
"Gwen/model"
|
|
"strconv"
|
|
)
|
|
|
|
type AuditConnForm struct {
|
|
Action string `json:"action"`
|
|
ConnId int64 `json:"conn_id"`
|
|
Id string `json:"id"`
|
|
Peer []string `json:"peer"`
|
|
Ip string `json:"ip"`
|
|
SessionId float64 `json:"session_id"`
|
|
Type int `json:"type"`
|
|
Uuid string `json:"uuid"`
|
|
}
|
|
|
|
func (a *AuditConnForm) ToAuditConn() *model.AuditConn {
|
|
fp := ""
|
|
fn := ""
|
|
if len(a.Peer) >= 1 {
|
|
fp = a.Peer[0]
|
|
if len(a.Peer) == 2 {
|
|
fn = a.Peer[1]
|
|
}
|
|
}
|
|
ssid := strconv.FormatFloat(a.SessionId, 'f', -1, 64)
|
|
return &model.AuditConn{
|
|
Action: a.Action,
|
|
ConnId: a.ConnId,
|
|
PeerId: a.Id,
|
|
FromPeer: fp,
|
|
FromName: fn,
|
|
Ip: a.Ip,
|
|
SessionId: ssid,
|
|
Type: a.Type,
|
|
Uuid: a.Uuid,
|
|
}
|
|
}
|