Class CdekServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.cdek.CdekServiceImpl
-
- All Implemented Interfaces:
CdekService
@Service public class CdekServiceImpl extends java.lang.Object implements CdekService
-
-
Field Summary
Fields Modifier and Type Field Description private com.cdek.java.model.auth.request.AuthRequestauthRequestprivate com.cdek.java.model.auth.request.AuthRequestauthRequestTestprivate com.cdek.java.client.CdekClientImplcdekClientprivate com.cdek.java.client.CdekClientImplcdekClientTestprivate CommercePropertiescommercePropertiesprivate com.fasterxml.jackson.databind.ObjectMappermapperprivate OrderRepositoryorderRepositoryprivate ProfileRepositoryprofileRepositoryprivate SellerRepositorysellerRepository
-
Constructor Summary
Constructors Constructor Description CdekServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.cdek.java.model.auth.response.AuthResponseauthenticate()com.cdek.java.model.auth.response.AuthResponseauthenticateTest()com.cdek.java.model.calculator.response.Calculatorcalculate(com.cdek.java.model.calculator.request.CalculatorRequest request)java.math.BigDecimalcalculateDeliveryPrice(Order order)com.cdek.java.model.courier.response.CourierResponsecreateCourierRequest(com.cdek.java.model.courier.request.CourierRequest request)java.util.List<com.cdek.java.model.deliverypoint.response.DeliveryPointResponse>getDeliveryPoints(com.cdek.java.model.deliverypoint.request.DeliveryPointRequest request)com.cdek.java.model.calculator.response.TariffCodegetTariffCode(Order order)com.cdek.java.model.calculator.response.TariffsgetTariffs(com.cdek.java.model.calculator.request.CalculatorRequest calcReq)voidinit()booleanisCdekKeysDefined()Checks if the CDEK keys are defined.booleanisTestCdekKeysDefined()Checks if the CDEK test keys are defined.com.cdek.java.model.order.response.OrderResponseorderRegistration(com.cdek.java.model.order.request.OrderRequest request)booleanship(Order order)
-
-
-
Field Detail
-
sellerRepository
@Autowired private SellerRepository sellerRepository
-
profileRepository
@Autowired private ProfileRepository profileRepository
-
orderRepository
@Autowired private OrderRepository orderRepository
-
commerceProperties
@Autowired private CommerceProperties commerceProperties
-
authRequest
private com.cdek.java.model.auth.request.AuthRequest authRequest
-
authRequestTest
private com.cdek.java.model.auth.request.AuthRequest authRequestTest
-
cdekClient
private com.cdek.java.client.CdekClientImpl cdekClient
-
cdekClientTest
private com.cdek.java.client.CdekClientImpl cdekClientTest
-
mapper
private final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
init
@PostConstruct public void init()
-
isCdekKeysDefined
public boolean isCdekKeysDefined()
Description copied from interface:CdekServiceChecks if the CDEK keys are defined.- Specified by:
isCdekKeysDefinedin interfaceCdekService- Returns:
- true if the CDEK keys are defined, false otherwise.
-
isTestCdekKeysDefined
public boolean isTestCdekKeysDefined()
Description copied from interface:CdekServiceChecks if the CDEK test keys are defined.- Specified by:
isTestCdekKeysDefinedin interfaceCdekService- Returns:
- true if the CDEK test keys are defined, false otherwise.
-
authenticate
public com.cdek.java.model.auth.response.AuthResponse authenticate()
- Specified by:
authenticatein interfaceCdekService
-
authenticateTest
public com.cdek.java.model.auth.response.AuthResponse authenticateTest()
- Specified by:
authenticateTestin interfaceCdekService
-
calculate
public com.cdek.java.model.calculator.response.Calculator calculate(com.cdek.java.model.calculator.request.CalculatorRequest request)
- Specified by:
calculatein interfaceCdekService
-
orderRegistration
public com.cdek.java.model.order.response.OrderResponse orderRegistration(com.cdek.java.model.order.request.OrderRequest request)
- Specified by:
orderRegistrationin interfaceCdekService
-
createCourierRequest
public com.cdek.java.model.courier.response.CourierResponse createCourierRequest(com.cdek.java.model.courier.request.CourierRequest request)
- Specified by:
createCourierRequestin interfaceCdekService
-
getDeliveryPoints
public java.util.List<com.cdek.java.model.deliverypoint.response.DeliveryPointResponse> getDeliveryPoints(com.cdek.java.model.deliverypoint.request.DeliveryPointRequest request)
- Specified by:
getDeliveryPointsin interfaceCdekService
-
getTariffs
public com.cdek.java.model.calculator.response.Tariffs getTariffs(com.cdek.java.model.calculator.request.CalculatorRequest calcReq)
- Specified by:
getTariffsin interfaceCdekService
-
getTariffCode
public com.cdek.java.model.calculator.response.TariffCode getTariffCode(Order order)
- Specified by:
getTariffCodein interfaceCdekService
-
calculateDeliveryPrice
public java.math.BigDecimal calculateDeliveryPrice(Order order)
- Specified by:
calculateDeliveryPricein interfaceCdekService
-
ship
public boolean ship(Order order)
- Specified by:
shipin interfaceCdekService
-
-