package com.cusc.nirvana.user.rnr.fp.controller;

import com.cusc.nirvana.common.result.Response;
import com.cusc.nirvana.user.rnr.fp.dto.FpDirectTboxChangeDTO;
import com.cusc.nirvana.user.rnr.fp.service.IFpChangeTboxService;
import com.cusc.nirvana.user.rnr.mg.dto.MgRnrCardInfoDTO;
import com.cusc.nirvana.user.rnr.mg.dto.RnrRelationDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/change/tbox")
public class ChangeTboxController {

    @Autowired
    private IFpChangeTboxService changeTboxService;

    @PostMapping("/unbindCards")
    public Response unbindCards(@RequestBody List<MgRnrCardInfoDTO> cardInfoDTOS) {
        return changeTboxService.unbindCardList(cardInfoDTOS);
    }

    @PostMapping("/bindCards")
    public Response bindCards(@RequestBody List<MgRnrCardInfoDTO> cardInfoDTOS) {
        return changeTboxService.bindCardList(cardInfoDTOS);
    }

    @PostMapping("/directChangeBox")
    public Response directChangeBox(@RequestBody FpDirectTboxChangeDTO tboxChangeDTO) {
        return changeTboxService.directChangeBox(tboxChangeDTO);
    }

    @PostMapping("/submit")
    public Response<Boolean> submit(@RequestBody RnrRelationDTO dto) {
        return changeTboxService.submit(dto);
    }

    @PostMapping("/checkStatus")
    public Response<Boolean> checkStatus(@RequestBody List<String> iccids) {
        return changeTboxService.checkNewIccid(iccids);
    }

}
