package Ġcom . school . system . grading . service Ċ Ċ import Ġcom . school . system . grading . entity . FIELD _ MISSING Ċ import Ġcom . school . system . grading . entity . Response Ċ import Ġcom . school . system . grading . entity . user class . request . User Class Create Ċ import Ġcom . school . system . grading . entity . user class . response . User Class Response Ċ import Ġcom . school . system . grading . repository . User Class Repository Ċ import Ġorg . springframework . http . Response Entity Ċ import Ġorg . springframework . stereotype . Service Ċ Ċ /** Ċ Ġ* Ġ@ project Ġgrad ing Ċ Ġ* Ġ@ author ĠMu ham mad ĠS aad Ċ Ġ* ĠDate : Ġ 6 / 7 / 2 1 Ċ Ġ**/ Ċ Ċ @ Service Ċ class ĠUser Class Service ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġuser Class Repository : ĠUser Class Repository Ċ ) Ġ{ ĊĊĠĠĠ Ġsuspend Ġfun ĠgetAll Classes () Ġ= Ġuser Class Repository . getAll Classes () ĊĊĠĠĠ Ġsuspend Ġfun Ġget One Class ( id : ĠInt ) Ġ= Ġuser Class Repository . getOne Class ( id ) ĊĊĠĠĠ Ġsuspend Ġfun Ġcreate Class ( user Class Create : ĠUser Class Create ): ĠResponseEntity < Response < User Class Response >> Ġ{ ĊĠĠĠĠĠĠĠ Ġif ( user Class Create . className . isNull OrEmpty () Ġ|| Ġuser Class Create . id Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠResponseEntity . ok ( Response ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstatus Ġ= ĠFIELD _ MISSING , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmessage Ġ= Ġ" Fields Ġare Ġmissing ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġuser Class Repository . createClass ( user Class Create ) ĊĠĠĠ Ġ} Ċ }