package com.ruoyi.api;

import com.ruoyi.ai.domain.AiTag;
import com.ruoyi.ai.service.IAiTagService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * ai-标签管理Controller
 *
 * @author shi
 * @date 2025-11-24
 */
@RestController
@RequestMapping("/api/tag")
public class AiTagApiController extends BaseController {
    @Autowired
    private IAiTagService aiTagService;

    /**
     * 查询ai-标签管理列表
     */
    @ApiOperation("查询标签列表")
    @GetMapping("/list")
    @Anonymous
    public AjaxResult list(Long aiId, HttpServletRequest request) {
        AiTag aiTag = new AiTag();
        aiTag.setAiId(aiId);
        aiTag.setStatus(0);
        aiTag.setLanguage(request.getHeader("Language"));
        List<AiTag> list = aiTagService.selectUserAiTagList(aiTag);
        return success(list);
    }


}
