diff --git a/framework-core/pom.xml b/framework-core/pom.xml
index 5f34fe1..b4e43bc 100644
--- a/framework-core/pom.xml
+++ b/framework-core/pom.xml
@@ -5,7 +5,7 @@
com.unionmed
unionmed-framework
- 0.0.5
+ 0.0.6
4.0.0
diff --git a/framework-core/src/main/java/com/unionmed/framework/authentication/annotation/Auth.java b/framework-core/src/main/java/com/unionmed/framework/authentication/annotation/Auth.java
new file mode 100644
index 0000000..85fe3ed
--- /dev/null
+++ b/framework-core/src/main/java/com/unionmed/framework/authentication/annotation/Auth.java
@@ -0,0 +1,16 @@
+package com.unionmed.framework.authentication.annotation;
+
+import org.springframework.web.bind.annotation.Mapping;
+
+import java.lang.annotation.*;
+
+/**
+ * @author ianChen
+ * @date 2023/5/9 11:28
+ */
+@Mapping
+@Documented
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Auth {
+}
diff --git a/framework-core/src/main/java/com/unionmed/framework/spring/mvc/dto/PageData.java b/framework-core/src/main/java/com/unionmed/framework/spring/mvc/dto/PageData.java
new file mode 100644
index 0000000..11ddc91
--- /dev/null
+++ b/framework-core/src/main/java/com/unionmed/framework/spring/mvc/dto/PageData.java
@@ -0,0 +1,23 @@
+package com.unionmed.framework.spring.mvc.dto;
+
+import lombok.Data;
+
+import java.util.Collection;
+
+/**
+ * @author ianChen
+ * @date 2023/5/4 16:28
+ */
+@Data
+public class PageData {
+
+ private int number;
+ private Collection member;
+
+ public static PageData inst(Collection collection) {
+ PageData data = new PageData();
+ data.number = collection == null ? 0 : collection.size();
+ data.member = collection;
+ return data;
+ }
+}
diff --git a/framework-core/src/main/java/com/unionmed/framework/spring/mvc/dto/Paging.java b/framework-core/src/main/java/com/unionmed/framework/spring/mvc/dto/Paging.java
new file mode 100644
index 0000000..94f746d
--- /dev/null
+++ b/framework-core/src/main/java/com/unionmed/framework/spring/mvc/dto/Paging.java
@@ -0,0 +1,27 @@
+package com.unionmed.framework.spring.mvc.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel
+public class Paging {
+
+ //分页数
+ @ApiModelProperty(value = "分页数")
+ private int page;
+
+ //每页展示数
+ @ApiModelProperty(value = "每页展示数")
+ private int rows;
+
+
+ public int getPage() {
+ return Math.max(page, 1);
+ }
+
+ public int getRows() {
+ return rows < 1 ? 10 : rows;
+ }
+}
diff --git a/framework-core/src/main/java/com/unionmed/framework/util/CashConverter.java b/framework-core/src/main/java/com/unionmed/framework/util/CashConverter.java
new file mode 100644
index 0000000..f95c19e
--- /dev/null
+++ b/framework-core/src/main/java/com/unionmed/framework/util/CashConverter.java
@@ -0,0 +1,117 @@
+package com.unionmed.framework.util;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.text.DecimalFormat;
+import java.util.regex.Pattern;
+
+/**
+ * @author ianChen
+ * @date 2023/3/14 14:33
+ */
+@Slf4j
+public class CashConverter {
+
+ private static String REGEX = "^\\d+\\.\\d{1,}|\\d+";
+
+ /**
+ * 将字符串转为现金值,单位:分
+ *
+ * @param cash 转换的字符串
+ * @return
+ */
+ public static int toInt(String cash) {
+ return Converter.toInt(toNum(cash));
+ }
+
+ /**
+ * 将字符串转为现金值,单位:分
+ *
+ * @param cash 转换的字符串
+ * @return
+ */
+ public static long toLong(String cash) {
+ return Converter.toLong(toNum(cash));
+ }
+
+ //金额四舍五入 单位里
+ public static int amountRound(int amount) {
+ DecimalFormat decimalFormat = new DecimalFormat("#.0");
+ return (int) Math.round(Double.valueOf(decimalFormat.format(Integer.valueOf(amount).doubleValue() / 10))) * 10;
+ }
+
+ protected static String toNum(String cash) {
+ if (!isMatchRegex(REGEX, cash)) {
+ log.warn("转换 [" + cash + "] 失败,不是合法的数字");
+ return "0";
+ }
+
+ String[] splits = cash.split("\\.");
+ if (splits.length == 1)
+ return splits[0] + "00";
+
+ if (splits[1].length() > 2)
+ splits[1] = splits[1].substring(0, 2);
+
+ return splits[0] + (splits[1].length() == 1 ? splits[1] + "0" : splits[1]);
+ }
+
+ private static boolean isMatchRegex(String regex, String s) {
+ return !ObjectUtils.isNull(regex) && !ObjectUtils.isNull(s) && Pattern.compile(regex).matcher(s).matches();
+ }
+
+ /**
+ * 将整数金额转换字符串,单位:元
+ *
+ * @param cash 转换的金额
+ * @return
+ */
+ public static String toString(int cash) {
+ return toString(cash + "");
+ }
+
+ /**
+ * 将整数金额转换(负数)字符串,单位:元
+ *
+ * @param cash 转换的金额
+ * @return
+ */
+ public static String toNegativeString(int cash) {
+ return toString((cash > 0 ? -cash : cash) + "");
+ }
+
+ /**
+ * 将整数金额转换字符串,单位:元
+ *
+ * @param cash 转换的金额
+ * @return
+ */
+ public static String toString(long cash) {
+ return toString(cash + "");
+ }
+
+ /**
+ * 将整数金额转换(负数)字符串,单位:元
+ *
+ * @param cash 转换的金额
+ * @return
+ */
+ public static String toNegativeString(long cash) {
+ return toString((cash > 0 ? -cash : cash) + "");
+ }
+
+ protected static String toString(String cash) {
+ String str = cash + "", preffix = "";
+ if (cash.startsWith("-")) {
+ str = str.substring(1);
+ preffix = "-";
+ }
+
+ if (str.length() == 1)
+ return preffix + "0.0" + str;
+ if (str.length() == 2)
+ return preffix + "0." + str;
+
+ return preffix + str.substring(0, str.length() - 2) + "." + str.substring(str.length() - 2);
+ }
+}
diff --git a/framework-core/src/main/java/com/unionmed/framework/util/IdCardUtils.java b/framework-core/src/main/java/com/unionmed/framework/util/IdCardUtils.java
index e41dbc2..df1ceb0 100644
--- a/framework-core/src/main/java/com/unionmed/framework/util/IdCardUtils.java
+++ b/framework-core/src/main/java/com/unionmed/framework/util/IdCardUtils.java
@@ -208,13 +208,11 @@ public class IdCardUtils {
return sb.toString();
}
- private static boolean verify(String str) {
+ public static boolean verify(String str) {
if (ObjectUtils.isEmpty(str)) {
- log.warn("身份证信息为空");
return false;
}
if (str.trim().length() != 18) {
- log.warn("身份证号必须为18位");
return false;
}
@@ -234,7 +232,6 @@ public class IdCardUtils {
int mod = sum % 11;
// 取模后的数和身份证最后以为进行对比
if (ObjectUtils.notEquals(chars[chars.length - 1], mods[mod])) {
- log.warn("身份证:{} 不合法!", str);
return false;
}
return true;
diff --git a/framework-orm/pom.xml b/framework-orm/pom.xml
index d0b28a9..d05624f 100644
--- a/framework-orm/pom.xml
+++ b/framework-orm/pom.xml
@@ -5,7 +5,7 @@
unionmed-framework
com.unionmed
- 0.0.5
+ 0.0.6
4.0.0
diff --git a/framework-test/pom.xml b/framework-test/pom.xml
index 6334306..6543761 100644
--- a/framework-test/pom.xml
+++ b/framework-test/pom.xml
@@ -5,7 +5,7 @@
com.unionmed
unionmed-framework
- 0.0.5
+ 0.0.6
4.0.0
diff --git a/pom.xml b/pom.xml
index c4b06b7..1cc8cef 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
4.0.0
com.unionmed
unionmed-framework
- 0.0.5
+ 0.0.6
pom
unionmed-framework