public static ApiDO buildApiDO(final ApiDTO apiDTO) {

        return Optional.ofNullable(apiDTO).map(item -> {
            Timestamp currentTime = new Timestamp(System.currentTimeMillis());
            ApiDO apiDO = ApiDO.builder()
                    .contextPath(item.getContextPath())
                    .apiPath(item.getApiPath())
                    .httpMethod(item.getHttpMethod())
                    .consume(item.getConsume())
                    .produce(item.getProduce())
                    .version(item.getVersion())
                    .rpcType(item.getRpcType())
                    .state(item.getState())
                    .ext(item.getExt())
                    .apiOwner(item.getApiOwner())
                    .apiDesc(item.getApiDesc())
                    .apiSource(item.getApiSource())
                    .document(item.getDocument())
                    .documentMd5(DigestUtils.md5Hex(item.getDocument()))
                    .build();
            if (StringUtils.isEmpty(item.getId())) {
                apiDO.setId(UUIDUtils.getInstance().generateShortUuid());
                apiDO.setDateCreated(currentTime);
            } else {
                apiDO.setId(item.getId());
            }
            return apiDO;
        }).orElse(null);
    }
buildApiDO.
@param apiDTO apiDTO
@return ApiDO
shenyu-admin/src/main/java/org/apache/shenyu/admin/model/entity/ApiDO.java