Commit c272b204 authored by Administrator's avatar Administrator

Delete DistributedIDService.java

parent b5f407d2
package pwc.taxtech.atms.service.impl;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.SnowFlake;
import javax.annotation.PostConstruct;
@Component
public class DistributedIdService extends BaseService {
@Value("${distributed_id_datacenter}")
private Integer dataCenterId;
@Value("${distributed_id_machine}")
private Integer machineId;
private SnowFlake snowFlake;
@PostConstruct
public void init() {
snowFlake = new SnowFlake(dataCenterId, machineId);
}
/**
* 获取Id
*
* @return long
*/
public long nextId() {
return snowFlake.nextId();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment