init ai backend

This commit is contained in:
Chuck1sn
2025-05-20 21:35:45 +08:00
parent f5a57f9d69
commit f103993960
11 changed files with 156 additions and 19 deletions

View File

@@ -15,7 +15,6 @@ import com.zl.mjga.repository.PermissionRepository;
import com.zl.mjga.repository.RoleRepository;
import com.zl.mjga.repository.UserRepository;
import com.zl.mjga.service.IdentityAccessService;
import java.time.OffsetDateTime;
import java.util.List;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -58,21 +57,22 @@ public class JacksonAnnotationMvcTest {
.andExpect(jsonPath("$.data[0].password").doesNotExist());
}
// @Test
// @WithMockUser
// void dateFieldWithFormatAnnotation_whenResponseIncludeField_fieldShouldBeExpectDataFormat()
// throws Exception {
// OffsetDateTime stubCreateDateTime =
// OffsetDateTime.of(2023, 12, 2, 1, 1, 1, 0, OffsetDateTime.now().getOffset());
// UserRolePermissionDto stubUserRolePermissionDto = new UserRolePermissionDto();
// stubUserRolePermissionDto.setCreateTime(stubCreateDateTime);
// when(identityAccessService.pageQueryUser(any(PageRequestDto.class), any(UserQueryDto.class)))
// .thenReturn(new PageResponseDto<>(1, List.of(stubUserRolePermissionDto)));
// mockMvc
// .perform(
// get(String.format("/iam/users?page=1&size=5&username=%s", "7bF3mcNVTj6P6v2"))
// .contentType(MediaType.APPLICATION_FORM_URLENCODED))
// .andExpect(status().isOk())
// .andExpect(jsonPath("$.data[0].createTime").value("2023-12-02 01:01:01"));
// }
// @Test
// @WithMockUser
// void dateFieldWithFormatAnnotation_whenResponseIncludeField_fieldShouldBeExpectDataFormat()
// throws Exception {
// OffsetDateTime stubCreateDateTime =
// OffsetDateTime.of(2023, 12, 2, 1, 1, 1, 0, OffsetDateTime.now().getOffset());
// UserRolePermissionDto stubUserRolePermissionDto = new UserRolePermissionDto();
// stubUserRolePermissionDto.setCreateTime(stubCreateDateTime);
// when(identityAccessService.pageQueryUser(any(PageRequestDto.class),
// any(UserQueryDto.class)))
// .thenReturn(new PageResponseDto<>(1, List.of(stubUserRolePermissionDto)));
// mockMvc
// .perform(
// get(String.format("/iam/users?page=1&size=5&username=%s", "7bF3mcNVTj6P6v2"))
// .contentType(MediaType.APPLICATION_FORM_URLENCODED))
// .andExpect(status().isOk())
// .andExpect(jsonPath("$.data[0].createTime").value("2023-12-02 01:01:01"));
// }
}