2026-03-03 15:43:47 +07:00
|
|
|
package ru.soune.nocopy.service.cost;
|
|
|
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import ru.soune.nocopy.service.tariff.TariffConstants;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
|
@Component
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
public class CostService {
|
|
|
|
|
|
|
|
|
|
public int protectFileCost(String fileType) {
|
|
|
|
|
int cost = 0;
|
|
|
|
|
|
|
|
|
|
switch (fileType) {
|
|
|
|
|
case "video":
|
|
|
|
|
return TariffConstants.VIDEO_TOKEN_VALUE;
|
|
|
|
|
case "image":
|
|
|
|
|
return TariffConstants.IMAGE_TOKEN_VALUE;
|
|
|
|
|
case "audio":
|
|
|
|
|
return TariffConstants.AUDIO_TOKEN_VALUE;
|
|
|
|
|
case "document":
|
|
|
|
|
return TariffConstants.PDF_TOKEN_VALUE;
|
2026-03-05 10:05:18 +07:00
|
|
|
default:
|
|
|
|
|
return cost;
|
2026-03-03 15:43:47 +07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|