| | |
| | | package com.ruoyi.generator.util; |
| | | |
| | | import com.ruoyi.common.constant.GenConstants; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.core.constant.GenConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.generator.config.GenConfig; |
| | | import com.ruoyi.generator.domain.GenTable; |
| | | import com.ruoyi.generator.domain.GenTableColumn; |
| | | import lombok.AccessLevel; |
| | | import lombok.NoArgsConstructor; |
| | | import org.apache.commons.lang3.RegExUtils; |
| | | |
| | | import java.util.Arrays; |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @NoArgsConstructor(access = AccessLevel.PRIVATE) |
| | | public class GenUtils { |
| | | |
| | | /** |
| | |
| | | column.setJavaField(StringUtils.toCamelCase(columnName)); |
| | | // 设置默认类型 |
| | | column.setJavaType(GenConstants.TYPE_STRING); |
| | | column.setQueryType(GenConstants.QUERY_EQ); |
| | | |
| | | if (arraysContains(GenConstants.COLUMNTYPE_STR, dataType) || arraysContains(GenConstants.COLUMNTYPE_TEXT, dataType)) { |
| | | // 字符串长度超过500设置为文本域 |
| | |
| | | public static String getModuleName(String packageName) { |
| | | int lastIndex = packageName.lastIndexOf("."); |
| | | int nameLength = packageName.length(); |
| | | String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength); |
| | | return moduleName; |
| | | return StringUtils.substring(packageName, lastIndex + 1, nameLength); |
| | | } |
| | | |
| | | /** |