...
 
Commits (31)
<?php
/**
* Api Module
*
* @author Tibor Katelbach <oceatoon@mail.com>
* @version 0.0.3
*
*/
class ApiModule extends CWebModule
{
private $_version = "v0.1.0";
private $_versionDate = "20/09/2019";
private $_keywords = "module,opensource,CO,communecter,api";
private $_description = "oPEN Data an open systems";
private $_pageTitle = "CO api";
public function getVersion(){return $this->_version;}
public function getVersionDate(){return $this->_versionDate;}
public function getKeywords(){return $this->_keywords;}
public function getDescription(){return $this->_description;}
public function getPageTitle(){return $this->_pageTitle;}
public function init()
{
// this method is called when the module is being created
......@@ -25,17 +34,32 @@ class ApiModule extends CWebModule
Yii::app()->language = (isset(Yii::app()->session["lang"])) ? Yii::app()->session["lang"] : 'fr';
// import the module-level models and components
Yii::app()->params["module"] = array(
"name" => self::getPageTitle(),
"parent" => "co2",
"costumId"=>"",
"overwrite" => array(
"views" => array(),
"assets" => array(),
"controllers" => array(),
));
// import the module-level models and components
$this->setImport(array(
'citizenToolKit.models.*',
'eco.models.*',
'places.models.*',
'map.models.*',
'news.models.*',
'dda.models.*',
'interop.models.*',
'survey.models.*',
'costum.models.*',
'places.models.*',
'eco.models.*',
Yii::app()->params["module"]["parent"].'.models.*',
Yii::app()->params["module"]["parent"].'.components.*',
$this->id.'.models.*',
$this->id.'.components.*',
$this->id.'.messages.*',
$this->id.'.messages.*'
));
}
......@@ -51,7 +75,11 @@ class ApiModule extends CWebModule
return false;
}
private $_assetsUrl;
public function getParentAssetsUrl()
{
return ( @Yii::app()->params["module"]["parent"] ) ? Yii::app()->getModule( Yii::app()->params["module"]["parent"] )->getAssetsUrl() : self::getAssetsUrl();
}
public function getAssetsUrl()
{
if ($this->_assetsUrl === null)
......
{
"openapi": "3.0.1",
"info": {
"title": "API CoAuth",
"description": "jwt auth",
"termsOfService": "",
"contact": {
"email": "laurentd@netc.fr"
},
"version": "0.1"
},
"servers": [
{
"url": "http://192.168.0.15:2323"
}
],
"tags": [
{
"name": "chat",
"description": "module"
}
],
"paths": {
"/": {
"post": {
"summary": "",
"description": "<h1>Get Token</h1>",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "params",
"properties": {
"action": {
"type": "string",
"description": "what"
},
"name": {
"type": "string",
"description": "slug"
},
"email": {
"type": "string",
"description": "email"
},
"token": {
"type": "string",
"description": "token"
}
}
}
}
}
},
"responses": {
"200": {
"description": "A token",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
}
},
"components": {}
}
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755