feat: add authentication and tenant context

This commit is contained in:
王鹏
2026-07-07 15:12:51 +08:00
parent 982f104f3d
commit 51e0f3a5ad
10 changed files with 341 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package com.linhelp.common.security;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class TenantContextTests {
@AfterEach
void clear() {
TenantContext.clear();
}
@Test
void storesTenantAndCommunityForCurrentRequestThread() {
TenantContext.set(1L, 10L);
assertThat(TenantContext.tenantId()).isEqualTo(1L);
assertThat(TenantContext.communityId()).isEqualTo(10L);
}
}