package com.ann.demo.service.impl;

import com.ann.demo.entity.interfaceEntity.MessageLog;
import com.ann.demo.repository.MessageRepository;
import com.ann.demo.service.MessageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Date 2019/7/9 10:24
 * @Created by  ljx
 */
@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    MessageRepository messageRepository;

    @Override
    public void save(MessageLog log) {
        messageRepository.save(log);
    }

    @Override
    public Integer countByInputContentAndInterfaceName(String xmlStr, String hipMessageServer) throws Exception{
        return messageRepository.countByInputContentAndInterfaceName(xmlStr, hipMessageServer);
    }

    @Override
    public List<MessageLog> findAllMessage() throws Exception {
        List<MessageLog> allHaha = messageRepository.findAllHaha();
        System.out.println(allHaha.size());
        return allHaha;
    }

    public String getArchiveMasterId(String inpNo,String visitId) {
        return  messageRepository.getArchiveMasterId(inpNo, visitId);
    }
}
