Commit 57bcf971 by 章家宝

偏好设置需求:新增账户id空判断

1 parent b9a187dd
...@@ -30,12 +30,20 @@ public class AccountPreferenceController { ...@@ -30,12 +30,20 @@ public class AccountPreferenceController {
@PostMapping("/get") @PostMapping("/get")
public BaseResp<AccountPreferenceGetDTO> getPreference(@RequestBody AccountPreferenceGetDTO dto, @Parameter(hidden = true) @RequestAttribute(LOGIN_ACCOUNT) Account account) { public BaseResp<AccountPreferenceGetDTO> getPreference(@RequestBody AccountPreferenceGetDTO dto, @Parameter(hidden = true) @RequestAttribute(LOGIN_ACCOUNT) Account account) {
Boolean isIndexPage = dto.getIsIndexPage() != null && dto.getIsIndexPage(); Boolean isIndexPage = dto.getIsIndexPage() != null && dto.getIsIndexPage();
if (account == null || account.getAccountId() <= 0) {
log.warn("查询用户偏好失败:用户ID非法");
return BaseResp.fail("用户ID非法");
}
return BaseResp.success(accountPreferenceService.getPreference(account, isIndexPage)); return BaseResp.success(accountPreferenceService.getPreference(account, isIndexPage));
} }
@Operation(summary = "7天内不弹窗", description = "用户设置7天内不弹窗") @Operation(summary = "7天内不弹窗", description = "用户设置7天内不弹窗")
@PostMapping("/skip.popup.for7days") @PostMapping("/skip.popup.for7days")
public BaseResp<Boolean> skipPopupFor7Days(@Parameter(hidden = true) @RequestAttribute(LOGIN_ACCOUNT) Account account) { public BaseResp<Boolean> skipPopupFor7Days(@Parameter(hidden = true) @RequestAttribute(LOGIN_ACCOUNT) Account account) {
if (account == null || account.getAccountId() <= 0) {
log.warn("查询用户偏好失败:用户ID非法");
return BaseResp.fail("用户ID非法");
}
return BaseResp.success(accountService.skipPreferenPopupForceDays(account.getAccountId(), 7)); return BaseResp.success(accountService.skipPreferenPopupForceDays(account.getAccountId(), 7));
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!