com.nbsaas.boot.no.ext.resource.NoSequenceExtResource Maven / Gradle / Ivy
The newest version!
package com.nbsaas.boot.no.ext.resource;
import com.nbsaas.boot.no.api.apis.NoSequenceApi;
import com.nbsaas.boot.no.ext.apis.NoSequenceExtApi;
import com.nbsaas.boot.no.rest.generator.*;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class NoSequenceExtResource implements NoSequenceExtApi {
@Resource
private NoSequenceApi noSequenceApi;
@Override
public String generate(String key) {
CompositeGenerator generator = new CompositeGenerator(
new KeyGenerator(key),
new DateGenerator("yyyyMMdd"),
new RandomGenerator(4),
new StepGenerator(key,noSequenceApi,6)
);
return generator.generate();
}
}