Initial commit
This commit is contained in:
106
src/api/shop/brand/index.ts
Normal file
106
src/api/shop/brand/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Brand, BrandParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询品牌
|
||||
*/
|
||||
export async function pageBrand(params: BrandParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Brand>>>(
|
||||
MODULES_API_URL + '/shop/brand/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询品牌列表
|
||||
*/
|
||||
export async function listBrand(params?: BrandParam) {
|
||||
const res = await request.get<ApiResult<Brand[]>>(
|
||||
MODULES_API_URL + '/shop/brand',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加品牌
|
||||
*/
|
||||
export async function addBrand(data: Brand) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/brand',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改品牌
|
||||
*/
|
||||
export async function updateBrand(data: Brand) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/brand',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除品牌
|
||||
*/
|
||||
export async function removeBrand(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/brand/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除品牌
|
||||
*/
|
||||
export async function removeBatchBrand(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/brand/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询品牌
|
||||
*/
|
||||
export async function getBrand(id: number) {
|
||||
const res = await request.get<ApiResult<Brand>>(
|
||||
MODULES_API_URL + '/shop/brand/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/brand/model/index.ts
Normal file
31
src/api/shop/brand/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 品牌
|
||||
*/
|
||||
export interface Brand {
|
||||
// ID
|
||||
brandId?: number;
|
||||
// 品牌名称
|
||||
brandName?: string;
|
||||
// 图标
|
||||
image?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌搜索条件
|
||||
*/
|
||||
export interface BrandParam extends PageParam {
|
||||
brandId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goods/index.ts
Normal file
106
src/api/shop/goods/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Goods, GoodsParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品记录表
|
||||
*/
|
||||
export async function pageGoods(params: GoodsParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Goods>>>(
|
||||
MODULES_API_URL + '/shop/goods/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品记录表列表
|
||||
*/
|
||||
export async function listGoods(params?: GoodsParam) {
|
||||
const res = await request.get<ApiResult<Goods[]>>(
|
||||
MODULES_API_URL + '/shop/goods',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品记录表
|
||||
*/
|
||||
export async function addGoods(data: Goods) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品记录表
|
||||
*/
|
||||
export async function updateGoods(data: Goods) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品记录表
|
||||
*/
|
||||
export async function removeGoods(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品记录表
|
||||
*/
|
||||
export async function removeBatchGoods(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品记录表
|
||||
*/
|
||||
export async function getGoods(id: number) {
|
||||
const res = await request.get<ApiResult<Goods>>(
|
||||
MODULES_API_URL + '/shop/goods/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
84
src/api/shop/goods/model/index.ts
Normal file
84
src/api/shop/goods/model/index.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { GoodsSpec } from '@/api/shop/goodsSpec/model';
|
||||
import { GoodsSku } from '@/api/shop/goodsSku/model';
|
||||
|
||||
/**
|
||||
* 商品记录表
|
||||
*/
|
||||
export interface Goods {
|
||||
// 自增ID
|
||||
goodsId?: number;
|
||||
// 类型 1实物商品 2虚拟商品
|
||||
type?: number;
|
||||
// 商品编码
|
||||
code?: string;
|
||||
// 商品标题
|
||||
title?: string;
|
||||
// 商品封面图
|
||||
image?: string;
|
||||
// 商品详情
|
||||
content?: string;
|
||||
// 商品附件
|
||||
files?: string;
|
||||
// 分类ID
|
||||
categoryId?: number;
|
||||
categoryParent?: string;
|
||||
categoryChildren?: string;
|
||||
// 分类名称
|
||||
categoryName?: string;
|
||||
// 规格
|
||||
specs?: number;
|
||||
// 货架
|
||||
position?: string;
|
||||
// 进货价格
|
||||
price?: number;
|
||||
// 销售价格
|
||||
salePrice?: string;
|
||||
// 销量
|
||||
sales?: number;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// 商品重量
|
||||
goodsWeight?: number;
|
||||
// 库存计算方式
|
||||
deductStockType?: number;
|
||||
// 推荐
|
||||
recommend?: number;
|
||||
// 状态, 0正常, 1待修,2异常已修,3异常未修
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 所有人
|
||||
userId?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
// 商品规格
|
||||
goodsSpecs?: GoodsSpec[];
|
||||
// 商品sku列表
|
||||
goodsSkus?: GoodsSku[];
|
||||
}
|
||||
|
||||
export interface BathSet {
|
||||
price?: number;
|
||||
salePrice?: number;
|
||||
stock?: number;
|
||||
skuNo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品记录表搜索条件
|
||||
*/
|
||||
export interface GoodsParam extends PageParam {
|
||||
goodsId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsAttr/index.ts
Normal file
106
src/api/shop/goodsAttr/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsAttr, GoodsAttrParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品属性表
|
||||
*/
|
||||
export async function pageGoodsAttr(params: GoodsAttrParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsAttr>>>(
|
||||
MODULES_API_URL + '/shop/goods-attr/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品属性表列表
|
||||
*/
|
||||
export async function listGoodsAttr(params?: GoodsAttrParam) {
|
||||
const res = await request.get<ApiResult<GoodsAttr[]>>(
|
||||
MODULES_API_URL + '/shop/goods-attr',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品属性表
|
||||
*/
|
||||
export async function addGoodsAttr(data: GoodsAttr) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品属性表
|
||||
*/
|
||||
export async function updateGoodsAttr(data: GoodsAttr) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品属性表
|
||||
*/
|
||||
export async function removeGoodsAttr(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品属性表
|
||||
*/
|
||||
export async function removeBatchGoodsAttr(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品属性表
|
||||
*/
|
||||
export async function getGoodsAttr(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsAttr>>(
|
||||
MODULES_API_URL + '/shop/goods-attr/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/shop/goodsAttr/model/index.ts
Normal file
29
src/api/shop/goodsAttr/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品属性表
|
||||
*/
|
||||
export interface GoodsAttr {
|
||||
// 主键
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 属性名
|
||||
attrName?: string;
|
||||
// 属性值
|
||||
attrValues?: string;
|
||||
// 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
|
||||
type?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品属性表搜索条件
|
||||
*/
|
||||
export interface GoodsAttrParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsAttrResult/index.ts
Normal file
106
src/api/shop/goodsAttrResult/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsAttrResult, GoodsAttrResultParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品属性详情表
|
||||
*/
|
||||
export async function pageGoodsAttrResult(params: GoodsAttrResultParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsAttrResult>>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-result/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品属性详情表列表
|
||||
*/
|
||||
export async function listGoodsAttrResult(params?: GoodsAttrResultParam) {
|
||||
const res = await request.get<ApiResult<GoodsAttrResult[]>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-result',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品属性详情表
|
||||
*/
|
||||
export async function addGoodsAttrResult(data: GoodsAttrResult) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-result',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品属性详情表
|
||||
*/
|
||||
export async function updateGoodsAttrResult(data: GoodsAttrResult) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-result',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品属性详情表
|
||||
*/
|
||||
export async function removeGoodsAttrResult(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-result/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品属性详情表
|
||||
*/
|
||||
export async function removeBatchGoodsAttrResult(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-result/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品属性详情表
|
||||
*/
|
||||
export async function getGoodsAttrResult(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsAttrResult>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-result/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
27
src/api/shop/goodsAttrResult/model/index.ts
Normal file
27
src/api/shop/goodsAttrResult/model/index.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品属性详情表
|
||||
*/
|
||||
export interface GoodsAttrResult {
|
||||
// 主键
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 商品属性参数
|
||||
result?: string;
|
||||
// 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
|
||||
type?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品属性详情表搜索条件
|
||||
*/
|
||||
export interface GoodsAttrResultParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsAttrValue/index.ts
Normal file
106
src/api/shop/goodsAttrValue/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsAttrValue, GoodsAttrValueParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品属性值表
|
||||
*/
|
||||
export async function pageGoodsAttrValue(params: GoodsAttrValueParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsAttrValue>>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-value/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品属性值表列表
|
||||
*/
|
||||
export async function listGoodsAttrValue(params?: GoodsAttrValueParam) {
|
||||
const res = await request.get<ApiResult<GoodsAttrValue[]>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-value',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品属性值表
|
||||
*/
|
||||
export async function addGoodsAttrValue(data: GoodsAttrValue) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品属性值表
|
||||
*/
|
||||
export async function updateGoodsAttrValue(data: GoodsAttrValue) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品属性值表
|
||||
*/
|
||||
export async function removeGoodsAttrValue(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-value/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品属性值表
|
||||
*/
|
||||
export async function removeBatchGoodsAttrValue(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-value/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品属性值表
|
||||
*/
|
||||
export async function getGoodsAttrValue(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsAttrValue>>(
|
||||
MODULES_API_URL + '/shop/goods-attr-value/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
59
src/api/shop/goodsAttrValue/model/index.ts
Normal file
59
src/api/shop/goodsAttrValue/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品属性值表
|
||||
*/
|
||||
export interface GoodsAttrValue {
|
||||
// 主键
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 商品属性索引值 (attr_value|attr_value[|....])
|
||||
suk?: string;
|
||||
// 属性对应的库存
|
||||
stock?: number;
|
||||
// 销量
|
||||
sales?: number;
|
||||
// 属性金额
|
||||
price?: string;
|
||||
// 图片
|
||||
image?: string;
|
||||
// 唯一值
|
||||
unique?: string;
|
||||
// 成本价
|
||||
cost?: string;
|
||||
// 商品条码
|
||||
barCode?: string;
|
||||
// 原价
|
||||
otPrice?: string;
|
||||
// 重量
|
||||
weight?: string;
|
||||
// 体积
|
||||
volume?: string;
|
||||
// 一级返佣
|
||||
brokerage?: string;
|
||||
// 二级返佣
|
||||
brokerageTwo?: string;
|
||||
// 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
|
||||
type?: string;
|
||||
// 活动限购数量
|
||||
quota?: number;
|
||||
// 活动限购数量显示
|
||||
quotaShow?: number;
|
||||
// attr_values 创建更新时的属性对应
|
||||
attrValue?: string;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品属性值表搜索条件
|
||||
*/
|
||||
export interface GoodsAttrValueParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsCategory/index.ts
Normal file
106
src/api/shop/goodsCategory/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsCategory, GoodsCategoryParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品分类
|
||||
*/
|
||||
export async function pageGoodsCategory(params: GoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsCategory>>>(
|
||||
MODULES_API_URL + '/shop/goods-category/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品分类列表
|
||||
*/
|
||||
export async function listGoodsCategory(params?: GoodsCategoryParam) {
|
||||
const res = await request.get<ApiResult<GoodsCategory[]>>(
|
||||
MODULES_API_URL + '/shop/goods-category',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品分类
|
||||
*/
|
||||
export async function addGoodsCategory(data: GoodsCategory) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*/
|
||||
export async function updateGoodsCategory(data: GoodsCategory) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-category',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类
|
||||
*/
|
||||
export async function removeGoodsCategory(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-category/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品分类
|
||||
*/
|
||||
export async function removeBatchGoodsCategory(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-category/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品分类
|
||||
*/
|
||||
export async function getGoodsCategory(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsCategory>>(
|
||||
MODULES_API_URL + '/shop/goods-category/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
63
src/api/shop/goodsCategory/model/index.ts
Normal file
63
src/api/shop/goodsCategory/model/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品分类
|
||||
*/
|
||||
export interface GoodsCategory {
|
||||
// 商品分类ID
|
||||
categoryId?: number;
|
||||
// 分类标识
|
||||
categoryCode?: string;
|
||||
// 分类名称
|
||||
title?: string;
|
||||
// 类型 0列表 1单页 2外链
|
||||
type?: number;
|
||||
// 分类图片
|
||||
image?: string;
|
||||
// 上级分类ID
|
||||
parentId?: number;
|
||||
// 路由/链接地址
|
||||
path?: string;
|
||||
// 组件路径
|
||||
component?: string;
|
||||
// 绑定的页面
|
||||
pageId?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品数量
|
||||
count?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)
|
||||
hide?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否显示在首页
|
||||
showIndex?: number;
|
||||
// 状态, 0正常, 1禁用
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
disabled?: boolean;
|
||||
key?: number;
|
||||
value?: number;
|
||||
label?: string;
|
||||
// 子菜单
|
||||
children?: GoodsCategory[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品分类搜索条件
|
||||
*/
|
||||
export interface GoodsCategoryParam extends PageParam {
|
||||
categoryId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsComment/index.ts
Normal file
106
src/api/shop/goodsComment/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsComment, GoodsCommentParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询评论表
|
||||
*/
|
||||
export async function pageGoodsComment(params: GoodsCommentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsComment>>>(
|
||||
MODULES_API_URL + '/shop/goods-comment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询评论表列表
|
||||
*/
|
||||
export async function listGoodsComment(params?: GoodsCommentParam) {
|
||||
const res = await request.get<ApiResult<GoodsComment[]>>(
|
||||
MODULES_API_URL + '/shop/goods-comment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加评论表
|
||||
*/
|
||||
export async function addGoodsComment(data: GoodsComment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改评论表
|
||||
*/
|
||||
export async function updateGoodsComment(data: GoodsComment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-comment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除评论表
|
||||
*/
|
||||
export async function removeGoodsComment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除评论表
|
||||
*/
|
||||
export async function removeBatchGoodsComment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-comment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询评论表
|
||||
*/
|
||||
export async function getGoodsComment(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsComment>>(
|
||||
MODULES_API_URL + '/shop/goods-comment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
61
src/api/shop/goodsComment/model/index.ts
Normal file
61
src/api/shop/goodsComment/model/index.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 评论表
|
||||
*/
|
||||
export interface GoodsComment {
|
||||
// 评论ID
|
||||
id?: number;
|
||||
// 用户ID
|
||||
uid?: number;
|
||||
// 订单ID
|
||||
oid?: number;
|
||||
// 商品唯一id
|
||||
unique?: string;
|
||||
// 商品id
|
||||
goodsId?: number;
|
||||
// 某种商品类型(普通商品、秒杀商品)
|
||||
replyType?: string;
|
||||
// 商品分数
|
||||
goodsScore?: string;
|
||||
// 服务分数
|
||||
serviceScore?: string;
|
||||
// 评论内容
|
||||
comment?: string;
|
||||
// 评论图片
|
||||
pics?: string;
|
||||
// 管理员回复内容
|
||||
merchantReplyContent?: string;
|
||||
// 管理员回复时间
|
||||
merchantReplyTime?: number;
|
||||
// 0未删除1已删除
|
||||
isDel?: string;
|
||||
// 0未回复1已回复
|
||||
isReply?: string;
|
||||
// 用户名称
|
||||
nickname?: string;
|
||||
// 用户头像
|
||||
avatar?: string;
|
||||
// 商品规格属性值,多个,号隔开
|
||||
sku?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论表搜索条件
|
||||
*/
|
||||
export interface GoodsCommentParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsCoupon/index.ts
Normal file
106
src/api/shop/goodsCoupon/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsCoupon, GoodsCouponParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品优惠券表
|
||||
*/
|
||||
export async function pageGoodsCoupon(params: GoodsCouponParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsCoupon>>>(
|
||||
MODULES_API_URL + '/shop/goods-coupon/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品优惠券表列表
|
||||
*/
|
||||
export async function listGoodsCoupon(params?: GoodsCouponParam) {
|
||||
const res = await request.get<ApiResult<GoodsCoupon[]>>(
|
||||
MODULES_API_URL + '/shop/goods-coupon',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品优惠券表
|
||||
*/
|
||||
export async function addGoodsCoupon(data: GoodsCoupon) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品优惠券表
|
||||
*/
|
||||
export async function updateGoodsCoupon(data: GoodsCoupon) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-coupon',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品优惠券表
|
||||
*/
|
||||
export async function removeGoodsCoupon(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品优惠券表
|
||||
*/
|
||||
export async function removeBatchGoodsCoupon(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-coupon/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品优惠券表
|
||||
*/
|
||||
export async function getGoodsCoupon(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsCoupon>>(
|
||||
MODULES_API_URL + '/shop/goods-coupon/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
35
src/api/shop/goodsCoupon/model/index.ts
Normal file
35
src/api/shop/goodsCoupon/model/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品优惠券表
|
||||
*/
|
||||
export interface GoodsCoupon {
|
||||
//
|
||||
id?: number;
|
||||
// 商品id
|
||||
goodsId?: number;
|
||||
// 优惠劵id
|
||||
issueCouponId?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品优惠券表搜索条件
|
||||
*/
|
||||
export interface GoodsCouponParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsDescription/index.ts
Normal file
106
src/api/shop/goodsDescription/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsDescription, GoodsDescriptionParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品描述表
|
||||
*/
|
||||
export async function pageGoodsDescription(params: GoodsDescriptionParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsDescription>>>(
|
||||
MODULES_API_URL + '/shop/goods-description/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品描述表列表
|
||||
*/
|
||||
export async function listGoodsDescription(params?: GoodsDescriptionParam) {
|
||||
const res = await request.get<ApiResult<GoodsDescription[]>>(
|
||||
MODULES_API_URL + '/shop/goods-description',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品描述表
|
||||
*/
|
||||
export async function addGoodsDescription(data: GoodsDescription) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-description',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品描述表
|
||||
*/
|
||||
export async function updateGoodsDescription(data: GoodsDescription) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-description',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品描述表
|
||||
*/
|
||||
export async function removeGoodsDescription(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-description/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品描述表
|
||||
*/
|
||||
export async function removeBatchGoodsDescription(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-description/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品描述表
|
||||
*/
|
||||
export async function getGoodsDescription(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsDescription>>(
|
||||
MODULES_API_URL + '/shop/goods-description/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
src/api/shop/goodsDescription/model/index.ts
Normal file
25
src/api/shop/goodsDescription/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品描述表
|
||||
*/
|
||||
export interface GoodsDescription {
|
||||
//
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 商品详情
|
||||
description?: string;
|
||||
// 商品类型
|
||||
type?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品描述表搜索条件
|
||||
*/
|
||||
export interface GoodsDescriptionParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsLog/index.ts
Normal file
106
src/api/shop/goodsLog/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsLog, GoodsLogParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品日志表
|
||||
*/
|
||||
export async function pageGoodsLog(params: GoodsLogParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsLog>>>(
|
||||
MODULES_API_URL + '/shop/goods-log/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品日志表列表
|
||||
*/
|
||||
export async function listGoodsLog(params?: GoodsLogParam) {
|
||||
const res = await request.get<ApiResult<GoodsLog[]>>(
|
||||
MODULES_API_URL + '/shop/goods-log',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品日志表
|
||||
*/
|
||||
export async function addGoodsLog(data: GoodsLog) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品日志表
|
||||
*/
|
||||
export async function updateGoodsLog(data: GoodsLog) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-log',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品日志表
|
||||
*/
|
||||
export async function removeGoodsLog(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-log/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品日志表
|
||||
*/
|
||||
export async function removeBatchGoodsLog(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-log/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品日志表
|
||||
*/
|
||||
export async function getGoodsLog(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsLog>>(
|
||||
MODULES_API_URL + '/shop/goods-log/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
53
src/api/shop/goodsLog/model/index.ts
Normal file
53
src/api/shop/goodsLog/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品日志表
|
||||
*/
|
||||
export interface GoodsLog {
|
||||
// 统计ID
|
||||
id?: number;
|
||||
// 类型visit,cart,order,pay,collect,refund
|
||||
type?: string;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 是否浏览
|
||||
visitNum?: string;
|
||||
// 加入购物车数量
|
||||
cartNum?: number;
|
||||
// 下单数量
|
||||
orderNum?: number;
|
||||
// 支付数量
|
||||
payNum?: number;
|
||||
// 支付金额
|
||||
payPrice?: string;
|
||||
// 商品成本价
|
||||
costPrice?: string;
|
||||
// 支付用户ID
|
||||
payUid?: number;
|
||||
// 退款数量
|
||||
refundNum?: number;
|
||||
// 退款金额
|
||||
refundPrice?: string;
|
||||
// 收藏
|
||||
collectNum?: string;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 注册时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品日志表搜索条件
|
||||
*/
|
||||
export interface GoodsLogParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsRelation/index.ts
Normal file
106
src/api/shop/goodsRelation/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsRelation, GoodsRelationParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品点赞和收藏表
|
||||
*/
|
||||
export async function pageGoodsRelation(params: GoodsRelationParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsRelation>>>(
|
||||
MODULES_API_URL + '/shop/goods-relation/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品点赞和收藏表列表
|
||||
*/
|
||||
export async function listGoodsRelation(params?: GoodsRelationParam) {
|
||||
const res = await request.get<ApiResult<GoodsRelation[]>>(
|
||||
MODULES_API_URL + '/shop/goods-relation',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品点赞和收藏表
|
||||
*/
|
||||
export async function addGoodsRelation(data: GoodsRelation) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-relation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品点赞和收藏表
|
||||
*/
|
||||
export async function updateGoodsRelation(data: GoodsRelation) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-relation',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品点赞和收藏表
|
||||
*/
|
||||
export async function removeGoodsRelation(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-relation/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品点赞和收藏表
|
||||
*/
|
||||
export async function removeBatchGoodsRelation(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-relation/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品点赞和收藏表
|
||||
*/
|
||||
export async function getGoodsRelation(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsRelation>>(
|
||||
MODULES_API_URL + '/shop/goods-relation/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/goodsRelation/model/index.ts
Normal file
31
src/api/shop/goodsRelation/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品点赞和收藏表
|
||||
*/
|
||||
export interface GoodsRelation {
|
||||
// id
|
||||
id?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 类型(收藏(collect)、点赞(like))
|
||||
type?: string;
|
||||
// 某种类型的商品(普通商品、秒杀商品)
|
||||
category?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 更新时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品点赞和收藏表搜索条件
|
||||
*/
|
||||
export interface GoodsRelationParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsRule/index.ts
Normal file
106
src/api/shop/goodsRule/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsRule, GoodsRuleParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品规则值(规格)表
|
||||
*/
|
||||
export async function pageGoodsRule(params: GoodsRuleParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsRule>>>(
|
||||
MODULES_API_URL + '/shop/goods-rule/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品规则值(规格)表列表
|
||||
*/
|
||||
export async function listGoodsRule(params?: GoodsRuleParam) {
|
||||
const res = await request.get<ApiResult<GoodsRule[]>>(
|
||||
MODULES_API_URL + '/shop/goods-rule',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品规则值(规格)表
|
||||
*/
|
||||
export async function addGoodsRule(data: GoodsRule) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-rule',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规则值(规格)表
|
||||
*/
|
||||
export async function updateGoodsRule(data: GoodsRule) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-rule',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规则值(规格)表
|
||||
*/
|
||||
export async function removeGoodsRule(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-rule/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品规则值(规格)表
|
||||
*/
|
||||
export async function removeBatchGoodsRule(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-rule/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品规则值(规格)表
|
||||
*/
|
||||
export async function getGoodsRule(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsRule>>(
|
||||
MODULES_API_URL + '/shop/goods-rule/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
23
src/api/shop/goodsRule/model/index.ts
Normal file
23
src/api/shop/goodsRule/model/index.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品规则值(规格)表
|
||||
*/
|
||||
export interface GoodsRule {
|
||||
//
|
||||
id?: number;
|
||||
// 规格名称
|
||||
ruleName?: string;
|
||||
// 规格值
|
||||
ruleValue?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规则值(规格)表搜索条件
|
||||
*/
|
||||
export interface GoodsRuleParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsSku/index.ts
Normal file
106
src/api/shop/goodsSku/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsSku, GoodsSkuParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品sku列表
|
||||
*/
|
||||
export async function pageGoodsSku(params: GoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsSku>>>(
|
||||
MODULES_API_URL + '/shop/goods-sku/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品sku列表列表
|
||||
*/
|
||||
export async function listGoodsSku(params?: GoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<GoodsSku[]>>(
|
||||
MODULES_API_URL + '/shop/goods-sku',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品sku列表
|
||||
*/
|
||||
export async function addGoodsSku(data: GoodsSku) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品sku列表
|
||||
*/
|
||||
export async function updateGoodsSku(data: GoodsSku) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-sku',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品sku列表
|
||||
*/
|
||||
export async function removeGoodsSku(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-sku/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品sku列表
|
||||
*/
|
||||
export async function removeBatchGoodsSku(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-sku/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品sku列表
|
||||
*/
|
||||
export async function getGoodsSku(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsSku>>(
|
||||
MODULES_API_URL + '/shop/goods-sku/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
47
src/api/shop/goodsSku/model/index.ts
Normal file
47
src/api/shop/goodsSku/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品sku列表
|
||||
*/
|
||||
export interface GoodsSku {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 规格组ID
|
||||
specId?: number;
|
||||
// 规格值ID
|
||||
specValueId?: number;
|
||||
// 规格值0
|
||||
specValue0?: string;
|
||||
// 规格值1
|
||||
specValue1?: string;
|
||||
// 规格值2
|
||||
specValue2?: string;
|
||||
// 商品图片
|
||||
image?: string;
|
||||
// 商品价格
|
||||
price?: string;
|
||||
// 市场价格
|
||||
salePrice?: string;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// sku编码
|
||||
skuNo?: string;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品sku列表搜索条件
|
||||
*/
|
||||
export interface GoodsSkuParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsSpec/index.ts
Normal file
106
src/api/shop/goodsSpec/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsSpec, GoodsSpecParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品多规格
|
||||
*/
|
||||
export async function pageGoodsSpec(params: GoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsSpec>>>(
|
||||
MODULES_API_URL + '/shop/goods-spec/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品多规格列表
|
||||
*/
|
||||
export async function listGoodsSpec(params?: GoodsSpecParam) {
|
||||
const res = await request.get<ApiResult<GoodsSpec[]>>(
|
||||
MODULES_API_URL + '/shop/goods-spec',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品多规格
|
||||
*/
|
||||
export async function addGoodsSpec(data: GoodsSpec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品多规格
|
||||
*/
|
||||
export async function updateGoodsSpec(data: GoodsSpec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品多规格
|
||||
*/
|
||||
export async function removeGoodsSpec(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品多规格
|
||||
*/
|
||||
export async function removeBatchGoodsSpec(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品多规格
|
||||
*/
|
||||
export async function getGoodsSpec(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsSpec>>(
|
||||
MODULES_API_URL + '/shop/goods-spec/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
30
src/api/shop/goodsSpec/model/index.ts
Normal file
30
src/api/shop/goodsSpec/model/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品多规格
|
||||
*/
|
||||
export interface GoodsSpec {
|
||||
// 主键
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 规格ID
|
||||
specId?: number;
|
||||
// 规格名称
|
||||
specName?: string;
|
||||
// 规格值
|
||||
valueList?: any[];
|
||||
specValues?: string;
|
||||
// 活动类型 0=商品,1=秒杀,2=砍价,3=拼团
|
||||
type?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品多规格搜索条件
|
||||
*/
|
||||
export interface GoodsSpecParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/goodsSpecRel/index.ts
Normal file
106
src/api/shop/goodsSpecRel/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { GoodsSpecRel, GoodsSpecRelParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品规格值
|
||||
*/
|
||||
export async function pageGoodsSpecRel(params: GoodsSpecRelParam) {
|
||||
const res = await request.get<ApiResult<PageResult<GoodsSpecRel>>>(
|
||||
MODULES_API_URL + '/shop/goods-spec-rel/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品规格值列表
|
||||
*/
|
||||
export async function listGoodsSpecRel(params?: GoodsSpecRelParam) {
|
||||
const res = await request.get<ApiResult<GoodsSpecRel[]>>(
|
||||
MODULES_API_URL + '/shop/goods-spec-rel',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品规格值
|
||||
*/
|
||||
export async function addGoodsSpecRel(data: GoodsSpecRel) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec-rel',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规格值
|
||||
*/
|
||||
export async function updateGoodsSpecRel(data: GoodsSpecRel) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec-rel',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格值
|
||||
*/
|
||||
export async function removeGoodsSpecRel(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec-rel/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品规格值
|
||||
*/
|
||||
export async function removeBatchGoodsSpecRel(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/goods-spec-rel/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品规格值
|
||||
*/
|
||||
export async function getGoodsSpecRel(id: number) {
|
||||
const res = await request.get<ApiResult<GoodsSpecRel>>(
|
||||
MODULES_API_URL + '/shop/goods-spec-rel/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
25
src/api/shop/goodsSpecRel/model/index.ts
Normal file
25
src/api/shop/goodsSpecRel/model/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品规格值
|
||||
*/
|
||||
export interface GoodsSpecRel {
|
||||
// 主键
|
||||
id?: number;
|
||||
// 规格ID
|
||||
specId?: number;
|
||||
// 规格值ID
|
||||
specValueId?: number;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格值搜索条件
|
||||
*/
|
||||
export interface GoodsSpecRelParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/merchant/index.ts
Normal file
106
src/api/shop/merchant/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Merchant, MerchantParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户
|
||||
*/
|
||||
export async function pageMerchant(params: MerchantParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Merchant>>>(
|
||||
MODULES_API_URL + '/shop/merchant/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户列表
|
||||
*/
|
||||
export async function listMerchant(params?: MerchantParam) {
|
||||
const res = await request.get<ApiResult<Merchant[]>>(
|
||||
MODULES_API_URL + '/shop/merchant',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户
|
||||
*/
|
||||
export async function addMerchant(data: Merchant) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户
|
||||
*/
|
||||
export async function updateMerchant(data: Merchant) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户
|
||||
*/
|
||||
export async function removeMerchant(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户
|
||||
*/
|
||||
export async function removeBatchMerchant(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户
|
||||
*/
|
||||
export async function getMerchant(id: number) {
|
||||
const res = await request.get<ApiResult<Merchant>>(
|
||||
MODULES_API_URL + '/shop/merchant/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
66
src/api/shop/merchant/model/index.ts
Normal file
66
src/api/shop/merchant/model/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商户
|
||||
*/
|
||||
export interface Merchant {
|
||||
// ID
|
||||
merchantId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户图标
|
||||
image?: string;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 商户姓名
|
||||
realName?: string;
|
||||
// 店铺类型
|
||||
shopType?: string;
|
||||
// 商户分类
|
||||
category?: string;
|
||||
// 商户坐标
|
||||
lngAndLat?: string;
|
||||
// 省
|
||||
province?: string;
|
||||
// 市
|
||||
city?: string;
|
||||
// 区
|
||||
region?: string;
|
||||
// 地址
|
||||
address?: string;
|
||||
// 手续费
|
||||
commission?: number;
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 资质图片
|
||||
files?: string;
|
||||
// 是否自营
|
||||
ownStore?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否需要审核
|
||||
goodsReview?: number;
|
||||
// 管理入口
|
||||
adminUrl?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 默认商户管理角色ID
|
||||
roleId?: number;
|
||||
roleName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户搜索条件
|
||||
*/
|
||||
export interface MerchantParam extends PageParam {
|
||||
merchantId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/merchantAccount/index.ts
Normal file
106
src/api/shop/merchantAccount/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantAccount, MerchantAccountParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户账号
|
||||
*/
|
||||
export async function pageMerchantAccount(params: MerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantAccount>>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户账号列表
|
||||
*/
|
||||
export async function listMerchantAccount(params?: MerchantAccountParam) {
|
||||
const res = await request.get<ApiResult<MerchantAccount[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-account',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户账号
|
||||
*/
|
||||
export async function addMerchantAccount(data: MerchantAccount) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户账号
|
||||
*/
|
||||
export async function updateMerchantAccount(data: MerchantAccount) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户账号
|
||||
*/
|
||||
export async function removeMerchantAccount(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户账号
|
||||
*/
|
||||
export async function removeBatchMerchantAccount(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户账号
|
||||
*/
|
||||
export async function getMerchantAccount(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantAccount>>(
|
||||
MODULES_API_URL + '/shop/merchant-account/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/shop/merchantAccount/model/index.ts
Normal file
39
src/api/shop/merchantAccount/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商户账号
|
||||
*/
|
||||
export interface MerchantAccount {
|
||||
// ID
|
||||
id?: number;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
password?: string;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 商户ID
|
||||
merchantId?: number;
|
||||
merchantName?: string;
|
||||
roleId?: number;
|
||||
roleName?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户账号搜索条件
|
||||
*/
|
||||
export interface MerchantAccountParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/merchantApply/index.ts
Normal file
106
src/api/shop/merchantApply/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantApply, MerchantApplyParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户入驻申请
|
||||
*/
|
||||
export async function pageMerchantApply(params: MerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantApply>>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户入驻申请列表
|
||||
*/
|
||||
export async function listMerchantApply(params?: MerchantApplyParam) {
|
||||
const res = await request.get<ApiResult<MerchantApply[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户入驻申请
|
||||
*/
|
||||
export async function addMerchantApply(data: MerchantApply) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户入驻申请
|
||||
*/
|
||||
export async function updateMerchantApply(data: MerchantApply) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户入驻申请
|
||||
*/
|
||||
export async function removeMerchantApply(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户入驻申请
|
||||
*/
|
||||
export async function removeBatchMerchantApply(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户入驻申请
|
||||
*/
|
||||
export async function getMerchantApply(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantApply>>(
|
||||
MODULES_API_URL + '/shop/merchant-apply/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
51
src/api/shop/merchantApply/model/index.ts
Normal file
51
src/api/shop/merchantApply/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商户入驻申请
|
||||
*/
|
||||
export interface MerchantApply {
|
||||
// ID
|
||||
applyId?: number;
|
||||
// 商户名称
|
||||
merchantName?: string;
|
||||
// 商户图标
|
||||
image?: string;
|
||||
// 商户手机号
|
||||
phone?: string;
|
||||
// 商户姓名
|
||||
realName?: string;
|
||||
// 店铺类型
|
||||
shopType?: string;
|
||||
// 商户分类
|
||||
category?: string;
|
||||
// 手续费
|
||||
commission?: string;
|
||||
// 关键字
|
||||
keywords?: string;
|
||||
// 资质图片
|
||||
files?: string;
|
||||
// 是否自营
|
||||
ownStore?: number;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 是否需要审核
|
||||
goodsReview?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户入驻申请搜索条件
|
||||
*/
|
||||
export interface MerchantApplyParam extends PageParam {
|
||||
applyId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/merchantType/index.ts
Normal file
106
src/api/shop/merchantType/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { MerchantType, MerchantTypeParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商户类型
|
||||
*/
|
||||
export async function pageMerchantType(params: MerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<PageResult<MerchantType>>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商户类型列表
|
||||
*/
|
||||
export async function listMerchantType(params?: MerchantTypeParam) {
|
||||
const res = await request.get<ApiResult<MerchantType[]>>(
|
||||
MODULES_API_URL + '/shop/merchant-type',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商户类型
|
||||
*/
|
||||
export async function addMerchantType(data: MerchantType) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商户类型
|
||||
*/
|
||||
export async function updateMerchantType(data: MerchantType) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商户类型
|
||||
*/
|
||||
export async function removeMerchantType(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商户类型
|
||||
*/
|
||||
export async function removeBatchMerchantType(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商户类型
|
||||
*/
|
||||
export async function getMerchantType(id: number) {
|
||||
const res = await request.get<ApiResult<MerchantType>>(
|
||||
MODULES_API_URL + '/shop/merchant-type/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
29
src/api/shop/merchantType/model/index.ts
Normal file
29
src/api/shop/merchantType/model/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
export interface MerchantType {
|
||||
// ID
|
||||
id?: number;
|
||||
// 店铺类型
|
||||
name?: string;
|
||||
// 店铺入驻条件
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序号
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户类型搜索条件
|
||||
*/
|
||||
export interface MerchantTypeParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/order/index.ts
Normal file
106
src/api/shop/order/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Order, OrderParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询订单
|
||||
*/
|
||||
export async function pageOrder(params: OrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Order>>>(
|
||||
MODULES_API_URL + '/shop/order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
export async function listOrder(params?: OrderParam) {
|
||||
const res = await request.get<ApiResult<Order[]>>(
|
||||
MODULES_API_URL + '/shop/order',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加订单
|
||||
*/
|
||||
export async function addOrder(data: Order) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
export async function updateOrder(data: Order) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
export async function removeOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
export async function removeBatchOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询订单
|
||||
*/
|
||||
export async function getOrder(id: number) {
|
||||
const res = await request.get<ApiResult<Order>>(
|
||||
MODULES_API_URL + '/shop/order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
79
src/api/shop/order/model/index.ts
Normal file
79
src/api/shop/order/model/index.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*/
|
||||
export interface Order {
|
||||
// ID
|
||||
orderId?: number;
|
||||
// 订单号
|
||||
orderNo?: string;
|
||||
// 类型
|
||||
type?: number;
|
||||
// 订单金额
|
||||
money?: string;
|
||||
// 实际付款金额(包含运费)
|
||||
payPrice?: string;
|
||||
// 套餐ID
|
||||
planId?: number;
|
||||
// 卡ID
|
||||
priceId?: number;
|
||||
// 获得的会员等级
|
||||
gradeId?: number;
|
||||
// 卡名称
|
||||
priceName?: string;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 持有者ID
|
||||
memberId?: number;
|
||||
// 真实姓名
|
||||
realName?: string;
|
||||
// 联系电话
|
||||
phone?: string;
|
||||
// 付款时间
|
||||
payTime?: string;
|
||||
// 支付流水号
|
||||
transactionId?: string;
|
||||
// 付款状态(10未付款 20已付款)
|
||||
payStatus?: number;
|
||||
// 到期时间
|
||||
expirationTime?: string;
|
||||
// 所在省份
|
||||
province?: string;
|
||||
// 所在城市
|
||||
city?: string;
|
||||
// 所在辖区
|
||||
region?: string;
|
||||
// 所在地区
|
||||
area?: string;
|
||||
// 街道地址
|
||||
address?: string;
|
||||
// 退款凭证
|
||||
refundImage?: string;
|
||||
// 退款理由
|
||||
refundContent?: string;
|
||||
// 订单是否已结算(0未结算 1已结算)
|
||||
isSettled?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单搜索条件
|
||||
*/
|
||||
export interface OrderParam extends PageParam {
|
||||
orderId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/spec/index.ts
Normal file
106
src/api/shop/spec/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Spec, SpecParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询商品规格组记录表
|
||||
*/
|
||||
export async function pageSpec(params: SpecParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Spec>>>(
|
||||
MODULES_API_URL + '/shop/spec/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品规格组记录表列表
|
||||
*/
|
||||
export async function listSpec(params?: SpecParam) {
|
||||
const res = await request.get<ApiResult<Spec[]>>(
|
||||
MODULES_API_URL + '/shop/spec',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加商品规格组记录表
|
||||
*/
|
||||
export async function addSpec(data: Spec) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规格组记录表
|
||||
*/
|
||||
export async function updateSpec(data: Spec) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格组记录表
|
||||
*/
|
||||
export async function removeSpec(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品规格组记录表
|
||||
*/
|
||||
export async function removeBatchSpec(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询商品规格组记录表
|
||||
*/
|
||||
export async function getSpec(id: number) {
|
||||
const res = await request.get<ApiResult<Spec>>(
|
||||
MODULES_API_URL + '/shop/spec/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
33
src/api/shop/spec/model/index.ts
Normal file
33
src/api/shop/spec/model/index.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { SpecValue } from '@/api/shop/specValue/model';
|
||||
|
||||
/**
|
||||
* 商品规格组记录表
|
||||
*/
|
||||
export interface Spec {
|
||||
// 规格组ID
|
||||
specId?: number;
|
||||
// 规格组名称
|
||||
specName?: string;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 状态
|
||||
status?: number;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 规格值
|
||||
specValues?: SpecValue[];
|
||||
key?: string;
|
||||
label?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格组记录表搜索条件
|
||||
*/
|
||||
export interface SpecParam extends PageParam {
|
||||
specId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
106
src/api/shop/specValue/index.ts
Normal file
106
src/api/shop/specValue/index.ts
Normal file
@@ -0,0 +1,106 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { SpecValue, SpecValueParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 分页查询规格值
|
||||
*/
|
||||
export async function pageSpecValue(params: SpecValueParam) {
|
||||
const res = await request.get<ApiResult<PageResult<SpecValue>>>(
|
||||
MODULES_API_URL + '/shop/spec-value/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询规格值列表
|
||||
*/
|
||||
export async function listSpecValue(params?: SpecValueParam) {
|
||||
const res = await request.get<ApiResult<SpecValue[]>>(
|
||||
MODULES_API_URL + '/shop/spec-value',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加规格值
|
||||
*/
|
||||
export async function addSpecValue(data: SpecValue) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改规格值
|
||||
*/
|
||||
export async function updateSpecValue(data: SpecValue) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec-value',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除规格值
|
||||
*/
|
||||
export async function removeSpecValue(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec-value/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除规格值
|
||||
*/
|
||||
export async function removeBatchSpecValue(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/spec-value/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询规格值
|
||||
*/
|
||||
export async function getSpecValue(id: number) {
|
||||
const res = await request.get<ApiResult<SpecValue>>(
|
||||
MODULES_API_URL + '/shop/spec-value/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
31
src/api/shop/specValue/model/index.ts
Normal file
31
src/api/shop/specValue/model/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 规格值
|
||||
*/
|
||||
export interface SpecValue {
|
||||
// 规格值ID
|
||||
specValueId?: number;
|
||||
// 规格值
|
||||
specValue?: string;
|
||||
// 规格组ID
|
||||
specId?: number;
|
||||
// 描述
|
||||
comments?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
key?: string;
|
||||
label?: string;
|
||||
value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 规格值搜索条件
|
||||
*/
|
||||
export interface SpecValueParam extends PageParam {
|
||||
specValueId?: number;
|
||||
specId?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user