新增训练任务步骤
parent
91b936397b
commit
1f770888b8
@ -0,0 +1,29 @@
|
|||||||
|
package com.ruoyi.biemo.business.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ruoyi.common.constant.TrainingScoreConstants;
|
||||||
|
import com.ruoyi.system.service.ISysTrainingScoreService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/makesoft/trainingScore")
|
||||||
|
public class TrainingScoreController {
|
||||||
|
@Autowired
|
||||||
|
ISysTrainingScoreService trainingScoreService;
|
||||||
|
|
||||||
|
@PostMapping("/addScore")
|
||||||
|
private void addScore(@RequestBody JSONObject jsonObject){
|
||||||
|
String controlsName = jsonObject.getString("controlsName");
|
||||||
|
BigInteger userId = jsonObject.getBigInteger("userId");
|
||||||
|
Map<String, Integer> trainingScoreConstantsMap = TrainingScoreConstants.getTrainingScoreConstantsMap();
|
||||||
|
Integer score = trainingScoreConstantsMap.get(controlsName);
|
||||||
|
Boolean isCommit=trainingScoreService.checkStatus(userId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class TrainingScoreConstants {
|
||||||
|
public static final int DATA_COLLECTION_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int DATA_COLLECTION_TOOLBAR_BUTTON = 2;
|
||||||
|
|
||||||
|
public static final int TEXT_SEGMENTATION_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int TEXT_SEGMENTATION_TOOLBAR_BUTTON = 3;
|
||||||
|
public static final int TEXT_SEGMENTATION_ANALYSIS_TRAIN_BUTTON = 4;
|
||||||
|
|
||||||
|
public static final int PART_OF_SPEECH_TAGGING_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int PART_OF_SPEECH_TAGGING_TOOLBAR_BUTTON = 3;
|
||||||
|
public static final int PART_OF_SPEECH_TAGGING_ANALYSIS_TRAIN_BUTTON = 4;
|
||||||
|
|
||||||
|
public static final int CATEGORY_MANAGEMENT_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int CATEGORY_MANAGEMENT_ADD_BUTTON = 2;
|
||||||
|
|
||||||
|
public static final int TEXT_CLASSIFICATION_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int TEXT_CLASSIFICATION_ARTICLE_CLASSIFICATION_BUTTON = 3;
|
||||||
|
public static final int TEXT_CLASSIFICATION_CREATE_ARTICLE_BUTTON = 3;
|
||||||
|
public static final int TEXT_CLASSIFICATION_TOOLBAR_DETAILS_BUTTON = 3;
|
||||||
|
|
||||||
|
|
||||||
|
public static final int TEXT_SUMMARIZATION_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int TEXT_SUMMARIZATION_ARTICLE_SUMMARY_BUTTON = 3;
|
||||||
|
public static final int TEXT_SUMMARIZATION_CREATE_ARTICLE_BUTTON = 3;
|
||||||
|
public static final int TEXT_SUMMARIZATION_TOOLBAR_DETAILS_BUTTON = 3;
|
||||||
|
|
||||||
|
public static final int SIMILARITY_CALCULATION_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int SIMILARITY_CALCULATION_ADD_BUTTON_TOP = 3;
|
||||||
|
public static final int SIMILARITY_CALCULATION_ADD_BUTTON_BOTTOM = 3;
|
||||||
|
public static final int SIMILARITY_CALCULATION_CALCULATE_SIMILARITY_BUTTON = 3;
|
||||||
|
|
||||||
|
public static final int SENTIMENT_ANALYSIS_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int SENTIMENT_ANALYSIS_SELECT_BUTTON = 3;
|
||||||
|
public static final int SENTIMENT_ANALYSIS_SENTIMENT_ANALYSIS_BUTTON = 3;
|
||||||
|
public static final int SENTIMENT_ANALYSIS_CREATE_SENTIMENT_WORD_BUTTON = 3;
|
||||||
|
|
||||||
|
public static final int DATA_VISUALIZATION_STEP_DESCRIPTION = 3;
|
||||||
|
public static final int DATA_VISUALIZATION_WORD_CLOUD_BUTTON = 3;
|
||||||
|
public static final int DATA_VISUALIZATION_SOCIAL_NETWORK_ANALYSIS_BUTTON = 3;
|
||||||
|
public static final int DATA_VISUALIZATION_SENTIMENT_ANALYSIS_BUTTON = 3;
|
||||||
|
|
||||||
|
public static final int REPORT_SUBMISSION_EXPERIENCE_PAGE_SAVE_BUTTON = 3;
|
||||||
|
public static final int REPORT_SUBMISSION_UPLOAD_REPORT_BUTTON = 4;
|
||||||
|
public static final int REPORT_SUBMISSION_SUBMIT_BUTTON = 3;
|
||||||
|
|
||||||
|
public static Map<String, Integer> getTrainingScoreConstantsMap() {
|
||||||
|
Map<String, Integer> constantsMap = new HashMap<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 获取TrainingScoreConstants类中的所有字段
|
||||||
|
Field[] fields = TrainingScoreConstants.class.getDeclaredFields();
|
||||||
|
|
||||||
|
// 遍历字段
|
||||||
|
for (Field field : fields) {
|
||||||
|
// 判断字段是否为静态字段
|
||||||
|
if (java.lang.reflect.Modifier.isStatic(field.getModifiers())) {
|
||||||
|
// 将字段名和字段值放入map中
|
||||||
|
constantsMap.put(field.getName(), field.getInt(null));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return constantsMap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.ruoyi.system.service;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
|
||||||
|
public interface ISysTrainingScoreService {
|
||||||
|
Boolean checkStatus(BigInteger userId);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.system.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.system.mapper.SysTrainingScoreMapper;
|
||||||
|
import com.ruoyi.system.service.ISysTrainingScoreService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigInteger;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class SysTrainingScoreServiceImpl implements ISysTrainingScoreService {
|
||||||
|
@Autowired
|
||||||
|
SysTrainingScoreMapper trainingScoreMapper;
|
||||||
|
@Override
|
||||||
|
public Boolean checkStatus(BigInteger userId) {
|
||||||
|
// trainingScoreMapper.selectByExample()
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue