update swagger done

This commit is contained in:
2024-11-27 07:44:45 +07:00
parent d5cd47f17a
commit 4a8fde1640
10 changed files with 477 additions and 255 deletions

View File

@ -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 { OrmHelper } from "../helpers/orm";
import Joi from "joi";
@ -14,6 +15,9 @@ export class UserRefreshTokenController {
static async list(req: Request, res: Response, next: NextFunction): Promise<Response> {
/*
#swagger.tags = ['User Refresh Token']
#swagger.security = [{
"bearerAuth": []
}]
#swagger.parameters['filter'] = {
in: 'query',
type: 'string'
@ -59,11 +63,14 @@ export class UserRefreshTokenController {
let whereVal: any = {};
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_like'] = '%' + param.filter + '%'
}
whereAttr += 'id_user = :id_user'
whereVal['id_user'] = req.auth.data.id;
const res_count = repo.createQueryBuilder()
.where(whereAttr, whereVal);
const res_list = repo.createQueryBuilder()