提交 | 用户 | 时间
|
e7c126
|
1 |
package com.iailab.module.system.framework.operatelog.core; |
H |
2 |
|
|
3 |
import cn.hutool.core.util.StrUtil; |
|
4 |
import com.iailab.framework.dict.core.DictFrameworkUtils; |
|
5 |
import com.iailab.module.infra.enums.DictTypeConstants; |
|
6 |
import com.mzt.logapi.service.IParseFunction; |
|
7 |
import lombok.extern.slf4j.Slf4j; |
|
8 |
import org.springframework.stereotype.Component; |
|
9 |
|
|
10 |
/** |
|
11 |
* 是否类型的 {@link IParseFunction} 实现类 |
|
12 |
* |
|
13 |
* @author HUIHUI |
|
14 |
*/ |
|
15 |
@Component |
|
16 |
@Slf4j |
|
17 |
public class BooleanParseFunction implements IParseFunction { |
|
18 |
|
|
19 |
public static final String NAME = "getBoolean"; |
|
20 |
|
|
21 |
@Override |
|
22 |
public boolean executeBefore() { |
|
23 |
return true; // 先转换值后对比 |
|
24 |
} |
|
25 |
|
|
26 |
@Override |
|
27 |
public String functionName() { |
|
28 |
return NAME; |
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
public String apply(Object value) { |
|
33 |
if (StrUtil.isEmptyIfStr(value)) { |
|
34 |
return ""; |
|
35 |
} |
|
36 |
return DictFrameworkUtils.getDictDataLabel(DictTypeConstants.BOOLEAN_STRING, value.toString()); |
|
37 |
} |
|
38 |
|
|
39 |
} |