Experiment with logging inside method
authorkenstir <kenstir@gmail.com>
Mon, 25 May 2020 15:59:45 +0000 (11:59 -0400)
committerkenstir <kenstir@gmail.com>
Mon, 25 May 2020 15:59:45 +0000 (11:59 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Selfcheck.pm

index 20a9943..b640ff9 100644 (file)
@@ -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;