package com.mortals.xhx.module.access.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.access.dao.AccessLogDao;
import com.mortals.xhx.module.access.model.AccessLogEntity;
import com.mortals.xhx.module.access.service.AccessLogService;

import java.util.Date;

/**
* AccessLogService
* 访问日志 service实现
*
* @author zxfei
* @date 2022-08-17
*/
@Service("accessLogService")
public class AccessLogServiceImpl extends AbstractCRUDServiceImpl<AccessLogDao, AccessLogEntity, Long> implements AccessLogService {

    public static void main(String[] args) {
        Snowflake snowflake = IdUtil.getSnowflake(0, 1);
        long id = snowflake.nextId();

        System.out.println(id);

        long generateDateTime = snowflake.getGenerateDateTime(id);
        System.out.println(DateUtil.date(generateDateTime).toString());

    }
}