【8.1.9】更新安全日志的标识

dev-8.1.9
stylefeng 2024-07-11 18:09:03 +08:00
parent 6fee4186a2
commit c957f4742f
3 changed files with 11 additions and 77 deletions

View File

@ -37,4 +37,9 @@ public interface LogPermissionCodeConstants {
*/
String BUSINESS_LOG = "BUSINESS_LOG";
/**
*
*/
String SECURITY_LOG = "SECURITY_LOG";
}

View File

@ -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));
}
/**
*
*

View File

@ -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);