feat: enhance API and query handling with Redis caching; add QueryGuard for query validation; refactor services to utilize RedisClient for improved performance
This commit is contained in:
22
src/query/function/function.controller.ts
Normal file
22
src/query/function/function.controller.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import { Controller, Inject, Post, UseGuards } from "@nestjs/common";
|
||||
import { ApiTokenGuard } from "src/api/guards/api-token.guard";
|
||||
import { FunctionService } from "./function.service";
|
||||
|
||||
@Controller("functions")
|
||||
@UseGuards(ApiTokenGuard)
|
||||
export class FunctionController {
|
||||
constructor(
|
||||
@Inject(FunctionService)
|
||||
private readonly functionService: FunctionService
|
||||
) {}
|
||||
|
||||
@Post("create")
|
||||
async createFunction(projectId: string, name: string, source: string) {
|
||||
return this.functionService.create(projectId, name, source);
|
||||
}
|
||||
|
||||
@Post("delete")
|
||||
async deleteFunction(projectId: string, name: string) {
|
||||
return this.functionService.deleteFunction(projectId, name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user