/* Ċ Ġ* ĠCopyright Ġ 2 0 1 7 Ġtwitter . com / P ens ato Alex Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġnet . pens ato . ude my . be eper Ċ Ċ import Ġnet . pens ato . ude my . be eper . domain . Usuario Ċ import Ġnet . pens ato . ude my . be eper . domain . Be ep Ċ import Ġnet . pens ato . ude my . be eper . repository . Usuario Repository Ċ import Ġnet . pens ato . ude my . be eper . repository . Be ep Repository Ċ import Ġorg . springframework . boot . CommandLine Runner Ċ import Ġorg . springframework . boot . Spring Application Ċ import Ġorg . springframework . boot . autoconfigure . SpringBoot Application Ċ import Ġorg . springframework . boot . builder . Spring Application Builder Ċ import Ġorg . springframework . boot . web . support . SpringBoot Servlet Initializer Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . data . jpa . repository . config . Enable Jpa Repositories Ċ import Ġorg . springframework . security . crypto . bcrypt . BC rypt Password Encoder ĊĊĊ Ċ @ SpringBoot Application Ċ @ Enable Jpa Repositories ( base Packages Ġ= ĠarrayOf (" net . pens ato . ude my . be eper . repository ")) Ċ open Ġclass ĠApp Ġ: ĠSpring Boot Servlet Initializer () Ġ{ ĊĊ ĉ override Ġfun Ġconfigure ( application : ĠSpring Application Builder ): ĠSpring Application Builder Ġ{ Ċĉ ĉ return Ġapplication . sources ( App :: class . java ) Ċ ĉ } ĊĊ ĉ @ Bean Ċ ĉ open Ġfun Ġb Crypt Password Encoder (): ĠBC rypt Password Encoder Ġ{ Ċĉ ĉ return ĠBC rypt Password Encoder () Ċ ĉ } ĊĊ ĉ @ Bean Ċ ĉ open Ġfun Ġinit ( Ċĉĉ ĉ person Repository : ĠUsuario Repository , Ċĉĉ ĉ be ep Repository : ĠBe ep Repository ) Ġ= ĠCommandLine Runner Ġ{ ĊĊĉ ĉ val Ġresult Ġ= Ġperson Repository . findAll () Ċĉ ĉ if Ġ( result Ġ== Ġnull Ġ|| Ġresult . toList (). isEmpty ()) Ġ{ ĊĊĉĉ ĉ val Ġj ohn Ġ= Ġperson Repository . save ( Usuario ( username Ġ= Ġ" John ", Ġemail Ġ= Ġ" john @ example . com ")) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" My Ġfirst Ġbe ep ", Ġauthor Ġ= Ġj ohn )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Another Ġbe ep ", Ġauthor Ġ= Ġj ohn )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Last Ġbe ep ", Ġauthor Ġ= Ġj ohn )) ĊĊĉĉ ĉ val Ġm ary Ġ= Ġperson Repository . save ( Usuario ( username Ġ= Ġ" M ary ", Ġemail Ġ= Ġ" mary @ example . com ")) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Hello Ġeveryone ", Ġauthor Ġ= Ġm ary )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" How Ġare Ġyou Ġdoing ?", Ġauthor Ġ= Ġm ary )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Good Ġby e Ġeveryone ", Ġauthor Ġ= Ġm ary )) ĊĊĉĉ ĉ val Ġj ose ph Ġ= Ġperson Repository . save ( Usuario ( username Ġ= Ġ" J ose ph ", Ġemail Ġ= Ġ" j ose ph @ example . com ")) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Sun ny Ġday Ġhere !", Ġauthor Ġ= Ġj ose ph )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Time Ġto Ġsurf ", Ġauthor Ġ= Ġj ose ph )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" H ao les Ġare Ġwelcome Ġ( else where )", Ġauthor Ġ= Ġj ose ph )) ĊĊĉĉ ĉ val Ġcar ly Ġ= Ġperson Repository . save ( Usuario ( username Ġ= Ġ" Car ly ", Ġemail Ġ= Ġ" car ly @ example . com ")) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Today 's Ġrecipe : ĠLas ag na ", Ġauthor Ġ= Ġcar ly )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Feel ing Ġlike Ġit alian Ġtoday ", Ġauthor Ġ= Ġcar ly )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Who 's Ġin Ġfor Ġan Ġextra Ġp ound ?", Ġauthor Ġ= Ġcar ly )) ĊĊĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" One Ġmore Ġbe ep ", Ġauthor Ġ= Ġj ohn )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" This Ġis Ġthe Ġlast Ġbe ep ... Ġmaybe ", Ġauthor Ġ= Ġj ohn )) ĊĊĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Hello Ġagain Ġeveryone ", Ġauthor Ġ= Ġm ary )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" It ' a Ġbeautiful Ġsun nn y Ġday Ġoutside ", Ġauthor Ġ= Ġm ary )) ĊĊĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Sh ark ! ĠSh ark ! ĠSh ark !", Ġauthor Ġ= Ġj ose ph )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" See Ġyou Ġguys Ġback Ġin Ġthe Ġc rib ", Ġauthor Ġ= Ġj ose ph )) ĊĊĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" Time Ġfor Ġa Ġde sert ", Ġauthor Ġ= Ġcar ly )) Ċĉĉ ĉ be ep Repository . save ( Be ep ( text Ġ= Ġ" How Ġabout Ġa Ġt ir am is u ?", Ġauthor Ġ= Ġcar ly )) Ċĉ ĉ } ĊĊ ĉ } Ċ } Ċ Ċ fun Ġmain ( args : ĠArray < String >) Ġ{ Ċ ĉ Spring Application . run ( App :: class . java , Ġ* args ) Ċ } Ċ