serializer

package
v0.0.0-...-59d6697 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Status int         `json:"status"`
	Data   interface{} `json:"data"`
	Msg    string      `json:"msg"`
	Error  string      `json:"error"`
}

Response 基础序列化器

type ResponseTask

type ResponseTask struct {
	Status int    `json:"status" exmaple:"200"`
	Data   Task   `json:"data"`
	Msg    string `json:"msg" exmaple:"ok"`
	Error  string `json:"error" exmaple:""`
}

type ResponseUser

type ResponseUser struct {
	Status int    `json:"status" exmaple:"200"`
	Data   User   `json:"data"`
	Msg    string `json:"msg" exmaple:"ok"`
	Error  string `json:"error" exmaple:""`
}

type Task

type Task struct {
	Id        uint   `json:"id" exmaple:"1"`
	Title     string `json:"title" exmaple:"吃饭"`
	Content   string `json:"content" exmaple:"中午吃螺蛳粉"`
	View      uint64 `json:"view" example:"32"`
	Status    int    `json:"status" example:"0"`
	CreateAt  int64  `json:"create_at"`
	StartTime int64  `json:"start_time"`
	EndTime   int64  `json:"end_time"`
}

func BuildTask

func BuildTask(item model.Task) Task

func BuildTasks

func BuildTasks(items []model.Task) (tasks []Task)

type User

type User struct {
	Id       uint   `json:"id" form:"id" exmaple:"1"`
	UserName string `json:"user_name" form:"user_name" example:"FanOne"`
	Status   string `josn:"status" form:"status"`
	CreateAt int64  `json:"create_at" form:"create_at"`
}

func BuildUser

func BuildUser(user model.User) User

Jump to

Keyboard shortcuts

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