package com.brilliance.isc.common.api.fftmsg.controller;

import com.brilliance.isc.common.api.fftmsg.service.FftmsgService;
import com.brilliance.isc.vo.FftmsgVo;
import com.brilliance.isc.vo.ResponseSet;
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("/fftmsg")
public class FftmsgController {

    @Autowired
    private FftmsgService fftmsgService;

    @PostMapping("/query")
    public ResponseSet<Boolean> queryFftmsg(@RequestBody FftmsgVo fftmsg) {
        return ResponseSet.simpleSuccess(fftmsgService.queryFftmsg(fftmsg));
    }

    @PostMapping("/bund")
    public ResponseSet<Boolean> bundFftmsg(@RequestBody FftmsgVo fftmsg) {
        fftmsgService.bundFftmsg(fftmsg);
        return ResponseSet.simpleSuccess("绑定成功");
    }

    @PostMapping("/unBund")
    public ResponseSet<Boolean> unBundFftmsg(@RequestBody FftmsgVo fftmsg) {
        fftmsgService.unBundFftmsg(fftmsg);
        return ResponseSet.simpleSuccess("解绑成功");
    }
}
