geek-custom-api-core 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geek-custom-api-core",
3
- "version": "0.0.22",
3
+ "version": "0.0.30",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -10,11 +10,16 @@ exports.UploadService = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  let UploadService = class UploadService {
12
12
  uploadFile(file) {
13
+ var _a;
13
14
  if (!file) {
14
15
  throw new common_1.BadRequestException('파일이 존재하지 않습니다.');
15
16
  }
17
+ const cdnDomain = (_a = process.env.CDN_DOMAIN) !== null && _a !== void 0 ? _a : null;
18
+ let filePath = file.location;
19
+ if (cdnDomain)
20
+ filePath = cdnDomain + file.key;
16
21
  return {
17
- filePath: file.location,
22
+ filePath: filePath,
18
23
  originFileName: file.originalname,
19
24
  size: file.size,
20
25
  contentType: file.contentType,
@@ -1 +1 @@
1
- {"version":3,"file":"upload.service.js","sourceRoot":"","sources":["../../../../src/api/common/upload/upload.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAiE;AAG1D,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,UAAU,CAAC,IAA2B;QACpC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,4BAAmB,CAAC,gBAAgB,CAAC,CAAC;QAClD,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,YAAY;YACjC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;SACnB,CAAC;IACf,CAAC;CACF,CAAA;AAbY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CAazB"}
1
+ {"version":3,"file":"upload.service.js","sourceRoot":"","sources":["../../../../src/api/common/upload/upload.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAiE;AAG1D,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,UAAU,CAAC,IAA2B;;QACpC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,4BAAmB,CAAC,gBAAgB,CAAC,CAAC;QAClD,CAAC;QACD,MAAM,SAAS,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,UAAU,mCAAI,IAAI,CAAC;QACjD,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,IAAI,SAAS;YAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC;QAC/C,OAAO;YACL,QAAQ,EAAE,QAAQ;YAClB,cAAc,EAAE,IAAI,CAAC,YAAY;YACjC,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;SACnB,CAAC;IACf,CAAC;CACF,CAAA;AAfY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CAezB"}