package com.crm.manager.controller;

import com.crm.manager.service.merchant.MerchantLoginUnsubscribeFeignService;
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.merchant.unsubscribe.MerchantLoginUnsubscribeDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.merchant.unsubscribe.MerchantLoginUnsubscribeApproveEntity;
import com.crm.rely.backend.core.entity.merchant.unsubscribe.MerchantLoginUnsubscribeDeleteEntity;
import com.crm.rely.backend.core.entity.merchant.unsubscribe.MerchantLoginUnsubscribeSearchEntity;
import org.springframework.beans.factory.annotation.Autowired;
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("/login/unsubscribe")
public class MerchantLoginUnsubscribeController {


    @Autowired
    private MerchantLoginUnsubscribeFeignService service;


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

        return service.delete(entity);
    }

    @PostMapping("/approve")
    public BaseResultDto approve(@RequestBody MerchantLoginUnsubscribeApproveEntity entity) throws Exception {


        return service.approve(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<MerchantLoginUnsubscribeDto> searchPage(@RequestBody MerchantLoginUnsubscribeSearchEntity entity) throws Exception {

        return service.searchPage(entity);
    }

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

        return service.searchSingle(entity);
    }

    @PostMapping("/callback")
    public BaseResultDto callback(@RequestBody SingleLongEntity entity) throws Exception {

        return service.callback(entity);
    }
}
