用户同步
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user