<?php
defined('BASEPATH') or exit('No direct script access allowed');
require(APPPATH . 'libraries/REST_Controller.php');


use Restserver\Libraries\REST_Controller;

class ApiController extends REST_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->library('Authorization_Token'); 
    }

    // public function result_get()
    // {
    //     $num = SUPPORT_NUM;
    //     return $this->response(array(
    //         'status' => 'Success',
    //         'name' => 'Fastinfo',
    //         'number' => $num
    //     ), parent::HTTP_OK);
    // }

    public function testToken_post(){
        $token_data['uid'] = 4; 
        $token_data['username'] = 'santo108';

        $tokenData = $this->authorization_token->generateToken($token_data);
        $final = array();
        $final['access_token'] = $tokenData;
        $final['status'] = true;
        $final['uid'] = 4;
        $final['message'] = 'Thank you for registering your new account!';
        $final['note'] = 'You have successfully register. Please check your email inbox to confirm your email address.';

        $this->response($final, REST_Controller::HTTP_OK); 
    }

}
