Commit 78962897 by 章家宝

feat:检测端h5接口代码提交

1 parent 4a0884b4
......@@ -110,7 +110,7 @@ public class InspectionWorkOrderController {
@Operation(summary = "获取检测工单详情", description = "获取检测工单详情")
@PostMapping("/detail/{id}")
@GetMapping("/detail/{id}")
public BaseResp<InspectionWODetailRespVO> pageList(@PathVariable("id") Long id) {
log.info("获取检测工单详情: {}", id);
try {
......
......@@ -2,6 +2,8 @@
server:
port: 6904
logging:
level:
root: info
location: /Users/gonglei/aus
spring:
task:
......
package com.glsx.usedcar.resp;
import lombok.Data;
import org.summerframework.core.enums.ErrorCodeEnum;
/**
* 通用返回结果类
......@@ -96,6 +97,17 @@ public class BaseResp<T> {
return resp;
}
public static <T> BaseResp<T> fail(ErrorCodeEnum errorCodeEnum) {
BaseResp<T> resp = new BaseResp<>();
resp.setSuccess(false);
resp.setCode(errorCodeEnum.getCode().toString());
resp.setMessage(errorCodeEnum.getMessage());
resp.setData(null);
return resp;
}
/**
* 失败响应(默认错误码+自定义错误消息)
* 默认错误码:999999(系统异常)
......
package com.glsx.usedcar.advice;
import com.glsx.usedcar.resp.BaseResp;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.HibernateException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.*;
import java.util.stream.Collectors;
/**
* 全局异常处理器,捕获所有Controller层未处理的异常
*/
@Slf4j
@RestControllerAdvice // 作用于所有@RestController
public class GlobalExceptionHandler {
// 捕获所有未指定的异常(兜底)
@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) // 明确返回500状态码
public BaseResp<Void> handleAllUncaughtException(Exception e) {
// 打印完整异常堆栈
log.error("全局捕获未处理异常:", e);
// 返回标准化错误响应
return BaseResp.fail("服务器内部错误:" + e.getMessage());
}
// 捕获参数校验异常(比如@Valid校验失败)
@ExceptionHandler(MethodArgumentNotValidException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public BaseResp<Void> handleValidationException(MethodArgumentNotValidException e) {
log.error("参数校验失败:", e);
String errorMsg = e.getBindingResult().getFieldErrors().stream()
.map(fieldError -> fieldError.getField() + ":" + fieldError.getDefaultMessage())
.collect(Collectors.joining(","));
return BaseResp.fail("参数错误:" + errorMsg);
}
// 捕获JPA/Hibernate相关异常
@ExceptionHandler(HibernateException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public BaseResp<Void> handleHibernateException(HibernateException e) {
log.error("数据库查询异常:", e);
return BaseResp.fail("数据库操作失败:" + e.getMessage());
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Configuration;
* <pre>
* Knife4j/OpenAPI配置类
* 用于启用和配置Swagger文档
* 访问地址:<a href="http://localhost:6903/admin/doc.html">aus-admin API文档</a>
* 访问地址:<a href="http://localhost:6904/doc.html">aus-admin API文档</a>
* </pre>
* @author yangwei
* @since 2026/2/9 18:25
......@@ -21,9 +21,9 @@ public class OpenApiConfig {
public OpenAPI customOpenApi() {
return new OpenAPI()
.info(new Info()
.title("aus-admin API文档")
.title("aus-inspect API文档")
.version("1.0.0")
.description("专电优拍后台管理系统API接口文档")
.description("专电优拍检测端H5 API接口文档")
.contact(new Contact()
.name("开发团队")
.email("yangwei@didihu.com.cn")
......
package com.glsx.usedcar.config;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.hibernate5.jakarta.Hibernate5JakartaModule;
import com.fasterxml.jackson.datatype.jsr310.ser.*;
import com.glsx.usedcar.interceptor.LoginInterceptor;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.*;
import org.springframework.data.domain.Page;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.summerframework.cache.CachedPropertyManager;
import org.summerframework.cache.CachedPropertySerializerModifier;
import org.summerframework.orm.paging.JsonPageSerializer;
import org.summerframework.storage.domain.FileInfo;
import org.summerframework.storage.web.FileInfoSerializer;
import org.summerframework.web.rest.deserializer.*;
import java.time.*;
import static org.summerframework.core.util.DateTimeUtils.*;
import static org.summerframework.core.util.DateTimeUtils.DATE_FORMATTER;
import static org.summerframework.core.util.DateTimeUtils.DATE_TIME_NO_SECOND_FORMATTER;
import static org.summerframework.core.util.DateTimeUtils.TIME_FORMATTER;
/**
* Web配置:注册拦截器
......@@ -31,5 +51,37 @@ public class WebConfig implements WebMvcConfigurer {
public RestTemplate restTemplate() {
return new RestTemplate();
}
/**
* JSON数据 序列化、反序列化
*/
@Bean
@Primary
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(CachedPropertyManager cachedPropertyManager) {
Hibernate5JakartaModule module = new Hibernate5JakartaModule();
module.disable(Hibernate5JakartaModule.Feature.USE_TRANSIENT_ANNOTATION);
JsonPageSerializer jsonPageSerializer = new JsonPageSerializer();
FileInfoSerializer fileInfoSerializer = new FileInfoSerializer();
Jackson2ObjectMapperBuilder jacksonBuilder = new Jackson2ObjectMapperBuilder()
.failOnUnknownProperties(false)
.serializationInclusion(JsonInclude.Include.NON_EMPTY)
.serializerByType(Page.class, jsonPageSerializer)
.serializerByType(FileInfo.class, fileInfoSerializer)
.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DATE_TIME_FORMATTER))
.serializerByType(LocalDate.class, new LocalDateSerializer(DATE_FORMATTER))
.serializerByType(LocalTime.class, new LocalTimeSerializer(TIME_FORMATTER))
.deserializerByType(LocalDateTime.class, new LocalDateTimeAttemptDeserializer(DATE_TIME_NO_SECOND_FORMATTER))
.deserializerByType(LocalDate.class, new LocalDateAttemptDeserializer(DATE_FORMATTER))
.deserializerByType(LocalTime.class, new LocalTimeAttemptDeserializer(TIME_FORMATTER));
MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter(jacksonBuilder.build());
ObjectMapper objectMapper = jsonConverter.getObjectMapper();
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
objectMapper.registerModule(module);
jsonPageSerializer.setObjectMapper(objectMapper);
objectMapper.setSerializerFactory(objectMapper.getSerializerFactory().withSerializerModifier(new CachedPropertySerializerModifier(cachedPropertyManager)));
return jsonConverter;
}
}
\ No newline at end of file
......@@ -73,4 +73,12 @@ public class InspectorContext {
public static boolean hasLogin() {
return getInspector() != null;
}
public static Object getInspectorName() {
Inspector inspector = getInspector();
if (inspector == null) {
return "未登录用户";
}
return inspector.getName();
}
}
\ No newline at end of file
......@@ -9,6 +9,9 @@ import com.glsx.usedcar.module.inspect.entity.Inspector;
import com.glsx.usedcar.module.inspect.service.InspectorService;
import com.glsx.usedcar.resp.BaseResp;
import com.glsx.usedcar.util.SmsCodeUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
......@@ -21,12 +24,14 @@ import java.util.Date;
import static com.glsx.usedcar.conts.Constants.LOGIN_INSPECTOR;
/**
* 认证控制器:登录/注册/测试接口
* 认证控制器:负责登录、验证码发送、退出登录等认证相关接口
* 核心能力:手机号验证码登录、短信验证码发送(带防刷)、登录态销毁
*/
@Slf4j
@RestController
@RequestMapping("/api/auth")
@RequestMapping("/rest/auth")
@RequiredArgsConstructor
@Tag(name = "认证接口", description = "登录/验证码/退出登录相关接口")
public class AuthController {
private final JwtProvider jwtProvider;
private final SmsCodeUtil smsCodeUtil;
......@@ -35,34 +40,53 @@ public class AuthController {
private int codeExpire;
/**
* 发送验证码(带防刷控制)
* 发送短信验证码(带频率防刷控制)
* 接口规则:
* 1. 仅对已注册的检测员手机号发送
* 2. 同一手机号1分钟内仅允许发送1次验证码
* 3. 验证码有效期由配置项 sms.code-expire 控制
*
* @param req 验证码请求参数(包含待验证的手机号)
* @return 发送结果:success=true表示发送成功,false/msg提示失败原因
*/
@Operation(
summary = "发送登录验证码",
description = "向检测员手机号发送6位数字验证码,包含频率防刷(1分钟/次),仅支持已注册手机号"
)
@PostMapping("/send-code")
public BaseResp<Boolean> sendCode(@RequestBody @Valid VerifyCodeReq req) {
public BaseResp<Boolean> sendCode(
@Parameter(description = "验证码请求参数(手机号格式校验:11位有效手机号)")
@RequestBody @Valid VerifyCodeReq req) {
try {
// 校验用户是否存在
Inspector inspector = inspectorService.findByPhone(req.getPhone());
if (inspector == null) {
return BaseResp.fail("用户不存在");
}
// 校验发送频率
smsCodeUtil.checkSendFrequency(req.getPhone());
// 频率校验通过,生成并存储验证码
smsCodeUtil.generateAndSaveCode(req.getPhone());
return BaseResp.success(true);
} catch (RuntimeException e) {
// 捕获防刷异常,返回友好提示
log.warn("手机号{}发送验证码失败:{}", req.getPhone(), e.getMessage());
return BaseResp.fail("发送验证码失败");
return BaseResp.fail("发送验证码失败:" + e.getMessage());
}
}
/**
* 验证码登录
* 手机号+验证码登录接口
* 登录成功后生成JWT Token,供后续接口鉴权使用
*
* @param loginRequest 登录请求参数(手机号+6位验证码)
* @return 登录结果:包含JWT Token、手机号、Token过期时间
*/
@Operation(
summary = "验证码登录",
description = "检测员通过手机号+验证码登录,成功返回JWT Token(后续接口需携带Token鉴权)"
)
@PostMapping("/login")
public BaseResp<LoginByCodeResp> login(@RequestBody LoginByCodeReq loginRequest) {
public BaseResp<LoginByCodeResp> login(
@Parameter(description = "登录请求参数(手机号+验证码)")
@RequestBody LoginByCodeReq loginRequest) {
String phone = loginRequest.getPhone();
Inspector inspector = inspectorService.findByPhone(phone);
if (inspector == null) {
......@@ -82,12 +106,23 @@ public class AuthController {
}
/**
* 退出登录(需要Token)
* 退出登录接口(需携带有效登录Token)
* 注:当前仅返回退出成功,实际生产环境可补充Token黑名单/失效逻辑
*
* @param request HttpServletRequest:用于获取登录态中的检测员手机号
* @return 退出结果:success=true表示退出成功
*/
@Operation(
summary = "退出登录",
description = "检测员退出登录(需携带有效JWT Token),当前仅返回成功状态,可扩展Token失效逻辑"
)
@PostMapping("/logout")
@RequireLogin
public BaseResp<Boolean> logout(HttpServletRequest request) {
@RequireLogin // 自定义注解:校验请求头中的Token是否有效
public BaseResp<Boolean> logout(
@Parameter(hidden = true)
HttpServletRequest request) {
String phone = (String) request.getAttribute(LOGIN_INSPECTOR);
log.info("检测员{}执行退出登录操作", phone);
return BaseResp.success(true);
}
......
package com.glsx.usedcar.controller;
import com.glsx.usedcar.annotation.RequireLogin;
import com.glsx.usedcar.context.InspectorContext;
import com.glsx.usedcar.module.inspect.entity.InspectionReport;
import com.glsx.usedcar.module.inspect.service.InspectionReportService;
import com.glsx.usedcar.module.inspect.vo.InspectionReportRespVO;
import com.glsx.usedcar.module.security.entity.User;
import com.glsx.usedcar.req.InspectionReportReq;
import com.glsx.usedcar.resp.BaseResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;
import org.summerframework.orm.paging.Pagination;
@Slf4j
@Tag(name = "检测报告接口", description = "检测报告的增删改查、绑定解绑操作")
@RestController
@RequireLogin
@RequiredArgsConstructor
@RequestMapping("/rest/inspect/report")
public class InspectionReportController {
private final InspectionReportService inspectionReportService;
/**
* 分页查询检测报告列表
* 支持关键词模糊查询(报告编号、工单号、VIN等),关键词过滤逻辑由Service层处理
*
* @param req 分页请求参数(包含页码、每页条数)
* @return 分页的检测报告列表
*/
@Operation(summary = "分页查询检测报告", description = "支持关键词模糊查询(报告编号、工单号、VIN等)")
@PostMapping("/page")
public Page<InspectionReportRespVO> pageList(@Valid @RequestBody Pagination<InspectionReport> pagination, Authentication authentication) {
log.info("【接口请求】分页查询检测报告,操作人={},页码={},条数={}", getUserName(authentication), pagination.getOffset(), pagination.getLimit());
try {
Page<InspectionReportRespVO> result = inspectionReportService.pageList(pagination);
return result;
} catch (Exception e) {
log.error("【接口响应】分页查询检测报告失败!操作人={},系统异常!", getUserName(authentication), e);
return null;
}
}
public BaseResp<Page<InspectionReportRespVO>> pageList(@Valid @RequestBody InspectionReportReq req) {
// 1. 处理分页参数默认值(页码默认1,每页条数默认20)
int page = req.getPage() == null || req.getPage() < 1 ? 1 : req.getPage();
int size = req.getSize() == null || req.getSize() < 1 ? 20 : req.getSize();
log.info("【接口请求】分页查询检测报告,操作人={},页码={},条数={}",
InspectorContext.getInspectorName(), page, size);
/**
* 安全获取操作人姓名(避免空指针)
*/
private String getUserName(Authentication authentication) {
try {
return authentication != null ? ((User) authentication.getPrincipal()).getUserName() : "未知用户";
// 2. 构建分页对象(offset = (页码-1)*每页条数)
Pagination<InspectionReport> pagination = new Pagination<>((page - 1) * size, size);
// 3. 调用Service查询(若有关键词过滤,可在此添加pagination.addFilter逻辑)
Page<InspectionReportRespVO> result = inspectionReportService.pageList(pagination);
return BaseResp.success(result);
} catch (Exception e) {
return "未知用户";
log.error("【接口响应】分页查询检测报告失败!操作人={},系统异常!",
InspectorContext.getPhone(), e);
return BaseResp.fail("系统异常: " + e.getMessage());
}
}
}
\ No newline at end of file
package com.glsx.usedcar.controller;
import com.glsx.usedcar.annotation.RequireLogin;
import com.glsx.usedcar.module.inspect.entity.InspectionWorkOrder;
import com.glsx.usedcar.module.inspect.service.InspectionWorkOrderService;
import com.glsx.usedcar.module.inspect.vo.InspectionWODetailRespVO;
import com.glsx.usedcar.module.inspect.vo.InspectionWORespVO;
import com.glsx.usedcar.req.InspectionWorkOrderReq;
import com.glsx.usedcar.resp.BaseResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -12,41 +14,62 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import org.summerframework.orm.paging.Operator;
import org.summerframework.orm.paging.Pagination;
/**
* 检测工单控制器
* 处理检测工单的分页查询、详情查询等操作
*/
@Slf4j
@Tag(name = "检测工单接口", description = "检测工单的增删改查操作")
@RequireLogin
@RestController
@RequiredArgsConstructor
@RequestMapping("/rest/inspect/wo")
public class InspectionWorkOrderController {
private final InspectionWorkOrderService inspectionWorkOrderService;
@Operation(summary = "分页检测工单", description = "分页查询检测工单列表")
/**
* 分页查询检测工单列表
*
* @param req 分页请求参数(包含页码、每页条数、工单状态)
* @return 分页的检测工单列表
*/
@Operation(summary = "分页检测工单", description = "根据工单状态分页查询检测工单列表")
@PostMapping("/page")
public Page<InspectionWORespVO> pageList(@Valid @RequestBody Pagination<InspectionWorkOrder> pagination) {
log.info("分页查询检测工单请求: offset={}, limit={}", pagination.getOffset(), pagination.getLimit());
public BaseResp<Page<InspectionWORespVO>> pageList(@Valid @RequestBody InspectionWorkOrderReq req) {
try {
int page = req.getPage() == null || req.getPage() < 1 ? 1 : req.getPage();
int size = req.getSize() == null || req.getSize() < 1 ? 20 : req.getSize();
Pagination<InspectionWorkOrder> pagination = new Pagination<>((page - 1) * size, size);
pagination.addFilter("status", req.getStatus(), Operator.eq);
log.info("分页查询检测工单请求: page={}, size={}, status={}", page, size, req.getStatus());
Page<InspectionWORespVO> result = inspectionWorkOrderService.pageList(pagination);
return result;
return BaseResp.success(result);
} catch (Exception e) {
log.error("分页查询检测工单失败!系统异常!", e);
return null;
return BaseResp.fail("分页查询检测工单失败:" + e.getMessage());
}
}
@Operation(summary = "获取检测工单详情", description = "获取检测工单详情")
@PostMapping("/detail/{id}")
public BaseResp<InspectionWODetailRespVO> pageList(@PathVariable("id") Long id) {
log.info("获取检测工单详情: {}", id);
/**
* 获取检测工单详情
*
* @param id 工单ID
* @return 工单详情信息
*/
@Operation(summary = "获取检测工单详情", description = "根据工单ID获取检测工单详情")
@GetMapping("/detail/{id}")
public BaseResp<InspectionWODetailRespVO> getDetail(@PathVariable("id") Long id) {
log.info("获取检测工单详情: id={}", id);
try {
InspectionWODetailRespVO result = inspectionWorkOrderService.detail(id);
return BaseResp.success(result);
} catch (Exception e) {
log.error("获取检测工单详情失败!系统异常!", e);
return BaseResp.fail("系统异常: " + e.getMessage());
return BaseResp.fail("获取检测工单详情失败:" + e.getMessage());
}
}
}
}
\ No newline at end of file
package com.glsx.usedcar.controller;
import cn.hutool.core.util.StrUtil;
import com.glsx.usedcar.annotation.RequireLogin;
import com.glsx.usedcar.context.InspectorContext;
import com.glsx.usedcar.module.inspect.service.InspectorService;
import com.glsx.usedcar.module.inspect.vo.InspectorDetailRespVO;
import com.glsx.usedcar.resp.BaseResp;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
......@@ -23,6 +22,7 @@ import org.summerframework.core.exception.BusinessCodeException;
*/
@Slf4j
@Tag(name = "检测师管理接口", description = "检测师信息的增删改查操作")
@RequireLogin
@RestController
@RequiredArgsConstructor
@RequestMapping("/rest/inspect")
......@@ -30,17 +30,12 @@ public class InspectorController {
private final InspectorService inspectorService;
@GetMapping("/detail")
@Operation(summary = "查询检测师详情", description = "查询检测师账号基本信息和操作日志")
@GetMapping("/detail/{id}")
public BaseResp<InspectorDetailRespVO> getDetail(
@Parameter(description = "检测师ID", required = true)
@NotNull(message = "检测师ID不能为空")
@Positive(message = "检测师ID必须为正数")
@PathVariable("id") Long id) {
log.info("查询检测师详情请求: ID={}", id);
public BaseResp<InspectorDetailRespVO> getDetail() {
log.info("查询检测师详情请求: ID={}", InspectorContext.getInspectorId());
try {
InspectorDetailRespVO result = inspectorService.getDetail(id);
InspectorDetailRespVO result = inspectorService.getDetail(InspectorContext.getInspectorId());
return BaseResp.success(result);
} catch (BusinessCodeException be) {
log.error("查询检测师详情失败!业务异常!", be);
......
package com.glsx.usedcar.controller;
import com.glsx.usedcar.annotation.RequireLogin;
import com.glsx.usedcar.resp.BaseResp;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -13,13 +14,13 @@ import org.springframework.web.bind.annotation.RestController;
public class TestController {
@RequestMapping("/hello")
public String hello() {
return "hello world";
public BaseResp<String> hello() {
return BaseResp.success("hello world");
}
@RequireLogin
@RequestMapping("/hello2")
public String hello2() {
return "hello world2";
public BaseResp<String> hello2() {
return BaseResp.success("hello world");
}
}
package com.glsx.usedcar.interceptor;
import com.alibaba.fastjson.JSON;
import com.glsx.usedcar.annotation.RequireLogin;
import com.glsx.usedcar.context.InspectorContext;
import com.glsx.usedcar.module.inspect.entity.Inspector;
import com.glsx.usedcar.module.inspect.service.InspectorService;
import com.glsx.usedcar.resp.BaseResp;
import com.glsx.usedcar.token.JwtProvider;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
......@@ -15,6 +17,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.summerframework.core.enums.ErrorCodeEnum;
import java.io.PrintWriter;
......@@ -94,7 +97,8 @@ public class LoginInterceptor implements HandlerInterceptor {
response.setContentType("application/json; charset=utf-8");
response.setStatus(HttpStatus.UNAUTHORIZED.value()); // 401状态码
try (PrintWriter writer = response.getWriter()) {
writer.write(String.format("{\"code\":401,\"message\":\"%s\"}", message));
BaseResp<Void> errorResponse = BaseResp.fail(ErrorCodeEnum.LOGIN_ERROR);
writer.write(JSON.toJSONString(errorResponse));
writer.flush();
} catch (Exception e) {
log.error("返回认证错误响应失败:", e);
......
package com.glsx.usedcar.req;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
/**
* 检测报告分页请求
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "检测报告分页请求")
public class InspectionReportReq {
@Schema(description = "每页条数,默认20", example = "20")
private Integer size;
@Schema(description = "页码,默认1(从1开始)", example = "1")
private Integer page;
}
\ No newline at end of file
package com.glsx.usedcar.req;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
/**
* 检测工单分页请求
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "检测工单分页请求")
public class InspectionWorkOrderReq {
@Schema(description = "每页条数,默认20", example = "20")
private Integer size;
@Schema(description = "页码,默认1(从1开始)", example = "1")
private Integer page;
/**
* 工单状态
* 1:待检测;2:检测中;3:已完成;4:已取消
*/
@Schema(description = "工单状态 1:待检测;2:检测中;3:已完成;4:已取消", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "查询状态不能为空")
private Integer status;
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!