服务集成与 API 设计:电影票务系统的实践
1. 集成测试结果
集成测试结果显示测试通过,以下是运行 OrdersService 集成测试的结果:
chakbookpro: chak$ ruby test/integration/orders_service_test_case.rb
Loaded suite test/integration/orders_service_test_case
Started
..
Finished in 0.344523 seconds.
2 tests, 3 assertions, 0 failures, 0 errors
2. 与 MoviesService 集成
2.1 数据库修改
由于应用被拆分为两部分,需要将两个应用的数据关联起来。MoviesService 中的 MovieShowtime 对象需要与 OrdersService 中的产品 ID 关联,因此需要在 movie_showtimes 表中添加 product_id 列,列类型为文本,以保持灵活性。以下是修改后的表结构:
create table movie_showtimes (
id integer not null
default nextval('movie_showtimes_id_seq'),
movie_id integer not null
references movies(id),
超级会员免费看
订阅专栏 解锁全文
23

被折叠的 条评论
为什么被折叠?



