fix: 根据阿里规约修改部份代码问题
This commit is contained in:
parent
4f1240ab0b
commit
edbebf0d5d
|
|
@ -84,7 +84,9 @@ public class KadaPaymentJava {
|
|||
|
||||
// 转16进制
|
||||
StringBuilder sb = new StringBuilder(hash.length * 2);
|
||||
for (byte b : hash) sb.append(String.format("%02x", b));
|
||||
for (byte b : hash) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class AiManagerController extends BaseController
|
|||
// 查询所有标签
|
||||
AiTag aiTag = new AiTag();
|
||||
aiTag.setAiId(data.getId());
|
||||
aiTag.setParentId(0l);
|
||||
aiTag.setParentId(0L);
|
||||
aiTag.setStatus(0);
|
||||
List<AiTag> tagList = aiTagService.selectAiTagList(aiTag);
|
||||
AjaxResult ajaxResult = success();
|
||||
|
|
|
|||
|
|
@ -113,6 +113,6 @@ public class AiRechargeGiftController extends BaseController
|
|||
@Anonymous
|
||||
@GetMapping("/getGifStatus")
|
||||
public boolean getGifStatus() {
|
||||
return aiRechargeGiftService.isActivityAvailable(1l);
|
||||
return aiRechargeGiftService.isActivityAvailable(1L);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public class AiTagController extends BaseController
|
|||
public AjaxResult edit(@RequestBody AiTag aiTag)
|
||||
{
|
||||
int rows = aiTagService.updateAiTag(aiTag);
|
||||
if (aiTag.getStatus() == 1 && aiTag.getParentId() != 0l) {
|
||||
if (aiTag.getStatus() == 1 && aiTag.getParentId() != 0L) {
|
||||
// 查询是否父级是否开启并且还有其他子级开启数量
|
||||
boolean b = aiTagService.checkStatus(aiTag.getParentId());
|
||||
if (!b) {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public class SysConfigController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@Validated @RequestBody SysConfig config)
|
||||
{
|
||||
if (config.getConfigId().equals(100l)) {
|
||||
if (config.getConfigId().equals(100L)) {
|
||||
if (!isStringLongInteger(config.getConfigValue())) {
|
||||
return error(config.getConfigName() + "参数值只能输入整数");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ public class IpUtils
|
|||
String[] s1 = ipWildCard.split("\\.");
|
||||
String[] s2 = ip.split("\\.");
|
||||
boolean isMatchedSeg = true;
|
||||
for (int i = 0; i < s1.length && !s1[i].equals("*"); i++)
|
||||
for (int i = 0; i < s1.length && !"*".equals(s1[i]); i++)
|
||||
{
|
||||
if (!s1[i].equals(s2[i]))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,10 +81,7 @@ public final class Base64 {
|
|||
int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
|
||||
int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
|
||||
int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
|
||||
char encodedData[] = null;
|
||||
|
||||
encodedData = new char[numberQuartet * 4];
|
||||
|
||||
char[] encodedData = new char[numberQuartet * 4];
|
||||
byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
|
||||
|
||||
int encodedIndex = 0;
|
||||
|
|
@ -159,7 +156,7 @@ public final class Base64 {
|
|||
return new byte[0];
|
||||
}
|
||||
|
||||
byte decodedData[] = null;
|
||||
byte[] decodedData = null;
|
||||
byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
|
||||
char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,9 @@ public class HmacSha256Utils {
|
|||
|
||||
// 转16进制
|
||||
StringBuilder sb = new StringBuilder(hash.length * 2);
|
||||
for (byte b : hash) sb.append(String.format("%02x", b));
|
||||
for (byte b : hash) {
|
||||
sb.append(String.format("%02x", b));
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,8 @@ public class Md5Utils
|
|||
{
|
||||
algorithm = MessageDigest.getInstance("MD5");
|
||||
algorithm.reset();
|
||||
algorithm.update(s.getBytes("UTF-8"));
|
||||
byte[] messageDigest = algorithm.digest();
|
||||
return messageDigest;
|
||||
algorithm.update(s.getBytes(StandardCharsets.UTF_8));
|
||||
return algorithm.digest();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
@ -32,13 +31,13 @@ public class Md5Utils
|
|||
return null;
|
||||
}
|
||||
|
||||
private static final String toHex(byte hash[])
|
||||
private static String toHex(byte[] hash)
|
||||
{
|
||||
if (hash == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
StringBuffer buf = new StringBuffer(hash.length * 2);
|
||||
StringBuilder buf = new StringBuilder(hash.length * 2);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < hash.length; i++)
|
||||
|
|
@ -60,7 +59,7 @@ public class Md5Utils
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("not supported charset...{}", e);
|
||||
log.error("not supported charset...{}", s, e);
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class SysLoginService {
|
|||
// 新增访客统计
|
||||
AiStatistics aiStatistics = new AiStatistics();
|
||||
aiStatistics.setSource(loginAiUser.getUser().getSource());
|
||||
aiStatistics.setVisitorCount(1l);
|
||||
aiStatistics.setVisitorCount(1L);
|
||||
aiStatisticsService.saveOrUpdateData(aiStatistics);
|
||||
String ip = IpUtils.getIpAddr();
|
||||
String country = IpCountryQueryByApi.getIpCountry(ip);
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ public class AiOrderServiceImpl implements IAiOrderService {
|
|||
* 生成订单
|
||||
* @param aiType 对应的AI类型
|
||||
*/
|
||||
@Override
|
||||
public AiOrder getAiOrder(String aiType) {
|
||||
return getAiOrder(aiType, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public class AiRechargeServiceImpl implements IAiRechargeService {
|
|||
|
||||
// 如果是首充活动就判断是否是第一次充值
|
||||
boolean isFristRecharge = true;
|
||||
if (aiRechargeGift.getIsFristRecharge().equals("Y")) {
|
||||
if ("Y".equals(aiRechargeGift.getIsFristRecharge())) {
|
||||
QueryWrapper<AiRecharge> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", aiRecharge.getUserId());
|
||||
queryWrapper.isNotNull("credited_time");
|
||||
|
|
|
|||
|
|
@ -137,7 +137,9 @@ public class AiTagServiceImpl implements IAiTagService {
|
|||
|
||||
@Override
|
||||
public List<AiTag> selectAiTagListByIds(String tags, String parentTags) {
|
||||
if (parentTags == null) parentTags = "";
|
||||
if (parentTags == null) {
|
||||
parentTags = "";
|
||||
}
|
||||
return aiTagMapper.selectAiTagListByIds(tags.split(","), parentTags.split(","));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -466,7 +466,9 @@ public class AiUserServiceImpl implements IAiUserService {
|
|||
@Override
|
||||
public void handleRebate(String orderNo, Long userId, BigDecimal amount) {
|
||||
AiUser aiUser = aiUserMapper.selectById(userId);
|
||||
if (aiUser.getSuperiorId() == null) return;
|
||||
if (aiUser.getSuperiorId() == null) {
|
||||
return;
|
||||
}
|
||||
// 查询上级用户
|
||||
AiUser superiorUser = aiUserMapper.selectById(aiUser.getSuperiorId());
|
||||
if (superiorUser != null) {
|
||||
|
|
|
|||
|
|
@ -244,6 +244,7 @@ public class ByteService implements IByteService {
|
|||
return body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String resolveCurrentAiUserApiKey() {
|
||||
return byteDeptApiKeyService.resolveVolcApiKey(SecurityUtils.getAiUserId());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue