From f4213e8a5201338f663f4c69dc21d19d5e044567 Mon Sep 17 00:00:00 2001 From: kenstir Date: Mon, 25 May 2020 11:59:45 -0400 Subject: [PATCH] Experiment with logging inside method --- .../perlmods/lib/OpenILS/Application/Selfcheck.pm | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm index 20a9943b69..b640ff974a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm @@ -20,6 +20,7 @@ use DateTime::Format::ISO8601; my $date_parser = DateTime::Format::ISO8601->new; use OpenSRF::Utils::Logger qw/$logger/; +use Data::Dumper; sub child_init { my $self = shift; @@ -32,29 +33,42 @@ sub exists { __PACKAGE__->register_method( method => "exists", api_name => "open-ils.selfcheck.exists", - api_level => 1, argc => 0, signature => { desc => 'Check if selfcheck service exists', return => { - desc => 'True' + desc => 'True if service exists', type => 'bool' } } ); sub xyzzy { - my ($self, $conn, $authtoken) = @_; + my ($self, $conn, $authtoken, $id) = @_; + + my $e = new_editor(xact => 1, authtoken => $authtoken); + return $e->die_event unless $e->checkauth; + + my $org = $e->requestor->ws_ou; + $logger->info("org:$org"); + $logger->info("e:".Dumper($e)); #return new OpenILS::Event("SELFCHECK_NOT_ALLOWED") unless ($U->is_true( # $U->ou_ancestor_setting_value($org, 'circ.selfcheck') #)); - return 'xyzzy'; + return $org; } __PACKAGE__->register_method( method => "xyzzy", - api_name => "open-ils.selfcheck.xyzzy" + api_name => "open-ils.selfcheck.xyzzy", + signature => { + params => [ + {type => 'string', desc => 'Authentication token'}, + {type => 'number', desc => 'ID'}, + ], + return => { desc => 'Test junk' } + } ); 1; -- 2.11.0