package com.schisandra.system.domain.service.impl;


import com.schisandra.system.domain.convert.SchisandraSysLogBOConverter;
import com.schisandra.system.domain.bo.SchisandraSysLogBO;
import com.schisandra.system.domain.service.SchisandraSysLogDomainService;
import com.schisandra.system.infra.basic.entity.SchisandraSysLog;
import com.schisandra.system.infra.basic.service.SchisandraSysLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 *  领域service实现了
 *
 * @author landaiqing
 * @since 2024-05-12 14:21:42
 */
@Service
@Slf4j
public class SchisandraSysLogDomainServiceImpl implements SchisandraSysLogDomainService {

    @Resource
    private SchisandraSysLogService schisandraSysLogService;

    @Override
    public Boolean add(SchisandraSysLogBO schisandraSysLogBO) {
        SchisandraSysLog schisandraSysLog = SchisandraSysLogBOConverter.INSTANCE.convertBOToEntity(schisandraSysLogBO);
        return schisandraSysLogService.insert(schisandraSysLog) > 0;
    }

    @Override
    public Boolean update(SchisandraSysLogBO schisandraSysLogBO) {
        SchisandraSysLog schisandraSysLog = SchisandraSysLogBOConverter.INSTANCE.convertBOToEntity(schisandraSysLogBO);
        return schisandraSysLogService.update(schisandraSysLog) > 0;
    }

    @Override
    public Boolean delete(SchisandraSysLogBO schisandraSysLogBO) {
        SchisandraSysLog schisandraSysLog = new SchisandraSysLog();
        schisandraSysLog.setId(schisandraSysLogBO.getId());
        return schisandraSysLogService.update(schisandraSysLog) > 0;
    }

}
