package com.fs.qw.controller;

import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.page.TableDataInfo;
import com.fs.sop.domain.QwMassSendLog;
import com.fs.sop.service.IQwMassSendLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 一键群发销售点击行为日志（总后台查看）
 */
@RestController
@RequestMapping("/qw/massSendLog")
public class QwMassSendLogController extends BaseController {

    @Autowired
    private IQwMassSendLogService qwMassSendLogService;

    /**
     * 分页列表
     */
    @PreAuthorize("@ss.hasPermi('qw:massSendLog:list')")
    @GetMapping("/list")
    public TableDataInfo list(QwMassSendLog query) {
        startPage();
        List<QwMassSendLog> list = qwMassSendLogService.selectQwMassSendLogList(query);
        return getDataTable(list);
    }

    /**
     * 详情
     */
    @PreAuthorize("@ss.hasPermi('qw:massSendLog:query')")
    @GetMapping("/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return AjaxResult.success(qwMassSendLogService.selectQwMassSendLogById(id));
    }
}
