zoujiajian преди 1 година
родител
ревизия
24ba59db6c
променени са 1 файла, в които са добавени 17 реда и са изтрити 0 реда
  1. 17 0
      netflix-web/src/main/java/com/cyksj/web/controller/suggest/UserSuggestController.java

+ 17 - 0
netflix-web/src/main/java/com/cyksj/web/controller/suggest/UserSuggestController.java

@@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
+import java.util.Optional;
 
 /**
  * server/投诉建议
@@ -126,5 +127,21 @@ public class UserSuggestController {
 		userSuggestService.recommendGoods(userRecommendGoodsRecord);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
+
+	/**
+	 * 标记留意已读
+	 */
+	@PutMapping("/update/status/{feedBackId}")
+	public Result<String> updateFeedBackStatus(@PathVariable Long feedBackId) {
+		long userId = StpUserUtil.getLoginIdAsLong();
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		Optional.ofNullable(userFeedbackRecordMapper.selectById(feedBackId)).ifPresent(fe->{
+			if (userIdList.contains(fe.getUserId())) {
+				fe.setIsNewReply(false);
+				userFeedbackRecordMapper.updateById(fe);
+			}
+		});
+		return GatewayResponse.SUCCESS.newBuilder().toResult();
+	}
 }