package com.sonic.frog.controller.web;

import com.sonic.common.auth.domains.Session;
import com.sonic.common.rpc.Result;
import com.sonic.frog.domain.input.AiUserStatInput;
import com.sonic.frog.domain.output.AiUserStatOutput;
import com.sonic.frog.service.AiUserStatService;
import com.sonic.sdk.api.annotation.IgnoreAuth;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Web-AI角色统计信息
 *
 * @author code
 */
@RestController
@Slf4j
public class AiUserStatWeb {

    @Autowired
    private AiUserStatService aiUserStatService;

    @IgnoreAuth
    @ApiOperation(value = "获取Ai用户统计信息", tags = {"Web-AI角统计"})
    @PostMapping("/web/ai-user/stat")
    public Result<AiUserStatOutput> getAiUserStatInfo(@Validated @RequestBody AiUserStatInput input, @ApiParam(hidden = true) Session session) {
        return Result.success(aiUserStatService.getAiUserStatByAiId(input.getAiId(), session.getUserId()));
    }

}
