mitao
2024-09-07 2862c3e4da3adbb4bea43151514f0c43b86476d6
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
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.xinquan.user.controller.client;
 
 
import com.xinquan.common.core.domain.R;
import com.xinquan.user.service.AppUserViewingHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * <p>
 * 用户观看历史 前端控制器
 * </p>
 *
 * @author mitao
 * @since 2024-09-06
 */
@Api(tags = {"用户端-观看历史相关接口"})
@RestController
@RequiredArgsConstructor
@RequestMapping("/user/app-user-viewing-history")
public class ClientAppUserViewingHistoryController {
 
    private final AppUserViewingHistoryService appUserViewingHistoryService;
 
    /**
     * 记录用户观看记录
     *
     * @param bizId       业务id
     * @param viewingType 观看类型 1=疗愈 2=课程
     */
    @PostMapping("/saveViewingHistory")
    @ApiOperation(value = "记录用户观看记录", tags = {"用户端-用户相关接口"})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "bizId", value = "业务id", dataType = "Long", required = true),
            @ApiImplicitParam(name = "viewingType", value = "观看类型 1=疗愈 2=课程", dataType = "Integer", required = true)
    })
    public R<?> saveViewingRecord(@RequestParam("bizId") Long bizId,
            @RequestParam("viewingType") Integer viewingType) {
        appUserViewingHistoryService.saveViewingRecord(bizId, viewingType);
        return R.ok();
    }
}