|
|
@@ -0,0 +1,100 @@
|
|
|
+import request from '../utils/request';
|
|
|
+import axios from 'axios';
|
|
|
+import {CONFIG_MODULE} from "./_prefix";
|
|
|
+
|
|
|
+/**
|
|
|
+ * 添加模型配置信息 POST /add
|
|
|
+ * @param {*} payload
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const addConfig = payload => {
|
|
|
+ console.log(payload);
|
|
|
+ const {id, fileInfoId, userId,modelTypeId,confName , fieldIds} = payload;
|
|
|
+ return axios.post(`${CONFIG_MODULE}/add`, {
|
|
|
+ id, fileInfoId, userId,modelTypeId,confName ,fieldIds
|
|
|
+ }).then(res => {
|
|
|
+ return res.data;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取所有模型配置 GET /get/all/{userId} 传入用户id
|
|
|
+ * @param {*} payload
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const getAllConfig = payload => {
|
|
|
+ const {uid} = payload;
|
|
|
+ return axios.get(`${CONFIG_MODULE}/get/all/${uid}`).then(res => {
|
|
|
+
|
|
|
+ return res.data;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取所有新配置 GET /get/all_new/{userId}
|
|
|
+ * @param {*} payload
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const getAllNew = payload => {
|
|
|
+ const { uid } = payload;
|
|
|
+ return axios.get(`${CONFIG_MODULE}/get/all_new/${uid}`).then(res => {
|
|
|
+
|
|
|
+ return res.data;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取单个个配置 GET /get/one/config/{configId}
|
|
|
+ * @param {*} payload
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const getOneConfig = payload => {
|
|
|
+ const { configId } = payload;
|
|
|
+ return axios.get(`${CONFIG_MODULE}/get/one/config/${configId}?`).then(res => {
|
|
|
+
|
|
|
+ return res.data;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 更改配置 GET /change/{configId}?confName={confName}&trainFeatureList={trainFeatureList}
|
|
|
+ * @param {*} payload
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const changeConfig = payload => {
|
|
|
+ const { configId,confName,tranFeatureList } = payload;
|
|
|
+ return axios.get(`${CONFIG_MODULE}/change/${configId}?confName=${confName}&trainFeatureList={trainFeatureList}`).then(res => {
|
|
|
+
|
|
|
+ return res.data;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * 删除模型 GET /delete/{configId}
|
|
|
+ * @param {*} payload
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const deleteModelByModelId = payload => {
|
|
|
+ const { configId } = payload;
|
|
|
+ return axios.get(`${CONFIG_MODULE}/delete/${configId}`).then(res => {
|
|
|
+
|
|
|
+ return res.data;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 选择特征 GET /get/features/{fileId}?fieldName={fieldName}
|
|
|
+ * @param {*} payload
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+export const getFeatureSelection = payload => {
|
|
|
+ const { fileId,fieldName } = payload;
|
|
|
+ return axios.get(`${CONFIG_MODULE}/get/features/${fileId}?fieldName=${fieldName}`).then(res => {
|
|
|
+
|
|
|
+ return res.data;
|
|
|
+ });
|
|
|
+}
|