fix(api): method fix
This commit is contained in:
@@ -6,7 +6,7 @@ import { Daily } from "./typing"
|
|||||||
export const getDailyWorkList = (data: Daily.Request) => {
|
export const getDailyWorkList = (data: Daily.Request) => {
|
||||||
return httpFetch<Daily.Response>({
|
return httpFetch<Daily.Response>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/list",
|
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/list",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -18,7 +18,7 @@ export const getDailyWorkList = (data: Daily.Request) => {
|
|||||||
export const addDailyWorkData = (data: Daily.CreateProps) => {
|
export const addDailyWorkData = (data: Daily.CreateProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/add",
|
url: BASE_LABEL_API + "/api/v1/label_server/daily_work/add",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import httpFetch from "@/api/fetch"
|
import httpFetch from "@/api/fetch"
|
||||||
|
import { usePermissionStore } from "../../store/auth"
|
||||||
import {
|
import {
|
||||||
LabelResult,
|
LabelResult,
|
||||||
LoginInfo,
|
LoginInfo,
|
||||||
RequestLabelResult,
|
RequestLabelResult,
|
||||||
ServerResponse,
|
ServerResponse,
|
||||||
} from "./typing"
|
} from "./typing"
|
||||||
import { usePermissionStore } from "../../store/auth"
|
|
||||||
|
|
||||||
export const BASE_LABEL_API = "https://label.cowarobot.com"
|
export const BASE_LABEL_API = "https://label.cowarobot.com"
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ export const getLabelResult = (task_id: number) => {
|
|||||||
url:
|
url:
|
||||||
BASE_LABEL_API +
|
BASE_LABEL_API +
|
||||||
`/api/v1/label_server/task/label_result?task_id=${task_id}`,
|
`/api/v1/label_server/task/label_result?task_id=${task_id}`,
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -29,7 +29,7 @@ export const getLabelResult = (task_id: number) => {
|
|||||||
export const saveLabelResult = (data: RequestLabelResult) => {
|
export const saveLabelResult = (data: RequestLabelResult) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/task/label_result",
|
url: BASE_LABEL_API + "/api/v1/label_server/task/label_result",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -46,7 +46,7 @@ export const getServerImage = async (data: {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
httpFetch<ServerResponse>({
|
httpFetch<ServerResponse>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/data/list",
|
url: BASE_LABEL_API + "/api/v1/label_server/data/list",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -70,7 +70,7 @@ export const getServerImage = async (data: {
|
|||||||
try {
|
try {
|
||||||
const res = await httpFetch<ServerResponse>({
|
const res = await httpFetch<ServerResponse>({
|
||||||
url: `/http://${proxy}:9112/api/v1/label_sync/get_data_list`,
|
url: `/http://${proxy}:9112/api/v1/label_sync/get_data_list`,
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(params),
|
body: JSON.stringify(params),
|
||||||
})
|
})
|
||||||
return res.data.data_list?.[0].image_data || ""
|
return res.data.data_list?.[0].image_data || ""
|
||||||
@@ -78,7 +78,7 @@ export const getServerImage = async (data: {
|
|||||||
console.log(error)
|
console.log(error)
|
||||||
const res = await httpFetch<ServerResponse>({
|
const res = await httpFetch<ServerResponse>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/data/list",
|
url: BASE_LABEL_API + "/api/v1/label_server/data/list",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify({ ...params, flag: 1 }),
|
body: JSON.stringify({ ...params, flag: 1 }),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -98,7 +98,7 @@ export const getLabelImage = (activeImage: string, path: string) => {
|
|||||||
`/api/v1/label_server/data/image?data_name=${encodeURIComponent(
|
`/api/v1/label_server/data/image?data_name=${encodeURIComponent(
|
||||||
activeImage
|
activeImage
|
||||||
)}&project_path=${encodeURIComponent(path)}`,
|
)}&project_path=${encodeURIComponent(path)}`,
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
responseType: "blob",
|
responseType: "blob",
|
||||||
},
|
},
|
||||||
@@ -109,7 +109,7 @@ export const getLabelImage = (activeImage: string, path: string) => {
|
|||||||
export const getAuxiliaryAnnotation = (data: any) => {
|
export const getAuxiliaryAnnotation = (data: any) => {
|
||||||
return httpFetch<any>({
|
return httpFetch<any>({
|
||||||
url: BASE_LABEL_API + "/api/model_server/sam2/sa",
|
url: BASE_LABEL_API + "/api/model_server/sam2/sa",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
responseType: "arraybuffer",
|
responseType: "arraybuffer",
|
||||||
@@ -121,7 +121,7 @@ export const getAuxiliaryAnnotation = (data: any) => {
|
|||||||
export const getTrackingAuxiliaryAnnotation = (data: any) => {
|
export const getTrackingAuxiliaryAnnotation = (data: any) => {
|
||||||
return httpFetch<any>({
|
return httpFetch<any>({
|
||||||
url: BASE_LABEL_API + "/api/model_server/sam2/vos",
|
url: BASE_LABEL_API + "/api/model_server/sam2/vos",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
responseType: "arraybuffer",
|
responseType: "arraybuffer",
|
||||||
@@ -133,7 +133,7 @@ export const getTrackingAuxiliaryAnnotation = (data: any) => {
|
|||||||
export const userLogin = (data: { name: string; password: string }) => {
|
export const userLogin = (data: { name: string; password: string }) => {
|
||||||
return httpFetch<LoginInfo>({
|
return httpFetch<LoginInfo>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/user/login",
|
url: BASE_LABEL_API + "/api/v1/label_server/user/login",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Project, ProjectDetail, ReviewUsers } from "./typing"
|
|||||||
export const getProjectList = (data: Project.ListRequest) => {
|
export const getProjectList = (data: Project.ListRequest) => {
|
||||||
return httpFetch<Project.ListResponse>({
|
return httpFetch<Project.ListResponse>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/list",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/list",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -20,7 +20,7 @@ export const getProjectList = (data: Project.ListRequest) => {
|
|||||||
export const getProjectDetailById = (id: number) => {
|
export const getProjectDetailById = (id: number) => {
|
||||||
return httpFetch<ProjectDetail.DataProps>({
|
return httpFetch<ProjectDetail.DataProps>({
|
||||||
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
|
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -32,7 +32,7 @@ export const getProjectDetailById = (id: number) => {
|
|||||||
export const checkLabelDataSource = (data: Project.CheckRequest) => {
|
export const checkLabelDataSource = (data: Project.CheckRequest) => {
|
||||||
return httpFetch<Project.CheckResponse>({
|
return httpFetch<Project.CheckResponse>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/check_data",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/check_data",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -45,7 +45,7 @@ export const checkLabelDataSource = (data: Project.CheckRequest) => {
|
|||||||
export const projectAdd = (data: Project.CreateProps) => {
|
export const projectAdd = (data: Project.CreateProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/add",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/add",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -58,7 +58,7 @@ export const projectAdd = (data: Project.CreateProps) => {
|
|||||||
export const projectReview = (data: Project.CreateProps) => {
|
export const projectReview = (data: Project.CreateProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/review",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/review",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -71,7 +71,7 @@ export const projectReview = (data: Project.CreateProps) => {
|
|||||||
export const projectConfig = (data: Project.ConfigProps) => {
|
export const projectConfig = (data: Project.ConfigProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/config",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/config",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -84,7 +84,7 @@ export const projectConfig = (data: Project.ConfigProps) => {
|
|||||||
export const projectEditById = (data: any, id: number) => {
|
export const projectEditById = (data: any, id: number) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + `/api/v1/label_server/project/edit/${id}`,
|
url: BASE_LABEL_API + `/api/v1/label_server/project/edit/${id}`,
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -97,7 +97,7 @@ export const projectEditById = (data: any, id: number) => {
|
|||||||
export const projectPreLabelReview = (data: Project.PreLabelProps) => {
|
export const projectPreLabelReview = (data: Project.PreLabelProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/prototype_review",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/prototype_review",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -110,7 +110,7 @@ export const projectPreLabelReview = (data: Project.PreLabelProps) => {
|
|||||||
export const projectDeliver = (data: { project_id: number }) => {
|
export const projectDeliver = (data: { project_id: number }) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/deliver",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/deliver",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -123,7 +123,7 @@ export const projectDeliver = (data: { project_id: number }) => {
|
|||||||
export const projectAccept = (data: { project_id: number; pass: boolean }) => {
|
export const projectAccept = (data: { project_id: number; pass: boolean }) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/accept",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/accept",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -139,7 +139,7 @@ export const projectCollect = (data: {
|
|||||||
}) => {
|
}) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/collect",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/collect",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -152,7 +152,7 @@ export const projectCollect = (data: {
|
|||||||
export const getReviewScaleList = (params: { project_id: number }) => {
|
export const getReviewScaleList = (params: { project_id: number }) => {
|
||||||
return httpFetch<any[]>({
|
return httpFetch<any[]>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/list",
|
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/list",
|
||||||
method: "get",
|
method: "GET",
|
||||||
data: params,
|
data: params,
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -165,7 +165,7 @@ export const getReviewScaleList = (params: { project_id: number }) => {
|
|||||||
export const saveUserReviewScale = (data: Project.ReviewScaleProps) => {
|
export const saveUserReviewScale = (data: Project.ReviewScaleProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/save",
|
url: BASE_LABEL_API + "/api/v1/label_server/review_scale/save",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -177,7 +177,7 @@ export const saveUserReviewScale = (data: Project.ReviewScaleProps) => {
|
|||||||
export const getProjectDetail = (id: number) => {
|
export const getProjectDetail = (id: number) => {
|
||||||
return httpFetch<Project.DetailResponse>({
|
return httpFetch<Project.DetailResponse>({
|
||||||
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
|
url: BASE_LABEL_API + `/api/v1/label_server/project/detail/${id}`,
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -189,7 +189,7 @@ export const getProjectDetail = (id: number) => {
|
|||||||
export const regenerateProjectEmbedding = (data: { project_id: number }) => {
|
export const regenerateProjectEmbedding = (data: { project_id: number }) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + `/api/v1/label_server/project/regenerate_embedding`,
|
url: BASE_LABEL_API + `/api/v1/label_server/project/regenerate_embedding`,
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -203,7 +203,7 @@ export const getPersonProjectDashBoard = () => {
|
|||||||
return httpFetch<Array<Project.PersonProjectDashboardResponseItem>>({
|
return httpFetch<Array<Project.PersonProjectDashboardResponseItem>>({
|
||||||
url:
|
url:
|
||||||
BASE_LABEL_API + `/api/v1/label_server/data_statistics/personal_project`,
|
BASE_LABEL_API + `/api/v1/label_server/data_statistics/personal_project`,
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -238,7 +238,7 @@ export const getCurrentPersonData = (params: { date: string }) => {
|
|||||||
export const getProjectTypeList = () => {
|
export const getProjectTypeList = () => {
|
||||||
return httpFetch<string[]>({
|
return httpFetch<string[]>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/type_list",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/type_list",
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -250,7 +250,7 @@ export const getProjectTypeList = () => {
|
|||||||
export const getProjectAdminList = () => {
|
export const getProjectAdminList = () => {
|
||||||
return httpFetch<Array<{ label: string; value: number }>>({
|
return httpFetch<Array<{ label: string; value: number }>>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/admin_list",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/admin_list",
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -262,7 +262,7 @@ export const getProjectAdminList = () => {
|
|||||||
export const getProjectReviewers = () => {
|
export const getProjectReviewers = () => {
|
||||||
return httpFetch<ReviewUsers>({
|
return httpFetch<ReviewUsers>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/reviewer_map",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/reviewer_map",
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -274,7 +274,7 @@ export const getProjectReviewers = () => {
|
|||||||
export const getSelfProjectList = () => {
|
export const getSelfProjectList = () => {
|
||||||
return httpFetch<Array<{ label: string; value: number }>>({
|
return httpFetch<Array<{ label: string; value: number }>>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/project/self",
|
url: BASE_LABEL_API + "/api/v1/label_server/project/self",
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Scheme } from "./typing"
|
|||||||
export const getLabelSchemeList = (params: Scheme.ListRequest) => {
|
export const getLabelSchemeList = (params: Scheme.ListRequest) => {
|
||||||
return httpFetch<Scheme.ListResponse>({
|
return httpFetch<Scheme.ListResponse>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/label_schema/list",
|
url: BASE_LABEL_API + "/api/v1/label_server/label_schema/list",
|
||||||
method: "get",
|
method: "GET",
|
||||||
data: params,
|
data: params,
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -20,7 +20,7 @@ export const getLabelSchemeList = (params: Scheme.ListRequest) => {
|
|||||||
export const addNewPlan = (data: Scheme.CreateProps) => {
|
export const addNewPlan = (data: Scheme.CreateProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/label_schema/add",
|
url: BASE_LABEL_API + "/api/v1/label_server/label_schema/add",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -35,7 +35,7 @@ export const getAllVersionByName = (name: string) => {
|
|||||||
url:
|
url:
|
||||||
BASE_LABEL_API +
|
BASE_LABEL_API +
|
||||||
`/api/v1/label_server/label_schema/version/list?name=${name}`,
|
`/api/v1/label_server/label_schema/version/list?name=${name}`,
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
@@ -62,7 +62,7 @@ export const saveWrongWordList = (data: {
|
|||||||
}) => {
|
}) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/error_repository/save",
|
url: BASE_LABEL_API + "/api/v1/label_server/error_repository/save",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -77,7 +77,7 @@ export const getWrongWordList = () => {
|
|||||||
data: { error: string; correct: string }[]
|
data: { error: string; correct: string }[]
|
||||||
}>({
|
}>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/error_repository/query",
|
url: BASE_LABEL_API + "/api/v1/label_server/error_repository/query",
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Task } from "./typing"
|
|||||||
export const getTaskList = (data: Task.ListRequest) => {
|
export const getTaskList = (data: Task.ListRequest) => {
|
||||||
return httpFetch<Task.ListResponse>({
|
return httpFetch<Task.ListResponse>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/task/list",
|
url: BASE_LABEL_API + "/api/v1/label_server/task/list",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -20,7 +20,7 @@ export const getTaskList = (data: Task.ListRequest) => {
|
|||||||
export const taskAcquire = (data: Task.AcquireReqProps) => {
|
export const taskAcquire = (data: Task.AcquireReqProps) => {
|
||||||
return httpFetch<Task.ListResponse>({
|
return httpFetch<Task.ListResponse>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/task/acquire",
|
url: BASE_LABEL_API + "/api/v1/label_server/task/acquire",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -33,7 +33,7 @@ export const taskAcquire = (data: Task.AcquireReqProps) => {
|
|||||||
export const taskDispatch = (data: Task.DispatchReqProps) => {
|
export const taskDispatch = (data: Task.DispatchReqProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/task/dispatch",
|
url: BASE_LABEL_API + "/api/v1/label_server/task/dispatch",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -46,7 +46,7 @@ export const taskDispatch = (data: Task.DispatchReqProps) => {
|
|||||||
export const taskRelease = (data: Task.ReleaseReqProps) => {
|
export const taskRelease = (data: Task.ReleaseReqProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/task/release",
|
url: BASE_LABEL_API + "/api/v1/label_server/task/release",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -59,7 +59,7 @@ export const taskRelease = (data: Task.ReleaseReqProps) => {
|
|||||||
export const getNextTaskId = (data: Task.NextReqProps) => {
|
export const getNextTaskId = (data: Task.NextReqProps) => {
|
||||||
return httpFetch<Task.NextResProps>({
|
return httpFetch<Task.NextResProps>({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/task/next",
|
url: BASE_LABEL_API + "/api/v1/label_server/task/next",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -72,7 +72,7 @@ export const getNextTaskId = (data: Task.NextReqProps) => {
|
|||||||
export const taskCommit = (data: Task.CommitReqProps) => {
|
export const taskCommit = (data: Task.CommitReqProps) => {
|
||||||
return httpFetch({
|
return httpFetch({
|
||||||
url: BASE_LABEL_API + "/api/v1/label_server/task/commit",
|
url: BASE_LABEL_API + "/api/v1/label_server/task/commit",
|
||||||
method: "post",
|
method: "POST",
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
@@ -85,7 +85,7 @@ export const taskCommit = (data: Task.CommitReqProps) => {
|
|||||||
export const getTaskWorkFlow = (id: number) => {
|
export const getTaskWorkFlow = (id: number) => {
|
||||||
return httpFetch<any[]>({
|
return httpFetch<any[]>({
|
||||||
url: BASE_LABEL_API + `/api/v1/label_server/task/workflow/${id}`,
|
url: BASE_LABEL_API + `/api/v1/label_server/task/workflow/${id}`,
|
||||||
method: "get",
|
method: "GET",
|
||||||
headerAttr: {
|
headerAttr: {
|
||||||
["Token"]: usePermissionStore.getState().token,
|
["Token"]: usePermissionStore.getState().token,
|
||||||
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
["Refresh-Token"]: usePermissionStore.getState().refresh_token,
|
||||||
|
|||||||
Reference in New Issue
Block a user