35 lines
1009 B
Java
35 lines
1009 B
Java
package com.rj.dto;
|
|
|
|
import lombok.Getter;
|
|
|
|
/**
|
|
* 客户照片上传至 MinIO 的结果,供控制器映射 HTTP 状态与 JSON。
|
|
*/
|
|
@Getter
|
|
public class CustomerPhotoUploadResult {
|
|
|
|
private final int httpStatus;
|
|
private final boolean success;
|
|
private final String message;
|
|
private final String url;
|
|
|
|
private CustomerPhotoUploadResult(int httpStatus, boolean success, String message, String url) {
|
|
this.httpStatus = httpStatus;
|
|
this.success = success;
|
|
this.message = message;
|
|
this.url = url;
|
|
}
|
|
|
|
public static CustomerPhotoUploadResult ok(String url) {
|
|
return new CustomerPhotoUploadResult(200, true, "上传成功", url);
|
|
}
|
|
|
|
public static CustomerPhotoUploadResult badRequest(String message) {
|
|
return new CustomerPhotoUploadResult(400, false, message, null);
|
|
}
|
|
|
|
public static CustomerPhotoUploadResult serverError(String message) {
|
|
return new CustomerPhotoUploadResult(500, false, message, null);
|
|
}
|
|
}
|