use of net.jeebiz.boot.api.annotation.BusinessLog in project spring-boot-starter-samples by vindell.
the class DemoController method newDemo.
/**
* 增加逻辑实现
*/
@ApiOperation(value = "创建xxx信息", notes = "根据DemoVo创建xxx", httpMethod = "POST")
@ApiImplicitParam(name = "demoVo", value = "xxx数据传输对象", required = true, dataType = "DemoVo")
@BusinessLog(module = LogConstant.Module.N01, business = LogConstant.BUSINESS.N010001, opt = BusinessType.INSERT)
@PostMapping("new/form")
@ResponseBody
public Object newDemo(@Valid DemoVo demoVo) {
try {
DemoModel demoModel = new DemoModel();
// 如果自己较少,采用手动设置方式
demoModel.setName(demoVo.getName());
// 如果自动较多,采用对象拷贝方式;该方式不支持文件对象拷贝
// PropertyUtils.copyProperties(demoModel, demoVo);
getDemoService().insert(demoModel);
return success("I99001");
} catch (Exception e) {
logException(this, e);
return fail("I99002");
}
}
use of net.jeebiz.boot.api.annotation.BusinessLog in project spring-boot-starter-samples by vindell.
the class DemoController method editDemo.
/**
* 修改逻辑实现
*/
@ApiOperation(value = "修改xxx信息", notes = "修改xxx", httpMethod = "POST")
@ApiImplicitParam(name = "demoVo", value = "xxx数据传输对象", required = true, dataType = "DemoVo")
@BusinessLog(module = LogConstant.Module.N01, business = LogConstant.BUSINESS.N010001, opt = BusinessType.UPDATE)
@RequestMapping("edit/form")
@ResponseBody
public Object editDemo(@Valid DemoVo demoVo) throws Exception {
try {
DemoModel demoModel = new DemoModel();
// 如果自己较少,采用手动设置方式
demoModel.setName(demoVo.getName());
// 如果自动较多,采用对象拷贝方式;该方式不支持文件对象拷贝
// PropertyUtils.copyProperties(demoModel, demoVo);
getDemoService().update(demoModel);
return success("I99003");
} catch (Exception e) {
logException(this, e);
return fail("I99004");
}
}
use of net.jeebiz.boot.api.annotation.BusinessLog in project spring-boot-starter-samples by vindell.
the class DemoController method newSimple.
/**
* 增加逻辑实现
*/
@ApiOperation(value = "创建xxx信息", notes = "根据DemoVo创建xxx", httpMethod = "POST")
@ApiImplicitParam(name = "demoVo", value = "xxx数据传输对象", required = true, dataType = "DemoVo")
@BusinessLog(module = LogConstant.Module.N01, business = LogConstant.BUSINESS.N010001, opt = BusinessType.INSERT)
@PostMapping("new/form")
@ResponseBody
public Object newSimple(@Valid DemoVo demoVo) {
try {
DemoModel demoModel = new DemoModel();
// 如果自己较少,采用手动设置方式
demoModel.setName(demoVo.getName());
// 如果自动较多,采用对象拷贝方式;该方式不支持文件对象拷贝
// PropertyUtils.copyProperties(demoModel, demoVo);
getDemoService().insert(demoModel);
return success("I99001");
} catch (Exception e) {
logException(this, e);
return fail("I99002");
}
}
use of net.jeebiz.boot.api.annotation.BusinessLog in project spring-boot-starter-samples by vindell.
the class DemoController method list.
@ApiOperation(value = "获取xxx列表", notes = "分页查询xxx信息")
@ApiImplicitParams({ @ApiImplicitParam(name = "pageNo", value = "当前页码", required = true, dataType = "Integer"), @ApiImplicitParam(name = "limit", value = "每页记录数", required = true, dataType = "Integer"), @ApiImplicitParam(name = "sortName", value = "排序字段名称", required = true, dataType = "String"), @ApiImplicitParam(name = "sortOrder", value = "排序类型 asc \\ desc", required = true, dataType = "String"), @ApiImplicitParam(name = "demoVo", value = "用户详细实体user", required = true, dataType = "UserVo") })
@ApiResponses({ @ApiResponse(code = HttpStatus.SC_OK, message = "操作成功"), @ApiResponse(code = HttpStatus.SC_UNAUTHORIZED, message = "请求要求身份验证"), @ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "请求资源不存在"), @ApiResponse(code = HttpStatus.SC_INTERNAL_SERVER_ERROR, message = "服务器内部异常"), @ApiResponse(code = HttpStatus.SC_FORBIDDEN, message = "权限不足") })
@BusinessLog(module = LogConstant.Module.N01, business = LogConstant.BUSINESS.N010001, opt = BusinessType.SELECT)
@PostMapping(value = "list")
@ResponseBody
public Object list(Integer pageNo, Integer limit, String sortName, String sortOrder, DemoVo demoVo, HttpServletRequest request) throws Exception {
try {
Page<DemoModel> pageResult = getDemoService().getPagedList(null);
List<DemoVo> retList = new ArrayList<DemoVo>();
for (DemoModel model : pageResult.getRecords()) {
retList.add(getBeanMapper().map(model, DemoVo.class));
}
return new Result<DemoVo>(pageResult, retList);
} catch (Exception e) {
logException(this, e);
return error("");
}
}
use of net.jeebiz.boot.api.annotation.BusinessLog in project spring-boot-starter-samples by vindell.
the class DemoController method editSimple.
/**
* 修改逻辑实现
*/
@ApiOperation(value = "修改xxx信息", notes = "修改xxx", httpMethod = "POST")
@ApiImplicitParam(name = "demoVo", value = "xxx数据传输对象", required = true, dataType = "DemoVo")
@BusinessLog(module = LogConstant.Module.N01, business = LogConstant.BUSINESS.N010001, opt = BusinessType.UPDATE)
@RequestMapping("edit/form")
@ResponseBody
public Object editSimple(@Valid DemoVo demoVo) throws Exception {
try {
DemoModel demoModel = new DemoModel();
// 如果自己较少,采用手动设置方式
demoModel.setName(demoVo.getName());
// 如果自动较多,采用对象拷贝方式;该方式不支持文件对象拷贝
// PropertyUtils.copyProperties(demoModel, demoVo);
getDemoService().update(demoModel);
return success("I99003");
} catch (Exception e) {
logException(this, e);
return fail("I99004");
}
}
Aggregations