Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump spring-boot-starter-web from 2.2.5.RELEASE to 2.5.12 #91

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The project code called Radar, like the code, monitor the transaction at the bac
* 配置简单,开箱即用!

## 相关站点
Gitee: https://gitee.com/freshday/radar
Github: https://github.com/wfh45678/radar // github 为镜像网站,贡献代码请提交到 gitee
Gitee: https://gitee.com/freshday/radar
Github: https://github.com/wfh45678/radar // github 为镜像网站,贡献代码请提交到 gitee
官网: https://www.riskengine.cn
Wiki: https://gitee.com/freshday/radar/wikis/home

Expand Down Expand Up @@ -100,11 +100,10 @@ https://gitee.com/freshday/radar/wikis/manual
## Contact to

如果喜欢本项目,Star支持一下, 让更多人了解本项目,谢谢!
独乐乐不如众乐乐,微信(nicedream7758)加群一起嗨!
提示:进群需要捐赠到gitee



## 特别说明
前端源码仅对企业级用户开放,需付费购买。
未经授权,禁止使用本项目源码申请软著和专利,保留追究法律责任的权力!
Copyright © 2019-2021 WangFeiHu
Copyright © 2019-2022 WangFeiHu
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mailto: wfh45678@163.com
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<mapper.version>4.0.0</mapper.version>
<mybatisGenerator.version>1.3.7</mybatisGenerator.version>
<mysql.version>8.0.16</mysql.version>
<springboot.version>2.2.5.RELEASE</springboot.version>
<springboot.version>2.5.12</springboot.version>
<tensorflow.version>1.12.0</tensorflow.version>
<es.version>7.11.2</es.version>
<mapstruct.version>1.4.1.Final</mapstruct.version>
Expand Down Expand Up @@ -114,7 +114,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.66</version>
<version>1.2.75</version>
</dependency>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 WangFeiHu
* Copyright (c) 2019-2022 WangFeiHu
* Radar is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,10 @@ public CommonResult disable(@PathVariable Long activationId) {
public CommonResult enable(@PathVariable Long activationId) {
return activationService.updateStatus(activationId, 1);
}

@PostMapping("/copy")
public CommonResult copy(@RequestBody Long id) {
CommonResult result = activationService.copy(id);
return result;
}
}
8 changes: 8 additions & 0 deletions radar-admin/src/main/resources/static/index.ba8e3789-1.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions radar-admin/src/main/resources/static/index.ba8e3789-2.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions radar-admin/src/main/resources/static/index.da6b2009-1.css

This file was deleted.

1 change: 0 additions & 1 deletion radar-admin/src/main/resources/static/index.da6b2009-2.css

This file was deleted.

2 changes: 1 addition & 1 deletion radar-admin/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>风控引擎管理平台</title> <link rel="shortcut icon" href="/images/anquan.png"> <!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]--> <link href="./index.da6b2009-1.css" rel="stylesheet"><link href="./index.da6b2009-2.css" rel="stylesheet"><link href="./index.da6b2009-3.css" rel="stylesheet"></head> <body> <div id="react-content"></div> <script type="text/javascript" src="./main.da6b2009.js"></script></body> </html>
<![endif]--> <link href="./index.ba8e3789-1.css" rel="stylesheet"><link href="./index.ba8e3789-2.css" rel="stylesheet"><link href="./index.ba8e3789-3.css" rel="stylesheet"></head> <body> <div id="react-content"></div> <script type="text/javascript" src="./main.ba8e3789.js"></script></body> </html>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,5 @@ public static Calendar addDate(Date d, int field, int value) {
return c;
}

/**
* <p>main.</p>
*
* @param args an array of {@link String} objects.
*/
public static void main(String[] args) {
System.out.println(formatDate(new Date(), "yyyy-MM-ww-dd"));

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,4 @@ public static String encrypt(String str, String salt) {
return md5StrBuff.toString();
}

/**
* <p>main.</p>
*
* @param args an array of {@link String} objects.
*/
public static void main(String[] args) {
System.out.println(encrypt("222222","admin"));
System.out.println(encrypt("123456","test"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public static void main(String[] args) {
}

public static String getLocation(String mobile) {
//TODO: 需要重新寻找手机号码段API 通道.
String httpUrl = "http://apis.baidu.com/apistore/mobilenumber/mobilenumber";
String httpArg = "phone=" + mobile;
String jsonResult = get(httpUrl, httpArg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import com.pgmmers.radar.vo.model.RuleHistoryVO;
import com.pgmmers.radar.vo.model.RuleVO;

import java.util.List;


public interface RuleDal {

Expand All @@ -22,4 +24,5 @@ public interface RuleDal {

int saveHistory(RuleHistoryVO model);

List<RuleVO> listByActId(Long actId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,13 @@ public int saveHistory(RuleHistoryVO ruleHistory) {
return count;
}

@Override
public List<RuleVO> listByActId(Long actId) {
Example example = new Example(RulePO.class);
Example.Criteria ruleCriteria = example.createCriteria();
ruleCriteria.andEqualTo("activationId", actId);
List<RulePO> ruleList = ruleMapper.selectByExample(example);
return ruleMapping.sourceToTarget(ruleList);
}

}
4 changes: 4 additions & 0 deletions radar-engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.pgmmers.radar.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;


@Configuration
@ConfigurationProperties(prefix = "sys.conf")
@Data
public class SystemProperties {

private String mongoRestoreDays;

private String machineLearning;

private String workdir;

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 WangFeiHu
* Copyright (c) 2019-2022 WangFeiHu
* Radar is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 WangFeiHu
* Copyright (c) 2019-2022 WangFeiHu
* Radar is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
Expand Down Expand Up @@ -54,4 +54,11 @@ public CommonResult upload(@Valid @RequestBody EventRequest request) {
CommonResult result = engineApi.uploadInfo(request.getGuid(), request.getReqId(), request.getJsonInfo());
return result;
}

@PostMapping("/syncStatus")
@ApiOperation(value = "事件状态同步接口")
public CommonResult syncStatus(@Valid @RequestBody StatusSyncRequest request) {
CommonResult result = engineApi.syncStatus(request.getGuid(), request.getEventId(), request.getStatus());
return result;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2019-2022 WangFeiHu
* Radar is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/

package com.pgmmers.radar.controller;

import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
* 状态同步请求。
* @author feihu.wang
*/
public class StatusSyncRequest {
@ApiModelProperty(value = "模型guid")
@NotBlank(message = "guid 不能为空")
private String guid;

@ApiModelProperty(value = "eventId")
@NotBlank(message = "eventId 不能为空")
private String eventId;

@ApiModelProperty(value = "status")
@NotNull(message = "status 不能为空")
private String status;

public String getGuid() {
return guid;
}

public void setGuid(String guid) {
this.guid = guid;
}

public String getEventId() {
return eventId;
}

public void setEventId(String eventId) {
this.eventId = eventId;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,18 @@ public CommonResult getScore(String modelGuid, String reqId) {
return result;
}

@Override
public CommonResult syncStatus(String modelGuid, String eventId, String status) {
CommonResult result = new CommonResult();
ModelVO model = modelService.getModelByGuid(modelGuid);
if (model == null) {
result.setMsg("模型不存在!");
return result;
}
long cnt = entityService.update(model.getId(), eventId, status);
result.setSuccess(cnt > 0 ? true : false);
return result;
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class MongoServiceImpl implements MongoService {

@Autowired
@Resource
private MongoTemplate mongoTemplate;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,27 @@ public class AggregateCommandImpl implements AggregateCommand {
@Override
public long count(String modelId, String searchField, Object searchFieldValue, String refDateName, Date begin,
Date end) {
return count(modelId, searchField, searchFieldValue, refDateName,"1", begin, end);
}

public long count(String modelId, String searchField, Object searchFieldValue, String refDateName, String status, Date begin,
Date end) {
String collectionName = "entity_" + modelId;
Long qty = mongoService.count(collectionName, Filters.and(Filters.eq(searchField, searchFieldValue),
Filters.eq("status", status),
Filters.gte(refDateName, begin.getTime()), Filters.lte(refDateName, end.getTime())));
return qty;
}

@Override
public long distinctCount(String modelId, String searchField, Object searchFieldValue, String refDateName,
Date begin, Date end, String distinctBy) {
return distinctCount(modelId,searchField,searchFieldValue,refDateName,"1", begin, end, distinctBy);
}

@Override
public long distinctCount(String modelId, String searchField, Object searchFieldValue, String refDateName,
String status, Date begin, Date end, String distinctBy) {
String collectionName = "entity_" + modelId;
Long qty = mongoService.distinctCount(collectionName, Filters.and(Filters.eq(searchField, searchFieldValue),
Filters.gte(refDateName, begin.getTime()), Filters.lte(refDateName, end.getTime())), distinctBy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
import com.pgmmers.radar.dal.bean.ActivationQuery;
import com.pgmmers.radar.dal.model.ActivationDal;
import com.pgmmers.radar.dal.model.ModelDal;
import com.pgmmers.radar.dal.model.RuleDal;
import com.pgmmers.radar.service.cache.CacheService;
import com.pgmmers.radar.service.cache.SubscribeHandle;
import com.pgmmers.radar.service.common.CommonResult;
import com.pgmmers.radar.service.model.ActivationService;
import com.pgmmers.radar.vo.model.ActivationVO;

import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;

import com.pgmmers.radar.vo.model.RuleVO;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -33,6 +38,9 @@ public Object query(Long modelId) {
@Autowired
private ActivationDal activationDal;

@Autowired
private RuleDal ruleDal;

@Autowired
private CacheService cacheService;

Expand Down Expand Up @@ -108,6 +116,28 @@ public CommonResult updateOrder(Long activationId, String ruleOrder) {
return result;
}

@Override
public CommonResult copy(Long id) {
CommonResult result = new CommonResult();
ActivationVO origVO = activationDal.get(id);
if (origVO == null) {
return result;
}
List<RuleVO> ruleList = ruleDal.listByActId(id);
origVO.setId(null);
origVO.setLabel(origVO.getLabel() + "_copy");
origVO.setCreateTime(new Date());
activationDal.save(origVO);
for (RuleVO ruleVO : ruleList) {
ruleVO.setId(null);
ruleVO.setActivationId(origVO.getId());
ruleVO.setCreateTime(new Date());
ruleDal.save(ruleVO);
}
result.setSuccess(true);
return result;
}

@Override
public CommonResult updateStatus(Long activationId, Integer status) {
CommonResult result = new CommonResult();
Expand Down
Loading