Commit efa8a3e2 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 43500513 c272b204
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