提交 8f949fb3 authored 作者: mooncake9527's avatar mooncake9527

fix delete

上级 28f1f019
...@@ -33,6 +33,10 @@ type BaseListReply struct { ...@@ -33,6 +33,10 @@ type BaseListReply struct {
List []any `json:"list" comment:"list" encomment:"list" form:"list"` // List []any `json:"list" comment:"list" encomment:"list" form:"list"` //
} }
type BaseListReply2 struct {
List any `json:"list" comment:"list" encomment:"list" form:"list"` //
}
type BaseReply struct { type BaseReply struct {
Result Result
} }
......
...@@ -236,7 +236,7 @@ func (x *Request) PATCH(ctx context.Context) *Request { ...@@ -236,7 +236,7 @@ func (x *Request) PATCH(ctx context.Context) *Request {
func (x *Request) Do(ctx context.Context, method string, data interface{}) *Request { func (x *Request) Do(ctx context.Context, method string, data interface{}) *Request {
x.method = method x.method = method
switch method { switch method {
case http.MethodGet, http.MethodDelete: case http.MethodGet:
if data != nil { if data != nil {
if params, ok := data.(map[string]interface{}); ok { //nolint if params, ok := data.(map[string]interface{}); ok { //nolint
x.SetParams(params) x.SetParams(params)
...@@ -246,7 +246,7 @@ func (x *Request) Do(ctx context.Context, method string, data interface{}) *Requ ...@@ -246,7 +246,7 @@ func (x *Request) Do(ctx context.Context, method string, data interface{}) *Requ
} }
} }
x.pull(ctx) x.pull(ctx)
case http.MethodPost, http.MethodPut, http.MethodPatch: case http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete:
if data != nil { if data != nil {
x.SetBody(data) x.SetBody(data)
} }
......
...@@ -27,7 +27,7 @@ func NewController() *Controller { ...@@ -27,7 +27,7 @@ func NewController() *Controller {
func (e *Controller) Bind(c *gin.Context, req interface{}) error { func (e *Controller) Bind(c *gin.Context, req interface{}) error {
switch c.Request.Method { switch c.Request.Method {
case http.MethodGet, http.MethodDelete: case http.MethodGet:
if err := c.ShouldBindQuery(req); err != nil { if err := c.ShouldBindQuery(req); err != nil {
if err.Error() == "EOF" { if err.Error() == "EOF" {
err = nil err = nil
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论