import { request } from './request'

const baseUri = ''
const controller = '/wx/data'
const pub = '/wx/public'
const dit = '/wx/dictController'

export function listBizAll(userId) {
    return request({
        url: baseUri + controller + '/listBizAll/' + userId,
        method: 'post'
    })
}

export function listProjectAll(data) {
    return request({
        url: baseUri + pub + '/listProjectAll',
        method: 'post',
        data
    })
}

export function getByCodes(data) {
    return request({
        url: baseUri + dit + '/getByCodes',
        method: 'post',
        data: data
    })
}

export function getDictData(code) {
    const postData = {
        codes: JSON.stringify(code)
    }
    return new Promise((resolve, reject) => {
        getByCodes(postData).then((res) => {
            resolve(res)
        }).catch((err, x) => {
            reject(err, x)
        })
    })
}

