package com.crm.manager.controller;

import com.crm.manager.service.activity.CustomActivitySurplusExcludeFeignService;
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.surplus.CustomActivitySurplusExcludeDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.custom.activity.surplus.CustomActivitySurplusExcludeAddEntity;
import com.crm.rely.backend.core.entity.custom.activity.surplus.CustomActivitySurplusExcludeDeleteEntitys;
import com.crm.rely.backend.core.entity.custom.activity.surplus.CustomActivitySurplusExcludeSearchEntity;
import com.crm.rely.backend.core.entity.custom.activity.surplus.CustomActivitySurplusExcludeUpdateEntity;
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;

@RestController
@RequestMapping("/custom/activity/surplus/exclude")
public class CustomActivitySurplusExcludeController {

    @Autowired
    private CustomActivitySurplusExcludeFeignService surplusExcludeFeignServic;

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

    @PostMapping("/delete")
    public BaseResultDto delete(@RequestBody @Validated CustomActivitySurplusExcludeDeleteEntitys entitys) throws Exception {
        return surplusExcludeFeignServic.delete(entitys);
    }

    @PostMapping("/update")
    public BaseResultDto update(@RequestBody @Validated CustomActivitySurplusExcludeUpdateEntity entity) throws Exception {

        return surplusExcludeFeignServic.update(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<CustomActivitySurplusExcludeDto> pageList(@RequestBody CustomActivitySurplusExcludeSearchEntity entity) throws Exception {

        return surplusExcludeFeignServic.searchPageList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto searchSingle(@RequestBody @Validated SingleLongEntity entity) throws Exception {
        return surplusExcludeFeignServic.searchSingle(entity);
    }
}
