Slide 1

Slide 1 text

αʔόαΠυ,PUMJOͷ͢͢Ί CVJMEFSTDPO /PSJZVLJ*TIJEB

Slide 2

Slide 2 text

͍͋ͭࣗ͝͞ݾ঺հ ɾ/PSJZVLJ*TIJEB ɾάϧϝܥͷ8FCαʔϏεΛӡӦ ɾ3FUUZגࣜձࣾ ɾΤϯδχΞ ɾαʔόαΠυ +BWB,PUMJO1)11ZUIPO ɾJ04 0CKFDUJWF$4XJGU ɾΠϯϑϥपΓ͸ଟগ "84%PDLFS

Slide 3

Slide 3 text

ຊ೔͸,PUMJOͷ͓࿩

Slide 4

Slide 4 text

,PUMJOͱ͍͑͹ʜ

Slide 5

Slide 5 text

(PPHMF*0ʹͯ"OESPJEެࣜݴޠ
 ɹͱͯ͠αϙʔτ͢Δ͜ͱ͕ൃදɹʂ

Slide 6

Slide 6 text

"OESPJEք۾Ͱ͸,PUMJOΛ࢖͍࢝ΊΔਓ͕
 ʹΘ͔ʹ૿͖͍͑ͯͯΔ

Slide 7

Slide 7 text

Ͱ΋"OESPJEઐ༻ͷݴޠͱ͍͏Θ͚Ͱ͸ͳ͍

Slide 8

Slide 8 text

ຊ೔ͷ͓࿩ αʔόαΠυͰͦ͜,PUMJOΛ࢖͓͏ʂ

Slide 9

Slide 9 text

ຊ೔ͷ͓࿩ ɾ,PUMJOΛಋೖͨ͠ܦҢ ɾαʔόαΠυͰ,PUMJOΛ͓͢͢Ί͍ͨ͠ཧ༝

Slide 10

Slide 10 text

ࠃ಺/P໊࣮άϧϝαʔϏε3FUUZͷӡӦ ೥ઃཱ XFCͱΞϓϦͰαʔϏεల։ γϯάϧυϝΠϯ εϚϗϑΝʔετ ݄ؒສ66

Slide 11

Slide 11 text

3FUUZ ɾ8FC ɾΞϓϦ

Slide 12

Slide 12 text

ฐࣾʹ͓͚ΔαʔόαΠυ,PUMJO ɾΞϓϦ༻"1*ʹ,PUMJOΛ࢖͍ͬͯ·͢ "1*αʔό +40/ ɾΞϓϦ͸"1*Λ௨ͯ͡σʔλΛऔಘͯͦ͠ΕΛ੔ܗͯ͠දࣔ %# "QQ

Slide 13

Slide 13 text

,PUMJOΛಋೖͨ͠ܦҢ

Slide 14

Slide 14 text

,PUMJOͰ࡞Δલͷ࿩1)1ͷ࣌୅ XFCΞϓϦέʔγϣϯ
 αʔό )5.-Λऔಘ͢ΔFOEQPJOU )5.- +40/Λऔಘ͢ΔFOEQPJOU +40/ 8FC "QQ ɾ"1*͸1)1Ͱॻ͔Ε͍ͯͨ ɾࣾ಺ʹ1)1Λॻ͚Δਓ͕ଟ͘։ൃεϐʔυ΋଎͍

Slide 15

Slide 15 text

,PUMJOͰ࡞Δલͷ࿩1)1ͷ࣌୅ ɾฦΓ஋ͷܕΛݫີʹఆ͍ٛͯ͠ͳ͔ͬͨ ɾฦΓ஋͸΄΅+40/ܗ͕ࣜͩҧ͏͜ͱ΋͋Δ ɾ"1*Λୟ͔ͳ͍ͱฦΓ஋ͷܕ͕Θ͔Βͳ͍ ɾಉ͡LFZͰ΋ɺܕ͕Ұҙʹఆ·Βͳ͍͜ͱ͕͋Δ ɾฦΓ஋ͷෆඋΛॲཧ͢Δͷ͸ΫϥΠΞϯτଆͷ੹຿ XFCΞϓϦέʔγϣϯ
 αʔό "SSBZ4USJOH͍ͩ͘͞ʂ GBMTF "QQ

Slide 16

Slide 16 text

,PUMJOͰ࡞Δલͷ࿩1)1ͷ࣌୅ ɾ"1*αʔόͷ෼཭Λܾஅ ɾฦΓ஋ͷܕΛ͖ͪΜͱࣄલʹఆٛ ɾ։ൃ଎౓ΑΓ඼࣭Λ༏ઌͯ͠ϓϩμΫτΛͭ͘Δ XFCΞϓϦέʔγϣϯαʔό "SSBZ4USJOH͍ͩ͘͞ʂ "1*αʔό ɾΞϓϦΤϯδχΞͷਫ਼ਆӴੜΛอͭ "QQ

Slide 17

Slide 17 text

,PUMJOͰ࡞Δલͷ࿩+BWBͷ࣌୅ ɾ1)1͔Β+BWB΁ͷҠߦ ɾ+BWB͸αʔόαΠυݴޠͱ࣮ͯ͠੷͕͋Γɺ'8΋๛෋ ɾฦΓ஋ͷܕΛ10+0 ී௨ͷ+BWBΦϒδΣΫτ Ͱఆٛ ɾ+6OJUΛ࢖ͬͯςετ΋ॻ͖΍͍͢ ɾ੩తܕ෇͚ݴޠͳͷͰ඼࣭͕อͪ΍͍͢ ɾ৽͘͠࡞ΔͳΒϞμϯͳػೳΛ࢖͍͍ͨ ɾ+BWBΛಋೖͨ͠ ɾϥϜμه๏4USFBN"1*0QUJPOBMܕ͕࢖͑Δ

Slide 18

Slide 18 text

͜ͷ࣌͸,PUMJOΛಋೖ͢Δؾ͸ແ͔ͬͨ
 ʢͱ͍͏ΑΓ஌Βͳ͔ͬͨʣ

Slide 19

Slide 19 text

͕ɺ͋Δ೔͜Μͳ͜ͱ͕

Slide 20

Slide 20 text

ͦ͜Ͱ

Slide 21

Slide 21 text

,PUMJO͸͓΋ΉΖʹಋೖ͞Εͨ

Slide 22

Slide 22 text

ͦΜͳಋೖ͔Β೥ʜ

Slide 23

Slide 23 text

,PUMJOΛಋೖͯ͠Ұ൪Α͔ͬͨ͜ͱ ɾ/VMMBCMFͳฦΓ஋ΛίϯύΠϥϨϕϧͰ
 ɹνΣοΫͰ͖ΔΑ͏ʹͳͬͨ ɾͦ΋ͦ΋1)1͔ΒҠߦͨ͠໨త͸ɺฦΓ஋ͷܕΛݫີʹఆٛ͢Δ͜ͱ ɾ+BWB࣌୅ʹ͸!/VMMBCMFΞϊςʔγϣϯͰදݱ͍͕ͯͨ͠ɺίϯύΠϥ
 ɹνΣοΫ͕ͳ͍ͨΊ࣮ଶͱҟͳ͍ͬͯͨ ɾ0QUJPOBM͸4FSJBMJ[BCMFͰ͸ͳ͍ͨΊ֎޲͖ͷΠϯλϑΣʔεͱͯ͠͸
 ɹ޲͔ͳ͍

Slide 24

Slide 24 text

αʔόαΠυͰ,PUMJOΛ͓͢͢Ί͍ͨ͠ཧ༝

Slide 25

Slide 25 text

αʔόαΠυͱ͍ͬͯ΋ϓϩμΫτ͸༷ʑ

Slide 26

Slide 26 text

֎෦ΠϯλϑΣʔεΛ࣋ͭ8FCΞϓϦέʔγϣϯͰ ,PUMJOΛ͓͢͢Ί͍ͨ͠

Slide 27

Slide 27 text

,PUMJOΛ͓͢͢Ί͢Δཧ༝ ɾ/VMMBCMFܕʢ0QUJPOBMܕͰ͸ͳ͘ʣΛ΋ͭ ɹ਺গͳ͍ݴޠͷͭ ɾ+BWBͱDPNQBUJCMF ɾαʔόαΠυͰ࣮੷ͷ͋Δ+BWBͷ๛෋ͳϥΠϒϥϦΛ;ΜͩΜʹ࢖͑Δ ɾطʹ+BWBͷϓϩμΫτ͕͋ΔͳΒ͙͢ʹಋೖͰ͖Δ ɾ໊લ͕͔Θ͍͍

Slide 28

Slide 28 text

/VMMBCMFܕͱ0QUJPOBMܕͷҧ͍ ɾ஌ΔݶΓͰ͸$,PUMJO͚͕ͩ΋ͭػߏ ɾʮOVMMʹͳΓ͏Δʯ͔Ͳ͏͔ʹͷΈؔ৺Λ͍࣋ͬͯΔ ɾ/VMMBCMFܕ ɾಉ͡ܕͷඇ/VMMܕ͸/VMMBCMFܕͱܧঝؔ܎ʹ͋Δ ɾ+BWB4DBMB4XJGUͳͲϞμϯͳݴޠ͕΋ͭػߏ ɾ0QUJPOBMܕ ɾݩͷܕ͔OVMMͷͲͪΒ͔Λ࣋ͭϥοϓܕͱ͍͏ߟ͑ํ ɾΞϯϥοϓͯ͠த਎ΛऔΓग़ͯ͠ૢ࡞͢Δ ɾ0QUJPOBM͸ωετ͢Δʢ0QUJPOBMͷ0QUJPOBM͕ଘࡏ͢Δʣ

Slide 29

Slide 29 text

/VMMBCMFܕ͕͋Ε͹ ɾ֎෦ΠϯλϑΣʔεΛఆٛ͢Δ৔໘Ͱ༗༻ ɾOVMMʹͳΓ͏Δ͔Ͳ͏͔͕ఆٛͰ͖Δ ɾ4XJGUͳͲͷΑ͏ͳ0QUJPOBMܕΛඋ͑Δݴޠ͔Β"1*Λ࢖͏৔߹ಛʹॏཁ ɾ0QUJPOBMܕ͸ʁ ɾݩͷܕΛϥοϓͨ͠ผͷܕ 0QUJPOBM5 ɾωετ·ͰදݱͰ͖Δඞཁ͸ͳ͍ ˠ֎෦ΠϯλϑΣʔεͷදݱʹ͸ʮOVMMͰ͋Δ͔ͦ͏Ͱͳ͍͔ʯ ɹ͚ͩΛදݱ͢Δ/VMMBCMFܕ͕ͪΐ͏ͲΑ͍ ɾ4FSJBMJ[BCMFͰͳ͍ݴޠ΋͋Δ

Slide 30

Slide 30 text

޾ͤʹͳΕͦ͏ͳ,PUMJOͷػೳ

Slide 31

Slide 31 text

޾ͤʹͳΕͦ͏ͳ,PUMJOͷػೳ interface IRestaurantInfo { @JsonProperty(“restaurant_id”) val restaurantId: Long @JsonProperty(“restaurant_name”) val restaurantName: String } ɾEBUBDMBTT ɾ୯ʹσʔλߏ଄͚ͩΛද͢Ϋϥεʢ$ݴޠ΍4XJGUͰ͍͏ߏ଄ମʣΛ
 ɹγϯϓϧʹදݱͰ͖Δ ɾΠϯλϑΣʔεΛ࣮૷͢Δ͜ͱ΋Ͱ͖ΔͷͰදهΏΕͷܰݮʹ໾ཱͭ data class Restaurant(override val restaurantId: Long, 
 override val restaurantName: String, val station: Station?): IRestaurantInfo

Slide 32

Slide 32 text

޾ͤʹͳΕͦ͏ͳ,PUMJOͷػೳ ɾJGXIFOUSZ͸ࣜ ɾͭ·ΓฦΓ஋Λ͍࣋ͬͯΔ Restaurant jsonObj; try { jsonObj = ObjectMapper().readValue(result, Restaurant.class); } catch (JsonProcessingException e) { jsonObj = RestaurantModel.get(id); } val jsonObj: Restaurant = try { ObjectMapper().readValue(result, Restaurant::class.java) } catch (e: JsonProcessingException) { RestaurantModel.get(id) }

Slide 33

Slide 33 text

޾ͤʹͳΕͦ͏ͳ,PUMJOͷػೳ ɾ֦ுؔ਺ ɾطଘͷΫϥεʹࣗ෼ͷ޷͖ͳϝιουΛ଍͢͜ͱ͕Ͱ͖Δ fun Map.toQueryString(): String { return this.keys.map { key -> this[key]?.let { “$key=${this[key]}" } }.filterNotNull().joinToString("&") } // a=1&b=2 val queryStr = mapOf("a" to 1, "b" to 2).toQueryString()

Slide 34

Slide 34 text

·ͱΊ ɾ֎෦ΠϯλϑΣʔεΛ΋ͭ8FCΞϓϦέʔγϣϯ
 ɹʹ͸,PUMJOΛੋඇ͓͢͢Ί͍ͨ͠ ɾOVMM͔Ͳ͏͔ΛؚΊͯ֎෦ΠϯλϑΣʔεΛݫີʹఆٛͰ͖Δ ɾαʔόαΠυͰར༻࣮੷ͷ๛෋ͳ+BWBͷࢿ࢈Λ࢖͑Δ ɾಋೖ͢Δͷ͸ͱͯ΋؆୯ ɾ,PUMJOͱ͍͏ݴޠࣗମΫη͕গͳ͍͍ͯ͘ݴޠ