Commit d1cea924 by ivan Lan

Add order/:id/snapshots & cart/snapshots & Imprve base controller

parent 73f9c6f4
...@@ -91,6 +91,39 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -91,6 +91,39 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
end end
end end
path "/#{namespace}/orders/{id}/product_snapshots" do
get(summary: '某订单的 order 所有snapshots') do
produces 'application/json'
consumes 'application/json'
parameter :buyer_type, in: :query, type: :string
parameter :buyer_id, in: :query, type: :integer
let(:buyer_id) { @user.id }
let(:buyer_type) { @user.class.name }
parameter :id, in: :path, type: :integer
parameter :page, in: :query, type: :string
parameter :per_page, in: :query, type: :string
let(:page) { 1 }
let(:per_page) { 100 }
let(:id) { @order_1.id }
before do
@orders.last.product_snapshots.create!(
product_series: @series_1,
count: 100
)
end
response(200, description: 'successful') do
it {
body = JSON.parse(response.body)
expect(body['product_snapshots'].count).to eq(@order_1.snapshots.count)
}
end
end
end
path "/#{namespace}/orders" do path "/#{namespace}/orders" do
...@@ -122,62 +155,6 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -122,62 +155,6 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
end end
end end
post(summary: '用户 创建订单(using incr_snapshot_ids') do
produces 'application/json'
consumes 'application/json'
parameter :buyer_type, in: :query, type: :string
parameter :buyer_id, in: :query, type: :integer
let(:buyer_id) { @user.id }
let(:buyer_type) { @user.class.name }
parameter :order, in: :body, schema: {
type: :object, properties: {
order: {
type: :object, properties: {
address: { type: :string },
user_remark: { type: :text },
incr_snapshot_ids: { type: :array },
# gone_snapshot_ids: { type: :array },
}
}
}
}
response(201, description: 'successful') do
let(:order) {{
order: {
address: 'This is an special address.',
user_remark: 'user remark ...',
incr_snapshot_ids: [ @snapshot_2.id ],
}
}}
it {
body = JSON.parse(response.body)
expect(body['snapshots'].count).to eq(1)
expect(body['snapshots'].first['id']).to eq(@snapshot_2.id)
expect(@snapshot_2.reload.is_in_cart).to eq(false)
}
end
response(400, description: 'failed, Cannot edit a snapshot which order was already paid.') do
let(:order) {{
order: {
incr_snapshot_ids: [ @snapshot_1.id ],
}
}}
before {
@order_1.pay!
}
it {
expect(response.status).to eq(400)
}
end
end
end
path "/#{namespace}/orders" do
post(summary: 'create order') do post(summary: 'create order') do
produces 'application/json' produces 'application/json'
consumes 'application/json' consumes 'application/json'
...@@ -192,6 +169,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -192,6 +169,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
type: :object, properties: { type: :object, properties: {
address: { type: :string }, address: { type: :string },
user_remark: { type: :text }, user_remark: { type: :text },
incr_snapshot_ids: { type: :array },
}, },
snapshots: { snapshots: {
type: :object, properties: { type: :object, properties: {
...@@ -208,7 +186,8 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -208,7 +186,8 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
{ {
order: { order: {
address: 'This is an special address.', address: 'This is an special address.',
user_remark: 'user remark ...' user_remark: 'user remark ...',
incr_snapshot_ids: [ @snapshot_2.id ],
}, },
snapshots: { snapshots: {
shotengai_series_id: @series_1.id, shotengai_series_id: @series_1.id,
...@@ -218,15 +197,15 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -218,15 +197,15 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
} }
it { it {
body = JSON.parse(response.body) expect(Order.last.snapshots.count).to eq(2)
expect(body['snapshots'].count).to eq(1) expect(Order.last.snapshots.map(&:shotengai_series_id).sort).to eq([@series_1.id, @snapshot_2.series.id].sort)
expect(body['snapshots'].first['shotengai_series_id']).to eq(@series_1.id) expect(Order.last.snapshots.map(&:id).sort.include?(@snapshot_2.id)).to eq(true)
expect(@snapshot_2.reload.is_in_cart).to eq(false)
} }
end end
end end
end end
path "/#{namespace}/orders/{id}" do path "/#{namespace}/orders/{id}" do
parameter :id, in: :path, type: :integer parameter :id, in: :path, type: :integer
...@@ -242,7 +221,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -242,7 +221,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
response(200, description: 'successful') do response(200, description: 'successful') do
it { it {
expect(JSON.parse(response.body)['snapshots'].count).to eq(@order_1.snapshots.count) # expect(JSON.parse(response.body)['snapshots'].count).to eq(@order_1.snapshots.count)
} }
end end
end end
......
...@@ -27,7 +27,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -27,7 +27,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
@orders = create_list(:order, 3) @orders = create_list(:order, 3)
@order_1 = @orders.first @order_1 = @orders.first
@cart = Order::Cart.create! @cart = create(:user).order_cart
@snapshot_1.update!(order: @order_1) @snapshot_1.update!(order: @order_1)
@snapshot_other.update!(order: @order_1) @snapshot_other.update!(order: @order_1)
...@@ -70,7 +70,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta ...@@ -70,7 +70,7 @@ RSpec.describe "#{namespace}/orders", type: :request, capture_examples: true, ta
consumes 'application/json' consumes 'application/json'
response(200, description: 'successful') do response(200, description: 'successful') do
it { it {
expect(JSON.parse(response.body)['snapshots'].count).to eq(@order_1.snapshots.count) # expect(JSON.parse(response.body)['snapshots'].count).to eq(@order_1.snapshots.count)
} }
end end
end end
......
json.current_page @resources.current_page json.current_page @resources.current_page
json.total_pages @resources.total_pages json.total_pages @resources.total_pages
json.set! @resources.klass.model_name.collection do json.set! @resources.klass.model_name.collection do
json.array! @resources, partial: 'shotengai/share/order_simple', as: :order json.array! @resources, partial: 'shotengai/share/merchant_order_simple', as: :order
end end
\ No newline at end of file
json.partial! "shotengai/share/order", order: @resource json.partial! "shotengai/share/merchant_order", order: @resource
json.extract! order, :id, :seq, :address,
:pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost,
:merchant_remark, :mark, :customer_remark,
:status, :status_zh, :meta
# json.snapshots order.snapshots, partial: 'shotengai/share/snapshot_simple', as: :snapshot
json.extract! order, :id, :seq, :address,
:pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost,
:merchant_remark, :mark, :customer_remark,
:status, :status_zh, :meta
\ No newline at end of file
json.extract! order, :id, :seq, :status_zh, :address, json.extract! order, :id, :seq, :status_zh, :address,
:pay_time, :delivery_time, :receipt_time, :pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost, :delivery_way, :delivery_cost, :customer_remark,
:merchant_remark, :mark, :customer_remark,
:status, :status_zh, :meta :status, :status_zh, :meta
json.snapshots order.snapshots, partial: 'shotengai/share/snapshot_simple', as: :snapshot # json.snapshots order.snapshots, partial: 'shotengai/share/snapshot_simple', as: :snapshot
\ No newline at end of file \ No newline at end of file
json.extract! order, :id, :seq, :address, json.extract! order, :id, :seq, :address,
:pay_time, :delivery_time, :receipt_time, :pay_time, :delivery_time, :receipt_time,
:delivery_way, :delivery_cost, :delivery_way, :delivery_cost, :customer_remark,
:merchant_remark, :mark, :customer_remark,
:status, :status_zh, :meta :status, :status_zh, :meta
\ No newline at end of file
...@@ -11,9 +11,9 @@ module Shotengai ...@@ -11,9 +11,9 @@ module Shotengai
# respond_with @products, template: "#{self.class.template_dir}/index" # respond_with @products, template: "#{self.class.template_dir}/index"
# #
cattr_accessor :template_dir cattr_accessor :template_dir
@@index_query ||= nil @@index_query = nil
@@default_query ||= nil @@default_query = nil
class << self class << self
# Add the index query to custom the @@index_resouces on the base of @@resources # Add the index query to custom the @@index_resouces on the base of @@resources
...@@ -100,14 +100,14 @@ module Shotengai ...@@ -100,14 +100,14 @@ module Shotengai
@resource.destroy! @resource.destroy!
head 204 head 204
end end
private private
def index_resources def index_resources
@@index_query&.call(default_resources, params) || default_resources @@index_query&.call(default_resources, params, request) || default_resources
end end
def default_resources def default_resources
@@default_query&.call(self.class.resources, params) || self.class.resources @@default_query&.call(self.class.resources, params, request) || self.class.resources
end end
def resource_key def resource_key
...@@ -119,7 +119,7 @@ module Shotengai ...@@ -119,7 +119,7 @@ module Shotengai
end end
def resource_params def resource_params
params.requrie(resource_key).permit!.merge other_resource_params params.require(resource_key).permit!.merge other_resource_params
end end
# rewrite this to add more custom column # rewrite this to add more custom column
......
...@@ -11,10 +11,10 @@ module Shotengai ...@@ -11,10 +11,10 @@ module Shotengai
remove_actions :index, :create, :destroy remove_actions :index, :create, :destroy
default_query do |resource, params| default_query do |resource, params, request|
end end
index_query do |resource, params| index_query do |resource, params, request|
end end
private private
......
...@@ -10,10 +10,11 @@ module Shotengai ...@@ -10,10 +10,11 @@ module Shotengai
remove_actions :destroy remove_actions :destroy
default_query do |resource, params| default_query do |resource, params, request|
end end
index_query do |resource, params| index_query do |resource, params, request|
request.params
resource.status_is(params[:status]) resource.status_is(params[:status])
end end
......
...@@ -6,13 +6,13 @@ module Shotengai ...@@ -6,13 +6,13 @@ module Shotengai
self.template_dir = 'shotengai/customer/series/' self.template_dir = 'shotengai/customer/series/'
remove_actions :create, :update, :destroy remove_actions :create, :update, :destroy
default_query do |resource, params| default_query do |resource, params, request|
resource.where( resource.where(
params[:product_id] && { shotengai_product_id: params[:product_id] } params[:product_id] && { shotengai_product_id: params[:product_id] }
) )
end end
index_query do |resource, params| index_query do |resource, params, request|
end end
end end
end end
......
...@@ -2,48 +2,51 @@ module Shotengai ...@@ -2,48 +2,51 @@ module Shotengai
module Controller module Controller
module Customer module Customer
class ProductSnapshotsController < Shotengai::Controller::Base class ProductSnapshotsController < Shotengai::Controller::Base
# self.resources = ProductSnapshot self.resources = ProductSnapshot
# self.template_dir = 'shotengai/customer/snapshots/' self.template_dir = 'shotengai/customer/snapshots/'
# before_action :buyer_auth before_action :buyer_auth
# before_action :edit_only_unpaid, except: [:index, :show, :create] before_action :edit_only_unpaid, except: [:index, :show, :create]
# default_query do |resource, params| self.default_query do |resource, params, request|
# # /orders/:order_id/snapshots # /orders/:order_id/snapshots
# # /series/:series_id/snapshots # /series/:series_id/snapshots
# p 'come here' buyer = params[:buyer_type].constantize.find(params[:buyer_id])
# resource.where( order_id = request.path_info.include?('cart') ? buyer.order_cart.id : params[:order_id]
# params[:order_id] && { shotengai_order_id: params[:order_id] } resource.where(
# ).where( order_id && { shotengai_order_id: order_id }
# params[:series_id] && { shotengai_series_id: params[:series_id] } ).count
# ) resource.where(
# end order_id && { shotengai_order_id: order_id }
).where(
params[:series_id] && { shotengai_series_id: params[:series_id] }
)
end
# index_query do |resource, params| index_query do |resource, params, request|
# params[:in_cart] ? resource.in_cart : resource.in_order end
# end
# # 不指定 order 时,默认创建在 cart 中 # 不指定 order 时,默认创建在 cart 中
# # TODO: WARNING: snapshots # TODO: WARNING: snapshots
# def create def create
# order_or_cart = Shotengai::Order.find_by_id(params[:order_id]) || @buyer.order_cart order_or_cart = Shotengai::Order.find_by_id(params[:order_id]) || @buyer.order_cart
# @resource = order_or_cart.product_snapshots.create!(resource_params) @resource = order_or_cart.product_snapshots.create!(resource_params)
# respond_with @resource, template: "#{@@template_dir}/show", status: 201 respond_with @resource, template: "#{@@template_dir}/show", status: 201
# end end
# private private
# def buyer_auth def buyer_auth
# @buyer = params[:buyer_type].constantize.find(params[:buyer_id]) @buyer = params[:buyer_type].constantize.find(params[:buyer_id])
# end end
# def resource_params def resource_params
# params.require(resource_key).permit( params.require(resource_key).permit(
# :count, :shotengai_series_id :count, :shotengai_series_id
# ) )
# end end
# def edit_only_unpaid def edit_only_unpaid
# raise Shotengai::WebError.new('订单已支付,不可修改。', '-1', 403) unless @resource.order.unpaid? raise Shotengai::WebError.new('订单已支付,不可修改。', '-1', 403) unless @resource.order.unpaid?
# end end
end end
end end
end end
......
...@@ -6,11 +6,11 @@ module Shotengai ...@@ -6,11 +6,11 @@ module Shotengai
self.template_dir = 'shotengai/customer/products/' self.template_dir = 'shotengai/customer/products/'
remove_actions :create, :update, :destroy remove_actions :create, :update, :destroy
default_query do |resource, params| default_query do |resource, params, request|
end end
index_query do |resource, params| index_query do |resource, params, request|
params[:catalog_list] ? params[:catalog_list] ?
resource.tagged_with(params[:catalog_list], on: :catalogs) : resource.tagged_with(params[:catalog_list], on: :catalogs) :
resource resource
......
...@@ -7,11 +7,11 @@ module Shotengai ...@@ -7,11 +7,11 @@ module Shotengai
remove_actions :create, :destroy remove_actions :create, :destroy
default_query do |resource, params| default_query do |resource, params, request|
end end
index_query do |resource, params| index_query do |resource, params, request|
resource.status_is(params[:status]) resource.status_is(params[:status])
end end
......
...@@ -5,13 +5,13 @@ module Shotengai ...@@ -5,13 +5,13 @@ module Shotengai
self.resources = ProductSeries self.resources = ProductSeries
self.template_dir = 'shotengai/merchant/series/' self.template_dir = 'shotengai/merchant/series/'
default_query do |resource, params| default_query do |resource, params, request|
resource.where( resource.where(
params[:product_id] && { shotengai_product_id: params[:product_id] } params[:product_id] && { shotengai_product_id: params[:product_id] }
) )
end end
index_query do |resource, params| index_query do |resource, params, request|
end end
......
...@@ -8,11 +8,11 @@ module Shotengai ...@@ -8,11 +8,11 @@ module Shotengai
remove_actions :create, :destroy remove_actions :create, :destroy
before_action :edit_only_unpaid, only: :update before_action :edit_only_unpaid, only: :update
default_query do |resource, params| default_query do |resource, params, request|
resource.in_order resource.in_order
end end
index_query do |resource, params| index_query do |resource, params, request|
resource.where( resource.where(
params[:order_id] && { shotengai_order_id: params[:order_id] } params[:order_id] && { shotengai_order_id: params[:order_id] }
).where( ).where(
......
...@@ -7,11 +7,11 @@ module Shotengai ...@@ -7,11 +7,11 @@ module Shotengai
before_action :manager_auth before_action :manager_auth
default_query do |resource, params| default_query do |resource, params, request|
resource.where(manager: @manager) resource.where(manager: @manager)
end end
index_query do |resource, params| index_query do |resource, params, request|
params[:catalog_list] ? params[:catalog_list] ?
resource.tagged_with(params[:catalog_list], on: :catalogs) : resource.tagged_with(params[:catalog_list], on: :catalogs) :
resource resource
......
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
}, },
"host": "xxx.com", "host": "xxx.com",
"paths": { "paths": {
"/user/orders/cart": { "/user/cart": {
"get": { "get": {
"responses": { "responses": {
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 8, "id": 521,
"snapshots": [ "snapshots": [
{ {
"id": 5, "id": 436,
"shotengai_series_id": 11, "shotengai_series_id": 417,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "count": 5,
...@@ -69,14 +69,14 @@ ...@@ -69,14 +69,14 @@
] ]
} }
}, },
"/user/orders/add_to_cart": { "/user/cart/product_snapshots": {
"post": { "post": {
"responses": { "responses": {
"201": { "201": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 14, "id": 445,
"shotengai_series_id": 15, "shotengai_series_id": 421,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 10, "count": 10,
...@@ -118,12 +118,12 @@ ...@@ -118,12 +118,12 @@
"type": "integer" "type": "integer"
}, },
{ {
"name": "snapshot", "name": "product_snapshot",
"in": "body", "in": "body",
"schema": { "schema": {
"type": "object", "type": "object",
"properties": { "properties": {
"snapshot": { "product_snapshot": {
"type": "object", "type": "object",
"properties": { "properties": {
"shotengai_series_id": { "shotengai_series_id": {
...@@ -161,10 +161,10 @@ ...@@ -161,10 +161,10 @@
"total_pages": 1, "total_pages": 1,
"orders": [ "orders": [
{ {
"id": 31, "id": 548,
"seq": null, "seq": null,
"address": null, "address": null,
"pay_time": "2017-08-29T11:40:50.000Z", "pay_time": "2017-09-11T09:32:49.000Z",
"delivery_time": null, "delivery_time": null,
"receipt_time": null, "receipt_time": null,
"delivery_way": null, "delivery_way": null,
...@@ -226,114 +226,7 @@ ...@@ -226,114 +226,7 @@
"201": { "201": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 42, "id": 576,
"seq": null,
"status_zh": "未支付",
"address": "This is an special address.",
"pay_time": null,
"delivery_time": null,
"receipt_time": null,
"delivery_way": null,
"delivery_cost": null,
"merchant_remark": null,
"mark": null,
"customer_remark": null,
"status": "unpaid",
"meta": null,
"snapshots": [
{
"id": 31,
"shotengai_series_id": 27,
"original_price": "100.0",
"price": "80.0",
"count": 5,
"product_status_zh": "未上架",
"order_status_zh": "未支付",
"product_status": "no_on",
"order_status": "unpaid",
"total_price": "400.0",
"total_original_price": "500.0",
"revised_amount": null,
"spec": {
"大小": "S",
"颜色": "红色"
},
"cover_image": "cover_image 1",
"meta": {
"meta1": "111",
"meta2": "222"
},
"is_in_cart": false
}
]
}
},
"description": "successful"
},
"400": {
"examples": {
"application/json": {
"error": "Validation failed: Id 订单已支付,禁止修改商品快照。"
}
},
"description": "failed, Cannot edit a snapshot which order was already paid."
}
},
"parameters": [
{
"name": "buyer_type",
"in": "query",
"type": "string"
},
{
"name": "buyer_id",
"in": "query",
"type": "integer"
},
{
"name": "order",
"in": "body",
"schema": {
"type": "object",
"properties": {
"order": {
"type": "object",
"properties": {
"address": {
"type": "string"
},
"user_remark": {
"type": "text"
},
"incr_snapshot_ids": {
"type": "array"
}
}
}
}
}
}
],
"tags": [
"user API",
"order"
],
"summary": "用户 创建订单(using incr_snapshot_ids",
"consumes": [
"application/json"
],
"produces": [
"application/json"
]
}
},
"/user/orders/create_directly": {
"post": {
"responses": {
"201": {
"examples": {
"application/json": {
"id": 60,
"seq": null, "seq": null,
"status_zh": "未支付", "status_zh": "未支付",
"address": "This is an special address.", "address": "This is an special address.",
...@@ -349,8 +242,8 @@ ...@@ -349,8 +242,8 @@
"meta": null, "meta": null,
"snapshots": [ "snapshots": [
{ {
"id": 46, "id": 477,
"shotengai_series_id": 35, "shotengai_series_id": 441,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 10, "count": 10,
...@@ -378,6 +271,14 @@ ...@@ -378,6 +271,14 @@
} }
}, },
"description": "successful" "description": "successful"
},
"400": {
"examples": {
"application/json": {
"error": "Validation failed: Id 订单已支付,禁止修改商品快照。"
}
},
"description": "failed, Cannot edit a snapshot which order was already paid."
} }
}, },
"parameters": [ "parameters": [
...@@ -407,7 +308,7 @@ ...@@ -407,7 +308,7 @@
"type": "text" "type": "text"
} }
}, },
"snapshot": { "snapshots": {
"type": "object", "type": "object",
"properties": { "properties": {
"shotengai_series_id": { "shotengai_series_id": {
...@@ -450,7 +351,7 @@ ...@@ -450,7 +351,7 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 65, "id": 582,
"seq": null, "seq": null,
"status_zh": "未支付", "status_zh": "未支付",
"address": null, "address": null,
...@@ -466,8 +367,8 @@ ...@@ -466,8 +367,8 @@
"meta": null, "meta": null,
"snapshots": [ "snapshots": [
{ {
"id": 50, "id": 481,
"shotengai_series_id": 39, "shotengai_series_id": 445,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
...@@ -490,8 +391,8 @@ ...@@ -490,8 +391,8 @@
"is_in_cart": false "is_in_cart": false
}, },
{ {
"id": 52, "id": 483,
"shotengai_series_id": 40, "shotengai_series_id": 446,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "count": 5,
...@@ -609,91 +510,12 @@ ...@@ -609,91 +510,12 @@
"produces": [ "produces": [
"application/json" "application/json"
] ]
} },
}, "delete": {
"/user/orders/{id}/pay": {
"parameters": [
{
"name": "id",
"in": "path",
"type": "integer",
"required": true
}
],
"post": {
"responses": { "responses": {
"200": { "204": {
"examples": { "examples": {
"application/json": { "": ""
"id": 89,
"seq": null,
"status_zh": "已支付",
"address": null,
"pay_time": "2017-08-29T11:40:51.000Z",
"delivery_time": null,
"receipt_time": null,
"delivery_way": null,
"delivery_cost": null,
"merchant_remark": null,
"mark": null,
"customer_remark": null,
"status": "paid",
"meta": null,
"snapshots": [
{
"id": 68,
"shotengai_series_id": 51,
"original_price": "100.0",
"price": "80.0",
"count": 2,
"product_status_zh": "未上架",
"order_status_zh": "已支付",
"product_status": "no_on",
"order_status": "paid",
"total_price": "160.0",
"total_original_price": "200.0",
"revised_amount": null,
"spec": {
"大小": "S",
"颜色": "白色"
},
"cover_image": "cover_image.image",
"meta": {
"meta1": "111",
"meta2": "222",
"series_meta1": "111",
"series_meta2": "222"
},
"is_in_cart": false
},
{
"id": 70,
"shotengai_series_id": 52,
"original_price": "100.0",
"price": "80.0",
"count": 5,
"product_status_zh": "未上架",
"order_status_zh": "已支付",
"product_status": "no_on",
"order_status": "paid",
"total_price": "400.0",
"total_original_price": "500.0",
"revised_amount": null,
"spec": {
"大小": "S",
"颜色": "黑色"
},
"cover_image": "cover_image.image",
"meta": {
"meta1": "111",
"meta2": "222",
"series_meta1": "111",
"series_meta2": "222"
},
"is_in_cart": false
}
]
}
}, },
"description": "successful" "description": "successful"
} }
...@@ -714,7 +536,7 @@ ...@@ -714,7 +536,7 @@
"user API", "user API",
"order" "order"
], ],
"summary": "用户 支付订单", "summary": "用户 取消未支付订单",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
...@@ -723,7 +545,7 @@ ...@@ -723,7 +545,7 @@
] ]
} }
}, },
"/user/orders/{id}/cancel": { "/user/orders/{id}/pay": {
"parameters": [ "parameters": [
{ {
"name": "id", "name": "id",
...@@ -737,11 +559,11 @@ ...@@ -737,11 +559,11 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 97, "id": 610,
"seq": null, "seq": null,
"status_zh": null, "status_zh": "已支付",
"address": null, "address": null,
"pay_time": null, "pay_time": "2017-09-11T09:32:51.000Z",
"delivery_time": null, "delivery_time": null,
"receipt_time": null, "receipt_time": null,
"delivery_way": null, "delivery_way": null,
...@@ -749,54 +571,58 @@ ...@@ -749,54 +571,58 @@
"merchant_remark": null, "merchant_remark": null,
"mark": null, "mark": null,
"customer_remark": null, "customer_remark": null,
"status": "canceled", "status": "paid",
"meta": null, "meta": null,
"snapshots": [ "snapshots": [
{ {
"id": 74, "id": 502,
"shotengai_series_id": 55, "shotengai_series_id": 459,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
"product_status_zh": "未上架", "product_status_zh": "未上架",
"order_status_zh": null, "order_status_zh": "已支付",
"product_status": "no_on", "product_status": "no_on",
"order_status": "canceled", "order_status": "paid",
"total_price": "160.0", "total_price": "160.0",
"total_original_price": "200.0", "total_original_price": "200.0",
"revised_amount": null, "revised_amount": null,
"spec": { "spec": {
"大小": "S", "大小": "S",
"颜色": "色" "颜色": "色"
}, },
"cover_image": "cover_image 1", "cover_image": "cover_image.image",
"meta": { "meta": {
"meta1": "111", "meta1": "111",
"meta2": "222" "meta2": "222",
"series_meta1": "111",
"series_meta2": "222"
}, },
"is_in_cart": false "is_in_cart": false
}, },
{ {
"id": 76, "id": 504,
"shotengai_series_id": 56, "shotengai_series_id": 460,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "count": 5,
"product_status_zh": "未上架", "product_status_zh": "未上架",
"order_status_zh": null, "order_status_zh": "已支付",
"product_status": "no_on", "product_status": "no_on",
"order_status": "canceled", "order_status": "paid",
"total_price": "400.0", "total_price": "400.0",
"total_original_price": "500.0", "total_original_price": "500.0",
"revised_amount": null, "revised_amount": null,
"spec": { "spec": {
"大小": "S", "大小": "S",
"颜色": "色" "颜色": "色"
}, },
"cover_image": "cover_image 1", "cover_image": "cover_image.image",
"meta": { "meta": {
"meta1": "111", "meta1": "111",
"meta2": "222" "meta2": "222",
"series_meta1": "111",
"series_meta2": "222"
}, },
"is_in_cart": false "is_in_cart": false
} }
...@@ -804,14 +630,6 @@ ...@@ -804,14 +630,6 @@
} }
}, },
"description": "successful" "description": "successful"
},
"400": {
"examples": {
"application/json": {
"error": "Event 'cancel' cannot transition from 'paid'. "
}
},
"description": "failed , you can cancel a order which status is unpaid"
} }
}, },
"parameters": [ "parameters": [
...@@ -830,7 +648,7 @@ ...@@ -830,7 +648,7 @@
"user API", "user API",
"order" "order"
], ],
"summary": "用户 取消未支付订单", "summary": "用户 支付订单",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
...@@ -839,7 +657,7 @@ ...@@ -839,7 +657,7 @@
] ]
} }
}, },
"/user/orders/{id}/get_it": { "/user/orders/{id}/confirm": {
"parameters": [ "parameters": [
{ {
"name": "id", "name": "id",
...@@ -853,13 +671,13 @@ ...@@ -853,13 +671,13 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 113, "id": 618,
"seq": null, "seq": null,
"status_zh": "已收货", "status_zh": "已收货",
"address": null, "address": null,
"pay_time": null, "pay_time": null,
"delivery_time": null, "delivery_time": null,
"receipt_time": "2017-08-29T11:40:52.000Z", "receipt_time": "2017-09-11T09:32:51.000Z",
"delivery_way": null, "delivery_way": null,
"delivery_cost": null, "delivery_cost": null,
"merchant_remark": null, "merchant_remark": null,
...@@ -869,8 +687,8 @@ ...@@ -869,8 +687,8 @@
"meta": null, "meta": null,
"snapshots": [ "snapshots": [
{ {
"id": 86, "id": 508,
"shotengai_series_id": 63, "shotengai_series_id": 463,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
...@@ -893,8 +711,8 @@ ...@@ -893,8 +711,8 @@
"is_in_cart": false "is_in_cart": false
}, },
{ {
"id": 88, "id": 510,
"shotengai_series_id": 64, "shotengai_series_id": 464,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "count": 5,
...@@ -947,7 +765,15 @@ ...@@ -947,7 +765,15 @@
] ]
} }
}, },
"/user/product_snapshots": { "/user/products/{product_id}/product_series": {
"parameters": [
{
"name": "product_id",
"in": "path",
"type": "string",
"required": true
}
],
"get": { "get": {
"responses": { "responses": {
"200": { "200": {
...@@ -955,35 +781,45 @@ ...@@ -955,35 +781,45 @@
"application/json": { "application/json": {
"current_page": 1, "current_page": 1,
"total_pages": 1, "total_pages": 1,
"product_snapshots": [ "product_series": [
{ {
"id": 105, "id": 467,
"shotengai_series_id": 75, "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "stock": 10,
"product_status_zh": "未上架",
"order_status_zh": null,
"product_status": "no_on",
"order_status": null,
"total_price": "400.0",
"total_original_price": "500.0",
"revised_amount": null,
"spec": { "spec": {
"大小": "S", "大小": "S",
"颜色": "色" "颜色": "色"
}, },
"cover_image": "cover_image 1", "cover_image": "cover_image.image",
"meta": { "meta": {
"meta1": "111", "series_meta1": "111",
"meta2": "222" "series_meta2": "222"
}, },
"is_in_cart": true "shotengai_product_id": 778
},
{
"id": 468,
"title": "Test Product Title",
"original_price": "100.0",
"price": "80.0",
"stock": 10,
"spec": {
"大小": "S",
"颜色": "黑色"
},
"cover_image": "cover_image.image",
"meta": {
"series_meta1": "111",
"series_meta2": "222"
},
"shotengai_product_id": 778
} }
] ]
} }
}, },
"description": "successful, in_cart" "description": "successful"
} }
}, },
"parameters": [ "parameters": [
...@@ -996,28 +832,13 @@ ...@@ -996,28 +832,13 @@
"name": "per_page", "name": "per_page",
"in": "query", "in": "query",
"type": "string" "type": "string"
},
{
"name": "series_id",
"in": "query",
"type": "integer"
},
{
"name": "order_id",
"in": "query",
"type": "string"
},
{
"name": "in_cart",
"in": "query",
"type": "boolean"
} }
], ],
"tags": [ "tags": [
"user API", "user API",
"product_snapshots" "product_series"
], ],
"summary": "用户 快照列表 三参数可仍以任意组合", "summary": "用户 某商品的 商品系列 列表",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
...@@ -1026,42 +847,43 @@ ...@@ -1026,42 +847,43 @@
] ]
} }
}, },
"/user/product_snapshots/{id}": { "/user/product_series/{id}": {
"parameters": [
{
"name": "id",
"in": "path",
"type": "string",
"required": true
}
],
"get": { "get": {
"responses": { "responses": {
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 110, "id": 469,
"shotengai_series_id": 79, "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "stock": 10,
"product_status_zh": "未上架",
"order_status_zh": "未支付",
"product_status": "no_on",
"order_status": "unpaid",
"total_price": "160.0",
"total_original_price": "200.0",
"revised_amount": null,
"spec": { "spec": {
"大小": "S", "大小": "S",
"颜色": "色" "颜色": "色"
}, },
"cover_image": "cover_image 1", "cover_image": "cover_image.image",
"banners": [ "banners": [
"iamge 1", "image1",
"iamge 2" "iamge2"
], ],
"meta": {
"series_meta1": "111",
"series_meta2": "222"
},
"detail": { "detail": {
"产品参数": "参数 参数...", "产品参数": "参数 参数...",
"使用说明": "xxxxxxxx..." "使用说明": "xxxxxxxx..."
}, },
"meta": { "shotengai_product_id": 781
"meta1": "111",
"meta2": "222"
},
"is_in_cart": false
} }
}, },
"description": "successful" "description": "successful"
...@@ -1069,9 +891,9 @@ ...@@ -1069,9 +891,9 @@
}, },
"tags": [ "tags": [
"user API", "user API",
"product_snapshots" "product_series"
], ],
"summary": "商户 商品快照的详情", "summary": "用户 商品系列的详情",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
...@@ -1090,14 +912,14 @@ ...@@ -1090,14 +912,14 @@
"total_pages": 1, "total_pages": 1,
"products": [ "products": [
{ {
"id": 142, "id": 793,
"title": "Test Product Title", "title": "Test Product Title",
"status": "no_on", "status": "no_on",
"status_zh": "未上架", "status_zh": "未上架",
"need_express": true, "need_express": true,
"cover_image": "cover_image.image", "cover_image": "cover_image.image",
"default_series": { "default_series": {
"id": 84, "id": 474,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -1111,7 +933,7 @@ ...@@ -1111,7 +933,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 142 "shotengai_product_id": 793
} }
} }
] ]
...@@ -1164,7 +986,7 @@ ...@@ -1164,7 +986,7 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 148, "id": 799,
"title": "Test Product Title", "title": "Test Product Title",
"status": "no_on", "status": "no_on",
"status_zh": "未上架", "status_zh": "未上架",
...@@ -1199,7 +1021,7 @@ ...@@ -1199,7 +1021,7 @@
"衣服" "衣服"
], ],
"default_series": { "default_series": {
"id": 86, "id": 476,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -1213,11 +1035,11 @@ ...@@ -1213,11 +1035,11 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 148 "shotengai_product_id": 799
}, },
"series": [ "series": [
{ {
"id": 86, "id": 476,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -1231,7 +1053,7 @@ ...@@ -1231,7 +1053,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 148 "shotengai_product_id": 799
} }
] ]
} }
...@@ -1262,10 +1084,10 @@ ...@@ -1262,10 +1084,10 @@
"total_pages": 1, "total_pages": 1,
"orders": [ "orders": [
{ {
"id": 147, "id": 635,
"seq": null, "seq": null,
"address": null, "address": null,
"pay_time": "2017-08-29T11:40:53.000Z", "pay_time": "2017-09-11T09:32:52.000Z",
"delivery_time": null, "delivery_time": null,
"receipt_time": null, "receipt_time": null,
"delivery_way": null, "delivery_way": null,
...@@ -1327,7 +1149,7 @@ ...@@ -1327,7 +1149,7 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 153, "id": 641,
"seq": null, "seq": null,
"status_zh": "未支付", "status_zh": "未支付",
"address": null, "address": null,
...@@ -1343,8 +1165,8 @@ ...@@ -1343,8 +1165,8 @@
"meta": null, "meta": null,
"snapshots": [ "snapshots": [
{ {
"id": 128, "id": 526,
"shotengai_series_id": 97, "shotengai_series_id": 487,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
...@@ -1367,8 +1189,8 @@ ...@@ -1367,8 +1189,8 @@
"is_in_cart": false "is_in_cart": false
}, },
{ {
"id": 130, "id": 528,
"shotengai_series_id": 98, "shotengai_series_id": 488,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "count": 5,
...@@ -1466,12 +1288,12 @@ ...@@ -1466,12 +1288,12 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 169, "id": 657,
"seq": null, "seq": null,
"status_zh": "运送中", "status_zh": "运送中",
"address": null, "address": null,
"pay_time": "2017-08-29T11:40:54.000Z", "pay_time": "2017-09-11T09:32:53.000Z",
"delivery_time": "2017-08-29T11:40:54.000Z", "delivery_time": "2017-09-11T09:32:53.000Z",
"receipt_time": null, "receipt_time": null,
"delivery_way": null, "delivery_way": null,
"delivery_cost": null, "delivery_cost": null,
...@@ -1482,8 +1304,8 @@ ...@@ -1482,8 +1304,8 @@
"meta": null, "meta": null,
"snapshots": [ "snapshots": [
{ {
"id": 140, "id": 538,
"shotengai_series_id": 105, "shotengai_series_id": 495,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
...@@ -1508,8 +1330,8 @@ ...@@ -1508,8 +1330,8 @@
"is_in_cart": false "is_in_cart": false
}, },
{ {
"id": 142, "id": 540,
"shotengai_series_id": 106, "shotengai_series_id": 496,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "count": 5,
...@@ -1578,7 +1400,7 @@ ...@@ -1578,7 +1400,7 @@
"total_pages": 1, "total_pages": 1,
"product_series": [ "product_series": [
{ {
"id": 113, "id": 503,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -1592,10 +1414,10 @@ ...@@ -1592,10 +1414,10 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 190 "shotengai_product_id": 841
}, },
{ {
"id": 114, "id": 504,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -1609,7 +1431,7 @@ ...@@ -1609,7 +1431,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 190 "shotengai_product_id": 841
} }
] ]
} }
...@@ -1646,7 +1468,7 @@ ...@@ -1646,7 +1468,7 @@
"201": { "201": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 120, "id": 510,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -1668,7 +1490,7 @@ ...@@ -1668,7 +1490,7 @@
"产品参数": "参数 参数...", "产品参数": "参数 参数...",
"使用说明": "xxxxxxxx..." "使用说明": "xxxxxxxx..."
}, },
"shotengai_product_id": 196 "shotengai_product_id": 847
} }
}, },
"description": "successful" "description": "successful"
...@@ -1742,19 +1564,13 @@ ...@@ -1742,19 +1564,13 @@
] ]
} }
}, },
"/merchant/products/{product_id}/product_series/{id}": { "/merchant/product_series/{id}": {
"parameters": [ "parameters": [
{ {
"name": "id", "name": "id",
"in": "path", "in": "path",
"type": "string", "type": "string",
"required": true "required": true
},
{
"name": "product_id",
"in": "path",
"type": "string",
"required": true
} }
], ],
"get": { "get": {
...@@ -1762,7 +1578,7 @@ ...@@ -1762,7 +1578,7 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 125, "id": 515,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -1784,7 +1600,7 @@ ...@@ -1784,7 +1600,7 @@
"产品参数": "参数 参数...", "产品参数": "参数 参数...",
"使用说明": "xxxxxxxx..." "使用说明": "xxxxxxxx..."
}, },
"shotengai_product_id": 205 "shotengai_product_id": 856
} }
}, },
"description": "successful" "description": "successful"
...@@ -1910,8 +1726,8 @@ ...@@ -1910,8 +1726,8 @@
"total_pages": 1, "total_pages": 1,
"product_snapshots": [ "product_snapshots": [
{ {
"id": 152, "id": 550,
"shotengai_series_id": 133, "shotengai_series_id": 523,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
...@@ -1982,8 +1798,8 @@ ...@@ -1982,8 +1798,8 @@
"total_pages": 1, "total_pages": 1,
"product_snapshots": [ "product_snapshots": [
{ {
"id": 158, "id": 556,
"shotengai_series_id": 137, "shotengai_series_id": 527,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
...@@ -2006,8 +1822,8 @@ ...@@ -2006,8 +1822,8 @@
"is_in_cart": false "is_in_cart": false
}, },
{ {
"id": 160, "id": 558,
"shotengai_series_id": 138, "shotengai_series_id": 528,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 5, "count": 5,
...@@ -2060,15 +1876,9 @@ ...@@ -2060,15 +1876,9 @@
] ]
} }
}, },
"/merchant/product_series/{product_series_id}/product_snapshots/{id}": { "/merchant/product_snapshots/{id}": {
"parameters": [ "parameters": [
{ {
"name": "product_series_id",
"in": "path",
"type": "string",
"required": true
},
{
"name": "id", "name": "id",
"in": "path", "in": "path",
"type": "string", "type": "string",
...@@ -2080,8 +1890,8 @@ ...@@ -2080,8 +1890,8 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 164, "id": 562,
"shotengai_series_id": 141, "shotengai_series_id": 531,
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
"count": 2, "count": 2,
...@@ -2186,14 +1996,14 @@ ...@@ -2186,14 +1996,14 @@
"total_pages": 1, "total_pages": 1,
"products": [ "products": [
{ {
"id": 253, "id": 904,
"title": "Test Product Title", "title": "Test Product Title",
"status": "no_on", "status": "no_on",
"status_zh": "未上架", "status_zh": "未上架",
"need_express": true, "need_express": true,
"cover_image": "cover_image.image", "cover_image": "cover_image.image",
"default_series": { "default_series": {
"id": 154, "id": 544,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2207,7 +2017,7 @@ ...@@ -2207,7 +2017,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 253 "shotengai_product_id": 904
} }
} }
] ]
...@@ -2260,7 +2070,7 @@ ...@@ -2260,7 +2070,7 @@
"201": { "201": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 263, "id": 914,
"title": "Test Product Title", "title": "Test Product Title",
"status": "no_on", "status": "no_on",
"status_zh": "未上架", "status_zh": "未上架",
...@@ -2296,7 +2106,7 @@ ...@@ -2296,7 +2106,7 @@
"上衣" "上衣"
], ],
"default_series": { "default_series": {
"id": 156, "id": 546,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2310,7 +2120,7 @@ ...@@ -2310,7 +2120,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 260 "shotengai_product_id": 911
}, },
"series": [] "series": []
} }
...@@ -2425,7 +2235,7 @@ ...@@ -2425,7 +2235,7 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 267, "id": 918,
"title": "Test Product Title", "title": "Test Product Title",
"status": "no_on", "status": "no_on",
"status_zh": "未上架", "status_zh": "未上架",
...@@ -2460,7 +2270,7 @@ ...@@ -2460,7 +2270,7 @@
"衣服" "衣服"
], ],
"default_series": { "default_series": {
"id": 158, "id": 548,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2474,11 +2284,11 @@ ...@@ -2474,11 +2284,11 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 267 "shotengai_product_id": 918
}, },
"series": [ "series": [
{ {
"id": 158, "id": 548,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2492,7 +2302,7 @@ ...@@ -2492,7 +2302,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 267 "shotengai_product_id": 918
} }
] ]
} }
...@@ -2673,7 +2483,7 @@ ...@@ -2673,7 +2483,7 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 276, "id": 927,
"title": "Test Product Title", "title": "Test Product Title",
"status": "on_sale", "status": "on_sale",
"status_zh": "已上架", "status_zh": "已上架",
...@@ -2708,7 +2518,7 @@ ...@@ -2708,7 +2518,7 @@
"衣服" "衣服"
], ],
"default_series": { "default_series": {
"id": 161, "id": 551,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2722,11 +2532,11 @@ ...@@ -2722,11 +2532,11 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 276 "shotengai_product_id": 927
}, },
"series": [ "series": [
{ {
"id": 161, "id": 551,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2740,7 +2550,7 @@ ...@@ -2740,7 +2550,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 276 "shotengai_product_id": 927
} }
] ]
} }
...@@ -2787,7 +2597,7 @@ ...@@ -2787,7 +2597,7 @@
"200": { "200": {
"examples": { "examples": {
"application/json": { "application/json": {
"id": 279, "id": 930,
"title": "Test Product Title", "title": "Test Product Title",
"status": "no_on", "status": "no_on",
"status_zh": "未上架", "status_zh": "未上架",
...@@ -2822,7 +2632,7 @@ ...@@ -2822,7 +2632,7 @@
"衣服" "衣服"
], ],
"default_series": { "default_series": {
"id": 162, "id": 552,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2836,11 +2646,11 @@ ...@@ -2836,11 +2646,11 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 279 "shotengai_product_id": 930
}, },
"series": [ "series": [
{ {
"id": 162, "id": 552,
"title": "Test Product Title", "title": "Test Product Title",
"original_price": "100.0", "original_price": "100.0",
"price": "80.0", "price": "80.0",
...@@ -2854,7 +2664,7 @@ ...@@ -2854,7 +2664,7 @@
"series_meta1": "111", "series_meta1": "111",
"series_meta2": "222" "series_meta2": "222"
}, },
"shotengai_product_id": 279 "shotengai_product_id": 930
} }
] ]
} }
......
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