You've already forked FrameTour-BE
refactor(statistics): 移除统计记录添加功能
- 删除 AppStatisticsController 中的 addStatistics 接口 - 移除 AppStatisticsServiceImpl 中 addStatistics 方法的实现 - 从 AppStatisticsService 接口中移除 addStatistics 方法声明- 清理 FaceServiceImpl 中调用统计记录添加的代码逻辑
This commit is contained in:
@@ -56,12 +56,4 @@ public class AppStatisticsController {
|
||||
return statisticsService.userConversionFunnel(query);
|
||||
}
|
||||
|
||||
// 统计数据记录
|
||||
@PostMapping("/addStatistics")
|
||||
@IgnoreToken
|
||||
public ApiResponse<String> addStatistics(@RequestBody StatisticsRecordAddReq req) {
|
||||
|
||||
return statisticsService.addStatistics(req);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,5 @@ public interface AppStatisticsService {
|
||||
|
||||
ApiResponse<AppStatisticsFunnelVO> userConversionFunnel(CommonQueryReq query);
|
||||
|
||||
ApiResponse<String> addStatistics(StatisticsRecordAddReq req);
|
||||
|
||||
ApiResponse orderChart(CommonQueryReq query);
|
||||
}
|
||||
|
||||
@@ -288,34 +288,6 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
|
||||
return int1 == null ? 0 : int1 + (int2 == null ? 0 : int2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<String> addStatistics(StatisticsRecordAddReq req) {
|
||||
// req.setId(SnowFlakeUtil.getLongId());
|
||||
if (req.getMemberId() == null) {
|
||||
try {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
Long userId = worker.getUserId();
|
||||
req.setMemberId(userId);
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
Integer type = req.getType();
|
||||
if(type==null){
|
||||
return ApiResponse.fail("类型不能为空");
|
||||
}
|
||||
Map<Integer, StatisticEnum> valueMap = StatisticEnum.cacheMap;
|
||||
if(!valueMap.containsKey(type)){
|
||||
return ApiResponse.fail("添加失败,类型不存在");
|
||||
}
|
||||
int i=statisticsMapper.addStatisticsRecord(req);
|
||||
if(i==0){
|
||||
return ApiResponse.fail("添加失败");
|
||||
}else{
|
||||
return ApiResponse.success("添加成功");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse orderChart(CommonQueryReq query) {
|
||||
if(query.getEndTime()==null && query.getStartTime()==null){
|
||||
|
||||
@@ -261,12 +261,6 @@ public class FaceServiceImpl implements FaceService {
|
||||
faceMapper.update(faceEntity);
|
||||
faceRepository.clearFaceCache(oldFaceId);
|
||||
}
|
||||
StatisticsRecordAddReq statisticsRecordAddReq = new StatisticsRecordAddReq();
|
||||
statisticsRecordAddReq.setMemberId(userId);
|
||||
statisticsRecordAddReq.setType(StatisticEnum.UPLOAD_FACE.code);
|
||||
statisticsRecordAddReq.setScenicId(scenicId);
|
||||
statisticsRecordAddReq.setMorphId(newFaceId);
|
||||
statisticsMapper.addStatisticsRecord(statisticsRecordAddReq);
|
||||
FaceRecognizeResp resp = new FaceRecognizeResp();
|
||||
resp.setUrl(faceUrl);
|
||||
resp.setFaceId(newFaceId);
|
||||
|
||||
Reference in New Issue
Block a user