package com.crm.manager.controller;

import com.crm.manager.service.merchant.MerchantLoginSubscribeFeignService;
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.subscribe.MerchantLoginSubscribeDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.merchant.subscribe.MerchantLoginSubscribeApproveEntity;
import com.crm.rely.backend.core.entity.merchant.subscribe.MerchantLoginSubscribeDeleteEntity;
import com.crm.rely.backend.core.entity.merchant.subscribe.MerchantLoginSubscribeSearchEntity;
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/subscribe")
public class MerchantLoginSubscribeController {


    @Autowired
    private MerchantLoginSubscribeFeignService service;


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

        return service.delete(entity);
    }

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


        return service.approve(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<MerchantLoginSubscribeDto> searchPage(@RequestBody MerchantLoginSubscribeSearchEntity 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);
    }
}
