feat(core): 初始化项目基础架构和CMS功能模块
- 添加Docker相关配置文件(.dockerignore, .env.example, .gitignore) - 实现服务端API代理功能,支持文件、模块和服务器API转发 - 创建文章详情页、栏目文章列表页和单页内容展示页面 - 集成Ant Design Vue组件库并实现SSR样式提取功能 - 定义API响应数据结构类型和应用布局组件 - 开发开发者应用中心和文章管理页面 - 实现CMS导航菜单获取和多租户切换功能
This commit is contained in:
118
app/api/shop/shopGoodsSku/index.ts
Normal file
118
app/api/shop/shopGoodsSku/index.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
import { ShopGoodsSpec } from '@/api/shop/shopGoodsSpec/model';
|
||||
import { ShopGoodsSku, ShopGoodsSkuParam } from '@/api/shop/shopGoodsSku/model';
|
||||
|
||||
export async function generateGoodsSku(data: ShopGoodsSpec) {
|
||||
const res = await request.post<ApiResult<ShopGoodsSku[]>>(
|
||||
MODULES_API_URL + '/shop/goods-sku/generateGoodsSku',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询商品sku列表
|
||||
*/
|
||||
export async function pageShopGoodsSku(params: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ShopGoodsSku>>>(
|
||||
MODULES_API_URL + '/shop/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 listShopGoodsSku(params?: ShopGoodsSkuParam) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku[]>>(
|
||||
MODULES_API_URL + '/shop/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 addShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/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 updateShopGoodsSku(data: ShopGoodsSku) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/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 removeShopGoodsSku(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/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 removeBatchShopGoodsSku(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
MODULES_API_URL + '/shop/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 getShopGoodsSku(id: number) {
|
||||
const res = await request.get<ApiResult<ShopGoodsSku>>(
|
||||
MODULES_API_URL + '/shop/shop-goods-sku/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
50
app/api/shop/shopGoodsSku/model/index.ts
Normal file
50
app/api/shop/shopGoodsSku/model/index.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 商品sku列表
|
||||
*/
|
||||
export interface ShopGoodsSku {
|
||||
// 主键ID
|
||||
id?: number;
|
||||
// 商品ID
|
||||
goodsId?: number;
|
||||
// 商品属性索引值 (attr_value|attr_value[|....])
|
||||
sku?: string;
|
||||
// 商品图片
|
||||
image?: string;
|
||||
// 商品价格
|
||||
price?: string;
|
||||
// 市场价格
|
||||
salePrice?: string;
|
||||
// 成本价
|
||||
cost?: string;
|
||||
// 库存
|
||||
stock?: number;
|
||||
// sku编码
|
||||
skuNo?: string;
|
||||
// 商品条码
|
||||
barCode?: string;
|
||||
// 重量
|
||||
weight?: string;
|
||||
// 体积
|
||||
volume?: string;
|
||||
// 唯一值
|
||||
uuid?: string;
|
||||
// 状态, 0正常, 1异常
|
||||
status?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
images?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品sku列表搜索条件
|
||||
*/
|
||||
export interface ShopGoodsSkuParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user