package com.fs.qw.controller;


import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.domain.R;
import com.fs.common.core.page.TableDataInfo;
import com.fs.common.enums.BusinessType;
import com.fs.sop.domain.SopUserLogsInfo;
import com.fs.sop.params.SendUserLogsInfoMsgParam;
import com.fs.sop.service.ISopUserLogsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * sopUserLogsInfoController
 *
 * @author fs
 * @date 2024-12-27
 */
@RestController
@RequestMapping("/qwSop/sopUserLogsInfo")
public class SopUserLogsInfoController extends BaseController
{
    @Autowired
    private ISopUserLogsInfoService sopUserLogsInfoService;

    /**
     * 查询sopUserLogsInfo列表
     */
    @GetMapping("/list")
    public TableDataInfo list(SopUserLogsInfo sopUserLogsInfo)
    {
        startPage();
        List<SopUserLogsInfo> list = sopUserLogsInfoService.selectSopUserLogsInfoList(sopUserLogsInfo);
        return getDataTable(list);
    }

    /**
     * 获取sopUserLogsInfo详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") String id)
    {
        return AjaxResult.success(sopUserLogsInfoService.selectSopUserLogsInfoById(id));
    }

    /**
     * 修改sopUserLogsInfo
     */
    @Log(title = "updateSopUserLogsInfo", businessType = BusinessType.UPDATE)
    @PutMapping
    public R edit(@RequestBody SopUserLogsInfo sopUserLogsInfo)
    {
        return sopUserLogsInfoService.updateSopUserLogsInfoToTime(sopUserLogsInfo);
    }

    /**
     * 一键群发sopUserLogsInfo
     */
    @PreAuthorize("@ss.hasPermi('qw:sopUserLogsInfo:msg')")
    @Log(title = "sendMsgSopUserLogsInfo", businessType = BusinessType.INSERT,isSaveRequestData=false)
    @PostMapping("/sendUserLogsInfoMsg")
    public R sendUserLogsInfoMsg(@RequestBody SendUserLogsInfoMsgParam param)
    {
        return sopUserLogsInfoService.sendUserLogsInfoMsg(param);
    }
}
