models

package
v1.1.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostLog

type PostLog struct {
	ID            bson.ObjectId          `bson:"_id"`
	Time          string                 `json:"time" bson:"time"`
	RequestId     string                 `json:"requestId" bson:"requestId"`
	ResponseTime  string                 `json:"responseTime" bson:"responseTime"`
	TTL           int                    `json:"ttl" bson:"ttl"`
	AppName       string                 `json:"appName" bson:"appName"`
	Apiname       string                 `json:"apiName" bson:"apiName"`
	Method        string                 `json:"method" bson:"method"`
	ContentType   string                 `json:"contentType" bson:"contentType"`
	Uri           string                 `json:"uri" bson:"uri"`
	ClientIP      string                 `json:"clientIP" bson:"clientIP"`
	RequestHeader map[string]string      `json:"requestHeader" bson:"requestHeader"`
	RequestParam  interface{}            `json:"requestParam" bson:"requestParam"`
	ResponseStr   string                 `json:"responseStr" bson:"responseStr"`
	ResponseMap   map[string]interface{} `json:"responseMap" bson:"responseMap"`
}

type Result

type Result struct {
	Status int         `json:"status" bson:"status"`
	Msg    string      `json:"msg" bson:"msg"`
	Data   interface{} `json:"data" bson:"data"`
	Page   *ResultPage `json:"page" bson:"page"`
}

* 通用返回结果类

func Error

func Error(s int, m string) Result

func Success

func Success(d interface{}) Result

func SuccessWithMsg

func SuccessWithMsg(msg string, d interface{}) Result

func SuccessWithPage

func SuccessWithPage(d interface{}, count, index, size, total int) Result

type ResultPage

type ResultPage struct {
	Count int `json:"count"` //总页数
	Index int `json:"index"` //页号
	Size  int `json:"size"`  //分页大小
	Total int `json:"total"` //总记录数
}

type Timestamp added in v1.0.7

type Timestamp time.Time

func NewTimestamp added in v1.0.7

func NewTimestamp(t time.Time) Timestamp

func (Timestamp) GetBSON added in v1.1.0

func (t Timestamp) GetBSON() (interface{}, error)

func (Timestamp) MarshalJSON added in v1.0.7

func (t Timestamp) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Timestamp) Scan added in v1.0.7

func (t *Timestamp) Scan(v interface{}) error

func (*Timestamp) SetBSON added in v1.1.0

func (t *Timestamp) SetBSON(raw bson.Raw) error

func (Timestamp) Time added in v1.0.7

func (t Timestamp) Time() time.Time

func (*Timestamp) UnmarshalJSON added in v1.0.7

func (t *Timestamp) UnmarshalJSON(data []byte) (err error)

func (Timestamp) Value added in v1.0.7

func (t Timestamp) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL