增加Times
This commit is contained in:
@@ -8,7 +8,7 @@ package org.redkale.test.service;
|
||||
import java.nio.channels.CompletionHandler;
|
||||
import org.redkale.annotation.Resource;
|
||||
import org.redkale.service.*;
|
||||
import org.redkale.util.Utility;
|
||||
import org.redkale.util.Times;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -31,19 +31,19 @@ public class CService implements Service {
|
||||
}
|
||||
|
||||
public RetResult<String> ccCurrentTime1(final String name) {
|
||||
String rs = "同步ccCurrentTime1: " + name + ": " + Utility.formatTime(System.currentTimeMillis());
|
||||
String rs = "同步ccCurrentTime1: " + name + ": " + Times.formatTime(System.currentTimeMillis());
|
||||
System.out.println("执行了 CService.ccCurrentTime1++++同步方法1");
|
||||
return new RetResult(rs);
|
||||
}
|
||||
|
||||
public void ccCurrentTime2(final CompletionHandler<RetResult<String>, Void> handler, final String name) {
|
||||
String rs = "异步ccCurrentTime2: " + name + ": " + Utility.formatTime(System.currentTimeMillis());
|
||||
String rs = "异步ccCurrentTime2: " + name + ": " + Times.formatTime(System.currentTimeMillis());
|
||||
System.out.println("执行了 CService.ccCurrentTime2----异步方法2");
|
||||
if (handler != null) handler.completed(new RetResult(rs), null);
|
||||
}
|
||||
|
||||
public void mcCurrentTime3(final MyAsyncHandler<RetResult<String>, Void> handler, final String name) {
|
||||
String rs = "异步mcCurrentTime3: " + name + ": " + Utility.formatTime(System.currentTimeMillis());
|
||||
String rs = "异步mcCurrentTime3: " + name + ": " + Times.formatTime(System.currentTimeMillis());
|
||||
System.out.println("执行了 CService.mcCurrentTime3----异步方法3");
|
||||
if (handler != null) handler.completed(new RetResult(rs), null);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ package org.redkale.test.source;
|
||||
import java.io.Serializable;
|
||||
import org.redkale.persistence.*;
|
||||
import org.redkale.source.*;
|
||||
import org.redkale.util.Times;
|
||||
import org.redkale.util.Utility;
|
||||
|
||||
/**
|
||||
@@ -115,7 +116,7 @@ public class LoginRecord extends BaseEntity {
|
||||
LoginRecord record = new LoginRecord();
|
||||
long now = System.currentTimeMillis();
|
||||
record.setCreatetime(now); //设置创建时间
|
||||
record.setLoginid(Utility.format36time(now) + "-" + Utility.uuid()); //主键的生成规则
|
||||
record.setLoginid(Times.format36time(now) + "-" + Utility.uuid()); //主键的生成规则
|
||||
//.... 填充其他字段
|
||||
source.insert(record);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user