test

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	City string `json:"city,omitempty" url:"city"`

	State string `json:"state,omitempty" url:"state"`

	Street string `json:"street,omitempty" url:"street"`

	Zip string `json:"zip,omitempty" url:"zip"`
}

type ApiResponse

type ApiResponse struct {
	Code int `json:"code,omitempty" url:"code"`

	Message string `json:"message,omitempty" url:"message"`

	Type string `json:"type,omitempty" url:"type"`
}

type Category

type Category struct {
	Id int64 `json:"id,omitempty" url:"id"`

	Name string `json:"name,omitempty" url:"name"`
}

type Customer

type Customer struct {
	Address []Address `json:"address,omitempty" url:"address"`

	Id int64 `json:"id,omitempty" url:"id"`

	Username string `json:"username,omitempty" url:"username"`
}

type CustomerClient

type CustomerClient struct {
	// contains filtered or unexported fields
}

func NewCustomer

func NewCustomer(opts ...ddhttp.DdClientOption) *CustomerClient

func (*CustomerClient) GetCustomerValidateToken

func (receiver *CustomerClient) GetCustomerValidateToken(ctx context.Context,
	queryParams struct {
		// required
		Token string `json:"token,omitempty" url:"token"`
	}) (ret bool, err error)

func (*CustomerClient) SetClient

func (receiver *CustomerClient) SetClient(client *resty.Client)

func (*CustomerClient) SetProvider

func (receiver *CustomerClient) SetProvider(provider ddhttp.IServiceProvider)

type Order

type Order struct {
	Complete bool `json:"complete,omitempty" url:"complete"`
	// 客户信息结构体
	// 用于描述客户相关的信息
	Customer struct {
		// 用户ID
		Id int64 `json:"id,omitempty" url:"id"`
		// 用户名
		Username string `json:"username,omitempty" url:"username"`
		// 用户地址
		// 例如:北京海淀区xxx街道
		// 某某小区
		Address []Address `json:"address,omitempty" url:"address"`
	} `json:"customer,omitempty" url:"customer"`

	Id int64 `json:"id,omitempty" url:"id"`

	PetId int64 `json:"petId,omitempty" url:"petId"`

	Quantity int `json:"quantity,omitempty" url:"quantity"`

	ShipDate *time.Time `json:"shipDate,omitempty" url:"shipDate"`
	// Order Status
	Status string `json:"status,omitempty" url:"status"`
}

type Pet

type Pet struct {
	Category Category `json:"category,omitempty" url:"category"`

	Id int64 `json:"id,omitempty" url:"id"`

	// required
	Name string `json:"name,omitempty" url:"name"`

	// required
	PhotoUrls []string `json:"photoUrls,omitempty" url:"photoUrls"`
	// pet status in the store
	// this is another line for test use
	Status string `json:"status,omitempty" url:"status"`

	Tags []Tag `json:"tags,omitempty" url:"tags"`
}

type PetClient

type PetClient struct {
	// contains filtered or unexported fields
}

func NewPet

func NewPet(opts ...ddhttp.DdClientOption) *PetClient

func (*PetClient) GetPetFindByStatus

func (receiver *PetClient) GetPetFindByStatus(ctx context.Context,
	queryParams struct {
		Status string `json:"status,omitempty" url:"status"`
	}) (ret []Pet, err error)

Finds Pets by status Multiple status values can be provided with comma separated strings

func (*PetClient) GetPetFindByTags

func (receiver *PetClient) GetPetFindByTags(ctx context.Context,
	queryParams struct {
		Tags []string `json:"tags,omitempty" url:"tags"`
	}) (ret []Pet, err error)

Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

func (*PetClient) GetPetPetId

func (receiver *PetClient) GetPetPetId(ctx context.Context,

	petId int64) (ret Pet, err error)

Find pet by ID Returns a single pet

func (*PetClient) PostPet

func (receiver *PetClient) PostPet(ctx context.Context,
	bodyJson Pet) (ret Pet, err error)

Add a new pet to the store Add a new pet to the store

func (*PetClient) PostPetPetIdUploadImage

func (receiver *PetClient) PostPetPetIdUploadImage(ctx context.Context,
	queryParams struct {
		AdditionalMetadata string `json:"additionalMetadata,omitempty" url:"additionalMetadata"`
	},

	petId int64,
	_uploadFile *multipart.FileHeader) (ret ApiResponse, err error)

uploads an image

func (*PetClient) PutPet

func (receiver *PetClient) PutPet(ctx context.Context,
	bodyJson Pet) (ret Pet, err error)

Update an existing pet Update an existing pet by Id

func (*PetClient) SetClient

func (receiver *PetClient) SetClient(client *resty.Client)

func (*PetClient) SetProvider

func (receiver *PetClient) SetProvider(provider ddhttp.IServiceProvider)

type StoreClient

type StoreClient struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(opts ...ddhttp.DdClientOption) *StoreClient

func (*StoreClient) GetStoreInventory

func (receiver *StoreClient) GetStoreInventory(ctx context.Context) (ret struct {
}, err error)

Returns pet inventories by status Returns a map of status codes to quantities

func (*StoreClient) GetStoreOrderOrderId

func (receiver *StoreClient) GetStoreOrderOrderId(ctx context.Context,

	orderId int64) (ret Order, err error)

Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions

func (*StoreClient) PostStoreOrder

func (receiver *StoreClient) PostStoreOrder(ctx context.Context,
	bodyJson Order) (ret Order, err error)

Place an order for a pet Place a new order in the store

func (*StoreClient) SetClient

func (receiver *StoreClient) SetClient(client *resty.Client)

func (*StoreClient) SetProvider

func (receiver *StoreClient) SetProvider(provider ddhttp.IServiceProvider)

type Tag

type Tag struct {
	Id int64 `json:"id,omitempty" url:"id"`

	Name string `json:"name,omitempty" url:"name"`
}

type UnipayClient

type UnipayClient struct {
	// contains filtered or unexported fields
}

func NewUnipay

func NewUnipay(opts ...ddhttp.DdClientOption) *UnipayClient

func (*UnipayClient) GetUnipayStartUnionPay

func (receiver *UnipayClient) GetUnipayStartUnionPay(ctx context.Context,
	queryParams struct {
		// required
		TxnAmt string `json:"txnAmt,omitempty" url:"txnAmt"`
		// required
		Token string `json:"token,omitempty" url:"token"`
		// required
		CompanyId string `json:"companyId,omitempty" url:"companyId"`
		// required
		FrontUrl string `json:"frontUrl,omitempty" url:"frontUrl"`
	}) (ret string, err error)

func (*UnipayClient) SetClient

func (receiver *UnipayClient) SetClient(client *resty.Client)

func (*UnipayClient) SetProvider

func (receiver *UnipayClient) SetProvider(provider ddhttp.IServiceProvider)

type User

type User struct {
	Additional1 struct {
	} `json:"additional1,omitempty" url:"additional1"`

	Additional2 struct {
	} `json:"additional2,omitempty" url:"additional2"`

	Avatar *os.File `json:"avatar,omitempty" url:"avatar"`

	Email string `json:"email,omitempty" url:"email"`

	FirstName string `json:"firstName,omitempty" url:"firstName"`

	Id int64 `json:"id,omitempty" url:"id"`

	LastName string `json:"lastName,omitempty" url:"lastName"`

	Password string `json:"password,omitempty" url:"password"`

	Phone string `json:"phone,omitempty" url:"phone"`
	// User Status
	UserStatus int `json:"userStatus,omitempty" url:"userStatus"`

	Username string `json:"username,omitempty" url:"username"`
}

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(opts ...ddhttp.DdClientOption) *UserClient

func (*UserClient) GetUserLogin

func (receiver *UserClient) GetUserLogin(ctx context.Context,
	queryParams struct {
		Username string `json:"username,omitempty" url:"username"`
		Password string `json:"password,omitempty" url:"password"`
	}) (ret string, err error)

Logs user into the system

func (*UserClient) GetUserUsername

func (receiver *UserClient) GetUserUsername(ctx context.Context,

	username string) (ret User, err error)

Get user by user name

func (*UserClient) PostUserCreateWithList

func (receiver *UserClient) PostUserCreateWithList(ctx context.Context,
	bodyJson []User) (ret User, err error)

Creates list of users with given input array Creates list of users with given input array

func (*UserClient) SetClient

func (receiver *UserClient) SetClient(client *resty.Client)

func (*UserClient) SetProvider

func (receiver *UserClient) SetProvider(provider ddhttp.IServiceProvider)

Jump to

Keyboard shortcuts

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