提交 80416707 authored 作者: Whispa's avatar Whispa

commit

上级 b18662ef
......@@ -269,8 +269,8 @@ public class AuthController extends Controller {
Calendar cal = Calendar.getInstance();
long currentTime = cal.getTimeInMillis();
long Max = 999999L;
long Min = 100000L;
long Max = 9999999999999L;
long Min = 1000000000000L;
long range = Math.abs((long) (Math.random() * (Max - Min)) + Min);
long id = Math.addExact(currentTime, range);
......
......@@ -6,7 +6,9 @@ import lombok.Setter;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Entity
@Getter
......@@ -70,4 +72,11 @@ public class Content extends Model {
public String getContent() {
return content;
}
public Map<String,Object> getMap() {
HashMap<String, Object> map = new HashMap<>();
map.put("content",getContent());
map.put("image",isImage);
return map;
}
}
......@@ -10,6 +10,7 @@ import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Entity
......@@ -127,8 +128,8 @@ public class Post extends Model {
@JsonProperty
public List<String> items() {
return contentList.stream().map(Content::getContent).collect(Collectors.toList());
public List<Map<String,Object>> items() {
return contentList.stream().map(Content::getMap).collect(Collectors.toList());
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论