mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-30 01:05:18 +02:00
Guillermo - data articles [skip ci]
This commit is contained in:
parent
e3683ba1a4
commit
8bc74384c2
@ -2,6 +2,29 @@
|
||||
use Respect\Validation\Validator as DataValidator;
|
||||
DataValidator::with('CustomValidations', true);
|
||||
|
||||
/**
|
||||
* @api {post} /article/add-topic Add a new topic.
|
||||
*
|
||||
* @apiName Add topic
|
||||
*
|
||||
* @apiGroup article
|
||||
*
|
||||
* @apiDescription This path adds a new topic.
|
||||
*
|
||||
* @apiPermission Staff level 2
|
||||
*
|
||||
* @apiParam {String} name Name of the new topic.
|
||||
*
|
||||
* @apiParam {string} icon Icon of the new topic.
|
||||
*
|
||||
* @apiParam {string} iconColor Icon's color of the new topic.
|
||||
*
|
||||
* @apiError {String} message
|
||||
*
|
||||
* @apiSuccess {Object} data
|
||||
*
|
||||
*/
|
||||
|
||||
class AddTopicController extends Controller {
|
||||
const PATH = '/add-topic';
|
||||
const METHOD = 'POST';
|
||||
|
@ -2,6 +2,31 @@
|
||||
use Respect\Validation\Validator as DataValidator;
|
||||
DataValidator::with('CustomValidations', true);
|
||||
|
||||
/**
|
||||
* @api {post} /article/add Add a article.
|
||||
*
|
||||
* @apiName Add
|
||||
*
|
||||
* @apiGroup article
|
||||
*
|
||||
* @apiDescription This path adds a new article.
|
||||
*
|
||||
* @apiPermission Staff level 2
|
||||
*
|
||||
* @apiParam {String} title Title of the new article.
|
||||
*
|
||||
* @apiParam {string} content Content of the new article.
|
||||
*
|
||||
* @apiParam {number} position Position of the new article.
|
||||
*
|
||||
* @apiParam {number} topicId Id of the articles's topic.
|
||||
*
|
||||
* @apiError {String} message
|
||||
*
|
||||
* @apiSuccess {Object} data
|
||||
*
|
||||
*/
|
||||
|
||||
class AddArticleController extends Controller {
|
||||
const PATH = '/add';
|
||||
const METHOD = 'POST';
|
||||
|
@ -2,6 +2,25 @@
|
||||
use Respect\Validation\Validator as DataValidator;
|
||||
DataValidator::with('CustomValidations', true);
|
||||
|
||||
/**
|
||||
* @api {post} /article/delete-topic Delete a topic.
|
||||
*
|
||||
* @apiName Delete topic
|
||||
*
|
||||
* @apiGroup article
|
||||
*
|
||||
* @apiDescription This path deletes a topic.
|
||||
*
|
||||
* @apiPermission Staff level 2
|
||||
*
|
||||
* @apiParam {number} topicId Id of the topic.
|
||||
*
|
||||
* @apiError {String} message
|
||||
*
|
||||
* @apiSuccess {Object} data
|
||||
*
|
||||
*/
|
||||
|
||||
class DeleteTopicController extends Controller {
|
||||
const PATH = '/delete-topic';
|
||||
const METHOD = 'POST';
|
||||
|
@ -2,6 +2,25 @@
|
||||
use Respect\Validation\Validator as DataValidator;
|
||||
DataValidator::with('CustomValidations', true);
|
||||
|
||||
/**
|
||||
* @api {post} /article/delete Delete a article.
|
||||
*
|
||||
* @apiName Delete
|
||||
*
|
||||
* @apiGroup article
|
||||
*
|
||||
* @apiDescription This path deletes a article.
|
||||
*
|
||||
* @apiPermission Staff level 2
|
||||
*
|
||||
* @apiParam {number} articleId Id of the article.
|
||||
*
|
||||
* @apiError {String} message
|
||||
*
|
||||
* @apiSuccess {Object} data
|
||||
*
|
||||
*/
|
||||
|
||||
class DeleteArticleController extends Controller {
|
||||
const PATH = '/delete';
|
||||
const METHOD = 'POST';
|
||||
|
@ -2,6 +2,31 @@
|
||||
use Respect\Validation\Validator as DataValidator;
|
||||
DataValidator::with('CustomValidations', true);
|
||||
|
||||
/**
|
||||
* @api {post} /article/edit-topic Edit a topic.
|
||||
*
|
||||
* @apiName Edit topic
|
||||
*
|
||||
* @apiGroup article
|
||||
*
|
||||
* @apiDescription This path edits a topic.
|
||||
*
|
||||
* @apiPermission Staff level 2
|
||||
*
|
||||
* @apiParam {number} topicId Id of the topic.
|
||||
*
|
||||
* @apiParam {String} name The new name of the topic.
|
||||
*
|
||||
* @apiParam {string} icon The new icon of the topic.
|
||||
*
|
||||
* @apiParam {string} iconColor The new Icon's color of the topic.
|
||||
*
|
||||
* @apiError {String} message
|
||||
*
|
||||
* @apiSuccess {Object} data
|
||||
*
|
||||
*/
|
||||
|
||||
class EditTopicController extends Controller {
|
||||
const PATH = '/edit-topic';
|
||||
const METHOD = 'POST';
|
||||
|
@ -2,6 +2,33 @@
|
||||
use Respect\Validation\Validator as DataValidator;
|
||||
DataValidator::with('CustomValidations', true);
|
||||
|
||||
/**
|
||||
* @api {post} /article/edit Edit a article.
|
||||
*
|
||||
* @apiName Edit a article
|
||||
*
|
||||
* @apiGroup article
|
||||
*
|
||||
* @apiDescription This path edits a article.
|
||||
*
|
||||
* @apiPermission Staff level 2
|
||||
*
|
||||
* @apiParam {number} articleId Id of the article.
|
||||
*
|
||||
* @apiParam {number} topicId Id of the topic of the article.
|
||||
*
|
||||
* @apiParam {string} content The new content of the article.
|
||||
*
|
||||
* @apiParam {string} title The new title of the article.
|
||||
*
|
||||
* @apiParam {number} position The new position of the article.
|
||||
*
|
||||
* @apiError {String} message
|
||||
*
|
||||
* @apiSuccess {Object} data
|
||||
*
|
||||
*/
|
||||
|
||||
class EditArticleController extends Controller {
|
||||
const PATH = '/edit';
|
||||
const METHOD = 'POST';
|
||||
|
@ -2,6 +2,21 @@
|
||||
use Respect\Validation\Validator as DataValidator;
|
||||
DataValidator::with('CustomValidations', true);
|
||||
|
||||
/**
|
||||
* @api {post} /article/get-all Get all articles.
|
||||
*
|
||||
* @apiName Get all
|
||||
*
|
||||
* @apiGroup article
|
||||
*
|
||||
* @apiDescription This path give back all the articles.
|
||||
*
|
||||
* @apiPermission any
|
||||
*
|
||||
* @apiSuccess {Object} data
|
||||
*
|
||||
*/
|
||||
|
||||
class GetAllArticlesController extends Controller {
|
||||
const PATH = '/get-all';
|
||||
const METHOD = 'POST';
|
||||
|
Loading…
x
Reference in New Issue
Block a user