“mitao”
2026-04-07 4ba9020b7c67cc318448a8aeac741492b23b4189
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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<Void> record() {
        appUserEntryLogAppService.record(StpAppUserUtil.getLoginIdAsLong());
        return ApiResponse.ok(null);
    }
}