Merge branch 'refs/heads/feature/community-center' into preview

master
yang 2025-03-17 17:31:26 +08:00
commit 940b6b4125
3 changed files with 24 additions and 0 deletions

View File

@ -64,6 +64,16 @@ public class SysAdviceController {
return R.ok(adviceVo); return R.ok(adviceVo);
} }
/**
*
*/
@GetMapping("getOfficialMsg")
@ApiOperation(value = "获取官方通知")
public R<List<AdviceVo>> getOfficialMsg() {
List<AdviceVo> adviceVo = sysAdviceService.getOfficialMsg();
return R.ok(adviceVo);
}
/** /**
* *

View File

@ -32,4 +32,6 @@ public interface ISysAdviceService extends IService<SysAdvice> {
* *
*/ */
void readAll(); void readAll();
List<AdviceVo> getOfficialMsg();
} }

View File

@ -253,6 +253,18 @@ public class SysAdviceServiceImpl extends ServiceImpl<SysAdviceMapper, SysAdvice
} }
} }
@Override
public List<AdviceVo> getOfficialMsg() {
List<SysAdvice> sysAdviceList = baseMapper.selectList(new LambdaQueryWrapper<SysAdvice>()
.eq(SysAdvice::getType, AdviceEnum.SYSTEM_NOTICE)
.eq(SysAdvice::getReceiverId, SecurityUtils.getUserId()));
return BeanUtil.copyToList(sysAdviceList, AdviceVo.class);
}
public void postConstruct() { public void postConstruct() {
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();