流れるようなインターフェース
ってこんなの?
よく分かんないです><
import play.api.db.DB import anorm._ import anorm.SqlParser._ import play.api.Play.current import java.math.BigDecimal class Calc { var totalAmount: Long = _ def sum(retail_code: String, seat_id: String, payment_flag: Boolean): this.type = { DB.withConnection(implicit conn => { try { // SQL ) totalAmount = amount.longValue() this } catch { case e: RuntimeException => { this } } }) } def withCoupon(couponId: String): this.type = { val discount = findCoupon(couponId) totalAmount = totalAmount - discount this } private def findCoupon(couponId: String): Long = { DB.withConnection(implicit conn => { val amount = //SQL amount.toLong }) } def calc: Long = { totalAmount } }
- アーティスト: 高垣彩陽
- 出版社/メーカー: ミュージックレイン
- 発売日: 2013/12/11
- メディア: CD
- この商品を含むブログ (2件) を見る