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();
}
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();
}
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;
}
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;
}
}
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("编辑成功!");
}
Aggregations