package com.sdut.labex.Factory;

import com.alibaba.fastjson.JSONObject;
import com.sdut.labex.entity.SubmitRecord;
import lombok.extern.slf4j.Slf4j;

/**
 * File: SubmitRecordsFactory
 * Created: 2023/6/21
 * Author: springforest
 * Description:
 */
@Slf4j
public class SubmitRecordsFactory {
    public static SubmitRecord create(JSONObject jsonObject) {
        SubmitRecord submitRecord = new SubmitRecord();
        submitRecord.setId(jsonObject.getInteger("id"));
        submitRecord.setExperimentId(jsonObject.getInteger("experimentId"));
        submitRecord.setStudentId(jsonObject.getString("studentId"));
        submitRecord.setFilePath(jsonObject.getString("filePath"));
        submitRecord.setScore(jsonObject.getInteger("score"));
        return submitRecord;
    }
}
