通过alibaba代码规约扫描

pull/183/head
1332987 3 years ago
parent ef29194da6
commit a4cd2e13de

@ -55,20 +55,40 @@ public class FileTypeUtils
public static String getFileExtendName(byte[] photoByte)
{
String strFileExtendName = "JPG";
if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56) && (photoByte[5] == 97)) {
if ((photoByte[4] == 55) || (photoByte[4] == 57)) {
int i71 = 71;
int i73 = 73;
int i2 = 2;
int i70 = 70;
int i3 = 3;
int i56 = 56;
int i5 = 5;
int i97 = 97;
int i4 = 4;
int i55 = 55;
int i57 = 57;
int i6 = 6;
int i74 = 74;
int i7 = 7;
int i8 = 8;
int i9 = 9;
int i66 = 66;
int i77 = 77;
int i80 = 80;
int i78 = 78;
if ((photoByte[0] == i71) && (photoByte[1] == i73) && (photoByte[i2] == i70) && (photoByte[i3] == i56) && (photoByte[i5] == i97)) {
if ((photoByte[i4] == i55) || (photoByte[i4] == i57)) {
strFileExtendName = "GIF";
}
}
else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70))
else if ((photoByte[i6] == i74) && (photoByte[i7] == i70) && (photoByte[i8] == i73) && (photoByte[i9] == i70))
{
strFileExtendName = "JPG";
}
else if ((photoByte[0] == 66) && (photoByte[1] == 77))
else if ((photoByte[0] == i66) && (photoByte[1] == i77))
{
strFileExtendName = "BMP";
}
else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71))
else if ((photoByte[1] == i80) && (photoByte[i2] == i78) && (photoByte[i3] == i71))
{
strFileExtendName = "PNG";
}

@ -21,29 +21,41 @@ public final class Base64 {
for (int i = 0; i < BASELENGTH; ++i) {
BASE_64_ALPHABET[i] = -1;
}
for (int i = 'Z'; i >= 'A'; i--) {
char z = 'Z';
char a = 'A';
for (int i = z; i >= a; i--) {
BASE_64_ALPHABET[i] = (byte) (i - 'A');
}
for (int i = 'z'; i >= 'a'; i--) {
char z1 = 'z';
char a1 = 'a';
for (int i = z1; i >= a1; i--) {
BASE_64_ALPHABET[i] = (byte) (i - 'a' + 26);
}
for (int i = '9'; i >= '0'; i--) {
char c = '9';
char c1 = '0';
for (int i = c; i >= c1; i--) {
BASE_64_ALPHABET[i] = (byte) (i - '0' + 52);
}
BASE_64_ALPHABET['+'] = 62;
BASE_64_ALPHABET['/'] = 63;
for (int i = 0; i <= 25; i++) {
int i1 = 25;
for (int i = 0; i <= i1; i++) {
LOOK_UP_BASE_64_ALPHABET[i] = (char) ('A' + i);
}
for (int i = 26, j = 0; i <= 51; i++, j++) {
int i2 = 26;
int i3 = 51;
for (int i = i2, j = 0; i <= i3; i++, j++) {
LOOK_UP_BASE_64_ALPHABET[i] = (char) ('a' + j);
}
for (int i = 52, j = 0; i <= 61; i++, j++) {
int i4 = 52;
int i5 = 61;
for (int i = i4, j = 0; i <= i5; i++, j++) {
LOOK_UP_BASE_64_ALPHABET[i] = (char) ('0' + j);
}
LOOK_UP_BASE_64_ALPHABET[62] = (char) '+';
@ -182,7 +194,8 @@ public final class Base64 {
d4 = base64Data[dataIndex++];
if (!isData((d3)) || !isData((d4))) {
if (isPad(d3) && isPad(d4)) {
if ((b2 & 0xf) != 0) {
int i1 = 0xf;
if ((b2 & i1) != 0) {
return null;
}
byte[] tmp = new byte[i * 3 + 1];
@ -191,7 +204,8 @@ public final class Base64 {
return tmp;
} else if (!isPad(d3) && isPad(d4)) {
b3 = BASE_64_ALPHABET[d3];
if ((b3 & 0x3) != 0) {
int i1 = 0x3;
if ((b3 & i1) != 0) {
return null;
}
byte[] tmp = new byte[i * 3 + 2];

@ -168,25 +168,35 @@ public class VelocityUtils {
fileName = StringUtils.format("{}/domain/{}.java", javaPath, className);
}
if (template.contains("sub-domain.java.vm") && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) {
String subdomainVm = "sub-domain.java.vm";
String mapperVm = "mapper.java.vm";
String serviceVm = "service.java.vm";
String serviceImplVm = "serviceImpl.java.vm";
String controllerVm = "controller.java.vm";
String mapperXmlVm = "mapper.xml.vm";
String sqlVm = "sql.vm";
String apiVm = "api.js.vm";
String indexVm = "index.vue.vm";
String indexTreeVm = "index-tree.vue.vm";
if (template.contains(subdomainVm) && StringUtils.equals(GenConstants.TPL_SUB, genTable.getTplCategory())) {
fileName = StringUtils.format("{}/domain/{}.java", javaPath, genTable.getSubTable().getClassName());
} else if (template.contains("mapper.java.vm")) {
} else if (template.contains(mapperVm)) {
fileName = StringUtils.format("{}/mapper/{}Mapper.java", javaPath, className);
} else if (template.contains("service.java.vm")) {
} else if (template.contains(serviceVm)) {
fileName = StringUtils.format("{}/service/I{}Service.java", javaPath, className);
} else if (template.contains("serviceImpl.java.vm")) {
} else if (template.contains(serviceImplVm)) {
fileName = StringUtils.format("{}/service/impl/{}ServiceImpl.java", javaPath, className);
} else if (template.contains("controller.java.vm")) {
} else if (template.contains(controllerVm)) {
fileName = StringUtils.format("{}/controller/{}Controller.java", javaPath, className);
} else if (template.contains("mapper.xml.vm")) {
} else if (template.contains(mapperXmlVm)) {
fileName = StringUtils.format("{}/{}Mapper.xml", mybatisPath, className);
} else if (template.contains("sql.vm")) {
} else if (template.contains(sqlVm)) {
fileName = businessName + "Menu.sql";
} else if (template.contains("api.js.vm")) {
} else if (template.contains(apiVm)) {
fileName = StringUtils.format("{}/api/{}/{}.js", vuePath, moduleName, businessName);
} else if (template.contains("index.vue.vm")) {
} else if (template.contains(indexVm)) {
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
} else if (template.contains("index-tree.vue.vm")) {
} else if (template.contains(indexTreeVm)) {
fileName = StringUtils.format("{}/views/{}/{}/index.vue", vuePath, moduleName, businessName);
}
return fileName;

Loading…
Cancel
Save