Search in sources :

Example 6 with LogOperate

use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.

the class SchemeResource method genCode.

@LogOperate(value = "方案生成代码")
@PutMapping(value = "/gen-code")
@PreAuthorize("@pms.hasPermission('gen_scheme_code')")
public Result genCode(@Valid @RequestBody GenCodeDto genCodeDto) {
    SchemeDto genSchemeDto = schemeService.getOneDto(genCodeDto.getId());
    ArgumentAssert.notNull(genSchemeDto, "无法获取代码生成方案信息");
    genSchemeDto.setReplaceFile(genCodeDto.getReplaceFile());
    schemeService.generateCode(genSchemeDto);
    return Result.buildOk("生成", genSchemeDto.getName(), "代码成功");
}
Also used : GenSchemeDto(com.albedo.java.modules.sys.domain.dto.GenSchemeDto) LogOperate(com.albedo.java.common.log.annotation.LogOperate) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Example 7 with LogOperate

use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.

the class JobLogResource method download.

@LogOperate(value = "任务日志导出")
@GetMapping(value = "/download")
@PreAuthorize("@pms.hasPermission('quartz_jobLog_export')")
public void download(JobLogQueryCriteria jobLogQueryCriteria, HttpServletResponse response) {
    QueryWrapper wrapper = QueryWrapperUtil.getWrapper(jobLogQueryCriteria);
    ExcelUtil<JobLogExcelVo> util = new ExcelUtil(JobLogExcelVo.class);
    util.exportExcel(jobLogService.findExcelVo(wrapper), "任务调度日志", response);
}
Also used : JobLogExcelVo(com.albedo.java.modules.quartz.domain.vo.JobLogExcelVo) ExcelUtil(com.albedo.java.common.util.ExcelUtil) QueryWrapper(com.baomidou.mybatisplus.core.conditions.query.QueryWrapper) LogOperate(com.albedo.java.common.log.annotation.LogOperate) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Example 8 with LogOperate

use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.

the class UserResource method saveInfo.

/**
 * 个人中心更新信息
 *
 * @param userInfoDto 用户信息
 * @return R
 */
@LogOperate(value = "用户管理编辑")
@PostMapping("/info")
public Result<String> saveInfo(@Valid @RequestBody UserInfoDto userInfoDto) {
    log.debug("REST request to save userDto : {}", userInfoDto);
    UserDto userDto = BeanUtil.copyPropertiesByClass(userInfoDto, UserDto.class);
    userDto.setId(SecurityUtil.getUser().getId());
    userDto.setUsername(SecurityUtil.getUser().getUsername());
    userService.saveOrUpdate(userDto);
    return Result.buildOk("更新成功");
}
Also used : UserDto(com.albedo.java.modules.sys.domain.dto.UserDto) LogOperate(com.albedo.java.common.log.annotation.LogOperate)

Example 9 with LogOperate

use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.

the class AliPayResource method toPayAsWeb.

@LogOperate("支付宝手机网页支付")
@Operation(summary = "手机网页支付")
@PostMapping(value = "/toPayAsWeb")
public ResponseEntity<String> toPayAsWeb(@Validated @RequestBody TradeVo trade) throws Exception {
    AlipayConfigDo alipay = alipayService.find();
    trade.setOutTradeNo(alipayUtils.getOrderCode());
    String payUrl = alipayService.toPayAsWeb(alipay, trade);
    return ResponseEntity.ok(payUrl);
}
Also used : AlipayConfigDo(com.albedo.java.modules.tool.domain.AlipayConfigDo) LogOperate(com.albedo.java.common.log.annotation.LogOperate) Operation(io.swagger.v3.oas.annotations.Operation)

Example 10 with LogOperate

use of com.albedo.java.common.log.annotation.LogOperate in project albedo by somowhere.

the class SchemeResource method genMenu.

@LogOperate(value = "生成方案编辑")
@PostMapping("/gen-menu")
@PreAuthorize("@pms.hasPermission('gen_scheme_menu')")
public Result genMenu(@Valid @RequestBody SchemeGenDto schemeGenDto) {
    SchemeDto schemeDto = schemeService.getOneDto(schemeGenDto.getId());
    TableDto tableDto = schemeDto.getTableDto();
    if (tableDto == null) {
        tableDto = tableService.getOneDto(schemeDto.getTableId());
    }
    String url = StringUtil.toAppendStr(StringUtil.SLASH, StringUtil.lowerCase(schemeDto.getModuleName()), (StringUtil.isNotBlank(schemeDto.getSubModuleName()) ? StringUtil.SLASH + StringUtil.lowerCase(schemeDto.getSubModuleName()) : ""), StringUtil.SLASH, StringUtil.toRevertCamelCase(StringUtil.lowerFirst(tableDto.getClassName()), CharUtil.DASHED), StringUtil.SLASH);
    menuService.saveByGenScheme(new GenSchemeDto(schemeDto.getName(), schemeGenDto.getParentMenuId(), url, tableDto.getClassName()));
    return Result.buildOk("生成", schemeDto.getName(), "菜单成功");
}
Also used : GenSchemeDto(com.albedo.java.modules.sys.domain.dto.GenSchemeDto) GenSchemeDto(com.albedo.java.modules.sys.domain.dto.GenSchemeDto) LogOperate(com.albedo.java.common.log.annotation.LogOperate) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Aggregations

LogOperate (com.albedo.java.common.log.annotation.LogOperate)15 PreAuthorize (org.springframework.security.access.prepost.PreAuthorize)11 ExcelUtil (com.albedo.java.common.util.ExcelUtil)4 QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)4 Operation (io.swagger.v3.oas.annotations.Operation)4 UserOnlineDo (com.albedo.java.modules.sys.domain.UserOnlineDo)2 GenSchemeDto (com.albedo.java.modules.sys.domain.dto.GenSchemeDto)2 AlipayConfigDo (com.albedo.java.modules.tool.domain.AlipayConfigDo)2 SessionInformation (org.springframework.security.core.session.SessionInformation)2 RSA (cn.hutool.crypto.asymmetric.RSA)1 JobLogExcelVo (com.albedo.java.modules.quartz.domain.vo.JobLogExcelVo)1 LogLoginDo (com.albedo.java.modules.sys.domain.LogLoginDo)1 LogOperateDo (com.albedo.java.modules.sys.domain.LogOperateDo)1 RoleDo (com.albedo.java.modules.sys.domain.RoleDo)1 UserDto (com.albedo.java.modules.sys.domain.dto.UserDto)1 UserExcelVo (com.albedo.java.modules.sys.domain.vo.UserExcelVo)1 DataScope (com.albedo.java.plugins.database.mybatis.datascope.DataScope)1 BigDecimal (java.math.BigDecimal)1