Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
injoyai committed Apr 24, 2024
1 parent 59805ec commit 3e4f764
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions io_model.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io

import (
"encoding/json"
"github.com/injoyai/base/g"
"net/http"
)

Expand All @@ -12,6 +14,15 @@ type Model struct {
Msg string `json:"msg,omitempty"` //消息
}

func (this *Model) String() string {
return string(this.Bytes())
}

func (this *Model) Bytes() g.Bytes {
bs, _ := json.Marshal(this)
return bs
}

func (this *Model) IsSucc() bool {
return this.Code == http.StatusOK
}
Expand Down

0 comments on commit 3e4f764

Please sign in to comment.