import request from '@/utils/request';
import type { RequestResult } from "@/services/options/typings";
import type { PermissionProinstModel, ShopModel } from './data';
/**
 * @description: 获取门店列表
 * @param {any} params 查询关键字
 * @return {list} 数据列表
 */
export async function getMyShopList(params: any): Promise<ShopModel[]> {
    const data: RequestResult = await request('/BaseInfo/GetServerpartShopList', {
        method: 'POST',
        data: { SearchParameter: params,pageIndex: 1,pageSize:9999 }
    })

    if (data.Result_Code !== 100) {
        return  [];
    }
    return data?.Result_Data.List
}

// 提交账号申请单
export async function createPermissionProInst(permissionProinst: PermissionProinstModel) {
    return request(`/BusinessProcess/CreateMerchantApply`, {
        method: 'POST',
        data: permissionProinst,
        // requestType: 'form',
    });
}
// 注册账号
export async function registerPermissionProInst(permissionProinst: PermissionProinstModel) {
    return request(`/BusinessProcess/RegisterUserApply`, {
        method: 'POST',
        data: permissionProinst,
        // requestType: 'form',
    });
}

