Compare commits

...

4 Commits

Author SHA1 Message Date
yangpeng a0c73017dc Merge remote-tracking branch 'origin/master' 2024-08-09 11:53:04 +08:00
yangpeng b5b402725d feat(): 字符集异常 2024-08-09 11:52:20 +08:00
yangpeng f3a4d430f4 feat(): 字符集异常 2024-08-09 11:50:39 +08:00
yangpeng c14ce4c1ba feat(): validation 2024-08-08 19:29:10 +08:00
9 changed files with 20 additions and 12 deletions

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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", "删除");

View File

@ -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>
@ -676,7 +680,6 @@ public class Convert {
public static String utf8Str (Object obj) { public static String utf8Str (Object obj) {
return str(obj, CharsetKit.CHARSET_UTF_8); return str(obj, CharsetKit.CHARSET_UTF_8);
} }
/** /**
* <br> * <br>
* 1ByteByteBuffer 2Arrays.toString * 1ByteByteBuffer 2Arrays.toString
@ -687,7 +690,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);
}
} }
/** /**

View File

@ -11,4 +11,4 @@ public class ValidationConfig {
public Validator validator() { public Validator validator() {
return Validation.byDefaultProvider().configure().buildValidatorFactory().getValidator(); return Validation.byDefaultProvider().configure().buildValidatorFactory().getValidator();
} }
} }

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */

View File

@ -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
*/ */