package com.crm.manager.controller;

import com.crm.manager.service.ib.MamSubsApplyFeignService;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.BaseResultWithPagerDto;
import com.crm.rely.backend.core.dto.mam.MamSubsApplyDto;
import com.crm.rely.backend.core.entity.mam.MamSubsApplyListEntity;
import com.crm.rely.backend.core.entity.mam.MamSubsApproveEntity;
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;

import java.util.List;

/**
 * Created by max on 2020/9/1.
 */
@RestController
@RequestMapping("/mam/subs")
public class MamSubsApplyController {

    @Autowired
    private MamSubsApplyFeignService mamSubsApplyFeignService;

    @PostMapping("/approve")
    public BaseResultDto<Object> approve(@RequestBody MamSubsApproveEntity entity) throws Exception {
        return mamSubsApplyFeignService.approve(entity);
    }

    @PostMapping("/apply/list")
    public BaseResultWithPagerDto<List<MamSubsApplyDto>> getList(@RequestBody MamSubsApplyListEntity entity) throws Exception {
        return mamSubsApplyFeignService.getList(entity);
    }

}
