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

import com.cusc.nirvana.common.result.Response;
import com.cusc.nirvana.user.rnr.fp.dto.SurplusQueryRequestDTO;
import com.cusc.nirvana.user.rnr.fp.service.IFpSurplusCardBindService;
import com.cusc.nirvana.user.rnr.mg.dto.RnrRelationDTO;
import com.cusc.nirvana.user.rnr.mg.dto.SurplusConfirmDto;
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;

/**
 * @author yubo
 * @since 2022-05-03 16:58
 */
@RestController
@RequestMapping("/fp/surplusCard")
public class FpSurplusCardBindController {


    @Autowired
    IFpSurplusCardBindService bindService;

    @PostMapping("/bind")
    public Response surplusCardBind(@RequestBody RnrRelationDTO dto) {
        return Response.createSuccess(bindService.surplusCardBind(dto));
    }

    @PostMapping("/bindDirect")
    public Response surplusCardBindDirect(@RequestBody RnrRelationDTO dto) {
        return Response.createSuccess(bindService.surplusCardBindDirect(dto));
    }


    @PostMapping("/confirm")
    public Response confirm(@RequestBody SurplusConfirmDto dto) {
        return Response.createSuccess(bindService.confirm(dto));
    }

    /**
     * 查询结果
     *
     * @param bean
     * @return
     */
    @PostMapping("/queryResult")
    public Response queryResult(@RequestBody SurplusQueryRequestDTO bean) {
        return Response.createSuccess(bindService.queryResult(bean));
    }

}
