无关风月
23 小时以前 02bb94e413f6950b9786c5ee86c0937bc20f8ae8
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TSystemBulletinController.java
@@ -47,6 +47,10 @@
    @ApiOperation(value = "新增系统公告")
    @PostMapping(value = "/add")
    public R<Boolean> add(@RequestBody SystemBulletinDTO dto) {
        if(dto.getStatus()==1){
            systemBulletinService.update(Wrappers.lambdaUpdate(TSystemBulletin.class)
                    .set(TSystemBulletin::getStatus, 2));
        }
        systemBulletinService.save(dto);
        return R.ok();
    }
@@ -54,8 +58,18 @@
    @ApiOperation(value = "编辑系统公告")
    @PostMapping(value = "/edit")
    public R<Boolean> edit(@RequestBody SystemBulletinDTO dto) {
        if(dto.getStatus()==1){
            systemBulletinService.update(Wrappers.lambdaUpdate(TSystemBulletin.class)
                    .set(TSystemBulletin::getStatus, 2));
        }
        systemBulletinService.updateById(dto);
        return R.ok();
    }
    @ApiOperation(value = "详情系统公告")
    @GetMapping(value = "/detail")
    public R<TSystemBulletin> detail(@RequestParam String id) {
        return R.ok(systemBulletinService.getById(id));
    }
    @Log(title = "删除系统公告", businessType = BusinessType.DELETE)
@@ -75,7 +89,7 @@
    }
    @Log(title = "启用/禁用系统公告", businessType = BusinessType.OTHER)
    @ApiOperation(value = "启用/禁用系统公告")
    @DeleteMapping(value = "/editStatus")
    @GetMapping(value = "/editStatus")
    public R<Boolean> editStatus(@RequestParam String id) {
        TSystemBulletin byId = systemBulletinService.getById(id);
        if (byId.getStatus()==1){