1
This commit is contained in:
parent
f693f036df
commit
ad9e91cd7a
@ -0,0 +1,8 @@
|
||||
package com.ycwl.basic.annotation;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface IgnoreLogReq {
|
||||
}
|
@ -1,10 +1,12 @@
|
||||
package com.ycwl.basic.aspectj;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ycwl.basic.annotation.IgnoreLogReq;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.annotation.Pointcut;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
@ -13,6 +15,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -35,6 +38,12 @@ public class RequestParameterAspectj {
|
||||
|
||||
@Around("classPackage()")
|
||||
public Object parameterPoint(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||
// 方法有 IgnoreLogReq 注解时不执行
|
||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||
Method callMethod = signature.getMethod();
|
||||
if (callMethod.isAnnotationPresent(IgnoreLogReq.class)) {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
final ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
if (requestAttributes != null) {
|
||||
final HttpServletRequest request = requestAttributes.getRequest();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ycwl.basic.controller.mobile;
|
||||
|
||||
import com.ycwl.basic.annotation.IgnoreLogReq;
|
||||
import com.ycwl.basic.model.jwt.JwtInfo;
|
||||
import com.ycwl.basic.model.mobile.goods.VideoTaskReq;
|
||||
import com.ycwl.basic.model.mobile.goods.VideoTaskStatusVO;
|
||||
@ -25,11 +26,13 @@ public class AppTaskController {
|
||||
private TaskService taskService;
|
||||
|
||||
@GetMapping("/face/{faceId}")
|
||||
@IgnoreLogReq
|
||||
public ApiResponse<VideoTaskStatusVO> getTaskStatusByFaceId(@PathVariable("faceId") Long faceId) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
return goodsService.getTaskStatusByFaceId(worker.getUserId(), faceId);
|
||||
}
|
||||
@GetMapping("/scenic/{scenicId}")
|
||||
@IgnoreLogReq
|
||||
public ApiResponse<VideoTaskStatusVO> getAllTaskStatusByScenicId(@PathVariable("scenicId") Long scenicId) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
return goodsService.getTaskStatusByScenicId(worker.getUserId(), scenicId);
|
||||
@ -43,6 +46,7 @@ public class AppTaskController {
|
||||
*/
|
||||
@ApiOperation("查询用户当前景区的具体模版视频合成任务状态 1 合成中 2 合成成功 ")
|
||||
@GetMapping("/face/{faceId}/template/{templateId}")
|
||||
@IgnoreLogReq
|
||||
public ApiResponse<VideoTaskStatusVO> getTemplateTaskStatus(@PathVariable("faceId") Long faceId, @PathVariable("templateId") Long templateId) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
return goodsService.getTaskStatusByTemplateId(worker.getUserId(), faceId, templateId);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.ycwl.basic.controller.task;
|
||||
|
||||
import com.ycwl.basic.annotation.IgnoreLogReq;
|
||||
import com.ycwl.basic.annotation.IgnoreToken;
|
||||
import com.ycwl.basic.model.pc.template.resp.TemplateRespVO;
|
||||
import com.ycwl.basic.model.task.req.TaskReqVo;
|
||||
@ -24,6 +25,7 @@ public class TaskTaskController {
|
||||
|
||||
@Autowired
|
||||
private TaskService taskService;
|
||||
@IgnoreLogReq
|
||||
@PostMapping("/sync")
|
||||
public ApiResponse<TaskSyncRespVo> sync(@RequestBody TaskReqVo req) {
|
||||
TaskSyncRespVo respVo = taskService.handleSyncTask(req);
|
||||
|
@ -3,6 +3,7 @@ package com.ycwl.basic.controller.viid;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.ycwl.basic.annotation.IgnoreLogReq;
|
||||
import com.ycwl.basic.annotation.IgnoreToken;
|
||||
import com.ycwl.basic.mapper.DeviceMapper;
|
||||
import com.ycwl.basic.mapper.FaceSampleMapper;
|
||||
@ -100,10 +101,11 @@ public class ViidController {
|
||||
* @param request 请求
|
||||
* @return 返回
|
||||
*/
|
||||
@IgnoreLogReq
|
||||
@RequestMapping(value = "/System/Keepalive", method = RequestMethod.POST)
|
||||
public VIIDBaseResp keepalive(@RequestBody KeepaliveReq req, HttpServletRequest request) {
|
||||
DeviceIdObject keepaliveObject = req.getKeepaliveObject();
|
||||
log.info("对方发送的心跳的信息:{}", keepaliveObject);
|
||||
// log.info("对方发送的心跳的信息:{}", keepaliveObject);
|
||||
|
||||
String deviceId = keepaliveObject.getDeviceId();
|
||||
DeviceEntity device = deviceMapper.getByDeviceNo(deviceId);
|
||||
@ -124,7 +126,7 @@ public class ViidController {
|
||||
device.setKeepaliveAt(new Date());
|
||||
deviceMapper.updateEntity(device);
|
||||
}
|
||||
log.info("已经解析过的心跳信息:{}", keepaliveObject);
|
||||
// log.info("已经解析过的心跳信息:{}", keepaliveObject);
|
||||
|
||||
return new VIIDBaseResp(
|
||||
new ResponseStatusObject(deviceId, "/VIID/System/UnRegister", "0", "注销成功", sdfTime.format(new Date()))
|
||||
|
@ -32,4 +32,5 @@ public class ContentPageVO {
|
||||
private String templateCoverUrl;
|
||||
@ApiModelProperty("是否购买:0未购买,1已购买")
|
||||
private Integer isBuy;
|
||||
private BigDecimal duration;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class FaceSampleEntity {
|
||||
* 样本ID
|
||||
*/
|
||||
private Long sourceId;
|
||||
private float score;
|
||||
private Float score;
|
||||
/**
|
||||
* 人脸照片
|
||||
*/
|
||||
|
@ -4,5 +4,5 @@ import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class AddFaceSampleRespVo {
|
||||
private float score;
|
||||
private Float score;
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import com.ycwl.basic.model.pc.scenic.resp.ScenicRespVO;
|
||||
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||
import com.ycwl.basic.repository.ScenicRepository;
|
||||
import com.ycwl.basic.service.mobile.AppScenicService;
|
||||
import com.ycwl.basic.repository.TemplateRepository;
|
||||
@ -120,6 +121,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
if (!memberVideoEntityList.isEmpty()) {
|
||||
contentPageVO.setIsBuy(memberVideoEntityList.get(0).getIsBuy());
|
||||
contentPageVO.setContentId(memberVideoEntityList.get(0).getVideoId());
|
||||
VideoRespVO videoMapperById = videoMapper.getById(contentPageVO.getContentId());
|
||||
contentPageVO.setDuration(videoMapperById.getDuration());
|
||||
contentPageVO.setLockType(-1);
|
||||
} else {
|
||||
contentPageVO.setContentType(0);
|
||||
|
@ -142,6 +142,7 @@ public class VideoPieceGetter {
|
||||
log.warn("没有可用的文件");
|
||||
return;
|
||||
}
|
||||
log.info("查询到可用的文件: {}", listByDtRange);
|
||||
long offset = faceSample.getCreateAt().getTime() - cutPre.multiply(BigDecimal.valueOf(1000)).longValue() - listByDtRange.get(0).getCreateTime().getTime();
|
||||
FfmpegTask ffmpegTask = new FfmpegTask();
|
||||
ffmpegTask.setFileList(listByDtRange);
|
||||
|
@ -36,7 +36,6 @@ public class XSSHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
*/
|
||||
public XSSHttpServletRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
logger.info("---xss XSSHttpServletRequestWrapper created-----");
|
||||
this.request = request;
|
||||
reqBody = getBodyString();
|
||||
}
|
||||
@ -55,12 +54,9 @@ public class XSSHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
*/
|
||||
@Override
|
||||
public String getParameter(String name) {
|
||||
logger.info("---xss XSSHttpServletRequestWrapper work getParameter-----");
|
||||
String parameter = request.getParameter(name);
|
||||
if (StringUtils.isNotBlank(parameter)) {
|
||||
logger.info("----filter before--name:{}--value:{}----", name, parameter);
|
||||
parameter = StringEscapeUtils.escapeHtml4(parameter);
|
||||
logger.info("----filter after--name:{}--value:{}----", name, parameter);
|
||||
}
|
||||
return parameter;
|
||||
}
|
||||
@ -73,16 +69,9 @@ public class XSSHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
*/
|
||||
@Override
|
||||
public String[] getParameterValues(String name) {
|
||||
logger.info("---xss XSSHttpServletRequestWrapper work getParameterValues-----");
|
||||
String[] parameterValues = request.getParameterValues(name);
|
||||
if (parameterValues != null && parameterValues.length > 0) {
|
||||
if (!CollectionUtil.isEmpty(Arrays.asList(parameterValues))) {
|
||||
// 经 “@Belief_7” 指正 这种方式不能更改parameterValues里面的值,要换成下面👇的写法
|
||||
//for (String value : parameterValues) {
|
||||
// logger.info("----filter before--name:{}--value:{}----", name, value);
|
||||
// value = StringEscapeUtils.escapeHtml4(value);
|
||||
// logger.info("----filter after--name:{}--value:{}----", name, value);
|
||||
// }
|
||||
for (int i = 0; i < parameterValues.length; i++)
|
||||
{
|
||||
parameterValues[i] = StringEscapeUtils.escapeHtml4(parameterValues[i]);
|
||||
@ -98,15 +87,14 @@ public class XSSHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, String[]> getParameterMap() {
|
||||
logger.info("---xss XSSHttpServletRequestWrapper work getParameterMap-----");
|
||||
Map<String, String[]> map = request.getParameterMap();
|
||||
if (map != null && !map.isEmpty()) {
|
||||
for (String[] value : map.values()) {
|
||||
/*循环所有的value*/
|
||||
for (String str : value) {
|
||||
logger.info("----filter before--value:{}----", str, str);
|
||||
logger.info("----filter before--value:{}----", str);
|
||||
str = StringEscapeUtils.escapeHtml4(str);
|
||||
logger.info("----filter after--value:{}----", str, str);
|
||||
logger.info("----filter after--value:{}----", str);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -120,7 +108,6 @@ public class XSSHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
*/
|
||||
@Override
|
||||
public BufferedReader getReader() throws IOException {
|
||||
logger.info("---xss XSSHttpServletRequestWrapper work getReader-----");
|
||||
return new BufferedReader(new InputStreamReader(getInputStream()));
|
||||
}
|
||||
|
||||
@ -130,7 +117,6 @@ public class XSSHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
*/
|
||||
@Override
|
||||
public ServletInputStream getInputStream() throws IOException {
|
||||
logger.info("---xss XSSHttpServletRequestWrapper work getInputStream-----");
|
||||
/*创建字节数组输入流*/
|
||||
final ByteArrayInputStream bais = new ByteArrayInputStream(reqBody.getBytes(StandardCharsets.UTF_8));
|
||||
return new ServletInputStream() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user