ice-cream-on-rails:使用Ruby on Rails练习API

时间:2021-04-12 11:38:37
【文件属性】:
文件名称:ice-cream-on-rails:使用Ruby on Rails练习API
文件大小:37KB
文件格式:ZIP
更新时间:2021-04-12 11:38:37
Ruby 冰淇淋卡车在铁轨上 通过Ice Cream Truck的实现,对Ruby on Rails API模式进行超级简单的探索。 卡车提供物品的初始库存和价格(请参阅 )和两个端点: GET /api/v1/foods列出卡车的当前库存以及单位和收入的总销售额 GET /api/v1/trucks列出当前的卡车及其销售以及单位和收入的总销售额 GET /api/v1/trucks/:id列出特定卡车的库存和销售(1、2等) PUT /api/v1/trucks/:id/sell接受JSON请求以购买所需的食品,该食品具有属性type , flavor (如果是冰淇淋)和quantity 。 如果数量大于可用库存,则返回错误。 例子: { " food " : { " type " : " IceCream " , " flavor " : " p
【文件预览】:
ice-cream-on-rails-main
----.gitignore(728B)
----app()
--------mailers()
--------models()
--------views()
--------jobs()
--------channels()
--------controllers()
----config.ru(160B)
----bin()
--------rails(182B)
--------setup(1010B)
--------bundle(3KB)
--------spring(494B)
--------rake(131B)
----storage()
--------.keep(0B)
----log()
--------.keep(0B)
----db()
--------migrate()
--------seeds.rb(1KB)
--------schema.rb(1KB)
----.ruby-version(11B)
----public()
--------robots.txt(99B)
----README.md(1KB)
----vendor()
--------.keep(0B)
----config()
--------cable.yml(199B)
--------spring.rb(97B)
--------credentials.yml.enc(464B)
--------boot.rb(207B)
--------database.yml(620B)
--------routes.rb(331B)
--------environments()
--------environment.rb(128B)
--------application.rb(1KB)
--------storage.yml(1KB)
--------locales()
--------puma.rb(2KB)
--------initializers()
----testing.http(3KB)
----lib()
--------tasks()
----tmp()
--------.keep(0B)
--------pids()
----Gemfile(1KB)
----.gitattributes(247B)
----Rakefile(227B)
----Gemfile.lock(4KB)

网友评论