mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
24 lines
410 B
Go
24 lines
410 B
Go
|
package room
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"demodesk/neko/internal/utils"
|
||
|
)
|
||
|
|
||
|
type DropPayload struct {
|
||
|
X int `json:"x"`
|
||
|
Y int `json:"y"`
|
||
|
Files []string `json:"files"`
|
||
|
}
|
||
|
|
||
|
func (h *RoomHandler) dropFiles(w http.ResponseWriter, r *http.Request) {
|
||
|
data := &DropPayload{}
|
||
|
if !utils.HttpJsonRequest(w, r, data) {
|
||
|
return
|
||
|
}
|
||
|
|
||
|
h.desktop.DropFiles(data.X, data.Y, data.Files)
|
||
|
utils.HttpSuccess(w)
|
||
|
}
|