package com.pavis.admin.controller.aigc;

import io.swagger.v3.oas.annotations.Operation;
import top.continew.starter.extension.crud.enums.Api;

import io.swagger.v3.oas.annotations.tags.Tag;

import org.springframework.web.bind.annotation.*;

import top.continew.starter.extension.crud.annotation.CrudRequestMapping;
import com.pavis.admin.common.controller.BaseController;
import com.pavis.admin.aigc.model.query.ModelQuery;
import com.pavis.admin.aigc.model.req.ModelReq;
import com.pavis.admin.aigc.model.resp.ModelDetailResp;
import com.pavis.admin.aigc.model.resp.ModelResp;
import com.pavis.admin.aigc.service.ModelService;

import java.util.List;

/**
 * AIGC模型配置管理 API
 *
 * @author semi
 * @since 2025/05/26 17:28
 */
@Tag(name = "AIGC模型配置管理 API")
@RestController
@CrudRequestMapping(value = "/aigc/model", api = {Api.PAGE, Api.GET, Api.CREATE, Api.UPDATE, Api.DELETE, Api.EXPORT})
public class ModelController extends BaseController<ModelService, ModelResp, ModelDetailResp, ModelQuery, ModelReq> {
    @Operation(summary = "模型和配置新增接口", description = "模型和配置新增接口")
    @PostMapping(value = "/insModelAndSecret")
    public void insModelAndSecret(@RequestBody ModelReq modelReq) {
        baseService.insModelAndSecret(modelReq);
    }

    @Operation(summary = "模型和配置查询接口", description = "模型和配置查询接口")
    @PostMapping(value = "/selModelAndSecrt")
    public List<ModelResp> selModelAndSecrt(@RequestBody ModelQuery modelQuery) {
        return baseService.selModelAndSecrtList(modelQuery);
    }

    @Operation(summary = "模型和配置更新接口", description = "模型和配置更新接口")
    @PostMapping(value = "/updateModelAndSecrt")
    public void updateModelAndSecrt(@RequestBody ModelResp modelResp) {
        baseService.updateModelAndSecrt(modelResp);
    }

    @Operation(summary = "模型和配置删除接口", description = "模型和配置删除接口")
    @PostMapping(value = "/delModelAndSecrt")
    public void delModelAndSecrt(List<Long> ids) {
        baseService.delModelAndSecrt(ids);
    }
}