From 91ebbdc5ef67699d166498f6cf5fcc21058817dd Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期二, 25 二月 2025 19:59:50 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java index f151c92..840cc85 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/controller/HomeController.java @@ -6,6 +6,7 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sangeshenbian.SystemUserVo; import com.panzhihua.common.service.sangeshenbian.SystemUserService; +import com.panzhihua.common.service.user.UserService; import com.panzhihua.sangeshenbian.model.entity.Banner; import com.panzhihua.sangeshenbian.model.entity.SystemUser; import com.panzhihua.sangeshenbian.model.query.BasePage; @@ -19,6 +20,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; +import org.springframework.context.annotation.Lazy; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -33,13 +35,14 @@ */ @RestController @RequestMapping("/applet/home") -@RequiredArgsConstructor +@RequiredArgsConstructor(onConstructor_=@Lazy) @Api(tags = "首页相关接口") public class HomeController extends BaseController { private final IBannerService bannerService; private final IMessageNotificationService messageNotificationService; private final IComplaintService complaintService; private final ISystemUserService systemUserService; + private final UserService userService; @ApiOperation("获取banner列表") @GetMapping("/banner-list") public R<List<Banner>> getBannerList() { @@ -68,6 +71,15 @@ @GetMapping("/current-user-info") @ApiOperation("获取三个身边当前用户信息 用于判断用户是否是上级") public R<SystemUser> getCurrentUserInfo() { - return R.ok(systemUserService.getSystemUserByPhone(getLoginUserInfo().getPhone()).get()); + return R.ok(systemUserService.getSystemUserByPhone(getLoginUserInfo().getPhone()).orElse(null)); + } + /** + * 标记已读 + */ + @PostMapping("/read") + @ApiOperation("标记已读") + public R<?> read(){ + messageNotificationService.read(getLoginUserInfo()); + return R.ok(); } } -- Gitblit v1.7.1