Commit 1e769698 by HlQ

[style] 代码优化

1 parent 348786ca
......@@ -29,6 +29,9 @@ import java.time.format.DateTimeFormatter;
@Configuration
public class RedisConfig {
private static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
private static final String dateFormat = "yyyy-MM-dd";
private static final String timeFormat = "HH:mm:ss";
@Value("${spring.data.redis.host}")
private String host;
@Value("${spring.data.redis.port}")
......@@ -38,10 +41,6 @@ public class RedisConfig {
@Value("${spring.data.redis.database}")
private Integer database;
private static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
private static final String dateFormat = "yyyy-MM-dd";
private static final String timeFormat = "HH:mm:ss";
@Bean(destroyMethod = "shutdown")
public RedissonClient redissonClient() {
Config config = new Config();
......
......@@ -51,7 +51,7 @@ public class MallDTO extends BaseDTO {
private Short attention;
/**
* 指标列表
* 指标列表
*/
private List<String> eventUidList;
......
......@@ -36,7 +36,7 @@ public class MAccount extends BaseDTO {
private String uid;
/**
* 集团名称
* 集团名称
*/
@TableField(value = "\"name\"", condition = SqlCondition.LIKE)
private String name;
......
......@@ -949,9 +949,6 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
return jsonObj.toString();
}
private record Result(Set<String> roleCodeList, MPJLambdaWrapper<Contract> wrapper) {
}
/*
* 1.校验合同数量,以及合同编号
* 2.校验合同金额
......@@ -1218,4 +1215,7 @@ public class ContractServiceImpl extends MPJBaseServiceImpl<ContractMapper, Cont
return true;
}
private record Result(Set<String> roleCodeList, MPJLambdaWrapper<Contract> wrapper) {
}
}
\ No newline at end of file
......@@ -56,6 +56,8 @@ import java.util.stream.Collectors;
@RequiredArgsConstructor
public class PointInfoServiceImpl extends MPJBaseServiceImpl<PointInfoMapper, PointInfo> implements IPointInfoService {
// todo 点位设计推送机器人消息到群组
private final static String DING_GROUP_TOKEN = "未定";
private final IFileService fileService;
private final IRejectInfoService rejectInfoService;
private final IRPointWxService pointWxService;
......@@ -64,13 +66,9 @@ public class PointInfoServiceImpl extends MPJBaseServiceImpl<PointInfoMapper, Po
private final DingMod dingMod;
private final WechatMod wechatMod;
private final Converter converter;
@Value("${fileUrl:}")
private String fileUrl;
// todo 点位设计推送机器人消息到群组
private final static String DING_GROUP_TOKEN = "未定";
@Override
public Object frontSubmit(PointInfoDTO dto) {
Object obj = insRec(dto);
......
......@@ -5,6 +5,7 @@ import org.springframework.stereotype.Service;
import vion.mapper.monitor.AgentRecordMapper;
import vion.model.monitor.AgentRecord;
import vion.service.monitor.IAgentRecordService;
/**
* @author vion
* @date 2024/10/31
......
......@@ -5,6 +5,7 @@ import org.springframework.stereotype.Service;
import vion.mapper.monitor.EventRecordMapper;
import vion.model.monitor.EventRecord;
import vion.service.monitor.IEventRecordService;
/**
* @author vion
* @date 2024/10/31
......
......@@ -5,6 +5,7 @@ import org.springframework.stereotype.Service;
import vion.mapper.monitor.RAgentServiceMapper;
import vion.model.monitor.RAgentService;
import vion.service.monitor.IRAgentServiceService;
/**
* @author vion
* @date 2024/10/22
......
......@@ -5,6 +5,7 @@ import org.springframework.stereotype.Service;
import vion.mapper.monitor.ServiceRecordMapper;
import vion.model.monitor.ServiceRecord;
import vion.service.monitor.IServiceRecordService;
/**
* @author vion
* @date 2024/10/23
......
......@@ -2,7 +2,8 @@ package vion.service.monitor;
import com.github.yulichang.base.MPJBaseService;
import vion.model.monitor.AgentRecord;
/**
/**
* @author vion
* @date 2024/10/31
*/
......
......@@ -2,7 +2,8 @@ package vion.service.monitor;
import com.github.yulichang.base.MPJBaseService;
import vion.model.monitor.EventRecord;
/**
/**
* @author vion
* @date 2024/10/31
*/
......
......@@ -2,7 +2,8 @@ package vion.service.monitor;
import com.github.yulichang.base.MPJBaseService;
import vion.model.monitor.RAgentService;
/**
/**
* @author vion
* @date 2024/10/22
*/
......
......@@ -2,7 +2,8 @@ package vion.service.monitor;
import com.github.yulichang.base.MPJBaseService;
import vion.model.monitor.ServiceRecord;
/**
/**
* @author vion
* @date 2024/10/23
*/
......
......@@ -2,11 +2,12 @@ package vion.service.monitor;
import com.baomidou.mybatisplus.extension.service.IService;
import vion.model.monitor.UpgradeInfo;
/**
/**
* @author vion
* @date 2024/11/24
*/
public interface IUpgradeInfoService extends IService<UpgradeInfo>{
public interface IUpgradeInfoService extends IService<UpgradeInfo> {
}
......@@ -44,11 +44,6 @@ import java.util.List;
@Slf4j
public class DingMod {
@Value("${ding.appkey:}")
private String appKey;
@Value("${ding.appsecret:}")
private String appSecret;
private final IUserService userService;
private final IRoleService roleService;
private final IResourceService resourceService;
......@@ -59,6 +54,10 @@ public class DingMod {
private final RedissonClient redissonClient;
private final RestClient oDingRestClient;
private final RestClient dingRestClient;
@Value("${ding.appkey:}")
private String appKey;
@Value("${ding.appsecret:}")
private String appSecret;
/**
* 获取钉钉token
......
......@@ -42,6 +42,10 @@ import java.util.Locale;
@Slf4j
public class JsonUtil {
private static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
private static final String dateFormat = "yyyy-MM-dd";
private static final String timeFormat = "HH:mm:ss";
public static ObjectNode createObj() {
return getObjectMapper().createObjectNode();
}
......@@ -225,10 +229,6 @@ public class JsonUtil {
private static final ObjectMapper INSTANCE = new JacksonObjectMapper();
}
private static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss";
private static final String dateFormat = "yyyy-MM-dd";
private static final String timeFormat = "HH:mm:ss";
private static class JacksonObjectMapper extends ObjectMapper {
private static final long serialVersionUID = 4288193147502386170L;
......
......@@ -23,19 +23,6 @@ import java.util.stream.Collectors;
@Slf4j
public class IPUtil {
private static String asnPath;
private static String cityPath;
@Value("${geo.asn.path}")
public void setAsnPath(String asnPath) {
IPUtil.asnPath = asnPath;
}
@Value("${geo.city.path}")
public void setCityPath(String cityPath) {
IPUtil.cityPath = cityPath;
}
public static Map<Integer, String> asnMap = new HashMap<>() {{
put(9812, "东方有线");
put(9389, "中国长城");
......@@ -188,6 +175,8 @@ public class IPUtil {
put(396982, "谷歌云");
put(36492, "谷歌云");
}};
private static String asnPath;
private static String cityPath;
public static String getAddr(String ip) {
var cityDB = FileUtil.file(cityPath);
......@@ -216,4 +205,14 @@ public class IPUtil {
return StrUtil.format("Country:{}, Province:{}, City:{}, ASN:{}", "Unknown", "Unknown", "Unknown", "Unknown");
}
@Value("${geo.asn.path}")
public void setAsnPath(String asnPath) {
IPUtil.asnPath = asnPath;
}
@Value("${geo.city.path}")
public void setCityPath(String cityPath) {
IPUtil.cityPath = cityPath;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!