package com.crm.manager.controller;

import com.crm.manager.service.CustomCommunicationPreferenceService;
import com.crm.rely.backend.core.constant.Constants;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.custom.communication.preference.CustomCommunicationPreferenceDto;
import com.crm.rely.backend.core.entity.custom.activity.CustomActivityApplyApproveEntity;
import com.crm.rely.backend.core.entity.custom.communication.preference.CustomCommunicationPreferenceSearchEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @description: 客户通讯偏好设置
 * @author: houn
 * @create: 2020-06-13 18:00
 **/
@RestController
@RequestMapping("/custom/communication/preference")
public class CustomCommunicationPreferenceController {

    @Autowired
    private CustomCommunicationPreferenceService customCommunicationPreferenceService;

    @PostMapping("/search/custom/list")
    public BaseResultDto searcherCustom(@RequestBody @Validated CustomCommunicationPreferenceSearchEntity entity) throws Exception {

        List<CustomCommunicationPreferenceDto> customCommunicationPreferenceDtos = customCommunicationPreferenceService.searchCustom(entity);

        return BaseResultDto.success(customCommunicationPreferenceDtos);
    }


}
