update swagger done
This commit is contained in:
@ -24,7 +24,7 @@
|
|||||||
"port": "5432",
|
"port": "5432",
|
||||||
"username": "postgres",
|
"username": "postgres",
|
||||||
"password": "123",
|
"password": "123",
|
||||||
"database": "bri_erp"
|
"database": "bri-erp"
|
||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"refresh_token_lifetime_day": 30,
|
"refresh_token_lifetime_day": 30,
|
||||||
|
|||||||
@ -19,15 +19,17 @@ export class AuthController {
|
|||||||
static async login(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async login(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['Auth']
|
#swagger.tags = ['Auth']
|
||||||
#swagger.parameters['body'] = {
|
#swagger.requestBody = {
|
||||||
in: 'body',
|
|
||||||
description: 'Login data',
|
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
username: "admin",
|
"application/json": {
|
||||||
password: "123456"
|
schema: {
|
||||||
|
$ref: "#/components/schemas/login"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
@ -35,9 +37,6 @@ export class AuthController {
|
|||||||
password: Joi.string().alphanum().min(6).required().label('Password')
|
password: Joi.string().alphanum().min(6).required().label('Password')
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('req.body', req.body)
|
|
||||||
console.log('req', req)
|
|
||||||
|
|
||||||
const param: User = await schema.validateAsync(req.body);
|
const param: User = await schema.validateAsync(req.body);
|
||||||
|
|
||||||
const userRepository = OrmHelper.DB.getRepository(User);
|
const userRepository = OrmHelper.DB.getRepository(User);
|
||||||
|
|||||||
@ -44,7 +44,9 @@ export class UserController {
|
|||||||
#swagger.parameters['order_direction'] = {
|
#swagger.parameters['order_direction'] = {
|
||||||
in: 'query',
|
in: 'query',
|
||||||
required: true,
|
required: true,
|
||||||
enum: [ "ASC", "DESC"]
|
schema: {
|
||||||
|
'@enum': ['ASC', 'DESC']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -103,23 +105,21 @@ export class UserController {
|
|||||||
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User']
|
#swagger.tags = ['User']
|
||||||
#swagger.security = [{
|
#swagger.security = [{
|
||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}]
|
}]
|
||||||
#swagger.parameters['body'] = {
|
|
||||||
in: 'body',
|
#swagger.requestBody = {
|
||||||
description: 'User data',
|
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
email: "admin@gmail.com",
|
"application/json": {
|
||||||
username: "admin",
|
schema: {
|
||||||
password: "123456",
|
$ref: "#/components/schemas/user"
|
||||||
retype_password: "123456",
|
}
|
||||||
name: "Administrator",
|
}
|
||||||
id_role: "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8",
|
|
||||||
status:"Y"
|
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
@ -158,7 +158,7 @@ export class UserController {
|
|||||||
static async updateProfile(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async updateProfile(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User']
|
#swagger.tags = ['User']
|
||||||
#swagger.security = [{
|
#swagger.security = [{
|
||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}]
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
@ -168,16 +168,17 @@ export class UserController {
|
|||||||
type: 'string'
|
type: 'string'
|
||||||
}
|
}
|
||||||
|
|
||||||
#swagger.parameters['body'] = {
|
#swagger.requestBody = {
|
||||||
in: 'body',
|
|
||||||
description: 'User data',
|
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
email: "admin@gmail.com",
|
"application/json": {
|
||||||
username: "admin",
|
schema: {
|
||||||
name: "Administrator"
|
$ref: "#/components/schemas/user_profile"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
@ -217,7 +218,7 @@ export class UserController {
|
|||||||
static async updatePassword(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async updatePassword(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User']
|
#swagger.tags = ['User']
|
||||||
#swagger.security = [{
|
#swagger.security = [{
|
||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}]
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
@ -227,15 +228,17 @@ export class UserController {
|
|||||||
type: 'string'
|
type: 'string'
|
||||||
}
|
}
|
||||||
|
|
||||||
#swagger.parameters['body'] = {
|
#swagger.requestBody = {
|
||||||
in: 'body',
|
|
||||||
description: 'User data',
|
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
password: "123456",
|
"application/json": {
|
||||||
retype_password: "123456",
|
schema: {
|
||||||
|
$ref: "#/components/schemas/user_password"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
@ -275,7 +278,7 @@ export class UserController {
|
|||||||
static async update(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async update(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User']
|
#swagger.tags = ['User']
|
||||||
#swagger.security = [{
|
#swagger.security = [{
|
||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}]
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
@ -285,20 +288,17 @@ export class UserController {
|
|||||||
type: 'string'
|
type: 'string'
|
||||||
}
|
}
|
||||||
|
|
||||||
#swagger.parameters['body'] = {
|
#swagger.requestBody = {
|
||||||
in: 'body',
|
|
||||||
description: 'User data',
|
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
email: "admin@gmail.com",
|
"application/json": {
|
||||||
username: "admin",
|
schema: {
|
||||||
password: "123456",
|
$ref: "#/components/schemas/user"
|
||||||
retype_password: "123456",
|
}
|
||||||
name: "Administrator",
|
}
|
||||||
id_role: "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8",
|
|
||||||
status:"Y"
|
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
@ -349,7 +349,7 @@ export class UserController {
|
|||||||
static async delete(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async delete(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User']
|
#swagger.tags = ['User']
|
||||||
#swagger.security = [{
|
#swagger.security = [{
|
||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}]
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
@ -386,7 +386,7 @@ export class UserController {
|
|||||||
static async restore(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async restore(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User']
|
#swagger.tags = ['User']
|
||||||
#swagger.security = [{
|
#swagger.security = [{
|
||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}]
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
|
|||||||
@ -16,6 +16,9 @@ export class UserActivityController {
|
|||||||
static async list(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async list(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Activity']
|
#swagger.tags = ['User Activity']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
#swagger.parameters['filter'] = {
|
#swagger.parameters['filter'] = {
|
||||||
in: 'query',
|
in: 'query',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
@ -102,20 +105,21 @@ export class UserActivityController {
|
|||||||
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Activity']
|
#swagger.tags = ['User Activity']
|
||||||
#swagger.parameters['body'] = {
|
#swagger.security = [{
|
||||||
in: 'body',
|
"bearerAuth": []
|
||||||
description: 'User Activity data',
|
}]
|
||||||
|
|
||||||
|
#swagger.requestBody = {
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
id_user: "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8",
|
"application/json": {
|
||||||
refresh_token: "1a1221b6-78a0-4b3b-bf5c-fa0af5f69be8",
|
schema: {
|
||||||
module: "dashboard",
|
$ref: "#/components/schemas/user_activity"
|
||||||
description: "Main Dashboard",
|
}
|
||||||
action: "V",
|
}
|
||||||
url: "https://bri-dev.shiblysolution.id/",
|
|
||||||
data_body:"{\"from\":\"2024-11-01\",\"to\":\"2024-11-26\"}"
|
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { Request, Response, NextFunction, Application } from "express";
|
import { Response, NextFunction, Application } from "express";
|
||||||
|
import { Request } from "express-jwt";
|
||||||
import { ReturnHelper } from "../helpers/express/return";
|
import { ReturnHelper } from "../helpers/express/return";
|
||||||
import { OrmHelper } from "../helpers/orm";
|
import { OrmHelper } from "../helpers/orm";
|
||||||
import Joi from "joi";
|
import Joi from "joi";
|
||||||
@ -14,6 +15,9 @@ export class UserRefreshTokenController {
|
|||||||
static async list(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async list(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Refresh Token']
|
#swagger.tags = ['User Refresh Token']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
#swagger.parameters['filter'] = {
|
#swagger.parameters['filter'] = {
|
||||||
in: 'query',
|
in: 'query',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
@ -59,11 +63,14 @@ export class UserRefreshTokenController {
|
|||||||
let whereVal: any = {};
|
let whereVal: any = {};
|
||||||
|
|
||||||
if (param.filter) {
|
if (param.filter) {
|
||||||
whereAttr = 'name like :filter_like or username like :filter_like or email = :filter ';
|
whereAttr = '(name like :filter_like or username like :filter_like or email = :filter) and ';
|
||||||
whereVal['filter'] = param.filter
|
whereVal['filter'] = param.filter
|
||||||
whereVal['filter_like'] = '%' + param.filter + '%'
|
whereVal['filter_like'] = '%' + param.filter + '%'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
whereAttr += 'id_user = :id_user'
|
||||||
|
whereVal['id_user'] = req.auth.data.id;
|
||||||
|
|
||||||
const res_count = repo.createQueryBuilder()
|
const res_count = repo.createQueryBuilder()
|
||||||
.where(whereAttr, whereVal);
|
.where(whereAttr, whereVal);
|
||||||
const res_list = repo.createQueryBuilder()
|
const res_list = repo.createQueryBuilder()
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { Paging } from "../types/paging";
|
|||||||
import CommonHelper from "../helpers/common";
|
import CommonHelper from "../helpers/common";
|
||||||
import { Status } from "../types/status";
|
import { Status } from "../types/status";
|
||||||
import { UserRole } from "../entity/users_roles";
|
import { UserRole } from "../entity/users_roles";
|
||||||
|
import { RoleList } from "../types/role";
|
||||||
|
|
||||||
const log: Logger<ILogObj> = new Logger({ name: '[UserRoleController]', type: 'pretty' });
|
const log: Logger<ILogObj> = new Logger({ name: '[UserRoleController]', type: 'pretty' });
|
||||||
|
|
||||||
@ -15,6 +16,9 @@ export class UserRoleController {
|
|||||||
static async list(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async list(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Roles']
|
#swagger.tags = ['User Roles']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
#swagger.parameters['filter'] = {
|
#swagger.parameters['filter'] = {
|
||||||
in: 'query',
|
in: 'query',
|
||||||
type: 'string'
|
type: 'string'
|
||||||
@ -98,19 +102,46 @@ export class UserRoleController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async role(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
|
/*
|
||||||
|
#swagger.tags = ['User Roles']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
|
*/
|
||||||
|
|
||||||
|
try {
|
||||||
|
const current_page = 1;
|
||||||
|
const total_count_data = CommonHelper.countObject(RoleList);
|
||||||
|
const list_data = CommonHelper.objectFlip(RoleList);
|
||||||
|
const count_data = CommonHelper.countObject(RoleList);
|
||||||
|
|
||||||
|
return ReturnHelper.successResponselist(res, 200, Language.lang.success_view, count_data, current_page, total_count_data, list_data);
|
||||||
|
} catch (e: unknown) {
|
||||||
|
log.error(e);
|
||||||
|
const err = e as Error;
|
||||||
|
|
||||||
|
return ReturnHelper.errorResponse(res, 400, 401, Language.lang.failed_view, err.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Roles']
|
#swagger.tags = ['User Roles']
|
||||||
#swagger.parameters['body'] = {
|
#swagger.security = [{
|
||||||
in: 'body',
|
"bearerAuth": []
|
||||||
description: 'User role data',
|
}]
|
||||||
|
#swagger.requestBody = {
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
name: "Administrator",
|
"application/json": {
|
||||||
roles: ["dashboard"],
|
schema: {
|
||||||
status:"Y"
|
$ref: "#/components/schemas/user_role"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
@ -140,6 +171,9 @@ export class UserRoleController {
|
|||||||
static async update(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async update(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Roles']
|
#swagger.tags = ['User Roles']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
in: 'path',
|
in: 'path',
|
||||||
description: 'User role ID.',
|
description: 'User role ID.',
|
||||||
@ -147,16 +181,17 @@ export class UserRoleController {
|
|||||||
type: 'string'
|
type: 'string'
|
||||||
}
|
}
|
||||||
|
|
||||||
#swagger.parameters['body'] = {
|
#swagger.requestBody = {
|
||||||
in: 'body',
|
|
||||||
description: 'User role data',
|
|
||||||
required: true,
|
required: true,
|
||||||
schema: {
|
content: {
|
||||||
name: "Administrator",
|
"application/json": {
|
||||||
roles: ["dashboard"],
|
schema: {
|
||||||
status:"Y"
|
$ref: "#/components/schemas/user_role"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const schema = Joi.object().keys({
|
const schema = Joi.object().keys({
|
||||||
@ -196,6 +231,9 @@ export class UserRoleController {
|
|||||||
static async delete(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async delete(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Roles']
|
#swagger.tags = ['User Roles']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
in: 'path',
|
in: 'path',
|
||||||
description: 'User role ID.',
|
description: 'User role ID.',
|
||||||
@ -230,6 +268,9 @@ export class UserRoleController {
|
|||||||
static async restore(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
static async restore(req: Request, res: Response, next: NextFunction): Promise<Response> {
|
||||||
/*
|
/*
|
||||||
#swagger.tags = ['User Roles']
|
#swagger.tags = ['User Roles']
|
||||||
|
#swagger.security = [{
|
||||||
|
"bearerAuth": []
|
||||||
|
}]
|
||||||
#swagger.parameters['id'] = {
|
#swagger.parameters['id'] = {
|
||||||
in: 'path',
|
in: 'path',
|
||||||
description: 'User role ID.',
|
description: 'User role ID.',
|
||||||
|
|||||||
@ -46,6 +46,16 @@ export default class CommonHelper {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static objectFlip(obj: any): any {
|
||||||
|
const ret = {};
|
||||||
|
|
||||||
|
Object.keys(obj).forEach(key => {
|
||||||
|
ret[obj[key]] = key;
|
||||||
|
});
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static countObject(obj: any): number {
|
static countObject(obj: any): number {
|
||||||
let c = 0;
|
let c = 0;
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@ export class RoutePrivate {
|
|||||||
app.put('/api/user/restore/:id', UserController.restore)
|
app.put('/api/user/restore/:id', UserController.restore)
|
||||||
|
|
||||||
app.get('/api/user_role/list', UserRoleController.list)
|
app.get('/api/user_role/list', UserRoleController.list)
|
||||||
|
app.get('/api/user_role/role', UserRoleController.role)
|
||||||
app.post('/api/user_role/create', UserRoleController.create)
|
app.post('/api/user_role/create', UserRoleController.create)
|
||||||
app.put('/api/user_role/update/:id', UserRoleController.update)
|
app.put('/api/user_role/update/:id', UserRoleController.update)
|
||||||
app.delete('/api/user_role/delete/:id', UserRoleController.delete)
|
app.delete('/api/user_role/delete/:id', UserRoleController.delete)
|
||||||
|
|||||||
@ -9,6 +9,47 @@ const doc = {
|
|||||||
},
|
},
|
||||||
host: config.get('server.host_swagger') + ':' + config.get('server.port'),
|
host: config.get('server.host_swagger') + ':' + config.get('server.port'),
|
||||||
components: {
|
components: {
|
||||||
|
schemas: {
|
||||||
|
login: {
|
||||||
|
$username: "admin",
|
||||||
|
$password: "123456"
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
$email: "admin@gmail.com",
|
||||||
|
$username: "admin",
|
||||||
|
$password: "123456",
|
||||||
|
$retype_password: "123456",
|
||||||
|
$name: "Administrator",
|
||||||
|
$id_role: "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8",
|
||||||
|
$status: "Y"
|
||||||
|
},
|
||||||
|
user_profile: {
|
||||||
|
$email: "admin@gmail.com",
|
||||||
|
$username: "admin",
|
||||||
|
$name: "Administrator"
|
||||||
|
},
|
||||||
|
user_password: {
|
||||||
|
$password: "123456",
|
||||||
|
$retype_password: "123456"
|
||||||
|
},
|
||||||
|
user_role: {
|
||||||
|
$name: "Administrator",
|
||||||
|
$roles: ["dashboard"],
|
||||||
|
$status: "Y"
|
||||||
|
},
|
||||||
|
user_activity: {
|
||||||
|
$id_user: "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8",
|
||||||
|
$refresh_token: "1a1221b6-78a0-4b3b-bf5c-fa0af5f69be8",
|
||||||
|
$module: "dashboard",
|
||||||
|
$description: "Main Dashboard",
|
||||||
|
$action: "V",
|
||||||
|
$url: "https://bri-dev.shiblysolution.id/",
|
||||||
|
$data_body: "{\"from\":\"2024-11-01\",\"to\":\"2024-11-26\"}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
parameters: {
|
||||||
|
|
||||||
|
},
|
||||||
securitySchemes: {
|
securitySchemes: {
|
||||||
bearerAuth: {
|
bearerAuth: {
|
||||||
type: 'http',
|
type: 'http',
|
||||||
|
|||||||
@ -61,12 +61,12 @@
|
|||||||
"name": "order_direction",
|
"name": "order_direction",
|
||||||
"in": "query",
|
"in": "query",
|
||||||
"required": true,
|
"required": true,
|
||||||
"enum": [
|
|
||||||
"ASC",
|
|
||||||
"DESC"
|
|
||||||
],
|
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"ASC",
|
||||||
|
"DESC"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -88,47 +88,6 @@
|
|||||||
"User"
|
"User"
|
||||||
],
|
],
|
||||||
"description": "",
|
"description": "",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "body",
|
|
||||||
"in": "body",
|
|
||||||
"description": "User data",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"email": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "admin@gmail.com"
|
|
||||||
},
|
|
||||||
"username": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "admin"
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "123456"
|
|
||||||
},
|
|
||||||
"retype_password": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "123456"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "Administrator"
|
|
||||||
},
|
|
||||||
"id_role": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8"
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "Y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
"responses": {
|
||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
@ -138,7 +97,17 @@
|
|||||||
{
|
{
|
||||||
"bearerAuth": []
|
"bearerAuth": []
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/user"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/user/update/{id}": {
|
"/api/user/update/{id}": {
|
||||||
@ -169,15 +138,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"$ref": "#/components/schemas/user"
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"example": "any"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,15 +177,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"$ref": "#/components/schemas/user_profile"
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"example": "any"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,15 +216,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"$ref": "#/components/schemas/user_password"
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"example": "any"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -391,7 +348,30 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/api/user_role/role": {
|
||||||
|
"get": {
|
||||||
|
"tags": [
|
||||||
|
"User Roles"
|
||||||
|
],
|
||||||
|
"description": "",
|
||||||
|
"responses": {
|
||||||
|
"default": {
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/user_role/create": {
|
"/api/user_role/create": {
|
||||||
@ -400,40 +380,25 @@
|
|||||||
"User Roles"
|
"User Roles"
|
||||||
],
|
],
|
||||||
"description": "",
|
"description": "",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "body",
|
|
||||||
"in": "body",
|
|
||||||
"description": "User role data",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"name": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "Administrator"
|
|
||||||
},
|
|
||||||
"roles": {
|
|
||||||
"type": "array",
|
|
||||||
"example": [
|
|
||||||
"dashboard"
|
|
||||||
],
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"status": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "Y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
"responses": {
|
||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/user_role"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -459,16 +424,17 @@
|
|||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"type": "object",
|
"$ref": "#/components/schemas/user_role"
|
||||||
"properties": {
|
|
||||||
"id": {
|
|
||||||
"example": "any"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -496,7 +462,12 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/user_role/restore/{id}": {
|
"/api/user_role/restore/{id}": {
|
||||||
@ -520,7 +491,12 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/user_activity": {
|
"/api/user_activity": {
|
||||||
@ -586,7 +562,12 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/user_activity/create": {
|
"/api/user_activity/create": {
|
||||||
@ -595,51 +576,25 @@
|
|||||||
"User Activity"
|
"User Activity"
|
||||||
],
|
],
|
||||||
"description": "",
|
"description": "",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "body",
|
|
||||||
"in": "body",
|
|
||||||
"description": "User Activity data",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"id_user": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8"
|
|
||||||
},
|
|
||||||
"refresh_token": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "1a1221b6-78a0-4b3b-bf5c-fa0af5f69be8"
|
|
||||||
},
|
|
||||||
"module": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "dashboard"
|
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "Main Dashboard"
|
|
||||||
},
|
|
||||||
"action": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "V"
|
|
||||||
},
|
|
||||||
"url": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "https://bri-dev.shiblysolution.id/"
|
|
||||||
},
|
|
||||||
"data_body": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "{'from':'2024-11-01','to':'2024-11-26'}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
"responses": {
|
||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/user_activity"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -698,7 +653,12 @@
|
|||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearerAuth": []
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"/api/refresh_token/force_logout/{refresh_token}": {
|
"/api/refresh_token/force_logout/{refresh_token}": {
|
||||||
@ -731,31 +691,20 @@
|
|||||||
"Auth"
|
"Auth"
|
||||||
],
|
],
|
||||||
"description": "",
|
"description": "",
|
||||||
"parameters": [
|
|
||||||
{
|
|
||||||
"name": "body",
|
|
||||||
"in": "body",
|
|
||||||
"description": "Login data",
|
|
||||||
"required": true,
|
|
||||||
"schema": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"username": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "admin"
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"type": "string",
|
|
||||||
"example": "123456"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"responses": {
|
"responses": {
|
||||||
"default": {
|
"default": {
|
||||||
"description": ""
|
"description": ""
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"requestBody": {
|
||||||
|
"required": true,
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/login"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -809,6 +758,176 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"components": {
|
"components": {
|
||||||
|
"schemas": {
|
||||||
|
"login": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"username": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "admin"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "123456"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"username",
|
||||||
|
"password"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"email": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "admin@gmail.com"
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "admin"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "123456"
|
||||||
|
},
|
||||||
|
"retype_password": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "123456"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "Administrator"
|
||||||
|
},
|
||||||
|
"id_role": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8"
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "Y"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"email",
|
||||||
|
"username",
|
||||||
|
"password",
|
||||||
|
"retype_password",
|
||||||
|
"name",
|
||||||
|
"id_role",
|
||||||
|
"status"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"user_profile": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"email": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "admin@gmail.com"
|
||||||
|
},
|
||||||
|
"username": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "admin"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "Administrator"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"email",
|
||||||
|
"username",
|
||||||
|
"name"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"user_password": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"password": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "123456"
|
||||||
|
},
|
||||||
|
"retype_password": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "123456"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"password",
|
||||||
|
"retype_password"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"user_role": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "Administrator"
|
||||||
|
},
|
||||||
|
"roles": {
|
||||||
|
"type": "array",
|
||||||
|
"example": [
|
||||||
|
"dashboard"
|
||||||
|
],
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "Y"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"roles",
|
||||||
|
"status"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"user_activity": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id_user": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "4a6991b6-78a0-4b3b-bf5c-fa0af5f69be8"
|
||||||
|
},
|
||||||
|
"refresh_token": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "1a1221b6-78a0-4b3b-bf5c-fa0af5f69be8"
|
||||||
|
},
|
||||||
|
"module": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "dashboard"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "Main Dashboard"
|
||||||
|
},
|
||||||
|
"action": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "V"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "https://bri-dev.shiblysolution.id/"
|
||||||
|
},
|
||||||
|
"data_body": {
|
||||||
|
"type": "string",
|
||||||
|
"example": "{\"from\":\"2024-11-01\",\"to\":\"2024-11-26\"}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"id_user",
|
||||||
|
"refresh_token",
|
||||||
|
"module",
|
||||||
|
"description",
|
||||||
|
"action",
|
||||||
|
"url",
|
||||||
|
"data_body"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parameters": {},
|
||||||
"securitySchemes": {
|
"securitySchemes": {
|
||||||
"bearerAuth": {
|
"bearerAuth": {
|
||||||
"type": "http",
|
"type": "http",
|
||||||
|
|||||||
Reference in New Issue
Block a user