基于mall4j产品的二开项目后端
lee
2024-12-18 efdb99f8cecc4afb592afad79c761081d5d5cf22
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
50
51
52
53
54
/*
 * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
 *
 * https://www.mall4j.com/
 *
 * 未经允许,不可做商业用途!
 *
 * 版权所有,侵权必究!
 */
package com.yami.shop.api.controller;
 
 
import com.yami.shop.bean.dto.FlowLogDto;
import com.yami.shop.bean.model.FlowLog;
import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.FlowLogService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import ma.glasnost.orika.MapperFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
 
 
/**
 * 用户流量记录
 *
 * @author YXF
 * @date 2020-07-13 13:18:33
 */
@RestController
@RequestMapping("/flowAnalysisLog")
@Tag(name = "用户流量记录接口")
public class FlowLogController {
 
    @Autowired
    private FlowLogService flowLogService;
    @Autowired
    private MapperFacade mapperFacade;
 
 
    @PostMapping
    @Operation(summary = "新增用户流量记录")
    public ServerResponseEntity<Boolean> save(@RequestBody @Valid FlowLogDto flowLogDto, HttpServletRequest request) {
        FlowLog flowLog = mapperFacade.map(flowLogDto, FlowLog.class);
        flowLogService.saveUserFlowLog(flowLog, request);
        return ServerResponseEntity.success();
    }
}