NAME

Yote::YapiServer::App::Base - Base class for Yapi applications

DESCRIPTION

Provides the foundation for building yapi server-side applications. Handles method authorization and capability tracking. Inherits serialization from Yote::YapiServer::BaseObj.

SUBCLASSING

package Yote::YapiServer::App::MyApp;
use base 'Yote::YapiServer::App::Base';

our %cols = (
    %Yote::YapiServer::App::Base::cols,
    my_field => 'VARCHAR(255)',
);

our %METHODS = (
    hello      => { public => 1 },
    getUserData => { auth => 1 },
    adminAction => { admin_only => 1 },
);

our %PUBLIC_VARS = (
    appVersion => '1.0',
);

sub hello {
    my ($self, $args, $session) = @_;
    return 1, "Hello, " . ($args->{name} // "World") . "!";
}