20260723173317
This commit is contained in:
1 parent
59b3ccfb1c
commit
5f73b54802
33 files changed
+3064
-2108
No files matched your search
@@ -8,11 +8,13 @@ import cn.g3soft.fmsapi.utils.snowflake.idgen.IdGenerator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -56,8 +58,15 @@ public class DataController {
|
||||
}
|
||||
|
||||
@GetMapping("/nextid")
|
||||
public ApiResponse<Long> nextId() {
|
||||
return ApiResponse.success(IdGenerator.nextId());
|
||||
public ApiResponse<?> nextId(@RequestParam(required = false, defaultValue = "1") int count) {
|
||||
if (count <= 1) {
|
||||
return ApiResponse.success(IdGenerator.nextId());
|
||||
}
|
||||
List<Long> ids = new ArrayList<>();
|
||||
for (int i = 0; i < count; i++) {
|
||||
ids.add(IdGenerator.nextId());
|
||||
}
|
||||
return ApiResponse.success(ids);
|
||||
}
|
||||
|
||||
@PostMapping("/describe")
|
||||
|
||||
@@ -76,7 +76,7 @@ public class DbUtils {
|
||||
sql.append(" WHERE ").append(searchCondition.trim());
|
||||
}
|
||||
if (hasText(orderBy)) {
|
||||
sql.append(" ORDER BY ").append(buildOrderBy(orderBy));
|
||||
sql.append(" ORDER BY ").append(buildPageOrderBy(orderBy));
|
||||
}
|
||||
|
||||
String querySql = sql.toString();
|
||||
|
||||
Reference in new issue
Block a user