use of top.longmarch.lmcore.annotation.OperationLog in project longmarch by yuyueqty.
the class CmsArticleController method changeStatus.
@OperationLog
@ApiOperation(value = "修改文章状态")
@RequiresPermissions("cms:article:update")
@PostMapping("/changeStatus")
public Result<Object> changeStatus(@RequestBody ChangeStatusDTO changeStatusDTO) {
log.info("修改文章状态, 入参:{}", changeStatusDTO);
CmsArticle cmsArticle = new CmsArticle();
BeanUtils.copyProperties(changeStatusDTO, cmsArticle);
cmsArticleService.updateById(cmsArticle);
return Result.ok();
}
use of top.longmarch.lmcore.annotation.OperationLog in project longmarch by yuyueqty.
the class ScheduleJobController method reset.
@OperationLog
@ApiOperation(value = "重置任务")
@RequiresPermissions("job:schedule:reset")
@PostMapping("/reset")
public Result<Object> reset(@RequestBody Long[] jobIds) {
ScheduleJob scheduleJob = new ScheduleJob();
scheduleJob.setCount(0);
scheduleJobService.update(scheduleJob, new LambdaUpdateWrapper<ScheduleJob>().in(ScheduleJob::getId, ListUtil.of(jobIds)));
return Result.ok();
}
use of top.longmarch.lmcore.annotation.OperationLog in project longmarch by yuyueqty.
the class AppProductController method changeStatus.
@OperationLog
@ApiOperation(value = "修改三方APP信息状态")
@RequiresPermissions("sign:appProduct:update")
@PostMapping("/changeStatus")
public Result<AppProduct> changeStatus(@RequestBody ChangeStatusDTO changeStatusDTO) {
log.info("修改三方APP信息状态, 入参:{}", changeStatusDTO);
AppProduct appProduct = new AppProduct();
BeanUtils.copyProperties(changeStatusDTO, appProduct);
appProductService.updateById(appProduct);
return Result.ok(appProduct);
}
use of top.longmarch.lmcore.annotation.OperationLog in project longmarch by yuyueqty.
the class CmsCategoryController method changeStatus.
@OperationLog
@ApiOperation(value = "修改类目状态")
@RequiresPermissions("cms:category:update")
@PostMapping("/changeStatus")
public Result<Boolean> changeStatus(@RequestBody ChangeStatusDTO changeStatusDTO) {
log.info("修改类目状态, 入参:{}", changeStatusDTO);
CmsCategory cmsCategory = new CmsCategory();
BeanUtils.copyProperties(changeStatusDTO, cmsCategory);
return Result.ok(cmsCategoryService.updateById(cmsCategory));
}
use of top.longmarch.lmcore.annotation.OperationLog in project longmarch by yuyueqty.
the class RecordLogAspect method doHandlerAspect.
@Override
public Object doHandlerAspect(ProceedingJoinPoint pjp, Method method) throws Throwable {
Result<?> result = (Result<?>) pjp.proceed();
if (result == null) {
return pjp.proceed();
}
log.info("status={}, method={}", result.getMessage(), method.getName());
OperationLog operationLog = method.getAnnotation(OperationLog.class);
if (operationLog != null) {
String operationDetail = executeTemplate(operationLog.value(), pjp, method);
if (StrUtil.isBlank(operationDetail) && pjp.getArgs() != null) {
operationDetail = JSONUtil.toJsonStr(pjp.getArgs());
}
Api api = AnnotationUtil.getAnnotation(pjp.getSignature().getDeclaringType(), Api.class);
ApiOperation apiOperation = method.getAnnotation(ApiOperation.class);
saveOperateLog(api, apiOperation, operationDetail, operationLog, result);
}
return result;
}
Aggregations