Search in sources :

Example 1 with OperationLog

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();
}
Also used : CmsArticle(top.longmarch.cms.entity.CmsArticle) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ApiOperation(io.swagger.annotations.ApiOperation) OperationLog(top.longmarch.lmcore.annotation.OperationLog)

Example 2 with OperationLog

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();
}
Also used : LambdaUpdateWrapper(com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper) ScheduleJob(top.longmarch.job.entity.ScheduleJob) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ApiOperation(io.swagger.annotations.ApiOperation) OperationLog(top.longmarch.lmcore.annotation.OperationLog)

Example 3 with OperationLog

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);
}
Also used : AppProduct(top.longmarch.sign.entity.AppProduct) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ApiOperation(io.swagger.annotations.ApiOperation) OperationLog(top.longmarch.lmcore.annotation.OperationLog)

Example 4 with OperationLog

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));
}
Also used : CmsCategory(top.longmarch.cms.entity.CmsCategory) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) ApiOperation(io.swagger.annotations.ApiOperation) OperationLog(top.longmarch.lmcore.annotation.OperationLog)

Example 5 with OperationLog

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;
}
Also used : ApiOperation(io.swagger.annotations.ApiOperation) OperationLog(top.longmarch.lmcore.annotation.OperationLog) Api(io.swagger.annotations.Api) Result(top.longmarch.lmcore.common.Result)

Aggregations

ApiOperation (io.swagger.annotations.ApiOperation)5 OperationLog (top.longmarch.lmcore.annotation.OperationLog)5 RequiresPermissions (org.apache.shiro.authz.annotation.RequiresPermissions)4 LambdaUpdateWrapper (com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper)1 Api (io.swagger.annotations.Api)1 CmsArticle (top.longmarch.cms.entity.CmsArticle)1 CmsCategory (top.longmarch.cms.entity.CmsCategory)1 ScheduleJob (top.longmarch.job.entity.ScheduleJob)1 Result (top.longmarch.lmcore.common.Result)1 AppProduct (top.longmarch.sign.entity.AppProduct)1