| | |
| | | public R<TSysProductIntroduction> getDetailById(@RequestParam String id) { |
| | | TSysProductIntroduction sysProductIntroduction = sysProductIntroductionService.getById(id); |
| | | // 查询次数自增 使用数据库原子更新操作 |
| | | sysProductIntroductionService.update( |
| | | Wrappers.<TSysProductIntroduction>lambdaUpdate() |
| | | .setSql("click_count = click_count + 1") |
| | | .eq(TSysProductIntroduction::getId, id) |
| | | ); |
| | | sysProductIntroduction.setClickCount(sysProductIntroduction.getClickCount() + 1); |
| | | sysProductIntroductionService.updateById(sysProductIntroduction); |
| | | return R.ok(sysProductIntroduction); |
| | | } |
| | | |