import 'dart:convert';
import 'dart:io';

import 'package:dio/dio.dart';
import 'package:electronic_assistant/base/app_base_request.dart';
import 'package:electronic_assistant/base/base_response.dart';
import 'package:electronic_assistant/data/api/network_module.dart';
import 'package:electronic_assistant/data/api/request/agenda_request.dart';
import 'package:electronic_assistant/data/api/request/agenda_status_request.dart';
import 'package:electronic_assistant/data/api/request/agenda_todo_request.dart';
import 'package:electronic_assistant/data/api/request/chat_history_request.dart';
import 'package:electronic_assistant/data/api/request/login_request.dart';
import 'package:electronic_assistant/data/api/request/talk_create_request.dart';
import 'package:electronic_assistant/data/api/request/talk_delete_request.dart';
import 'package:electronic_assistant/data/api/request/talk_file_request.dart';
import 'package:electronic_assistant/data/api/request/talk_generate_request.dart';
import 'package:electronic_assistant/data/api/request/talk_paginate_request.dart';
import 'package:electronic_assistant/data/api/request/talk_query_request.dart';
import 'package:electronic_assistant/data/api/request/talk_rename_request.dart';
import 'package:electronic_assistant/data/api/request/talk_request.dart';
import 'package:electronic_assistant/data/api/request/user_info_update_request.dart';
import 'package:electronic_assistant/data/api/request/verification_code_request.dart';
import 'package:electronic_assistant/data/api/response/agenda_list_all_response.dart';
import 'package:electronic_assistant/data/api/response/agenda_list_mine_response.dart';
import 'package:electronic_assistant/data/api/response/agenda_response.dart';
import 'package:electronic_assistant/data/api/response/chat_history_response.dart';
import 'package:electronic_assistant/data/api/response/example_info_response.dart';
import 'package:electronic_assistant/data/api/response/home_info_response.dart';
import 'package:electronic_assistant/data/api/response/login_response.dart';
import 'package:electronic_assistant/data/api/response/talk_check_electric_response.dart';
import 'package:electronic_assistant/data/api/response/talk_generate_response.dart';
import 'package:electronic_assistant/data/api/response/talk_info_response.dart';
import 'package:electronic_assistant/data/api/response/talk_paginate_response.dart';
import 'package:electronic_assistant/data/api/response/talk_query_response.dart';
import 'package:electronic_assistant/data/api/response/tasks_running_response.dart';
import 'package:electronic_assistant/data/api/response/talk_original_response.dart';
import 'package:electronic_assistant/data/api/response/user_info_response.dart';
import 'package:electronic_assistant/data/bean/talks.dart';
import 'package:electronic_assistant/data/consts/constants.dart';
import 'package:retrofit/http.dart';

part 'atmob_api.g.dart';

@RestApi()
abstract class AtmobApi {
  factory AtmobApi(Dio dio, {String baseUrl}) = _AtmobApi;

  /// 获取验证码
  @POST("/project/secretary/v1/user/code")
  Future<BaseResponse> getVerificationCode(
      @Body() VerificationCodeRequest request);

  /// 登录
  @POST("/project/secretary/v1/user/login")
  Future<BaseResponse<LoginResponse>> login(@Body() LoginRequest request);

  /// 更新用户信息
  @POST("/project/secretary/v1/user/info/update")
  Future<BaseResponse> updateUserInfo(@Body() UserInfoUpdateRequest request);

  /// 用户信息
  @POST("/project/secretary/v1/user/info")
  Future<BaseResponse<UserInfoResponse>> userInfo(
      @Body() AppBaseRequest request);

  /// 首页信息
  @POST("/project/secretary/v1/home/info")
  Future<BaseResponse<HomeInfoResponse>> homeInfo(
      @Body() AppBaseRequest request);

  @POST("/project/secretary/v1/agenda/page")
  Future<BaseResponse<AgendaResponse>> agendaPage(
      @Body() AgendaRequest request);

  @POST("/project/secretary/v1/talk/update")
  Future<BaseResponse> talkRename(@Body() TalkRenameRequest request);

  @POST("/project/secretary/v1/talk/delete")
  Future<BaseResponse> talkDelete(@Body() TalkDeleteRequest request);

  @POST("/project/secretary/v1/agenda/complete")
  Future<BaseResponse> agendaFinish(@Body() AgendaStatusRequest request);

  /// 聊天记录
  @POST("/project/secretary/v1/chat/page")
  Future<BaseResponse<ChatHistoryResponse>> chatHistory(
      @Body() ChatHistoryRequest request);

  @POST("/project/secretary/v1/talk/info")
  Future<BaseResponse<TalkInfoResponse>> talkInfo(@Body() TalkRequest request);

  @POST("/project/secretary/v1/agenda/list/all")
  Future<BaseResponse<AgendaListAllResponse>> agendaListAll(
      @Body() TalkRequest request);

  @POST("/project/secretary/v1/agenda/list/mime")
  Future<BaseResponse<AgendaListMineResponse>> agendaListMine(
      @Body() TalkRequest request);

  @POST("/project/secretary/v1/talk/original")
  Future<BaseResponse<TalkOriginalResponse>> talkOriginal(
      @Body() TalkRequest request);

  @POST("/project/secretary/v1/talk/check/electric")
  Future<BaseResponse<TalkCheckElectricResponse>> checkElectric(
      @Body() TalkGenerateRequest request);

  @POST("/project/secretary/v1/agenda/todo")
  Future<BaseResponse> agendaTodo(@Body() AgendaTodoRequest request);

  /// 录音完成，创建谈话记录
  @POST("/project/secretary/v1/talk/create")
  Future<BaseResponse<TalkBean>> talkCreate(@Body() TalkCreateRequest request);

  @POST("/project/secretary/v1/talk/tasks/running")
  Future<BaseResponse<TasksRunningResponse>> tasksRunning(
      @Body() AppBaseRequest request);

  @POST("/project/secretary/v1/talk/query")
  Future<BaseResponse<TalkQueryResponse>> talkQuery(
      @Body() TalkQueryRequest request);

  @POST("/project/secretary/v1/talk/page")
  Future<BaseResponse<TalkPaginateResponse>> talkPagePaginate(
      @Body() TalkPaginateRequest request);

  @POST("/project/secretary/v1/example/info")
  Future<BaseResponse<ExampleInfoResponse>> exampleInfo(
      @Body() AppBaseRequest request);

  @POST("/project/secretary/v1/user/deprecate")
  Future<BaseResponse> userDeprecate(@Body() AppBaseRequest request);
}

final atmobApi = AtmobApi(defaultDio, baseUrl: Constants.baseUrl);
