package com.red.circle.other.app.inner.endpoint.ai.qianfan;

import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.ai.qianfan.AiQianFanChatClientService;
import com.red.circle.other.inner.endpoint.ai.qian.api.AiQianFanChatClientApi;
import com.red.circle.tool.core.tuple.ImmutableKeyValuePair;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 千帆AI数据统计 服务.
 *
 * @author pengliang on 2023/6/5
 */
@Validated
@RestController
@RequestMapping(value = AiQianFanChatClientApi.API_PREFIX, produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
public class AiQianFanChatClientEndpoint implements AiQianFanChatClientApi {

    private final AiQianFanChatClientService aiQianFanChatClientService;

    @Override
    public ResultResponse<List<ImmutableKeyValuePair<String, String>>> record(Long userId) {
        return ResultResponse.success(aiQianFanChatClientService.record(userId));
    }
}
