package com.storlead.sales.controller.customer;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.storlead.framework.common.result.Result;
import com.storlead.sales.pojo.dto.customer.WorkOrderViewLogSearchDTO;
import com.storlead.sales.pojo.vo.customer.WorkOrderViewLogListVO;
import com.storlead.sales.service.customer.WorkOrderViewLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
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;

/**
 * <p>
 * 工单访问记录表 前端控制器
 * </p>
 *
 * @author YPZ
 * @since 2024-04-29
 */
@RestController
@RequestMapping("/work-order-view-log")
@Api(tags = "销售: 工单管理相关接口")
public class WorkOrderViewLogController {

    @Resource
    private WorkOrderViewLogService workOrderViewLogService;

    @PostMapping(value = "/add")
    @ApiOperation(value = "工单查看用户管理-用户查看工单(传工单id)", notes = "工单管理-用户查看工单(传工单id)")
    public Result<?> add(Long workOrderId) {

        return workOrderViewLogService.addWorkOrderViewLog(workOrderId);
    }

    @PostMapping(value = "/list")
    @ApiOperation(value = "工单查看用户管理-列表", notes = "工单查看用户管理-列表")
    public Result<IPage<WorkOrderViewLogListVO>> list(@RequestBody WorkOrderViewLogSearchDTO workOrderViewLogSearchDTO) {
        return workOrderViewLogService.selectListVO(workOrderViewLogSearchDTO);
    }
}
