|
|
@@ -2,6 +2,7 @@
|
|
|
using Business.ResourceExamineManagement;
|
|
|
using Business.ResourceExamineManagement.Dto;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
+using MongoDB.Bson.IO;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
@@ -9,6 +10,7 @@ using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
using Volo.Abp;
|
|
|
using Volo.Abp.AspNetCore.Mvc;
|
|
|
+using Newtonsoft.Json;
|
|
|
|
|
|
namespace Business.Controllers
|
|
|
{
|
|
|
@@ -25,10 +27,19 @@ namespace Business.Controllers
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet]
|
|
|
- public long CreatePrimaryKey()
|
|
|
+ public string CreatePrimaryKey(int count)
|
|
|
{
|
|
|
+ //雪花算法帮助类
|
|
|
SnowFlake snow = new SnowFlake();
|
|
|
- return snow.NextId();
|
|
|
+ //返回值
|
|
|
+ List<long> ids = new List<long>();
|
|
|
+ for (int i = 0; i < count;i++)
|
|
|
+ {
|
|
|
+ //雪花算法生成id
|
|
|
+ ids.Add(snow.NextId());
|
|
|
+ }
|
|
|
+ var json = Newtonsoft.Json.JsonConvert.SerializeObject(ids);
|
|
|
+ return json;
|
|
|
}
|
|
|
}
|
|
|
}
|