|
|
@@ -34,6 +34,7 @@ public class MindFortuneController {
|
|
|
*/
|
|
|
@PostMapping("/fortune")
|
|
|
public Result<Map<String, Object>> getTodayFortune(@RequestAttribute("userId") Long userId) {
|
|
|
+ if (userId == null) return Result.error("请先登录");
|
|
|
Long familyId = membershipService.getUserFamilyId(userId);
|
|
|
FamilyFortune fortune = fortuneService.getFamilyFortune(familyId, LocalDate.now());
|
|
|
Map<String, Object> result = batchBuildFortuneResponse(fortune);
|
|
|
@@ -45,6 +46,7 @@ public class MindFortuneController {
|
|
|
*/
|
|
|
@PostMapping("/fortune/refresh")
|
|
|
public Result<FamilyFortune> refreshFortune(@RequestAttribute("userId") Long userId) {
|
|
|
+ if (userId == null) return Result.error("请先登录");
|
|
|
Long familyId = membershipService.getUserFamilyId(userId);
|
|
|
FamilyFortune fortune = fortuneService.getFamilyFortune(familyId, LocalDate.now());
|
|
|
fortune.setLuckyDirection(fortuneService.calculateLuckyDirection(familyId, LocalDate.now()));
|
|
|
@@ -61,6 +63,7 @@ public class MindFortuneController {
|
|
|
public Result<Map<String, Object>> exportFortuneReport(
|
|
|
@RequestAttribute("userId") Long userId,
|
|
|
@RequestBody ExportReportRequest request) {
|
|
|
+ if (userId == null) return Result.error("请先登录");
|
|
|
Long familyId = membershipService.getUserFamilyId(userId);
|
|
|
try {
|
|
|
// 文件大小校验
|