s1llyw0rdz/web/handler/form/status.go

26 lines
473 B
Go
Raw Permalink Normal View History

2021-11-22 13:00:19 +00:00
package form
import (
"net/http"
2021-11-22 20:23:30 +00:00
"strconv"
2021-11-22 13:00:19 +00:00
)
type StatusForm struct {
2021-11-22 20:23:30 +00:00
Id int64
2021-11-22 13:00:19 +00:00
Content string
2021-11-30 20:50:10 +00:00
Face string
2021-11-22 13:00:19 +00:00
Error string
2025-11-20 01:10:58 +00:00
Number int }
2021-11-22 13:00:19 +00:00
func NewStatusForm(r *http.Request) *StatusForm {
2021-11-22 20:23:30 +00:00
var id int64
id, _ = strconv.ParseInt(r.FormValue("id"), 10, 64)
2025-11-20 01:10:58 +00:00
number, _ := strconv.Atoi(r.FormValue("number"))
2021-11-22 13:00:19 +00:00
return &StatusForm{
2021-11-22 20:23:30 +00:00
Id: id,
2021-11-22 13:00:19 +00:00
Content: r.FormValue("content"),
2021-11-30 20:50:10 +00:00
Face: r.FormValue("face"),
2025-11-20 01:10:58 +00:00
Number: number,
2021-11-22 13:00:19 +00:00
}
}