用户同步

This commit is contained in:
2026-05-19 08:35:55 +08:00
parent 7c9ee9101e
commit b73f5505bf
10 changed files with 334 additions and 2 deletions

View File

@@ -72,6 +72,7 @@ public class LbUserController {
public ResponseEntity<Map<String, Object>> list(
@RequestParam(defaultValue = "1") Integer current,
@RequestParam(defaultValue = "10") Integer size,
@RequestParam(required = false) String tenantId,
@RequestParam(required = false) Long pid,
@RequestParam(required = false) String username,
@RequestParam(required = false) String nickname,
@@ -94,6 +95,7 @@ public class LbUserController {
lbUserService.pageQuery(
current,
size,
tenantId,
pid,
username,
nickname,
@@ -117,4 +119,20 @@ public class LbUserController {
}
return ResponseEntity.internalServerError().body(result);
}
@PostMapping("/sync-from-hxr")
@Operation(
summary = "从 hxrd 后台同步用户",
description =
"分页调用 /app/admin/user/select每页 limit=90将 data 解析为 LbUser 后立即 upsert 到 lb_user"
+ "需配置 hxr.admin.cookie 或 phpsid")
public ResponseEntity<Map<String, Object>> syncFromHxr(
@Parameter(description = "租户 id", required = true) @RequestParam String tenantId) {
Map<String, Object> result = lbUserService.syncFromHxrAdmin(tenantId);
Boolean success = (Boolean) result.get("success");
if (success != null && success) {
return ResponseEntity.ok(result);
}
return ResponseEntity.badRequest().body(result);
}
}