package com.ruoyi.ibs.datavisual.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.ibs.datavisual.domain.dto.VisitTrajectoryDTO;
import com.ruoyi.ibs.datavisual.domain.entity.VisitTrajectory;
import com.ruoyi.ibs.datavisual.service.VisitTrajectoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author 吴凯程
 * @Date 2025/4/24
 **/
@Api(tags = "走访热力图")
@RestController
@RequestMapping("/trajectory")
public class VisitTrajectoryController extends BaseController {

    @Resource
    private VisitTrajectoryService visitTrajectoryService;

    @ApiOperation("获取所有走访记录")
    @Log(title = "走访热力图-获取所有走访记录")
    @GetMapping("/list")
    public R<List<VisitTrajectory>> getIndexDict(VisitTrajectoryDTO visitTrajectoryDTO) {
        return R.ok(visitTrajectoryService.getVisitTrajectoryList(visitTrajectoryDTO));
    }

    @ApiOperation("根据日期获取所有走访记录")
    @Log(title = "走访热力图-根据日期获取所有走访记录")
    @GetMapping("/date/list")
    public R<List<VisitTrajectory>> getIndexDict(@RequestParam String date) {
        return R.ok(visitTrajectoryService.getVisitTrajectoryListByDate(date));
    }

}
