mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-14 20:53:42 +08:00
v-3.0.0
This commit is contained in:
10
dist/modules/upload/upload.controller.js
vendored
10
dist/modules/upload/upload.controller.js
vendored
@@ -24,9 +24,6 @@ let UploadController = class UploadController {
|
||||
async uploadFile(file) {
|
||||
return this.uploadService.uploadFile(file);
|
||||
}
|
||||
async test() {
|
||||
return this.uploadService.test();
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
(0, common_1.Post)('file'),
|
||||
@@ -37,13 +34,6 @@ __decorate([
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], UploadController.prototype, "uploadFile", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('test'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '测试' }),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", Promise)
|
||||
], UploadController.prototype, "test", null);
|
||||
UploadController = __decorate([
|
||||
(0, swagger_1.ApiTags)('upload'),
|
||||
(0, common_1.Controller)('upload'),
|
||||
|
||||
10
dist/modules/upload/upload.service.js
vendored
10
dist/modules/upload/upload.service.js
vendored
@@ -233,16 +233,6 @@ let UploadService = class UploadService {
|
||||
return { key, uploadPath };
|
||||
}
|
||||
}
|
||||
async test() {
|
||||
const params = {
|
||||
filename: 'mjtest.png',
|
||||
dir: 'mj',
|
||||
url: 'https://cdn.discordapp.com/attachments/1097409128491651135/1169910551275638855/snine_60b5c001b_A_young_girl_smiles_brightly_in_the_pure_blue_f_8a41fe5f-5101-4c1e-b948-a748a0583577.png?ex=65571f1b&is=6544aa1b&hm=b82f2d88224eb7942e24c63a8e519c7693de12a2b96daa0f327dfb8f691b1480&',
|
||||
};
|
||||
const res = await this.uploadFileFromUrl(params);
|
||||
console.log('res: ', res);
|
||||
return res;
|
||||
}
|
||||
async getBufferFromUrl(url) {
|
||||
const proxyMj = (await this.globalConfigService.getConfigs(['mjProxy'])) || 0;
|
||||
const response = await axios_1.default.get(url, { responseType: 'stream' });
|
||||
|
||||
Reference in New Issue
Block a user