package com.brilliance.isc.swift.messages.service.impl;

import com.brilliance.isc.swift.messages.service.MtMessageService;
import com.prowidesoftware.swift.model.mt.AbstractMT;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.io.IOException;
@Slf4j
@Service
public class MtMessageServiceImpl implements MtMessageService {

    @Override
    public AbstractMT analysis(String mtmessage, String msgtype) throws Exception {
        try {
            return AbstractMT.parse(mtmessage);
        } catch (IOException e) {
            log.error("swift报文 解析失败{}",e);
            throw new Exception(e);
        }

    }
}
