Search in sources :

Example 76 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class StoreContactRESTController method store.

@RequestMapping(value = "/public/{store}", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.ACCEPTED)
@ResponseBody
public AjaxResponse store(@PathVariable final String store, HttpServletRequest request, HttpServletResponse response) {
    AjaxResponse ajaxResponse = new AjaxResponse();
    try {
        /**
         * default routine *
         */
        MerchantStore merchantStore = (MerchantStore) request.getAttribute(Constants.MERCHANT_STORE);
        if (merchantStore != null) {
            if (!merchantStore.getCode().equals(store)) {
                merchantStore = null;
            }
        }
        if (merchantStore == null) {
            merchantStore = merchantStoreService.getByCode(store);
        }
        if (merchantStore == null) {
            LOGGER.error("Merchant store is null for code " + store);
            response.sendError(503, "Merchant store is null for code " + store);
            return null;
        }
        Language language = merchantStore.getDefaultLanguage();
        Map<String, Language> langs = languageService.getLanguagesMap();
        return null;
    } catch (Exception e) {
        LOGGER.error("Error while saving category", e);
        try {
            response.sendError(503, "Error while saving category " + e.getMessage());
        } catch (Exception ignore) {
        }
        return null;
    }
}
Also used : Language(com.salesmanager.core.model.reference.language.Language) AjaxResponse(com.salesmanager.core.business.utils.ajax.AjaxResponse) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 77 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class PersistableUserPopulator method populate.

@Override
public User populate(PersistableUser source, User target, MerchantStore store, Language language) throws ConversionException {
    Validate.notNull(source, "PersistableUser cannot be null");
    Validate.notNull(store, "MerchantStore cannot be null");
    if (target == null) {
        target = new User();
    }
    target.setFirstName(source.getFirstName());
    target.setLastName(source.getLastName());
    target.setAdminEmail(source.getEmailAddress());
    target.setAdminName(source.getUserName());
    if (!StringUtils.isBlank(source.getPassword())) {
        target.setAdminPassword(passwordEncoder.encode(source.getPassword()));
    }
    if (!StringUtils.isBlank(source.getStore())) {
        try {
            MerchantStore userStore = merchantStoreService.getByCode(source.getStore());
            target.setMerchantStore(userStore);
        } catch (ServiceException e) {
            throw new ConversionException("Error while reading MerchantStore store [" + source.getStore() + "]", e);
        }
    } else {
        target.setMerchantStore(store);
    }
    target.setActive(source.isActive());
    Language lang = null;
    try {
        lang = languageService.getByCode(source.getDefaultLanguage());
    } catch (Exception e) {
        throw new ConversionException("Cannot get language [" + source.getDefaultLanguage() + "]", e);
    }
    // set default language
    target.setDefaultLanguage(lang);
    List<Group> userGroups = new ArrayList<Group>();
    List<String> names = new ArrayList<String>();
    for (PersistableGroup group : source.getGroups()) {
        names.add(group.getName());
    }
    try {
        List<Group> groups = groupService.listGroupByNames(names);
        for (Group g : groups) {
            userGroups.add(g);
        }
    } catch (Exception e1) {
        throw new ConversionException("Error while getting user groups", e1);
    }
    target.setGroups(userGroups);
    return target;
}
Also used : ConversionException(com.salesmanager.core.business.exception.ConversionException) Group(com.salesmanager.core.model.user.Group) PersistableGroup(com.salesmanager.shop.model.security.PersistableGroup) PersistableGroup(com.salesmanager.shop.model.security.PersistableGroup) PersistableUser(com.salesmanager.shop.model.user.PersistableUser) User(com.salesmanager.core.model.user.User) ServiceException(com.salesmanager.core.business.exception.ServiceException) Language(com.salesmanager.core.model.reference.language.Language) ArrayList(java.util.ArrayList) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ServiceException(com.salesmanager.core.business.exception.ServiceException) ConversionException(com.salesmanager.core.business.exception.ConversionException)

Example 78 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class OrderFacadeImpl method getReadableOrderHistory.

@Override
public List<ReadableOrderStatusHistory> getReadableOrderHistory(Long orderId, MerchantStore store, Language language) {
    Order order = orderService.getOrder(orderId, store);
    if (order == null) {
        throw new ResourceNotFoundException("Order id [" + orderId + "] not found for merchand [" + store.getId() + "]");
    }
    Set<OrderStatusHistory> historyList = order.getOrderHistory();
    List<ReadableOrderStatusHistory> returnList = historyList.stream().map(f -> mapToReadbleOrderStatusHistory(f)).collect(Collectors.toList());
    return returnList;
}
Also used : ShopOrder(com.salesmanager.shop.model.order.ShopOrder) Order(com.salesmanager.core.model.order.Order) ShoppingCart(com.salesmanager.core.model.shoppingcart.ShoppingCart) OrderEntity(com.salesmanager.shop.model.order.OrderEntity) DigitalProductService(com.salesmanager.core.business.services.catalog.product.file.DigitalProductService) OrderProduct(com.salesmanager.core.model.order.orderproduct.OrderProduct) ZonedDateTime(java.time.ZonedDateTime) ReadableOrderPopulator(com.salesmanager.shop.populator.order.ReadableOrderPopulator) Autowired(org.springframework.beans.factory.annotation.Autowired) Delivery(com.salesmanager.core.model.common.Delivery) StringUtils(org.apache.commons.lang3.StringUtils) ShippingQuote(com.salesmanager.core.model.shipping.ShippingQuote) BigDecimal(java.math.BigDecimal) ShippingProduct(com.salesmanager.core.model.shipping.ShippingProduct) Map(java.util.Map) PricingService(com.salesmanager.core.business.services.catalog.product.PricingService) TransactionService(com.salesmanager.core.business.services.payments.TransactionService) ShippingService(com.salesmanager.core.business.services.shipping.ShippingService) CreditCardType(com.salesmanager.core.model.payments.CreditCardType) CustomerFacade(com.salesmanager.shop.store.controller.customer.facade.CustomerFacade) FieldError(org.springframework.validation.FieldError) Set(java.util.Set) CreditCardPayment(com.salesmanager.core.model.payments.CreditCardPayment) ShoppingCartItemPopulator(com.salesmanager.shop.populator.order.ShoppingCartItemPopulator) ZoneId(java.time.ZoneId) PaymentService(com.salesmanager.core.business.services.payments.PaymentService) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) ShippingQuoteService(com.salesmanager.core.business.services.shipping.ShippingQuoteService) ShopOrder(com.salesmanager.shop.model.order.ShopOrder) ProductService(com.salesmanager.core.business.services.catalog.product.ProductService) OrderSummary(com.salesmanager.core.model.order.OrderSummary) Billing(com.salesmanager.core.model.common.Billing) CreditCardUtils(com.salesmanager.core.business.utils.CreditCardUtils) BindingResult(org.springframework.validation.BindingResult) OrderService(com.salesmanager.core.business.services.order.OrderService) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ShoppingCartFacade(com.salesmanager.shop.store.controller.shoppingCart.facade.ShoppingCartFacade) ArrayList(java.util.ArrayList) ZoneService(com.salesmanager.core.business.services.reference.zone.ZoneService) OrderTotalSummary(com.salesmanager.core.model.order.OrderTotalSummary) OrderAttribute(com.salesmanager.core.model.order.attributes.OrderAttribute) PersistableOrderProduct(com.salesmanager.shop.model.order.PersistableOrderProduct) Service(org.springframework.stereotype.Service) ProductAttributeService(com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService) LinkedHashSet(java.util.LinkedHashSet) ShoppingCartService(com.salesmanager.core.business.services.shoppingcart.ShoppingCartService) Product(com.salesmanager.core.model.catalog.product.Product) Country(com.salesmanager.core.model.reference.country.Country) ReadableOrderProduct(com.salesmanager.shop.model.order.ReadableOrderProduct) EmailTemplatesUtils(com.salesmanager.shop.utils.EmailTemplatesUtils) Validate(org.apache.commons.lang3.Validate) Date(java.util.Date) LoggerFactory(org.slf4j.LoggerFactory) CreditCard(com.salesmanager.core.model.order.payment.CreditCard) ServiceException(com.salesmanager.core.business.exception.ServiceException) ShoppingCartItem(com.salesmanager.core.model.shoppingcart.ShoppingCartItem) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ReadableTransaction(com.salesmanager.shop.model.order.transaction.ReadableTransaction) ObjectError(org.springframework.validation.ObjectError) Locale(java.util.Locale) OrderCriteria(com.salesmanager.core.model.order.OrderCriteria) OrderProductPopulator(com.salesmanager.shop.populator.order.OrderProductPopulator) OrderFacade(com.salesmanager.shop.store.controller.order.facade.OrderFacade) CountryService(com.salesmanager.core.business.services.reference.country.CountryService) OrderList(com.salesmanager.core.model.order.OrderList) Instant(java.time.Instant) Collectors(java.util.stream.Collectors) ReadableOrderProductPopulator(com.salesmanager.shop.populator.order.ReadableOrderProductPopulator) ReadableCustomer(com.salesmanager.shop.model.customer.ReadableCustomer) ReadableOrderStatusHistory(com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory) List(java.util.List) Payment(com.salesmanager.core.model.payments.Payment) LocaleUtils(com.salesmanager.shop.utils.LocaleUtils) PersistableOrderStatusHistory(com.salesmanager.shop.model.order.history.PersistableOrderStatusHistory) PersistableOrderApiPopulator(com.salesmanager.shop.populator.order.PersistableOrderApiPopulator) CoreConfiguration(com.salesmanager.core.business.utils.CoreConfiguration) LocalDate(java.time.LocalDate) ProductAvailability(com.salesmanager.core.model.catalog.product.availability.ProductAvailability) Address(com.salesmanager.shop.model.customer.address.Address) OrderStatusHistory(com.salesmanager.core.model.order.orderstatus.OrderStatusHistory) Async(org.springframework.scheduling.annotation.Async) PersistableCustomerPopulator(com.salesmanager.shop.populator.customer.PersistableCustomerPopulator) Order(com.salesmanager.core.model.order.Order) DateUtil(com.salesmanager.shop.utils.DateUtil) HashMap(java.util.HashMap) TransactionType(com.salesmanager.core.model.payments.TransactionType) OrderTotal(com.salesmanager.shop.model.order.total.OrderTotal) PaymentType(com.salesmanager.core.model.payments.PaymentType) HashSet(java.util.HashSet) Inject(javax.inject.Inject) Language(com.salesmanager.core.model.reference.language.Language) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) LabelUtils(com.salesmanager.shop.utils.LabelUtils) ReadableTransactionPopulator(com.salesmanager.shop.populator.order.transaction.ReadableTransactionPopulator) Qualifier(org.springframework.beans.factory.annotation.Qualifier) CustomerPopulator(com.salesmanager.shop.populator.customer.CustomerPopulator) PersistablePaymentPopulator(com.salesmanager.shop.populator.order.transaction.PersistablePaymentPopulator) Transaction(com.salesmanager.core.model.payments.Transaction) Constants(com.salesmanager.core.business.constants.Constants) Logger(org.slf4j.Logger) OrderStatus(com.salesmanager.core.model.order.orderstatus.OrderStatus) Customer(com.salesmanager.core.model.customer.Customer) ImageFilePath(com.salesmanager.shop.utils.ImageFilePath) PersistableCustomer(com.salesmanager.shop.model.customer.PersistableCustomer) ShippingSummary(com.salesmanager.core.model.shipping.ShippingSummary) ConversionException(com.salesmanager.core.business.exception.ConversionException) Comparator(java.util.Comparator) Collections(java.util.Collections) ReadableOrderStatusHistory(com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) ReadableOrderStatusHistory(com.salesmanager.shop.model.order.history.ReadableOrderStatusHistory) PersistableOrderStatusHistory(com.salesmanager.shop.model.order.history.PersistableOrderStatusHistory) OrderStatusHistory(com.salesmanager.core.model.order.orderstatus.OrderStatusHistory)

Example 79 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class ShippingConfigurationApi method shippingModules.

/**
 * Get available shipping modules
 *
 * @param merchantStore
 * @param language
 * @return
 */
@GetMapping("/private/modules/shipping")
@ApiOperation(httpMethod = "GET", value = "List list of shipping modules", notes = "Requires administration access", produces = "application/json", response = List.class)
@ApiImplicitParams({ @ApiImplicitParam(name = "store", dataType = "string", defaultValue = "DEFAULT") })
public List<IntegrationModuleSummaryEntity> shippingModules(@ApiIgnore MerchantStore merchantStore, @ApiIgnore Language language) {
    try {
        List<IntegrationModule> modules = shippingService.getShippingMethods(merchantStore);
        // configured modules
        Map<String, IntegrationConfiguration> configuredModules = shippingService.getShippingModulesConfigured(merchantStore);
        return modules.stream().map(m -> integrationModule(m, configuredModules)).collect(Collectors.toList());
    } catch (ServiceException e) {
        LOGGER.error("Error getting shipping modules", e);
        throw new ServiceRuntimeException("Error getting shipping modules", e);
    }
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) IntegrationModuleConfiguration(com.salesmanager.shop.model.system.IntegrationModuleConfiguration) ShippingFacade(com.salesmanager.shop.store.controller.shipping.facade.ShippingFacade) Constants(com.salesmanager.shop.constants.Constants) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ServiceException(com.salesmanager.core.business.exception.ServiceException) RequestBody(org.springframework.web.bind.annotation.RequestBody) Language(com.salesmanager.core.model.reference.language.Language) ApiOperation(io.swagger.annotations.ApiOperation) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) AuthorizationUtils(com.salesmanager.shop.utils.AuthorizationUtils) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) Map(java.util.Map) GetMapping(org.springframework.web.bind.annotation.GetMapping) IntegrationModule(com.salesmanager.core.model.system.IntegrationModule) Api(io.swagger.annotations.Api) Tag(io.swagger.annotations.Tag) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) ShippingService(com.salesmanager.core.business.services.shipping.ShippingService) PostMapping(org.springframework.web.bind.annotation.PostMapping) Logger(org.slf4j.Logger) ApiImplicitParam(io.swagger.annotations.ApiImplicitParam) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) Collectors(java.util.stream.Collectors) RestController(org.springframework.web.bind.annotation.RestController) IntegrationModuleSummaryEntity(com.salesmanager.shop.model.system.IntegrationModuleSummaryEntity) ApiIgnore(springfox.documentation.annotations.ApiIgnore) HttpStatus(org.springframework.http.HttpStatus) List(java.util.List) Stream(java.util.stream.Stream) PackageDetails(com.salesmanager.core.model.shipping.PackageDetails) IntegrationConfiguration(com.salesmanager.core.model.system.IntegrationConfiguration) SwaggerDefinition(io.swagger.annotations.SwaggerDefinition) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) Optional(java.util.Optional) PersistableAddress(com.salesmanager.shop.model.references.PersistableAddress) ReadableAddress(com.salesmanager.shop.model.references.ReadableAddress) ApiImplicitParams(io.swagger.annotations.ApiImplicitParams) ServiceException(com.salesmanager.core.business.exception.ServiceException) IntegrationConfiguration(com.salesmanager.core.model.system.IntegrationConfiguration) IntegrationModule(com.salesmanager.core.model.system.IntegrationModule) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) GetMapping(org.springframework.web.bind.annotation.GetMapping) ApiImplicitParams(io.swagger.annotations.ApiImplicitParams) ApiOperation(io.swagger.annotations.ApiOperation)

Example 80 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class CustomerFacadeImpl method getAllCustomerReviewsByReviewed.

@Override
public List<ReadableCustomerReview> getAllCustomerReviewsByReviewed(Long customerId, MerchantStore store, Language language) {
    // customer exist
    Customer customer = getCustomerById(customerId);
    Validate.notNull(customer, "Reviewed customer cannot be null");
    return customerReviewService.getByReviewedCustomer(customer).stream().map(customerReview -> convertCustomerReviewToReadableCustomerReview(customerReview, store, language)).collect(Collectors.toList());
}
Also used : ShoppingCart(com.salesmanager.core.model.shoppingcart.ShoppingCart) PermissionService(com.salesmanager.core.business.services.user.PermissionService) CustomerList(com.salesmanager.core.model.customer.CustomerList) CustomerEntityPopulator(com.salesmanager.shop.populator.customer.CustomerEntityPopulator) Date(java.util.Date) EmailConstants(com.salesmanager.shop.constants.EmailConstants) LoggerFactory(org.slf4j.LoggerFactory) Autowired(org.springframework.beans.factory.annotation.Autowired) StringUtils(org.apache.commons.lang3.StringUtils) LanguageService(com.salesmanager.core.business.services.reference.language.LanguageService) ServiceException(com.salesmanager.core.business.exception.ServiceException) CustomerOptinService(com.salesmanager.core.business.services.customer.optin.CustomerOptinService) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) CustomerReviewService(com.salesmanager.core.business.services.customer.review.CustomerReviewService) UserAlreadyExistException(com.salesmanager.shop.model.customer.UserAlreadyExistException) Locale(java.util.Locale) Map(java.util.Map) SecurityContextHolder(org.springframework.security.core.context.SecurityContextHolder) CustomerService(com.salesmanager.core.business.services.customer.CustomerService) CountryService(com.salesmanager.core.business.services.reference.country.CountryService) UUID(org.jgroups.util.UUID) ReadableCustomerReview(com.salesmanager.shop.model.customer.ReadableCustomerReview) CustomerEntity(com.salesmanager.shop.model.customer.CustomerEntity) Collection(java.util.Collection) Collectors(java.util.stream.Collectors) GrantedAuthority(org.springframework.security.core.GrantedAuthority) ReadableCustomer(com.salesmanager.shop.model.customer.ReadableCustomer) List(java.util.List) CustomerBillingAddressPopulator(com.salesmanager.shop.populator.customer.CustomerBillingAddressPopulator) LocaleUtils(com.salesmanager.shop.utils.LocaleUtils) CoreConfiguration(com.salesmanager.core.business.utils.CoreConfiguration) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) Optional(java.util.Optional) UsernamePasswordAuthenticationToken(org.springframework.security.authentication.UsernamePasswordAuthenticationToken) Optin(com.salesmanager.core.model.system.optin.Optin) Authentication(org.springframework.security.core.Authentication) Address(com.salesmanager.shop.model.customer.address.Address) EmailService(com.salesmanager.core.business.services.system.EmailService) OptinType(com.salesmanager.core.model.system.optin.OptinType) Async(org.springframework.scheduling.annotation.Async) Email(com.salesmanager.core.business.modules.email.Email) Group(com.salesmanager.core.model.user.Group) Constants(com.salesmanager.shop.constants.Constants) ReadableCustomerPopulator(com.salesmanager.shop.populator.customer.ReadableCustomerPopulator) SimpleGrantedAuthority(org.springframework.security.core.authority.SimpleGrantedAuthority) Zone(com.salesmanager.core.model.reference.zone.Zone) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) ZoneService(com.salesmanager.core.business.services.reference.zone.ZoneService) Inject(javax.inject.Inject) Language(com.salesmanager.core.model.reference.language.Language) ConversionRuntimeException(com.salesmanager.shop.store.api.exception.ConversionRuntimeException) Permission(com.salesmanager.core.model.user.Permission) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) LabelUtils(com.salesmanager.shop.utils.LabelUtils) Service(org.springframework.stereotype.Service) Qualifier(org.springframework.beans.factory.annotation.Qualifier) EmailUtils(com.salesmanager.shop.utils.EmailUtils) CustomerDeliveryAddressPopulator(com.salesmanager.shop.populator.customer.CustomerDeliveryAddressPopulator) CustomerPopulator(com.salesmanager.shop.populator.customer.CustomerPopulator) CustomerReview(com.salesmanager.core.model.customer.review.CustomerReview) PersistableCustomerReview(com.salesmanager.shop.model.customer.PersistableCustomerReview) ShoppingCartService(com.salesmanager.core.business.services.shoppingcart.ShoppingCartService) Logger(org.slf4j.Logger) AuthenticationManager(org.springframework.security.authentication.AuthenticationManager) Country(com.salesmanager.core.model.reference.country.Country) Customer(com.salesmanager.core.model.customer.Customer) CustomerCriteria(com.salesmanager.core.model.customer.CustomerCriteria) CustomerOptin(com.salesmanager.core.model.system.optin.CustomerOptin) ImageFilePath(com.salesmanager.shop.utils.ImageFilePath) EmailTemplatesUtils(com.salesmanager.shop.utils.EmailTemplatesUtils) PersistableCustomerBillingAddressPopulator(com.salesmanager.shop.populator.customer.PersistableCustomerBillingAddressPopulator) PersistableCustomerShippingAddressPopulator(com.salesmanager.shop.populator.customer.PersistableCustomerShippingAddressPopulator) GroupType(com.salesmanager.core.model.user.GroupType) PersistableCustomer(com.salesmanager.shop.model.customer.PersistableCustomer) Validate(org.apache.commons.lang3.Validate) PasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder) PersistableCustomerOptin(com.salesmanager.shop.model.customer.optin.PersistableCustomerOptin) GroupService(com.salesmanager.core.business.services.user.GroupService) ConversionException(com.salesmanager.core.business.exception.ConversionException) OptinService(com.salesmanager.core.business.services.system.optin.OptinService) PersistableCustomerReviewPopulator(com.salesmanager.shop.populator.customer.PersistableCustomerReviewPopulator) ReadableCustomerReviewPopulator(com.salesmanager.shop.populator.customer.ReadableCustomerReviewPopulator) ReadableCustomerList(com.salesmanager.shop.populator.customer.ReadableCustomerList) ReadableCustomer(com.salesmanager.shop.model.customer.ReadableCustomer) Customer(com.salesmanager.core.model.customer.Customer) PersistableCustomer(com.salesmanager.shop.model.customer.PersistableCustomer)

Aggregations

Language (com.salesmanager.core.model.reference.language.Language)148 MerchantStore (com.salesmanager.core.model.merchant.MerchantStore)115 ArrayList (java.util.ArrayList)58 List (java.util.List)56 ServiceException (com.salesmanager.core.business.exception.ServiceException)55 Collectors (java.util.stream.Collectors)50 Product (com.salesmanager.core.model.catalog.product.Product)45 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)44 ServiceRuntimeException (com.salesmanager.shop.store.api.exception.ServiceRuntimeException)42 ResourceNotFoundException (com.salesmanager.shop.store.api.exception.ResourceNotFoundException)38 Autowired (org.springframework.beans.factory.annotation.Autowired)35 ConversionException (com.salesmanager.core.business.exception.ConversionException)30 Category (com.salesmanager.core.model.catalog.category.Category)30 Validate (org.apache.commons.lang3.Validate)29 Customer (com.salesmanager.core.model.customer.Customer)28 Optional (java.util.Optional)28 Inject (javax.inject.Inject)28 Service (org.springframework.stereotype.Service)28 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)27 ImageFilePath (com.salesmanager.shop.utils.ImageFilePath)25