package com.izouma.wenlvju.service;


import com.alibaba.fastjson.JSONObject;
import com.izouma.wenlvju.ApplicationTests;
import com.izouma.wenlvju.domain.RateExpertAudit;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class RateExpertAuditServiceTest extends ApplicationTests {
    @Autowired
    private RateExpertAuditService rateExpertAuditService;

    @Test
    public void test() {
        String str = "[{\"rateId\":\"162\",\"type\":\"examOrganization\",\"score\":2,\"img\":[\"https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-04-21-18-08-22sHaeBMxp.png\",\"https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-04-21-18-08-26FnGfZASi.png\"]},{\"rateId\":\"162\",\"type\":\"examSite\",\"score\":4,\"img\":[]},{\"rateId\":\"162\",\"type\":\"examRoom\",\"score\":2,\"img\":[]},{\"rateId\":\"162\",\"type\":\"environment\",\"score\":4,\"img\":[]},{\"rateId\":\"162\",\"type\":\"safety\",\"score\":4,\"img\":[]},{\"rateId\":\"162\",\"type\":\"promote\",\"score\":2,\"img\":[]},{\"rateId\":\"162\",\"type\":\"signUp\",\"score\":2,\"img\":[]},{\"rateId\":\"162\",\"type\":\"examPreparation\",\"score\":3,\"img\":[]},{\"rateId\":\"162\",\"type\":\"examService\",\"score\":5,\"img\":[]},{\"rateId\":\"162\",\"type\":\"examiner\",\"score\":5,\"img\":[]},{\"rateId\":\"162\",\"type\":\"specification\",\"score\":5,\"img\":[]},{\"rateId\":\"162\",\"type\":\"video\",\"score\":5,\"img\":[]},{\"rateId\":\"162\",\"type\":\"score\",\"score\":3,\"img\":[]},{\"rateId\":\"162\",\"type\":\"artTrain\",\"score\":4,\"img\":[]},{\"rateId\":\"162\",\"type\":\"artResult\",\"score\":5,\"img\":[]}]";
        List<RateExpertAudit> audits = JSONObject.parseArray(str, RateExpertAudit.class);
        rateExpertAuditService.batchSave(audits);
    }
}