123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- import { CRequest } from "./request"
- import Global from "@/common/global"
- const proxyApi = Global.getIsDev ? '/api' : '/question-api'
- /** /gamecontest/admin/bank */
- export async function getQuestionBank (options?: any) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/bank`, {
- method: "GET",
- ...options
- })
- }
- /** gamecontest/admin/card */
- export async function getQuestionCard (params: any, options?: any) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/card`, {
- method: "GET",
- params: params,
- ...options
- })
- }
- /** /gamecontest/admin/bank/add */
- export async function addQuestionBank (
- params: {
- bankName: string
- },
- options?: any
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/bank/add`, {
- method: "POST",
- params: params,
- ...options
- })
- }
- /** /gamecontest/admin/bank/add */
- export async function delQuestionBank (id: number | string) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/bank/${id}`, {
- method: "DELETE"
- })
- }
- /** gamecontest/admin/bank */
- export async function putQuestionBank (data: any) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/bank`, {
- data,
- method: "PUT"
- })
- }
- /** /gamecontest/admin/textbook */
- export async function getQuestionBook (
- params: { bankId: string | number}
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/textbook`, {
- params,
- method: "GET"
- })
- }
- /** /gamecontest/admin/textbook/addTextBook */
- export async function postQuestionBook (
- data: any
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/textbook/addTextBook`, {
- data,
- method: "POST"
- })
- }
- export async function putQuestionBook (
- id: string,
- params: {label: string}
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/textbook/${id}`, {
- params,
- method: "PUT"
- })
- }
- /**
- *
- * @description 启用或者停用题卡
- * @api /gamecontest/admin/card/{id}
- *
- */
- export async function useQuestionCard (
- id: string,
- params: {
- state: number
- }
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/card/${id}`, {
- params,
- method: "PUT"
- })
- }
- /**
- *
- * @description 删除题卡
- * @api /gamecontest/admin/card/{id}
- *
- */
- export async function delQuestionCard (
- id: string,
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/card/${id}`, {
- method: "DELETE"
- })
- }
- /**
- *
- * @description 新增题卡
- * @api /gamecontest/admin/card/{state}
- *
- */
- // {
- // "ableVar": "",
- // "bookId": "",
- // "content": [
- // {
- // "bg": "",
- // "cardId": "",
- // "color": "",
- // "createTime": "",
- // "h": 0,
- // "id": "",
- // "ih": 0,
- // "imgUrl": "",
- // "iw": 0,
- // "ix": 0,
- // "iy": 0,
- // "label": "",
- // "ph": 0,
- // "pw": 0,
- // "px": 0,
- // "py": 0,
- // "rotate": 0,
- // "roundOrArrow": "",
- // "updateTime": "",
- // "voiceUrl": "",
- // "w": 0,
- // "x": 0,
- // "y": 0
- // }
- // ],
- // "createTime": "",
- // "id": "",
- // "label": "",
- // "options": [
- // {
- // "cardId": "",
- // "color": "",
- // "createTime": "",
- // "id": "",
- // "ifTrue": true,
- // "imgUrl": "",
- // "label": "",
- // "myAnswer": "",
- // "updateTime": ""
- // }
- // ],
- // "rightOptionCount": 0,
- // "state": 0,
- // "takeTime": 0,
- // "title": "",
- // "totalOptionCount": 0,
- // "updateTime": "",
- // "voiceUrl": ""
- // }
- export async function addQuestionCard (
- state: 0 | 1,
- data: any
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/card/${state}`, {
- data,
- method: "POST"
- })
- }
- /**
- * 编辑题卡
- */
- export async function putQuestionCard (
- state: 0 | 1,
- data: any
- ) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/card/questionCard/${state}`, {
- data,
- method: "PUT"
- })
- }
- /**
- * @description 根据id 获取 题卡数据
- *
- */
- export async function getQuestionCardByid (cardId: string | number) {
- return CRequest<API.ResponseFormat>(`/gamecontest/admin/card/${cardId}`, {
- method: "GET"
- })
- }
|