mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-09-20 19:35:46 +08:00
Query your own connection
This commit is contained in:
@ -46,4 +46,9 @@ public class OperationPageQueryParam extends PageQueryParam {
|
|||||||
* operation type
|
* operation type
|
||||||
*/
|
*/
|
||||||
private String operationType;
|
private String operationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,9 @@ public class OperationServiceImpl implements OperationService {
|
|||||||
if (StringUtils.isNotBlank(param.getOperationType())) {
|
if (StringUtils.isNotBlank(param.getOperationType())) {
|
||||||
queryWrapper.eq("operation_type", param.getOperationType());
|
queryWrapper.eq("operation_type", param.getOperationType());
|
||||||
}
|
}
|
||||||
|
if (param.getUserId() != null) {
|
||||||
|
queryWrapper.eq("user_id", param.getUserId());
|
||||||
|
}
|
||||||
Integer start = param.getPageNo();
|
Integer start = param.getPageNo();
|
||||||
Integer offset = param.getPageSize();
|
Integer offset = param.getPageSize();
|
||||||
Page<OperationSavedDO> page = new Page<>(start, offset);
|
Page<OperationSavedDO> page = new Page<>(start, offset);
|
||||||
|
@ -11,6 +11,7 @@ import ai.chat2db.server.tools.base.wrapper.result.ActionResult;
|
|||||||
import ai.chat2db.server.tools.base.wrapper.result.DataResult;
|
import ai.chat2db.server.tools.base.wrapper.result.DataResult;
|
||||||
import ai.chat2db.server.tools.base.wrapper.result.PageResult;
|
import ai.chat2db.server.tools.base.wrapper.result.PageResult;
|
||||||
import ai.chat2db.server.tools.base.wrapper.result.web.WebPageResult;
|
import ai.chat2db.server.tools.base.wrapper.result.web.WebPageResult;
|
||||||
|
import ai.chat2db.server.tools.common.util.ContextUtils;
|
||||||
import ai.chat2db.server.web.api.controller.operation.saved.converter.OperationWebConverter;
|
import ai.chat2db.server.web.api.controller.operation.saved.converter.OperationWebConverter;
|
||||||
import ai.chat2db.server.web.api.controller.operation.saved.request.BatchTabCloseRequest;
|
import ai.chat2db.server.web.api.controller.operation.saved.request.BatchTabCloseRequest;
|
||||||
import ai.chat2db.server.web.api.controller.operation.saved.request.OperationCreateRequest;
|
import ai.chat2db.server.web.api.controller.operation.saved.request.OperationCreateRequest;
|
||||||
@ -54,6 +55,7 @@ public class OperationSavedController {
|
|||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public WebPageResult<OperationVO> list(OperationQueryRequest request) {
|
public WebPageResult<OperationVO> list(OperationQueryRequest request) {
|
||||||
OperationPageQueryParam param = operationWebConverter.queryReq2param(request);
|
OperationPageQueryParam param = operationWebConverter.queryReq2param(request);
|
||||||
|
param.setUserId(ContextUtils.getUserId());
|
||||||
PageResult<Operation> dtoPageResult = operationService.queryPage(param);
|
PageResult<Operation> dtoPageResult = operationService.queryPage(param);
|
||||||
List<OperationVO> operationVOS = operationWebConverter.dto2vo(dtoPageResult.getData());
|
List<OperationVO> operationVOS = operationWebConverter.dto2vo(dtoPageResult.getData());
|
||||||
return WebPageResult.of(operationVOS, dtoPageResult.getTotal(), request.getPageNo(), request.getPageSize());
|
return WebPageResult.of(operationVOS, dtoPageResult.getTotal(), request.getPageNo(), request.getPageSize());
|
||||||
|
Reference in New Issue
Block a user