« blib/lib/auto/share/dist/Cmd-Dwarf/app/lib/App/Controller/Cli/LoadSchema.pm
↑ Summary
blib/lib/auto/share/dist/Cmd-Dwarf/app/lib/Dwarf/Message.pm »
| 1 | package App::Controller::Api::ShowSession; | ||
| 2 | use Dwarf::Pragma; | ||
| 3 | use parent 'App::Controller::ApiBase'; | ||
| 4 | use Dwarf::DSL; | ||
| 5 | use Dwarf::Util qw/decode_utf8_recursively/; | ||
| 6 | use App::Type; | ||
| 7 | use Class::Method::Modifiers; | ||
| 8 | |||
| 9 | after will_dispatch => sub { | ||
| 10 | }; | ||
| 11 | |||
| 12 | after did_dispatch => sub { | ||
| 13 | self->validate_response( | ||
| 14 | id => 'Str', | ||
| 15 | session => 'HashRef', | ||
| 16 | cookie => 'HashRef', | ||
| 17 | ); | ||
| 18 | }; | ||
| 19 | |||
| 20 | sub get { | ||
| 21 | # 本番では動かないように | ||
| 22 | not_found if is_production; | ||
| 23 | |||
| 24 | return { | ||
| 25 | id => session->session_id, | ||
| 26 | session => decode_utf8_recursively(session->as_hashref), | ||
| 27 | cookie => decode_utf8_recursively(req->cookies) | ||
| 28 | }; | ||
| 29 | } | ||
| 30 | |||
| 31 | 1; |