Commit 20f8432a by tutingyin

refactor: 用户日志上报 去除安全空间 微信/QQ 信息回传

parent 14ce6205
......@@ -6,17 +6,12 @@ import com.skr.mdm.result.ResponseResult;
import com.skr.mdm.service.CmdHandlerService;
import com.skr.mdm.service.StrategyFactory;
import com.skr.mdm.service.impl.equipment.DeviceDebugLogServiceImpl;
import com.skr.mdm.service.impl.log.SafeQqServiceImpl;
import com.skr.mdm.service.impl.log.SafeWechatServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
......@@ -30,10 +25,6 @@ import springfox.documentation.annotations.ApiIgnore;
public class UserLogController {
@Autowired
private SafeWechatServiceImpl safeWechatService;
@Autowired
private SafeQqServiceImpl safeQqService;
@Autowired
private DeviceDebugLogServiceImpl deviceDebugLogService;
@PostMapping("upload")
......@@ -45,104 +36,6 @@ public class UserLogController {
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("wechat/upload")
@ApiOperation("普通系统上传微信日志(0x3DD)")
public ResponseResult wechatUploadLog(@RequestParam @ApiParam(value = "数据", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.WECHAT_SEND);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("qq/upload")
@ApiOperation("普通系统上传QQ日志(0x3ED)")
public ResponseResult qqUploadLog(@RequestParam @ApiParam(value = "数据", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.QQ_SEND);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("wechat/user")
@ApiOperation("微信用户信息(0x3E3)")
public ResponseResult wechatUser(@RequestParam @ApiParam(value = "微信用户信息", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.WECHAT_USER_UPLOAD);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("safe/wechat")
@ApiOperation("安全空间微信聊天记录")
public ResponseResult safeWechat(@RequestParam @ApiParam(value = "微信用户信息", required = true) String data,
@RequestParam(required = false) @ApiParam(value = "微信聊天文件", required = false) MultipartFile file,
@ApiIgnore Authentication authentication) throws Exception {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
return safeWechatService.uploadWechatRecord(file, data, loginUserDTO);
}
@PostMapping("qq/user")
@ApiOperation("QQ用户信息(0x3EC)")
public ResponseResult qqUser(@RequestParam @ApiParam(value = "QQ用户信息", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.QQ_USER_UPLOAD);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("safe/qq")
@ApiOperation("安全空间QQ聊天记录")
public ResponseResult safeQq(@RequestParam @ApiParam(value = "QQ用户信息", required = true) String data,
@RequestParam(required = false) @ApiParam(value = "QQ聊天文件", required = false) MultipartFile file,
@ApiIgnore Authentication authentication) throws Exception {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
return safeQqService.uploadQqRecord(file, data, loginUserDTO);
}
@PostMapping("deal/upload")
@ApiOperation("上传交易日志")
public ResponseResult dealLogUpload(@RequestParam @ApiParam(value = "数据", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.LOG_DEAL_UPLOAD);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("url/blacklist/upload")
@ApiOperation("上传网址黑名单日志(0x3E5)")
public ResponseResult urlBlacklistUpload(@RequestParam @ApiParam(value = "数据", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.LOG_URL_BLACKLIST_UPLOAD);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("url/violation/upload")
@ApiOperation("上传违规网址日志(0x3E6)")
public ResponseResult urlViolationUpload(@RequestParam @ApiParam(value = "数据", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.LOG_URL_VIOLATION_UPLOAD);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("url/bad/upload")
@ApiOperation("上传不良网址日志(0x3E7)")
public ResponseResult urlVisitBadUpload(@RequestParam @ApiParam(value = "数据", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.LOG_URL_VISIT_BAD_UPLOAD);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("url/upload")
@ApiOperation("上传网址访问日志(0x3E8)")
public ResponseResult urlVisitUpload(@RequestParam @ApiParam(value = "数据", required = true) String data,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
CmdHandlerService strategy = StrategyFactory.getStrategy(CmdTypeConstants.LOG_URL_VISIT_UPLOAD);
return strategy.cmdHandler(loginUserDTO.getId(), data);
}
@PostMapping("confirm")
@ApiOperation("日志确认")
......@@ -154,10 +47,11 @@ public class UserLogController {
}
@PostMapping("file/upload")
@ApiOperation("调试日志上传")
public ResponseResult debugUploadLog(@ApiParam(value = "文件", required = true) MultipartFile file,
@ApiOperation("调试日志上传 含有info 上传失败原因")
public ResponseResult debugUploadLog(@RequestParam @ApiParam(value = "文件", required = true) MultipartFile file,
@RequestParam(required = false) String info,
@ApiIgnore Authentication authentication) {
LoginUserDTO loginUserDTO = (LoginUserDTO) authentication.getPrincipal();
return deviceDebugLogService.upload(loginUserDTO, file);
return deviceDebugLogService.upload(loginUserDTO, info, file);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment