entities

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address added in v1.1.5

type Address struct {
	Street string `json:"street" validate:"required" example:"huandaodonglu"`
	City   string `json:"city" validate:"required" example:"xiamen"`
	Planet string `json:"planet" validate:"required" example:"snow"`
	Phone  string `json:"phone" validate:"required" example:"snow"`
}

Address houses a users address information

type TestRequest

type TestRequest struct {
	Name string `json:"name" example:"snow"`
	Url  string `json:"url" example:"github.com/qit-team/snow"`
}

请求数据结构

type TestResponse

type TestResponse struct {
	Id   int64  `json:"id" example:"1"`
	Name string `json:"name" example:"snow"`
	Url  string `json:"url" example:"github.com/qit-team/snow"`
}

返回数据结构

type TestValidatorRequest added in v1.1.5

type TestValidatorRequest struct {
	// tips,因为组件required不管是没传值或者传 0 or "" 都通过不了,但是如果用指针类型,那么0就是0,而nil无法通过校验
	Id        *int64     `json:"id" validate:"required" example:"1"`
	Age       int        `json:"age" validate:"required,gte=0,lte=130" example:"20"`
	Name      *string    `json:"name" validate:"required" example:"snow"`
	Email     string     `json:"email" validate:"required,email" example:"snow@github.com"`
	Url       string     `json:"url" validate:"required" example:"github.com/qit-team/snow"`
	Mobile    string     `json:"mobile" validate:"required" example:"snow"`
	RangeNum  int        `json:"range_num" validate:"max=10,min=1" example:"3"`
	TestNum   *int       `json:"test_num" validate:"required,oneof=5 7 9" example:"7"`
	Content   *string    `json:"content" example:"snow"`
	Addresses []*Address `json:"addresses" validate:"required,dive,required"`
}

请求数据结构

type TestValidatorResponse added in v1.1.5

type TestValidatorResponse struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
	Url  string `json:"url"`
}

返回数据结构

Jump to

Keyboard shortcuts

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