package Ġcom . github . coupon . service Ċ Ċ import Ġcom . github . coupon . dao . Se ck ill Promotion Dao Ċ import Ġcom . github . coupon . entity . Se ck ill Promotion Ċ import Ġkotlinx . coroutines . flow . Flow Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . stereotype . Service Ċ Ċ /** Ċ * Ċ * Ġ@ author ĠAn do chi wa Ċ * Ġ@ email Ġa 1 0 6 6 0 7 9 4 6 9 @ gmail . com Ċ * Ġ@ date Ġ 2 0 2 1 - 0 9 - 2 7 Ġ 0 4 : 4 1 : 2 1 Ċ */ Ċ @ Service Ċ class ĠSe ck ill Promotion Service Ġ{ ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar Ġse ck ill Promotion Dao : ĠSe ck ill Promotion Dao ĊĊĠĠĠ Ġsuspend Ġfun Ġget ById ( id : ĠLong ): ĠSe ck ill Promotion ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġse ck ill Promotion Dao . findById ( id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġsave OrUpdate ( se ck ill Promotion : ĠSe ck ill Promotion ): ĠSe ck ill Promotion Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġse ck ill Promotion Dao . save ( se ck ill Promotion ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġdelete ById ( id : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġse ck ill Promotion Dao . delete ById ( id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠgetAll (): ĠFlow < Se ck ill Promotion > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġse ck ill Promotion Dao . findAll () ĊĠĠĠ Ġ} Ċ } ĊĊ