package domain type Response[T any] struct { Code int `json:"code"` Message string `json:"message"` Data T `json:"data,omitempty"` } func OK[T any](data T) Response[T] { return Response[T]{Code: 0, Message: "ok", Data: data} } func Fail(msg string) Response[any] { return Response[any]{Code: 1, Message: msg} }