Spaces:
Sleeping
Sleeping
Download backend/src/controllers/BaseCloudController.ts from jacqueshuang/ng: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/jacqueshuang/ng/resolve/main/backend/src/controllers/BaseCloudController.ts
- Command line
-
hf download hf://spaces/jacqueshuang/ng/backend/src/controllers/BaseCloudController.ts
-
curl -L -o BaseCloudController.ts https://huggingface.co/spaces/jacqueshuang/ng/resolve/main/backend/src/controllers/BaseCloudController.ts
1.16 kB
| import { Request, Response } from "express"; | |
| import { BaseController } from "./BaseController"; | |
| import { ICloudStorageService } from "@/types/services"; | |
| export abstract class BaseCloudController extends BaseController { | |
| constructor(protected cloudService: ICloudStorageService) { | |
| super(); | |
| } | |
| async getShareInfo(req: Request, res: Response): Promise<void> { | |
| await this.handleRequest(req, res, async () => { | |
| const { shareCode, receiveCode } = req.query; | |
| // await this.cloudService.setCookie(req); | |
| return await this.cloudService.getShareInfo(shareCode as string, receiveCode as string); | |
| }); | |
| } | |
| async getFolderList(req: Request, res: Response): Promise<void> { | |
| await this.handleRequest(req, res, async () => { | |
| const { parentCid } = req.query; | |
| await this.cloudService.setCookie(req); | |
| return await this.cloudService.getFolderList(parentCid as string); | |
| }); | |
| } | |
| async saveFile(req: Request, res: Response): Promise<void> { | |
| await this.handleRequest(req, res, async () => { | |
| await this.cloudService.setCookie(req); | |
| return await this.cloudService.saveSharedFile(req.body); | |
| }); | |
| } | |
| } | |