package cn.common.service.impl;

import cn.common.common.constants.BaseConstant;
import cn.common.common.utils.common.DateTimeUtil;
import cn.common.common.utils.spring.SnowflakeIdWorker;
import cn.common.repository.repository.PlatformDictRepository;
import cn.common.service.PlatformService;
import lombok.extern.slf4j.Slf4j;
import ma.glasnost.orika.MapperFacade;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Singer create by singer email:singer-coder@qq.com
 * @projectName health-platform-api
 * @Description: 管理平台操作服务方法实现
 * @date 2020-06-11
 */
@Service(value = "platformService")
@Slf4j
public class PlatformServiceImpl implements PlatformService {

    @Resource
    private BaseConstant baseConstant;

    @Resource
    private PlatformDictRepository platformDictRepository;

    @Resource
    private MapperFacade mapperFacade;

    /**
      * 生成雪花算法ID
      * @author: create by singer - Singer email:singer-coder@qq.com
      * @date 2021/5/10
      * @return String
      */
    @Override
    public String snowflakeId(){
        return SnowflakeIdWorker.uniqueMainId();
    }

    /**
     * 当前服务器时间
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2021/5/10
     * @return String
     */
    @Override
    public Long currenLongTime(){
        return DateTimeUtil.currenLongTime();
    }

}
