Example for API

This commit is contained in:
2018-12-13 10:55:35 +09:00
parent cf4ad2b1cc
commit cce4b1f186
3 changed files with 23 additions and 6 deletions

View File

@ -5,19 +5,23 @@ namespace WebProjectFitness\API;
class APIUser extends API {
private $declaredFunctions = [
'insert' => [
'create' => [
'method' => 'POST',
'params' => [
'name' => [
'id' => [
'required' => true,
'type' => 'string'
]
]
],
]
];
public function __construct() {
parent::__construct( $this->declaredFunctions );
}
public function create( $data ) {
$this->returnJson( [ 'body' => 'truc', 'id' => $data[ 'id' ] ] );
}
}