package com.fs.aiob.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.enums.BusinessType;
import com.fs.aiob.domain.AiobBaiduEncryption;
import com.fs.aiob.service.IAiobBaiduEncryptionService;
import com.fs.common.utils.poi.ExcelUtil;
import com.fs.common.core.page.TableDataInfo;

/**
 * 百度AI外呼加密Controller
 * 
 * @author fs
 * @date 2025-03-20
 */
@RestController
@RequestMapping("/aiob/AiobBaiduEncryption")
public class AiobBaiduEncryptionController extends BaseController
{
    @Autowired
    private IAiobBaiduEncryptionService aiobBaiduEncryptionService;

    /**
     * 查询百度AI外呼加密列表
     */
    @PreAuthorize("@ss.hasPermi('aiob:AiobBaiduEncryption:list')")
    @GetMapping("/list")
    public TableDataInfo list(AiobBaiduEncryption aiobBaiduEncryption)
    {
        startPage();
        List<AiobBaiduEncryption> list = aiobBaiduEncryptionService.selectAiobBaiduEncryptionList(aiobBaiduEncryption);
        return getDataTable(list);
    }

    /**
     * 导出百度AI外呼加密列表
     */
    @PreAuthorize("@ss.hasPermi('aiob:AiobBaiduEncryption:export')")
    @Log(title = "百度AI外呼加密", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(AiobBaiduEncryption aiobBaiduEncryption)
    {
        List<AiobBaiduEncryption> list = aiobBaiduEncryptionService.selectAiobBaiduEncryptionList(aiobBaiduEncryption);
        ExcelUtil<AiobBaiduEncryption> util = new ExcelUtil<AiobBaiduEncryption>(AiobBaiduEncryption.class);
        return util.exportExcel(list, "百度AI外呼加密数据");
    }

    /**
     * 获取百度AI外呼加密详细信息
     */
    @PreAuthorize("@ss.hasPermi('aiob:AiobBaiduEncryption:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(aiobBaiduEncryptionService.selectAiobBaiduEncryptionById(id));
    }

    /**
     * 新增百度AI外呼加密
     */
    @PreAuthorize("@ss.hasPermi('aiob:AiobBaiduEncryption:add')")
    @Log(title = "百度AI外呼加密", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody AiobBaiduEncryption aiobBaiduEncryption)
    {
        return toAjax(aiobBaiduEncryptionService.insertAiobBaiduEncryption(aiobBaiduEncryption));
    }

    /**
     * 修改百度AI外呼加密
     */
    @PreAuthorize("@ss.hasPermi('aiob:AiobBaiduEncryption:edit')")
    @Log(title = "百度AI外呼加密", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AiobBaiduEncryption aiobBaiduEncryption)
    {
        return toAjax(aiobBaiduEncryptionService.updateAiobBaiduEncryption(aiobBaiduEncryption));
    }

    /**
     * 删除百度AI外呼加密
     */
    @PreAuthorize("@ss.hasPermi('aiob:AiobBaiduEncryption:remove')")
    @Log(title = "百度AI外呼加密", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(aiobBaiduEncryptionService.deleteAiobBaiduEncryptionByIds(ids));
    }
}
