package jnpf.elnService.template;
|
|
import jnpf.elnService.impl.ElnFieldCodeGenerator;
|
import org.springframework.stereotype.Service;
|
|
@Service
|
public class ElnTemplateCodeAssistService {
|
|
public String suggest(String text) {
|
if (text == null || text.trim().isEmpty()) {
|
throw ElnTemplateOperationException.validation("中文名称不能为空");
|
}
|
String code = ElnFieldCodeGenerator.suggestSegmentedCode(text.trim());
|
if (code.isEmpty()) {
|
throw ElnTemplateOperationException.validation("中文名称无法生成有效编码");
|
}
|
return code;
|
}
|
}
|