package com.crm.manager.controller;

import com.crm.manager.service.activity.CustomActivityMidyearTenPercentGiveAgentFeignService;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.custom.activity.midyear.ten.percent.give.agent.CustomActivityMidyearTenPercentGiveAgentDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.custom.activity.midyear.ten.percent.give.agent.CustomActivityMidyearTenPercentGiveAgentAddEntity;
import com.crm.rely.backend.core.entity.custom.activity.midyear.ten.percent.give.agent.CustomActivityMidyearTenPercentGiveAgentDeleteEntity;
import com.crm.rely.backend.core.entity.custom.activity.midyear.ten.percent.give.agent.CustomActivityMidyearTenPercentGiveAgentSearchEntity;
import lombok.extern.log4j.Log4j;
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;

/**
 * @author: houn
 */
@Log4j
@RestController
@RequestMapping("/custom/activity/midyear/ten/percent/give/agent")
public class CustomActivityMidyearTenPercentGiveAgentController {

    @Autowired
    private CustomActivityMidyearTenPercentGiveAgentFeignService service;

    @PostMapping("/add")
    public BaseResultDto add(@RequestBody @Validated CustomActivityMidyearTenPercentGiveAgentAddEntity entity) throws Exception {
        
        return service.add(entity);
    }


    @PostMapping("/delete")
    public BaseResultDto delete(@RequestBody @Validated CustomActivityMidyearTenPercentGiveAgentDeleteEntity entity) throws Exception {

        return service.delete(entity);
    }


    @PostMapping("/search/list")
    public ResultWithPagerDto<CustomActivityMidyearTenPercentGiveAgentDto> searcherList(@RequestBody @Validated CustomActivityMidyearTenPercentGiveAgentSearchEntity entity) throws Exception {

        return service.searcherList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto searcherSingle(@RequestBody @Validated SingleLongEntity entity) throws Exception {

        return service.searcherSingle(entity);
    }
}
