整理商品管理模块

This commit is contained in:
2024-07-25 19:20:53 +08:00
parent 717c89a58e
commit cf0961afdd
48 changed files with 1814 additions and 965 deletions
+8 -8
View File
@@ -1,14 +1,14 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type { MerchantApply, MerchantApplyParam } from './model';
import { SERVER_API_URL } from '@/config/setting';
import { MODULES_API_URL } from '@/config/setting';
/**
* 分页查询商户入驻申请
*/
export async function pageMerchantApply(params: MerchantApplyParam) {
const res = await request.get<ApiResult<PageResult<MerchantApply>>>(
SERVER_API_URL + '/system/merchant-apply/page',
MODULES_API_URL + '/shop/merchant-apply/page',
{
params
}
@@ -24,7 +24,7 @@ export async function pageMerchantApply(params: MerchantApplyParam) {
*/
export async function listMerchantApply(params?: MerchantApplyParam) {
const res = await request.get<ApiResult<MerchantApply[]>>(
SERVER_API_URL + '/system/merchant-apply',
MODULES_API_URL + '/shop/merchant-apply',
{
params
}
@@ -40,7 +40,7 @@ export async function listMerchantApply(params?: MerchantApplyParam) {
*/
export async function addMerchantApply(data: MerchantApply) {
const res = await request.post<ApiResult<unknown>>(
SERVER_API_URL + '/system/merchant-apply',
MODULES_API_URL + '/shop/merchant-apply',
data
);
if (res.data.code === 0) {
@@ -54,7 +54,7 @@ export async function addMerchantApply(data: MerchantApply) {
*/
export async function updateMerchantApply(data: MerchantApply) {
const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/system/merchant-apply',
MODULES_API_URL + '/shop/merchant-apply',
data
);
if (res.data.code === 0) {
@@ -68,7 +68,7 @@ export async function updateMerchantApply(data: MerchantApply) {
*/
export async function removeMerchantApply(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
SERVER_API_URL + '/system/merchant-apply/' + id
MODULES_API_URL + '/shop/merchant-apply/' + id
);
if (res.data.code === 0) {
return res.data.message;
@@ -81,7 +81,7 @@ export async function removeMerchantApply(id?: number) {
*/
export async function removeBatchMerchantApply(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
SERVER_API_URL + '/system/merchant-apply/batch',
MODULES_API_URL + '/shop/merchant-apply/batch',
{
data
}
@@ -97,7 +97,7 @@ export async function removeBatchMerchantApply(data: (number | undefined)[]) {
*/
export async function getMerchantApply(id: number) {
const res = await request.get<ApiResult<MerchantApply>>(
SERVER_API_URL + '/system/merchant-apply/' + id
MODULES_API_URL + '/shop/merchant-apply/' + id
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;