scala - change data type sequence String to String -
my dal :
def login(username: string,pass :string) = sql"""select ad1sys.pkg_stc_login.user_login ('#$username','#$pass')from dual""".as[string] def getempname(username: string,empname :string) = sql"""select ad1sys.pkg_stc_login.get_empl_name ('#$username','#$empname') dual""".as[(string)]
my service :
def login(username:string,pass:string): future[seq[(string)]] = { db.run(dallogin.login(username, pass)) } def getempname(username:string,empname:string): future[seq[(string)]] = { db.run(dallogin.getempname(username, empname)) }
my controller :
def login = action.async(bodyparsers.parse.json) { request => val username = (request.body \ "username").as[string] val pass = (request.body \ "pass").as[string] servicelogin.login(username, pass).map { data => servicelogin.getempname(username,data).map(result => ok(json.tojson(result.map( p => modelkodecabang(p) )) ))} }
the result service.login seq(string) "data", can't use seq(string) parameter servicelogin.getempname(username,data).. how convert seq(string) string ??
Comments
Post a Comment