|
@@ -0,0 +1,53 @@
|
|
|
|
|
+import {ApiResponse, ApiResponseList} from "@/types";
|
|
|
|
|
+import flyio from "../flyio";
|
|
|
|
|
+import {SelectedUniversityMajor} from "@/types/study";
|
|
|
|
|
+import {EnrollRule, VoluntaryRecord, VoluntaryResult} from "@/types/voluntary";
|
|
|
|
|
+
|
|
|
|
|
+export function getRenderRules(params: SelectedUniversityMajor) {
|
|
|
|
|
+ // 普通高中,EnrollRuleItem.readonly=true 取学考成绩
|
|
|
|
|
+ return flyio.post('/voluntary/getRenderRules', params) as Promise<ApiResponseList<EnrollRule>>
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function getSkillRules(params: SelectedUniversityMajor) {
|
|
|
|
|
+ // EnrollRule 需要返回文化+职业,但职业EnrollRule.details = []不需要返回字段规则
|
|
|
|
|
+ return flyio.post('/voluntary/getSkillRules', params) as Promise<ApiResponseList<EnrollRule>>
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function postRenderRules(target: SelectedCollegeMajor, model: Record<string, any>) {
|
|
|
|
|
+ return flyio.post('/voluntary/postRenderRules', {target, model}) as Promise<ApiResponse<VoluntaryResult>>
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function postSkillRules(target: SelectedUniversityMajor, model: Record<string, any>) {
|
|
|
|
|
+ // VoluntaryResult.histories 不需要返回
|
|
|
|
|
+ return flyio.post('/voluntary/postSkillRules', {target, model}) as Promise<ApiResponse<VoluntaryResult>>
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function getVoluntaryList(params) {
|
|
|
|
|
+ // 此接口不分页,全部返回
|
|
|
|
|
+ return flyio.get('/voluntary/getVoluntaryList') as Promise<ApiResponseList<VoluntaryRecord>>
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function addVoluntary(data: SelectedUniversityMajor) {
|
|
|
|
|
+ // 注意合并,数量限制(1个院校6个?确认一下),
|
|
|
|
|
+ return flyio.post('/voluntary/addVoluntary', data)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function removeVoluntaryByUniversity(universityId) {
|
|
|
|
|
+ // 删除院校下的所有 // SelectedUniversityMajor.universityId
|
|
|
|
|
+ return flyio.post('/voluntary/removeVoluntaryByUniversity/' + universityId)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function removeVoluntaryByMajor(majorId) {
|
|
|
|
|
+ // 删除指定专业,注意合并 // SelectedUniversityMajor.majorId
|
|
|
|
|
+ return flyio.post('/voluntary/removeVoluntaryByMajor/' + majorId)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function sortVoluntaryByMajor(universityId, majorIdList: []) {
|
|
|
|
|
+ // 按传入专业id顺序,保存专业排序优先级
|
|
|
|
|
+ return flyio.post('/voluntary/sortVoluntaryByMajor', {universityId, majorIdList})
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+export function sortVoluntaryByUniversity(universityIdList: []) {
|
|
|
|
|
+ // 按传入院校id顺序,保存排序优先级
|
|
|
|
|
+ return flyio.post('/voluntary/sortVoluntaryByUniversity', {universityIdList})
|
|
|
|
|
+}
|