package com.tcm.training.admin.app.statistics.controller; import com.tcm.training.admin.app.auth.support.StpAppUserUtil; import com.tcm.training.admin.common.ApiResponse; import com.tcm.training.admin.statistics.service.AppUserEntryLogAppService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * APP 用户进入记录接口。 */ @Validated @RestController @RequestMapping({"/api/app", "/api/v1/app"}) public class AppUserEntryLogController { private final AppUserEntryLogAppService appUserEntryLogAppService; /** * 注入 APP 用户进入记录服务。 */ public AppUserEntryLogController(AppUserEntryLogAppService appUserEntryLogAppService) { this.appUserEntryLogAppService = appUserEntryLogAppService; } /** * 记录 APP 用户进入行为。 */ @PostMapping("/user-entry-logs") public ApiResponse record() { appUserEntryLogAppService.record(StpAppUserUtil.getLoginIdAsLong()); return ApiResponse.ok(null); } }