30 lines
794 B
Java
30 lines
794 B
Java
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;
|
|
default:
|
|
return cost;
|
|
}
|
|
}
|
|
}
|