api รายละเอียดรายการผลงาน ใช้.oรายงาน ก.พ.7/ก.ก.1 #1642

This commit is contained in:
Bright 2025-08-06 10:53:06 +07:00
parent d93edbf97a
commit 217354f653

View file

@ -103,6 +103,32 @@ export class PortfolioController extends Controller {
return new HttpSuccess(_portfolio);
}
/**
* API ..7/..1
*
* @summary ..7/..1
*
*/
@Get("kk1/{keycloak}")
async GetPortfolio(@Path() keycloak: string, @Request() request: RequestWithUser) {
const _portfolio = await this.portfolioRepository.find({
where: { createdUserId: keycloak },
select: [
"name",
"createdAt"
],
order: { createdAt: "DESC" },
});
const result =
_portfolio.map(x => ({
name: x.name,
year: x.createdAt.getFullYear() > 2500
? x.createdAt.getFullYear()
: x.createdAt.getFullYear()+543
}));
return new HttpSuccess(result);
}
/**
* API body
*