mirror of https://gitee.com/stylefeng/roses
【8.1.9】更新安全日志的标识
parent
6fee4186a2
commit
c957f4742f
|
@ -37,4 +37,9 @@ public interface LogPermissionCodeConstants {
|
|||
*/
|
||||
String BUSINESS_LOG = "BUSINESS_LOG";
|
||||
|
||||
/**
|
||||
* 安全日志的标识
|
||||
*/
|
||||
String SECURITY_LOG = "SECURITY_LOG";
|
||||
|
||||
}
|
||||
|
|
|
@ -4,18 +4,15 @@ import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
|||
import cn.stylefeng.roses.kernel.log.security.entity.LogSecurity;
|
||||
import cn.stylefeng.roses.kernel.log.security.pojo.request.LogSecurityRequest;
|
||||
import cn.stylefeng.roses.kernel.log.security.service.LogSecurityService;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.request.BaseRequest;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
|
||||
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
|
||||
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.stylefeng.roses.kernel.log.api.constants.LogPermissionCodeConstants.SECURITY_LOG;
|
||||
|
||||
/**
|
||||
* 安全日志控制器
|
||||
|
@ -24,82 +21,12 @@ import java.util.List;
|
|||
* @since 2024/07/11 15:56
|
||||
*/
|
||||
@RestController
|
||||
@ApiResource(name = "安全日志")
|
||||
@ApiResource(name = "安全日志", requiredPermission = true, requirePermissionCode = SECURITY_LOG)
|
||||
public class LogSecurityController {
|
||||
|
||||
@Resource
|
||||
private LogSecurityService logSecurityService;
|
||||
|
||||
/**
|
||||
* 添加安全日志
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/07/11 15:56
|
||||
*/
|
||||
@PostResource(name = "添加安全日志", path = "/logSecurity/add")
|
||||
public ResponseData<LogSecurity> add(@RequestBody @Validated(LogSecurityRequest.add.class) LogSecurityRequest logSecurityRequest) {
|
||||
logSecurityService.add(logSecurityRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除安全日志
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/07/11 15:56
|
||||
*/
|
||||
@PostResource(name = "删除安全日志", path = "/logSecurity/delete")
|
||||
public ResponseData<?> delete(@RequestBody @Validated(LogSecurityRequest.delete.class) LogSecurityRequest logSecurityRequest) {
|
||||
logSecurityService.del(logSecurityRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除安全日志
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/07/11 15:56
|
||||
*/
|
||||
@PostResource(name = "批量删除安全日志", path = "/logSecurity/batchDelete")
|
||||
public ResponseData<?> batchDelete(@RequestBody @Validated(BaseRequest.batchDelete.class) LogSecurityRequest logSecurityRequest) {
|
||||
logSecurityService.batchDelete(logSecurityRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑安全日志
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/07/11 15:56
|
||||
*/
|
||||
@PostResource(name = "编辑安全日志", path = "/logSecurity/edit")
|
||||
public ResponseData<?> edit(@RequestBody @Validated(LogSecurityRequest.edit.class) LogSecurityRequest logSecurityRequest) {
|
||||
logSecurityService.edit(logSecurityRequest);
|
||||
return new SuccessResponseData<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看安全日志详情
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/07/11 15:56
|
||||
*/
|
||||
@GetResource(name = "查看安全日志详情", path = "/logSecurity/detail")
|
||||
public ResponseData<LogSecurity> detail(@Validated(LogSecurityRequest.detail.class) LogSecurityRequest logSecurityRequest) {
|
||||
return new SuccessResponseData<>(logSecurityService.detail(logSecurityRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安全日志列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/07/11 15:56
|
||||
*/
|
||||
@GetResource(name = "获取安全日志列表", path = "/logSecurity/list")
|
||||
public ResponseData<List<LogSecurity>> list(LogSecurityRequest logSecurityRequest) {
|
||||
return new SuccessResponseData<>(logSecurityService.findList(logSecurityRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取安全日志列表(带分页)
|
||||
*
|
||||
|
|
|
@ -16,3 +16,5 @@ CREATE TABLE `sys_log_security` (
|
|||
`update_user` bigint DEFAULT NULL COMMENT '修改人',
|
||||
PRIMARY KEY (`security_log_id`) USING BTREE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='安全日志';
|
||||
|
||||
INSERT INTO `sys_menu_options`(`menu_option_id`, `app_id`, `menu_id`, `option_name`, `option_code`, `create_time`, `create_user`, `update_time`, `update_user`) VALUES (1811330833279811585, 1671406745336016898, 1673525659931275265, '安全日志', 'SECURITY_LOG', '2024-07-11 17:24:58', 1339550467939639299, NULL, NULL);
|
Loading…
Reference in New Issue