feat: support RESTful api (#33)

This commit is contained in:
monkeyWie authored and GitHub committed 2022-09-09 18:31:57 +08:00
1 parent e292926697
commit c6aa83194f
22 files changed
+603 -125

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package model
type Result[T any] struct {
Msg string `json:"msg"`
Data T `json:"data"`
}
func NewResult[T any](msg string, data T) *Result[T] {
return &Result[T]{
Msg: msg,
Data: data,
}
}
func NewResultWithMsg(msg string) *Result[any] {
return NewResult[any](msg, nil)
}
func NewResultWithData[T any](data T) *Result[T] {
return NewResult[T]("", data)
}
+8
View File
@@ -0,0 +1,8 @@
package model
import "github.com/monkeyWie/gopeed-core/pkg/base"
type CreateTaskReq struct {
Resource *base.Resource `json:"resource"`
Options *base.Options `json:"options"`
}