37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
|
|
package com.senmesh.sfile.controller;
|
||
|
|
|
||
|
|
import com.senmesh.common.AlitaResult;
|
||
|
|
import com.senmesh.sfile.service.RiskFileService;
|
||
|
|
import io.swagger.annotations.Api;
|
||
|
|
import io.swagger.annotations.ApiOperation;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
||
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 风险文件Controller
|
||
|
|
*/
|
||
|
|
@RestController
|
||
|
|
@Api(tags = "风险文件")
|
||
|
|
public class RiskFileController {
|
||
|
|
|
||
|
|
@Autowired
|
||
|
|
private RiskFileService riskFileService;
|
||
|
|
|
||
|
|
@GetMapping("/risk_file/rule")
|
||
|
|
@ApiOperation("获取风险规则")
|
||
|
|
public AlitaResult<String> getRiskRule() {
|
||
|
|
return AlitaResult.success(riskFileService.getRiskRule());
|
||
|
|
}
|
||
|
|
|
||
|
|
@PostMapping("/risk_file/rule")
|
||
|
|
@ApiOperation("保存风险规则")
|
||
|
|
public AlitaResult<Void> saveRiskRule(@RequestBody String riskRule) {
|
||
|
|
riskFileService.saveRiskRule(riskRule);
|
||
|
|
return AlitaResult.success();
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|