client

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 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"`

	State string `json:"state,omitempty"`

	Street string `json:"street,omitempty"`

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

type ApiResponse

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

	Message string `json:"message,omitempty"`

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

type Category

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

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

type Customer

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

	Id int64 `json:"id,omitempty"`

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

type Order

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

	Id int64 `json:"id,omitempty"`

	PetId int64 `json:"petId,omitempty"`

	Quantity int `json:"quantity,omitempty"`

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

type Pet

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

	Id int64 `json:"id,omitempty"`

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

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

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

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"`
	}) (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"`
	}) (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"`
	},

	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 map[string]int, 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"`

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

type UnipayClient added in v0.3.9

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

func NewUnipay added in v0.3.9

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

func (*UnipayClient) GetUnipayStartUnionPay added in v0.3.9

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

func (*UnipayClient) SetClient added in v0.3.9

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

func (*UnipayClient) SetProvider added in v0.3.9

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

type User

type User struct {
	Additional1 map[string]string `json:"additional1,omitempty"`

	Additional2 map[string]Tag `json:"additional2,omitempty"`

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

	Email string `json:"email,omitempty"`

	FirstName string `json:"firstName,omitempty"`

	Id int64 `json:"id,omitempty"`

	LastName string `json:"lastName,omitempty"`

	Password string `json:"password,omitempty"`

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

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

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"`
		Password string `json:"password,omitempty"`
	}) (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