增加状态更新接口客户的状态可以是线索高一项第1项客户
This commit is contained in:
35
src/main/java/com/rj/dto/CustomerStageUpdateResult.java
Normal file
35
src/main/java/com/rj/dto/CustomerStageUpdateResult.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.rj.dto;
|
||||
|
||||
import com.rj.entity.CustomerManagement;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 客户阶段(stage)更新结果,供控制层映射 HTTP 状态与 JSON。
|
||||
*/
|
||||
@Getter
|
||||
public class CustomerStageUpdateResult {
|
||||
|
||||
private final int httpStatus;
|
||||
private final boolean success;
|
||||
private final String message;
|
||||
private final CustomerManagement customer;
|
||||
|
||||
private CustomerStageUpdateResult(int httpStatus, boolean success, String message, CustomerManagement customer) {
|
||||
this.httpStatus = httpStatus;
|
||||
this.success = success;
|
||||
this.message = message;
|
||||
this.customer = customer;
|
||||
}
|
||||
|
||||
public static CustomerStageUpdateResult ok(CustomerManagement customer) {
|
||||
return new CustomerStageUpdateResult(200, true, "阶段更新成功", customer);
|
||||
}
|
||||
|
||||
public static CustomerStageUpdateResult badRequest(String message) {
|
||||
return new CustomerStageUpdateResult(400, false, message, null);
|
||||
}
|
||||
|
||||
public static CustomerStageUpdateResult serverError(String message) {
|
||||
return new CustomerStageUpdateResult(500, false, message, null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user