1、工具类名称规则修改
This commit is contained in:
parent
04b66da1ba
commit
ea5dd49c7a
|
|
@ -5,7 +5,7 @@ package com.xjs.utils;
|
|||
* @desc 中文工具类
|
||||
* @create 2021-12-29
|
||||
*/
|
||||
public class ChineseUtil {
|
||||
public class ChineseUtils {
|
||||
|
||||
/**
|
||||
* 校验String是否全是中文
|
||||
|
|
@ -16,7 +16,7 @@ import java.util.regex.Pattern;
|
|||
* @author xiejs
|
||||
* @since 2022-01-15
|
||||
*/
|
||||
public class IPUtil {
|
||||
public class IPUtils {
|
||||
|
||||
/**
|
||||
* 获取外网ip
|
||||
|
|
@ -26,7 +26,7 @@ public class IPUtil {
|
|||
String ip = null;
|
||||
// 第一种方式
|
||||
try {
|
||||
ip = IPUtil.getNowIP1();
|
||||
ip = IPUtils.getNowIP1();
|
||||
ip.trim();
|
||||
} catch (Exception e) {
|
||||
System.out.println("getPublicIP - getNowIP1 failed ~ ");
|
||||
|
|
@ -35,7 +35,7 @@ public class IPUtil {
|
|||
return ip;
|
||||
// 第二种方式
|
||||
try {
|
||||
ip = IPUtil.getNowIP2();
|
||||
ip = IPUtils.getNowIP2();
|
||||
ip.trim();
|
||||
} catch (Exception e) {
|
||||
System.out.println("getPublicIP - getNowIP2 failed ~ ");
|
||||
|
|
@ -44,7 +44,7 @@ public class IPUtil {
|
|||
return ip;
|
||||
// 第三种方式
|
||||
try {
|
||||
ip = IPUtil.getNowIP3();
|
||||
ip = IPUtils.getNowIP3();
|
||||
ip.trim();
|
||||
} catch (Exception e) {
|
||||
System.out.println("getPublicIP - getNowIP3 failed ~ ");
|
||||
|
|
@ -53,7 +53,7 @@ public class IPUtil {
|
|||
return ip;
|
||||
// 第四种方式
|
||||
try {
|
||||
ip = IPUtil.getNowIP4();
|
||||
ip = IPUtils.getNowIP4();
|
||||
ip.trim();
|
||||
} catch (Exception e) {
|
||||
System.out.println("getPublicIP - getNowIP4 failed ~ ");
|
||||
|
|
@ -11,11 +11,11 @@ import java.util.Date;
|
|||
* @desc
|
||||
* @create 2021-12-29
|
||||
*/
|
||||
class ChineseUtilTest {
|
||||
class ChineseUtilsTest {
|
||||
|
||||
@Test
|
||||
public void test1() {
|
||||
boolean b = ChineseUtil.checkNameChese("爱喔爱");
|
||||
boolean b = ChineseUtils.checkNameChese("爱喔爱");
|
||||
System.out.println(b);
|
||||
}
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ import com.xjs.business.api.RemoteTranDIctFeign;
|
|||
import com.xjs.business.api.RemoteTranslationFeign;
|
||||
import com.xjs.business.api.domain.TranslationVo;
|
||||
import com.xjs.exception.BusinessException;
|
||||
import com.xjs.utils.ChineseUtil;
|
||||
import com.xjs.utils.ChineseUtils;
|
||||
import com.xjs.word.domain.EnglishWord;
|
||||
import com.xjs.word.mapper.EnglishWordMapper;
|
||||
import com.xjs.word.service.IEnglishWordService;
|
||||
|
|
@ -110,8 +110,8 @@ public class EnglishWordServiceImpl implements IEnglishWordService {
|
|||
throw new BusinessException("该单词已存在!!!!");
|
||||
}
|
||||
//校验前端传入的是否英文或中文
|
||||
boolean alpha = ChineseUtil.isAlpha(englishWord.getContent());
|
||||
boolean chinese = ChineseUtil.checkNameChese(englishWord.getContent());
|
||||
boolean alpha = ChineseUtils.isAlpha(englishWord.getContent());
|
||||
boolean chinese = ChineseUtils.checkNameChese(englishWord.getContent());
|
||||
if (!alpha && !chinese) {
|
||||
throw new BusinessException("不能包含其他符号!!!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import com.ruoyi.common.redis.service.RedisService;
|
|||
import com.xjs.common.client.api.roll.RollIPFeignClient;
|
||||
import com.xjs.config.RollProperties;
|
||||
import com.xjs.copywriting.domain.RequestBody;
|
||||
import com.xjs.utils.IPUtil;
|
||||
import com.xjs.utils.IPUtils;
|
||||
import com.xjs.weather.domain.IPInfoVo;
|
||||
import com.xjs.weather.factory.IPFactory;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
|
@ -35,7 +35,7 @@ public class RollIPFactory implements IPFactory<IPInfoVo> {
|
|||
public IPInfoVo IpApi() {
|
||||
RequestBody requestBody = new RequestBody();
|
||||
try {
|
||||
requestBody.setIp(IPUtil.getV4IP());
|
||||
requestBody.setIp(IPUtils.getV4IP());
|
||||
} catch (Exception e) {
|
||||
requestBody.setIp("127.0.0.1");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue