fix(工作台): 待办计划列表排序未生效

--bug=1049452 --user=宋昌昌 【工作台】待办-测试计划列表-创建时间-点击排序未生效 https://www.tapd.cn/55049933/s/1616331
This commit is contained in:
song-cc-rock 2024-11-25 13:52:39 +08:00 committed by Craftsman
parent eeb21b425d
commit 66551a3b4f
1 changed files with 4 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
@ -64,7 +65,9 @@ public class ToDoController {
@CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project")
public Pager<List<TestPlanResponse>> planPage(@Validated @RequestBody TestPlanTableRequest request) {
// 默认按照创建时间倒序
if (MapUtils.isEmpty(request.getSort())) {
request.setSort(Map.of("createTime", "desc"));
}
request.setMyTodo(true);
request.setMyTodoUserId(SessionUtils.getUserId());
return testPlanManagementService.page(request);