update api cards and backoffice

This commit is contained in:
Le Viet
2022-06-20 15:02:52 +07:00
parent 4ce4d0c3fd
commit 5e3dc0c755
13 changed files with 1140 additions and 591 deletions
+52
View File
@@ -0,0 +1,52 @@
const BkoUserController = require("../controllers").bkoUser;
module.exports = (app, url) => {
/**
* @swagger
* /v1/user/login:
* post:
* tags:
* - Users
* summary: Create a JSONPlaceholder user.
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* username:
* type: string
* description: The user's username.
* example: test
* password:
* type: string
* description: The user's password.
* example: password
* responses:
* 200:
* description: Login success
* content:
* application/json:
* schema:
* type: object
* properties:
* accessToken:
* type: string
* description: Message
* example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RAZmxvYXQuc2ciLCJpYXQiOjE2NDcwODIxNDIsImV4cCI6MTY0NzA4Mzk0Mn0.fMQYB4ielKPh21QcZFwOJSjlGNCAg8rkvEcKWctxdX8
* 400:
* description: Invalid
* content:
* application/json:
* schema:
* type: object
* properties:
* message:
* type: string
* description: Message
* example: Wrong username or password
*/
app.post(url + "admin/login", BkoUserController.login);
};
+3 -1
View File
@@ -1,6 +1,8 @@
const member = require("./member");
const admin = require("./admin");
const url = '/api/v1/';
module.exports = (app) => {
member(app, url)
member(app, url);
admin(app, url);
};
+53 -4
View File
@@ -292,8 +292,10 @@ module.exports = (app, url) => {
* app.post("refreshlinkemail");
* app.post("usertransportlist");
* app.post("usertransportprofile");
* app.post("getdashcarddata");
*/
*
* */
app.get(url + "user/getdashcarddata", auth, memberController.getDashCards);
/**
* @swagger
* /v1/user/loadsavedcards:
@@ -314,8 +316,55 @@ module.exports = (app, url) => {
* $ref: '#/components/schemas/Member'
*/
app.get(url + "user/loadsavedcards", auth, memberController.loadSavedCards);
/**
* @swagger
* /v1/user/savedashcard:
* post:
* tags:
* - Users
* summary: Create a JSONPlaceholder user.
* requestBody:
* required: true
* content:
* application/json:
* schema:
* type: object
* properties:
* email:
* type: string
* description: The user's username.
* example: test@float.sg
* mode:
* type: integer
* description: The reset mode
* example: 100
* responses:
* 200:
* description: Login success
* content:
* application/json:
* schema:
* type: object
* properties:
* accessToken:
* type: string
* description: Message
* example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RAZmxvYXQuc2ciLCJpYXQiOjE2NDcwODIxNDIsImV4cCI6MTY0NzA4Mzk0Mn0.fMQYB4ielKPh21QcZFwOJSjlGNCAg8rkvEcKWctxdX8
* 400:
* description: Invalid
* content:
* application/json:
* schema:
* type: object
* properties:
* message:
* type: string
* description: Message
* example: Wrong username or password
*/
app.post(url + "user/savedashcard", auth, memberController.saveDashCard);
/*
* app.post("savedashcard");
*
* app.post("saveuserbudget");
* app.post("resetpass");
* app.post("settingsarray");
@@ -346,9 +395,9 @@ module.exports = (app, url) => {
*/
app.get(url + "user/getslidecarddata", auth, memberController.getSlideCardData);
app.post(url + "user/subscribecard", auth, memberController.subscribeCard);
/**
* app.post("subscribedcarddata");
* app.post("subscribecard");
* app.post("savesurvey");
* app.post("pointsdetail");
* app.post("loadredeemabale");