package com.xhkjedu.slog.service.log;

import com.xhkjedu.model.slog.THandleLog;
import com.xhkjedu.slog.mapper.log.HandleLogMapper;
import com.xhkjedu.utils.N_Utils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

/**
 * @Description：操作日志
 * @Author: WN
 * @Date: 2023/11/15 10:31:42
 **/
@Service
public class HandleLogService {

    @Resource
    private HandleLogMapper handleLogMapper;
    @Resource
    private HttpServletRequest request;

    /*
     * @Description 保存登录日志
     * @Date 2023/11/15 10:46:12
     * @Author WN
     * @Param [handleLog]
     * @Return java.lang.Integer
     **/
    public Integer add(THandleLog handleLog){
        handleLog.setHandletime(N_Utils.getSecondTimestamp());

        return handleLogMapper.insertUseGeneratedKeys(handleLog);
    }

    /*
     * @Description 操作日志列表-校园
     * @Date 2023/11/15 10:56:58
     * @Author WN
     * @Param [handleLog]
     * @Return java.util.List<com.xhkjedu.sapi.model.log.THandleLog>
     **/
    public List<THandleLog> listHandleLogForSchool(THandleLog handleLog){
        return handleLogMapper.listHandleLogForSchool(handleLog);
    }

    /*
     * @Description 操作日志列表-区域
     * @Date 2023/11/15 11:05:51
     * @Author WN
     * @Param [handleLog]
     * @Return java.util.List<java.util.Map>
     **/
    public List<Map> listHandleLogForCloud(THandleLog handleLog){
        return handleLogMapper.listHandleLogForCloud(handleLog);
    }
}
