Documentation ¶
Index ¶
- type Address
- type ApiResponse
- type Category
- type Customer
- type Order
- type Pet
- type PetClient
- func (receiver *PetClient) GetPetFindByStatus(ctx context.Context, queryParams struct{ ... }) (ret []Pet, err error)
- func (receiver *PetClient) GetPetFindByTags(ctx context.Context, queryParams struct{ ... }) (ret []Pet, err error)
- func (receiver *PetClient) GetPetPetId(ctx context.Context, petId int64) (ret Pet, err error)
- func (receiver *PetClient) PostPet(ctx context.Context, bodyJson Pet) (ret Pet, err error)
- func (receiver *PetClient) PostPetPetIdUploadImage(ctx context.Context, queryParams struct{ ... }, petId int64, ...) (ret ApiResponse, err error)
- func (receiver *PetClient) PutPet(ctx context.Context, bodyJson Pet) (ret Pet, err error)
- func (receiver *PetClient) SetClient(client *resty.Client)
- func (receiver *PetClient) SetProvider(provider ddhttp.IServiceProvider)
- type StoreClient
- func (receiver *StoreClient) GetStoreInventory(ctx context.Context) (ret map[string]int, err error)
- func (receiver *StoreClient) GetStoreOrderOrderId(ctx context.Context, orderId int64) (ret Order, err error)
- func (receiver *StoreClient) PostStoreOrder(ctx context.Context, bodyJson Order) (ret Order, err error)
- func (receiver *StoreClient) SetClient(client *resty.Client)
- func (receiver *StoreClient) SetProvider(provider ddhttp.IServiceProvider)
- type Tag
- type UnipayClient
- type User
- type UserClient
- func (receiver *UserClient) GetUserLogin(ctx context.Context, queryParams struct{ ... }) (ret string, err error)
- func (receiver *UserClient) GetUserUsername(ctx context.Context, username string) (ret User, err error)
- func (receiver *UserClient) PostUserCreateWithList(ctx context.Context, bodyJson []User) (ret User, err error)
- func (receiver *UserClient) SetClient(client *resty.Client)
- func (receiver *UserClient) SetProvider(provider ddhttp.IServiceProvider)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiResponse ¶
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 ¶
Find pet by ID Returns a single pet
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) 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 ¶
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 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)