This commit is contained in:
mynah
2020-01-15 23:42:58 -06:00
parent 567e991278
commit 252ec865b3
33 changed files with 1556 additions and 238 deletions

View File

@@ -3,6 +3,7 @@ use Mojo::Base 'Mojolicious';
use Dojo::Conf;
use Dojo::Model::Vuelo;
use Dojo::Model::Users;
use Dojo::Model::Vdgproc;
# This method will run once at server start
sub startup {
@@ -13,25 +14,35 @@ use Dojo::Model::Users;
$self->helper(dbv => sub { state $dbv = Dojo::Model::Vuelo->new });
$self->helper(dbg => sub { state $dbg = Dojo::Model::Users->new });
$self->defaults({%Dojo::Conf::def});
$self->helper(mproc => sub { state $mproc = Dojo::Model::Vdgproc->new });
$self->defaults({%Dojo::Conf::def});
my $r = $self->routes; #router
# user ========================================================================
# de la pagina ===============================================================
$r->any('/')->to('home#home_');
$r->any('/home')->to('home#home');
$r->any('/cal')->to('home#cal');
$r->any('/event/:id'=> [id => qr/\d+/])->to('home#event');
$r->any('/pod')->to('home#podcast');
$r->any('/store')->to('home#store');
$r->any('/tv')->to('home#tv');
$r->any('/contact')->to('home#contact');
$r->any('/contact2')->to('home#contact2');
$r->any('/pang')->to('home#pang');
# =============================================================================
# de la tienda ================================================================
$r->any('/cal')->to('proc#cal');
$r->any('/event/:id'=> [id => qr/\d+/])->to('proc#event');
$r->any('/spay/:class/:id' => [class => qr/\d+/, id => qr/\d+/])->to('proc#spay');
$r->any('/spay/intentCreate')->to('proc#intentCreate');
$r->any('/spay/intentConfirm')->to('proc#intentConfirm');
# =============================================================================
# por matar ===================================================================
$r->any('/xpay')->to('misc#stripe');
$r->any('/storep')->to('home#storep');
$r->any('/storep/:id' => [id => qr/\d+/])->to('home#storep');
# =============================================================================
# candy =======================================================================
$r->any('/json/candy/:command')->to('data#candy');
$r->any('/candy')->to('home#candy');
@@ -41,26 +52,25 @@ use Dojo::Model::Users;
$r->any('/json/*dreq')->to('data#simple');
# =============================================================================
# register user ===============================================================
# usuarios y accesos ==========================================================
$r->any('/reg')->to('users#reg');
# =============================================================================
# login guest =================================================================
# login guest ======
$r->any('/login')->to('users#login');
$r->any('/logout')->to('users#logout');
my $logged_in = $r->under('/')->to('users#is_logged');
$logged_in->get('/radio')->to('home#radio');
# =============================================================================
# ===================
# login user grulla ===========================================================
# login user grulla =
# common grulla user
my $user = $r->under('/')->to('users#is_grulla');
$user->any('/ccast')->to('home#bcast');
# personal
my $guest = $r->under('/')->to('users#is_grulla_tmp');
$guest->any('/bcast')->to('home#bcast');
# =============================================================================
# ===================
# admin =======================================================================
my $admin = $r->under('/admin')->to('users#is_admin');
@@ -74,6 +84,8 @@ use Dojo::Model::Users;
$admin->any('json/:dreq/:id')->to('home#admin_json');
# =============================================================================
# a not foud ==================================================================
$r->any('/*whatever' => {whatever => ''} => sub {
my $c = shift;