package com.njzscloud.supervisory.doubao.controller;

import com.njzscloud.common.core.utils.R;
import com.njzscloud.supervisory.doubao.param.GarbageAnalysisParam;
import com.njzscloud.supervisory.doubao.result.GarbageAnalysisResult;
import com.njzscloud.supervisory.doubao.sevice.DouBaoService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 豆包
 * 使用豆包官方SDK的生产级实现
 */
@Slf4j
@RestController
@RequestMapping("/douBao")
@RequiredArgsConstructor
public class DouBaoController {

    private final DouBaoService douBaoService;

    @PostMapping("/analyzeGarbage")
    public R<GarbageAnalysisResult> analyzeGarbage(@RequestBody GarbageAnalysisParam param) {
        return R.success(douBaoService.analyzeGarbage(param));
    }

}
