Search in sources :

Example 1 with AutoLog

use of org.jeecg.common.aspect.annotation.AutoLog in project jeecg-boot by jeecgboot.

the class JeecgShardingDemoController method test2.

/**
 * 双库分表
 * @return
 */
@PostMapping(value = "/test2")
@AutoLog(value = "双库分表")
@ApiOperation(value = "双库分表", notes = "双库分表")
public Result<?> test2() {
    for (int i = 20; i <= 30; i++) {
        ShardingSysLog shardingSysLog = new ShardingSysLog();
        shardingSysLog.setLogContent("双库分表测试");
        shardingSysLog.setLogType(i);
        shardingSysLog.setOperateType(i);
        shardingSysLogService.save(shardingSysLog);
    }
    return Result.OK();
}
Also used : ShardingSysLog(org.jeecg.modules.test.sharding.entity.ShardingSysLog) PostMapping(org.springframework.web.bind.annotation.PostMapping) AutoLog(org.jeecg.common.aspect.annotation.AutoLog) ApiOperation(io.swagger.annotations.ApiOperation)

Example 2 with AutoLog

use of org.jeecg.common.aspect.annotation.AutoLog in project jeecg-boot by jeecgboot.

the class JeecgShardingDemoController method add.

/**
 * 单库分表
 * @return
 */
@PostMapping(value = "/test1")
@AutoLog(value = "单库分表")
@ApiOperation(value = "单库分表", notes = "分库分表添加")
public Result<?> add() {
    for (int i = 0; i < 10; i++) {
        ShardingSysLog shardingSysLog = new ShardingSysLog();
        shardingSysLog.setLogContent("jeecg");
        shardingSysLog.setLogType(i);
        shardingSysLog.setOperateType(i);
        shardingSysLogService.save(shardingSysLog);
    }
    return Result.OK();
}
Also used : ShardingSysLog(org.jeecg.modules.test.sharding.entity.ShardingSysLog) PostMapping(org.springframework.web.bind.annotation.PostMapping) AutoLog(org.jeecg.common.aspect.annotation.AutoLog) ApiOperation(io.swagger.annotations.ApiOperation)

Example 3 with AutoLog

use of org.jeecg.common.aspect.annotation.AutoLog in project jeecg-boot by jeecgboot.

the class SysPositionController method queryById.

/**
 * 通过id查询
 *
 * @param id
 * @return
 */
@AutoLog(value = "职务表-通过id查询")
@ApiOperation(value = "职务表-通过id查询", notes = "职务表-通过id查询")
@GetMapping(value = "/queryById")
public Result<SysPosition> queryById(@RequestParam(name = "id", required = true) String id) {
    Result<SysPosition> result = new Result<SysPosition>();
    SysPosition sysPosition = sysPositionService.getById(id);
    if (sysPosition == null) {
        result.error500("未找到对应实体");
    } else {
        result.setResult(sysPosition);
        result.setSuccess(true);
    }
    return result;
}
Also used : SysPosition(org.jeecg.modules.system.entity.SysPosition) Result(org.jeecg.common.api.vo.Result) AutoLog(org.jeecg.common.aspect.annotation.AutoLog) ApiOperation(io.swagger.annotations.ApiOperation)

Example 4 with AutoLog

use of org.jeecg.common.aspect.annotation.AutoLog in project jeecg-boot by jeecgboot.

the class SysCheckRuleController method checkByCode.

/**
 * 通过id查询
 *
 * @param ruleCode
 * @return
 */
@AutoLog(value = "编码校验规则-通过Code校验传入的值")
@ApiOperation(value = "编码校验规则-通过Code校验传入的值", notes = "编码校验规则-通过Code校验传入的值")
@GetMapping(value = "/checkByCode")
public Result checkByCode(@RequestParam(name = "ruleCode") String ruleCode, @RequestParam(name = "value") String value) throws UnsupportedEncodingException {
    SysCheckRule sysCheckRule = sysCheckRuleService.getByCode(ruleCode);
    if (sysCheckRule == null) {
        return Result.error("该编码不存在");
    }
    JSONObject errorResult = sysCheckRuleService.checkValue(sysCheckRule, URLDecoder.decode(value, "UTF-8"));
    if (errorResult == null) {
        return Result.ok();
    } else {
        Result<Object> r = Result.error(errorResult.getString("message"));
        r.setResult(errorResult);
        return r;
    }
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) SysCheckRule(org.jeecg.modules.system.entity.SysCheckRule) JSONObject(com.alibaba.fastjson.JSONObject) AutoLog(org.jeecg.common.aspect.annotation.AutoLog) ApiOperation(io.swagger.annotations.ApiOperation)

Example 5 with AutoLog

use of org.jeecg.common.aspect.annotation.AutoLog in project jeecg-boot by jeecgboot.

the class SysDataSourceController method edit.

/**
 * 编辑
 *
 * @param sysDataSource
 * @return
 */
@AutoLog(value = "多数据源管理-编辑")
@ApiOperation(value = "多数据源管理-编辑", notes = "多数据源管理-编辑")
@RequestMapping(value = "/edit", method = { RequestMethod.PUT, RequestMethod.POST })
public Result<?> edit(@RequestBody SysDataSource sysDataSource) {
    try {
        SysDataSource d = sysDataSourceService.getById(sysDataSource.getId());
        DataSourceCachePool.removeCache(d.getCode());
        String dbPassword = sysDataSource.getDbPassword();
        if (StringUtils.isNotBlank(dbPassword)) {
            String encrypt = SecurityUtil.jiami(dbPassword);
            sysDataSource.setDbPassword(encrypt);
        }
        sysDataSourceService.updateById(sysDataSource);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return Result.ok("编辑成功!");
}
Also used : SysDataSource(org.jeecg.modules.system.entity.SysDataSource) AutoLog(org.jeecg.common.aspect.annotation.AutoLog) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

AutoLog (org.jeecg.common.aspect.annotation.AutoLog)36 ApiOperation (io.swagger.annotations.ApiOperation)33 Result (org.jeecg.common.api.vo.Result)9 SysDataSource (org.jeecg.modules.system.entity.SysDataSource)9 SysPosition (org.jeecg.modules.system.entity.SysPosition)9 KmDoc (org.jeecg.modules.KM.entity.KmDoc)8 LoginUser (org.jeecg.common.system.vo.LoginUser)5 ParseException (java.text.ParseException)4 KmFile (org.jeecg.modules.KM.entity.KmFile)4 JSONObject (com.alibaba.fastjson.JSONObject)3 QueryWrapper (com.baomidou.mybatisplus.core.conditions.query.QueryWrapper)3 Method (java.lang.reflect.Method)3 Date (java.util.Date)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 MethodSignature (org.aspectj.lang.reflect.MethodSignature)3 LogDTO (org.jeecg.common.api.dto.LogDTO)3 SysCheckRule (org.jeecg.modules.system.entity.SysCheckRule)3 LambdaQueryWrapper (com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper)2 IPage (com.baomidou.mybatisplus.core.metadata.IPage)2 Page (com.baomidou.mybatisplus.extension.plugins.pagination.Page)2