云
8 小时以前 795bc269ba9acfae74620059c4ed64bd121aa288
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package cn.iocoder.yudao.module.mdm.service.item;
 
import cn.iocoder.yudao.module.mdm.controller.admin.item.vo.MdmItemSaveReqVO;
 
/**
 * 单行导入的解析结果:失败时只带文案,成功时带组装好的 SaveReqVO。
 */
public record MdmItemRowResolution(String failureMessage, MdmItemSaveReqVO saveReqVO) {
 
    public boolean isSuccess() {
        return failureMessage == null;
    }
 
    public static MdmItemRowResolution failure(String failureMessage) {
        return new MdmItemRowResolution(failureMessage, null);
    }
 
    public static MdmItemRowResolution success(MdmItemSaveReqVO saveReqVO) {
        return new MdmItemRowResolution(null, saveReqVO);
    }
}