package com.ruoyi.ibs.task.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.ibs.task.domain.dto.VisitLogDTO;
import com.ruoyi.ibs.task.domain.vo.VisitLogVO;
import com.ruoyi.ibs.task.service.VisitLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author 吴凯程
 * @Date 2025/3/3
 **/
@Api(tags = "任务管理-触达接口")
@RestController
@RequestMapping("/task/visit")
public class VisitLogController {

    @Resource
    private VisitLogService visitLogService;

    @ApiOperation("新增跟进")
    @Log(title = "走访-新增跟进")
    @PostMapping("/add")
    public R<String> addVisitLog(@RequestBody VisitLogDTO visitLogDTO) {
        return R.ok(visitLogService.addVisitLog(visitLogDTO));
    }

    @ApiOperation("获取跟进列表")
    @Log(title = "走访-获取跟进列表")
    @GetMapping("/list")
    public R<VisitLogVO> getVisitLogList(String custId) {
        return R.ok(visitLogService.getVisitLogList(custId));
    }


}
