use of com.tvd12.ezyfox.bean.annotation.EzyPostInit in project ezyfox-server-example by tvd12.
the class WheelService method postInit.
@EzyPostInit
public void postInit() {
wheel = wheelRepo.findById("wheel");
if (wheel == null) {
wheel = loadWheelFromJsonFile();
wheelRepo.save(wheel);
}
emptyFragments = wheel.getFragments().stream().filter(it -> it.getPrizeType() == WheelPrizeType.EMPTY).collect(Collectors.toList());
AtomicInteger lastRange = new AtomicInteger(0);
randomRanges = wheel.getFragments().stream().map(it -> lastRange.addAndGet((int) ((it.getRatio() / 100.0) * RANDOM_MAX_VALUE))).collect(Collectors.toList());
}
use of com.tvd12.ezyfox.bean.annotation.EzyPostInit in project ezyhttp by youngmonkeys.
the class CustomerService method postInit.
@EzyPostInit
public void postInit() {
save(new Customer(1L, "Hello", 25));
save(new Customer(2L, "World", 26));
}
Aggregations