package com.kexue.skills.controller;

import com.kexue.skills.common.CommonResult;
import com.kexue.skills.entity.response.SkillResponse;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * 技能生成控制器
 *
 * @author 维哥
 * @since 2026-01-28
 */
@RestController
@RequestMapping("api/skillGen")
@Tag(name = "技能生成 Api")
@CrossOrigin(origins = "*")
public class SkillGenController {

    @Resource
    private com.kexue.skills.service.SkillGenService skillGenService;

    /**
     * 生成技能
     *
     * @param request 生成请求
     * @return 生成结果
     */
    @PostMapping("/generate")
    @Operation(summary = "生成技能", description = "生成技能")
    public CommonResult<SkillResponse> generate(@RequestBody com.kexue.skills.entity.request.SkillGenRequest request) {
        return CommonResult.success(skillGenService.generateSkill(request));
    }

    /**
     * 分析技能
     *
     * @param request 分析请求
     * @return 分析结果
     */
    @PostMapping("/analyze")
    @Operation(summary = "分析技能", description = "分析技能")
    public CommonResult<String> analyze(@RequestBody com.kexue.skills.entity.request.SkillAnalyzeRequest request) {
        return CommonResult.success(skillGenService.analyzeSkill(request));
    }
}
