feat(): 字符集异常
parent
c14ce4c1ba
commit
f3a4d430f4
|
@ -3,7 +3,7 @@ package com.muyu.common.core.enums;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: zi run
|
* @Author: by 杨旭飞
|
||||||
* @Date 2024/8/5 19:01
|
* @Date 2024/8/5 19:01
|
||||||
* @Description 系统支付枚举
|
* @Description 系统支付枚举
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.muyu.common.core.enums;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: zi run
|
* @Author: by 杨旭飞
|
||||||
* @Date 2024/8/4 14:09
|
* @Date 2024/8/4 14:09
|
||||||
* @Description 系统是否枚举
|
* @Description 系统是否枚举
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.muyu.common.core.enums;
|
package com.muyu.common.core.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户状态
|
* @Description 用户状态
|
||||||
*
|
* @Author: by 杨旭飞
|
||||||
* @author muyu
|
* @Date 2024/8/4 14:09
|
||||||
*/
|
*/
|
||||||
public enum UserStatus {
|
public enum UserStatus {
|
||||||
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
|
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.muyu.common.core.text;
|
package com.muyu.common.core.text;
|
||||||
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
@ -16,6 +18,8 @@ import java.util.Set;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
public class Convert {
|
public class Convert {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(Convert.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 转换为字符串<br>
|
* 转换为字符串<br>
|
||||||
* 如果给定的值为null,或者转换失败,返回默认值<br>
|
* 如果给定的值为null,或者转换失败,返回默认值<br>
|
||||||
|
@ -687,7 +691,12 @@ public class Convert {
|
||||||
* @return 字符串
|
* @return 字符串
|
||||||
*/
|
*/
|
||||||
public static String str (Object obj, String charsetName) {
|
public static String str (Object obj, String charsetName) {
|
||||||
return str(obj, Charset.forName(charsetName));
|
try {
|
||||||
|
return str(obj, CharsetKit.charset(charsetName));//字符集
|
||||||
|
}catch (Exception exception){
|
||||||
|
log.error("字符集转换异常:[{}--{}]->{}",obj,charsetName,exception.getMessage(),exception);
|
||||||
|
throw new RuntimeException(exception);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -9,7 +9,7 @@ import java.lang.annotation.Target;
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: zi run
|
* @Author: by 杨旭飞
|
||||||
* @Date 2024/8/5 19:33
|
* @Date 2024/8/5 19:33
|
||||||
* @Description validation自定义支付渠道校验
|
* @Description validation自定义支付渠道校验
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -11,7 +11,7 @@ import java.lang.annotation.Target;
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: zi run
|
* @Author: by 杨旭飞
|
||||||
* @Date 2024/8/4 14:25
|
* @Date 2024/8/4 14:25
|
||||||
* @Description validation自定义系统字典校验
|
* @Description validation自定义系统字典校验
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,7 +5,7 @@ import jakarta.validation.ConstraintValidator;
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
import jakarta.validation.ConstraintValidatorContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: zi run
|
* @Author: by 杨旭飞
|
||||||
* @Date 2024/8/5 19:33
|
* @Date 2024/8/5 19:33
|
||||||
* @Description 支付渠道的校验器
|
* @Description 支付渠道的校验器
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,7 +5,7 @@ import jakarta.validation.ConstraintValidator;
|
||||||
import jakarta.validation.ConstraintValidatorContext;
|
import jakarta.validation.ConstraintValidatorContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: zi run
|
* @Author: by 杨旭飞
|
||||||
* @Date 2024/8/4 14:31
|
* @Date 2024/8/4 14:31
|
||||||
* @Description 是否系统字典的校验器
|
* @Description 是否系统字典的校验器
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue