/**
 * Copyright (c) 2018 人人开源 All rights reserved.
 * <p>
 * https://www.renren.io
 * <p>
 * 版权所有，侵权必究！
 */

package test.com.pjilisense.flxai.controller;

import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiModelProperty;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import test.com.pjilisense.flxai.TestUtils;

import java.util.HashMap;
import java.util.Map;

public class AppAiAssistantControllerTest {
    @BeforeEach
    public void setUpTestDataWithinTransaction() {
        // set up test data within the transaction
    }
    @AfterEach
    public void tearDownWithinTransaction() {
        // execute "tear down" logic within the transaction
    }

    @Test
    public void testAppAiAssistantSave() {
        String url = TestUtils.WebconnectURL+"/api/robot/appaiassistant";
        String charset = TestUtils.UTF8;
        try {
            Map<String, Object> params = new HashMap<String, Object>();
            params.put("author","sharkbear212a");
            params.put("homepage","https://github.com/sharkbear212a");
            params.put("identifier","japan-language-helpera");
            params.put("avatar","avatara");
            params.put("description","擅长日语五十音，平假名，片假名，单词和短语解释与记忆技巧a");
            params.put("tags","解释,记忆技巧,日语教学a");
            params.put("title","日语帮助记忆师a");
            params.put("category","education");
            params.put("schemaVersion","1");
            params.put("createAt","2024-12-04");
            params.put("createdAt","2024-12-04");
            params.put("userid","flx");
            String body = TestUtils.doPost(url, JSON.toJSONString(params), charset);
            System.out.println(body);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Test
    public void testGetAllAiAssistant() {
        String url = TestUtils.WebconnectURL+"/api/robot/appaiassistant/getAllAiAssistant?userid=flx";
        String charset = TestUtils.UTF8;
        try {
            String body = TestUtils.doGet(url, charset);
            System.out.println(body);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}