Commit f366a727 authored by 杨春程's avatar 杨春程

update

parent 6e0c6acf
{ # this is an example of the Uber API
"swagger": "2.0", # as a demonstration of an API spec in YAML
"info": { swagger: '2.0'
"title": "api/settlement/create", info:
"description": "下单", title: api/settlement/create
"version": "1.0.0" description: 下单
}, version: "1.0.0"
"host": "backend.test.gmei.com", # the domain of the service
"schemes": [ host: backend.test.gmei.com
"http" # array of all schemes that your API supports
], schemes:
"basePath": "/v1", - http
"produces": [ # will be prefixed to all paths
"application/json" produces:
], - application/json
"paths": { paths:
"/products": { /api/settlement/create:
"get": { get:
"summary": "用户下单", summary: 用户下单
"description": "用户下单\n", description: |
"parameters": [ 用户下单
{ parameters:
"name": "use_point", - name: use_point
"in": "query", in: query
"description": "此单用户是否使用美分", description: 此单用户是否使用美分
"required": true, required: true
"type": "boolean" type: boolean
}, - name: coupon_id
{ in: query
"name": "coupon_id", description: 美券id
"in": "query", required: false
"description": "美券id", type: number
"required": false, - name: service_id
"type": "number" in: query
}, description: 美购id
{ required: true
"name": "service_id", type: number
"in": "query", - name: item_key
"description": "美购id", in: query
"required": true, description: 多属性key, 如果是多属性美购此项必填!
"type": "number" required: false
}, type: number
{ - name: cart_item_id
"name": "item_key", in: query
"in": "query", description: 购物车id, id1-id2-id3
"description": "多属性key, 如果是多属性美购此项必填!", required: false
"required": false, type: string
"type": "number" - name: platform
}, in: query
{ description: 何种平台下单, iPhone or android or web
"name": "cart_item_id", required: true
"in": "query", type: string
"description": "购物车id, id1-id2-id3", - name: phone
"required": true, in: query
"type": "string" description: 联系人手机号发生修改才需要提交此参数
}, required: false
{ type: string
"name": "platform", tags:
"in": "query", - Products
"description": "何种平台下单, iPhone or android or web", responses:
"required": true, 200:
"type": "string" description: An array of price estimates by product
}, examples:
{ application/json:
"name": "phone", error: 0
"in": "query", message: 0
"description": "联系人手机号发生修改才需要提交此参数", data:
"required": false, status: 0
"type": "string" id: 123456
} default:
], description: Unexpected error
"tags": [ schema:
"Products" $ref: '#/definitions/Error'
], /api/settlement/preview:
"responses": { get:
"200": { summary: 下单预览
"description": "An array of price estimates by product", description: |
"examples": { 下单预览
"application/json": { parameters:
"error": 0, - name: cart_item_id
"message": 0, in: query
"data": { description: 购物车商品id.
"status": 0, required: false
"id": 123456 type: string
} - name: service_id
} in: query
} description: 美购id.
}, required: true
"default": { type: string
"description": "Unexpected error", - name: item_key
"schema": { in: query
"$ref": "#/definitions/Error" description: 多属性key.
} required: false
} type: string
} - name: coupon_id
} in: query
}, description: 美券id.
"/api/settlement/preview": { required: false
"get": { type: string
"summary": "下单预览", tags:
"description": "下单预览\n", - Estimates
"parameters": [ responses:
{ 200:
"name": "cart_item_id", description: An array of price estimates by product
"in": "query", schema:
"description": "购物车商品id.", type: array
"required": false, items:
"type": "string" $ref: '#/definitions/PriceEstimate'
}, default:
{ description: Unexpected error
"name": "service_id", schema:
"in": "query", $ref: '#/definitions/Error'
"description": "美购id.", /estimates/time:
"required": true, get:
"type": "string" summary: Time Estimates
}, description: The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.
{ parameters:
"name": "item_key", - name: start_latitude
"in": "query", in: query
"description": "多属性key.", description: Latitude component of start location.
"required": false, required: true
"type": "string" type: number
}, format: double
{ - name: start_longitude
"name": "coupon_id", in: query
"in": "query", description: Longitude component of start location.
"description": "美券id.", required: true
"required": false, type: number
"type": "string" format: double
} - name: customer_uuid
], in: query
"tags": [ type: string
"Estimates" format: uuid
], description: Unique customer identifier to be used for experience customization.
"responses": { - name: product_id
"200": { in: query
"description": "An array of price estimates by product", type: string
"schema": { description: Unique identifier representing a specific product for a given latitude & longitude.
"type": "array", tags:
"items": { - Estimates
"$ref": "#/definitions/PriceEstimate" responses:
} 200:
} description: An array of products
}, schema:
"default": { type: array
"description": "Unexpected error", items:
"schema": { $ref: '#/definitions/Product'
"$ref": "#/definitions/Error" default:
} description: Unexpected error
} schema:
} $ref: '#/definitions/Error'
} /me:
}, get:
"/estimates/time": { summary: User Profile
"get": { description: The User Profile endpoint returns information about the Uber user that has authorized with the application.
"summary": "Time Estimates", tags:
"description": "The Time Estimates endpoint returns ETAs for all products offered at a given location, with the responses expressed as integers in seconds. We recommend that this endpoint be called every minute to provide the most accurate, up-to-date ETAs.", - User
"parameters": [ responses:
{ 200:
"name": "start_latitude", description: Profile information for a user
"in": "query", schema:
"description": "Latitude component of start location.", $ref: '#/definitions/Profile'
"required": true, default:
"type": "number", description: Unexpected error
"format": "double" schema:
}, $ref: '#/definitions/Error'
{ /history:
"name": "start_longitude", get:
"in": "query", summary: User Activity
"description": "Longitude component of start location.", description: The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.
"required": true, parameters:
"type": "number", - name: offset
"format": "double" in: query
}, type: integer
{ format: int32
"name": "customer_uuid", description: Offset the list of returned results by this amount. Default is zero.
"in": "query", - name: limit
"type": "string", in: query
"format": "uuid", type: integer
"description": "Unique customer identifier to be used for experience customization." format: int32
}, description: Number of items to retrieve. Default is 5, maximum is 100.
{ tags:
"name": "product_id", - User
"in": "query", responses:
"type": "string", 200:
"description": "Unique identifier representing a specific product for a given latitude & longitude." description: History information for the given user
} schema:
], $ref: '#/definitions/Activities'
"tags": [ default:
"Estimates" description: Unexpected error
], schema:
"responses": { $ref: '#/definitions/Error'
"200": { definitions:
"description": "An array of products", Product:
"schema": { type: object
"type": "array", properties:
"items": { product_id:
"$ref": "#/definitions/Product" type: string
} description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles.
} description:
}, type: string
"default": { description: Description of product.
"description": "Unexpected error", display_name:
"schema": { type: string
"$ref": "#/definitions/Error" description: Display name of product.
} capacity:
} type: string
} description: Capacity of product. For example, 4 people.
} image:
}, type: string
"/me": { description: Image URL representing the product.
"get": { PriceEstimate:
"summary": "User Profile", type: object
"description": "The User Profile endpoint returns information about the Uber user that has authorized with the application.", properties:
"tags": [ product_id:
"User" type: string
], description: Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles
"responses": { currency_code:
"200": { type: string
"description": "Profile information for a user", description: "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code."
"schema": { display_name:
"$ref": "#/definitions/Profile" type: string
} description: Display name of product.
}, estimate:
"default": { type: string
"description": "Unexpected error", description: Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or "Metered" for TAXI.
"schema": { low_estimate:
"$ref": "#/definitions/Error" type: number
} description: Lower bound of the estimated price.
} high_estimate:
} type: number
} description: Upper bound of the estimated price.
}, surge_multiplier:
"/history": { type: number
"get": { description: Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier.
"summary": "User Activity", Profile:
"description": "The User Activity endpoint returns data about a user's lifetime activity with Uber. The response will include pickup locations and times, dropoff locations and times, the distance of past requests, and information about which products were requested.<br><br>The history array in the response will have a maximum length based on the limit parameter. The response value count may exceed limit, therefore subsequent API requests may be necessary.", type: object
"parameters": [ properties:
{ first_name:
"name": "offset", type: string
"in": "query", description: First name of the Uber user.
"type": "integer", last_name:
"format": "int32", type: string
"description": "Offset the list of returned results by this amount. Default is zero." description: Last name of the Uber user.
}, email:
{ type: string
"name": "limit", description: Email address of the Uber user
"in": "query", picture:
"type": "integer", type: string
"format": "int32", description: Image URL of the Uber user.
"description": "Number of items to retrieve. Default is 5, maximum is 100." promo_code:
} type: string
], description: Promo code of the Uber user.
"tags": [ Activity:
"User" type: object
], properties:
"responses": { uuid:
"200": { type: string
"description": "History information for the given user", description: Unique identifier for the activity
"schema": { Activities:
"$ref": "#/definitions/Activities" type: object
} properties:
}, offset:
"default": { type: integer
"description": "Unexpected error", format: int32
"schema": { description: Position in pagination.
"$ref": "#/definitions/Error" limit:
} type: integer
} format: int32
} description: Number of items to retrieve (100 max).
} count:
} type: integer
}, format: int32
"definitions": { description: Total number of items available.
"Product": { history:
"type": "object", type: array
"properties": { items:
"product_id": { $ref: '#/definitions/Activity'
"type": "string", Error:
"description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles." type: object
}, properties:
"description": { code:
"type": "string", type: integer
"description": "Description of product." format: int32
}, message:
"display_name": { type: string
"type": "string", fields:
"description": "Display name of product." type: string
},
"capacity": {
"type": "string",
"description": "Capacity of product. For example, 4 people."
},
"image": {
"type": "string",
"description": "Image URL representing the product."
}
}
},
"PriceEstimate": {
"type": "object",
"properties": {
"product_id": {
"type": "string",
"description": "Unique identifier representing a specific product for a given latitude & longitude. For example, uberX in San Francisco will have a different product_id than uberX in Los Angeles"
},
"currency_code": {
"type": "string",
"description": "[ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) currency code."
},
"display_name": {
"type": "string",
"description": "Display name of product."
},
"estimate": {
"type": "string",
"description": "Formatted string of estimate in local currency of the start location. Estimate could be a range, a single number (flat rate) or \"Metered\" for TAXI."
},
"low_estimate": {
"type": "number",
"description": "Lower bound of the estimated price."
},
"high_estimate": {
"type": "number",
"description": "Upper bound of the estimated price."
},
"surge_multiplier": {
"type": "number",
"description": "Expected surge multiplier. Surge is active if surge_multiplier is greater than 1. Price estimate already factors in the surge multiplier."
}
}
},
"Profile": {
"type": "object",
"properties": {
"first_name": {
"type": "string",
"description": "First name of the Uber user."
},
"last_name": {
"type": "string",
"description": "Last name of the Uber user."
},
"email": {
"type": "string",
"description": "Email address of the Uber user"
},
"picture": {
"type": "string",
"description": "Image URL of the Uber user."
},
"promo_code": {
"type": "string",
"description": "Promo code of the Uber user."
}
}
},
"Activity": {
"type": "object",
"properties": {
"uuid": {
"type": "string",
"description": "Unique identifier for the activity"
}
}
},
"Activities": {
"type": "object",
"properties": {
"offset": {
"type": "integer",
"format": "int32",
"description": "Position in pagination."
},
"limit": {
"type": "integer",
"format": "int32",
"description": "Number of items to retrieve (100 max)."
},
"count": {
"type": "integer",
"format": "int32",
"description": "Total number of items available."
},
"history": {
"type": "array",
"items": {
"$ref": "#/definitions/Activity"
}
}
}
},
"Error": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"fields": {
"type": "string"
}
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment