123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- import { defineStore } from 'pinia'
- import { AxiosWrapper } from '@/utils/axios-wrapper'
- import { get } from 'lodash-es'
- const url = '/matchExt'
- const axios = new AxiosWrapper()
- export const MatchExtStore = defineStore('matchExt', () => {
- const query = async ({ skip = 0, limit = undefined, ...info } = {}) => {
- let cond = {}
- if (skip) cond.skip = skip
- if (limit) cond.limit = limit
- cond = { ...cond, ...info }
- const res = await axios.$get(`${url}`, cond)
- return res
- }
- const fetch = async (payload) => {
- const res = await axios.$get(`${url}/${payload}`)
- return res
- }
- const create = async (payload) => {
- const res = await axios.$post(`${url}`, payload)
- return res
- }
- const update = async (payload) => {
- const id = get(payload, 'id', get(payload, '_id'))
- const res = await axios.$post(`${url}/${id}`, payload)
- return res
- }
- const del = async (payload) => {
- const res = await axios.$delete(`${url}/${payload}`)
- return res
- }
- const firstStep = async (payload) => {
- const id = get(payload, 'id', get(payload, '_id'))
- const res = await axios.$post(`${url}/firstStep/${id}`, payload)
- return res
- }
- const step1 = async (payload) => {
- const res = await axios.$post(`${url}/step1`, payload)
- return res
- }
- const step2 = async (payload) => {
- const res = await axios.$post(`${url}/step2`, payload)
- return res
- }
- const stepFill = async (payload) => {
- const res = await axios.$post(`${url}/step2/fill`, payload)
- return res
- }
- const step3 = async (payload) => {
- const res = await axios.$post(`${url}/step3`, payload)
- return res
- }
- const step4 = async (payload) => {
- const res = await axios.$post(`${url}/step4`, payload)
- return res
- }
- const step4Score = async (payload) => {
- const id = get(payload, 'id', get(payload, '_id'))
- const res = await axios.$post(`${url}/step4/score/${id}`, payload)
- return res
- }
- const step4To5 = async (payload) => {
- const id = get(payload, 'id', get(payload, '_id'))
- const res = await axios.$post(`${url}/step4/to5/${id}`, payload)
- return res
- }
- const step5 = async (payload) => {
- const res = await axios.$post(`${url}/step5`, payload)
- return res
- }
- const step5Time = async (payload) => {
- const id = get(payload, 'id', get(payload, '_id'))
- const res = await axios.$post(`${url}/step5/time/${id}`, payload)
- return res
- }
- const step5Sms = async (payload) => {
- const res = await axios.$get(`${url}/step5/sms/${payload}`)
- return res
- }
- const step5Sup = async (payload) => {
- const id = get(payload, 'id', get(payload, '_id'))
- const res = await axios.$post(`${url}/step5/supplement/${id}`, payload)
- return res
- }
- const step5Order = async (payload) => {
- const id = get(payload, 'match_id', get(payload, 'match_id'))
- const res = await axios.$post(`${url}/step5/order/${id}`, payload)
- return res
- }
- const step6 = async (payload) => {
- const res = await axios.$post(`${url}/step6`, payload)
- return res
- }
- const step7 = async (payload) => {
- const res = await axios.$post(`${url}/step7`, payload)
- return res
- }
- const step8 = async (payload) => {
- const res = await axios.$post(`${url}/step8`, payload)
- return res
- }
- return {
- query,
- fetch,
- create,
- update,
- firstStep,
- step1,
- step2,
- stepFill,
- step3,
- step4,
- step4Score,
- step4To5,
- step5,
- step5Time,
- step5Sms,
- step5Sup,
- step5Order,
- step6,
- step7,
- step8,
- del
- }
- })
|