package com.trade.client.system.controller;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.trade.common.utils.LoggerUtil;
import com.trade.service.contract.queue.MessageSender;

/**
 * e签宝回调
 */
@RestController
public class ESignCallBackController {

    protected final Logger logger = LoggerUtil.logger(LoggerUtil.LogFileNameEnum.SYS_LOG);;
    @Resource
    MessageSender messageSender;

    @PostMapping("/notice/signStatus")
    public Object doNoticeESignStatus(@RequestBody String requestBody) {
        logger.info("收到e签宝回调通知：{}", requestBody);
        // 推送mq,异步处理
        messageSender.sendESignCallbackMessage(requestBody);
        return true;
    }
}
