wip: 新增电商模块

This commit is contained in:
ah--desktop
2025-09-11 00:15:25 +08:00
parent a305dcdc3f
commit a79058f1f6
74 changed files with 3841 additions and 241 deletions
@@ -0,0 +1,100 @@
import { requestClient } from '#/api/request';
import type { PageQueryDTO, PageResultVO } from '#/types/common';
import type { CompanyDTO, CompanyVO, DepartmentDTO, DepartmentVO, PositionDTO, PositionVO } from './types';
/**
* 公司管理API
*/
/**
* 分页获取公司列表
*/
export async function getCompanyPageApi(params: PageQueryDTO<CompanyDTO.CompanyFiltersDTO>) {
return requestClient.post<PageResultVO<CompanyVO.CompanyInfoVO>>('/company/page', params);
}
/**
* 创建公司
*/
export async function createCompanyApi(data: CompanyDTO.CreateCompanyDTO) {
return requestClient.post<CompanyVO.CompanyInfoVO>('/company/create', data);
}
/**
* 更新公司
*/
export async function updateCompanyApi(id: number, data: CompanyDTO.UpdateCompanyDTO) {
return requestClient.put<CompanyVO.CompanyInfoVO>(`/company/update/${id}`, data);
}
/**
* 删除公司
*/
export async function deleteCompanyApi(id: number) {
return requestClient.delete<void>(`/company/delete/${id}`);
}
/**
* 部门管理API
*/
/**
* 分页获取部门列表
*/
export async function getDepartmentPageApi(params: PageQueryDTO<DepartmentDTO.DepartmentFiltersDTO>) {
return requestClient.post<PageResultVO<DepartmentVO.DepartmentInfoVO>>('/department/page', params);
}
/**
* 创建部门
*/
export async function createDepartmentApi(data: DepartmentDTO.CreateDepartmentDTO) {
return requestClient.post<DepartmentVO.DepartmentInfoVO>('/department/create', data);
}
/**
* 更新部门
*/
export async function updateDepartmentApi(id: number, data: DepartmentDTO.UpdateDepartmentDTO) {
return requestClient.put<DepartmentVO.DepartmentInfoVO>(`/department/update/${id}`, data);
}
/**
* 删除部门
*/
export async function deleteDepartmentApi(id: number) {
return requestClient.delete<void>(`/department/delete/${id}`);
}
/**
* 岗位管理API
*/
/**
* 分页获取岗位列表
*/
export async function getPositionPageApi(params: PageQueryDTO<PositionDTO.PositionFiltersDTO>) {
return requestClient.post<PageResultVO<PositionVO.PositionInfoVO>>('/position/page', params);
}
/**
* 创建岗位
*/
export async function createPositionApi(data: PositionDTO.CreatePositionDTO) {
return requestClient.post<PositionVO.PositionInfoVO>('/position/create', data);
}
/**
* 更新岗位
*/
export async function updatePositionApi(id: number, data: PositionDTO.UpdatePositionDTO) {
return requestClient.put<PositionVO.PositionInfoVO>(`/position/update/${id}`, data);
}
/**
* 删除岗位
*/
export async function deletePositionApi(id: number) {
return requestClient.delete<void>(`/position/delete/${id}`);
}
@@ -0,0 +1,6 @@
/**
* 组织管理模块API导出
*/
export * from './apis';
export * from './types';
@@ -0,0 +1,6 @@
/**
* 组织管理模块类型定义导出
*/
export * from './types.dto';
export * from './types.vo';
@@ -0,0 +1,131 @@
/**
* 组织管理模块DTO类型定义
*/
export namespace CompanyDTO {
/** 创建公司参数 */
export interface CreateCompanyDTO {
/** 公司名称 */
name: string;
/** 公司地址 */
address?: string;
/** 联系人 */
contactPerson?: string;
/** 联系电话 */
contactPhone?: string;
/** 邮箱 */
email?: string;
/** Logo */
logo?: string;
/** 状态 */
status?: number;
/** 订阅到期时间 */
expireTime?: string;
}
/** 更新公司参数 */
export interface UpdateCompanyDTO {
/** 公司名称 */
name: string;
/** 公司地址 */
address?: string;
/** 联系人 */
contactPerson?: string;
/** 联系电话 */
contactPhone?: string;
/** 邮箱 */
email?: string;
/** Logo */
logo?: string;
/** 状态 */
status?: number;
/** 订阅到期时间 */
expireTime?: string;
}
/** 公司过滤条件 */
export interface CompanyFiltersDTO {
/** 公司名称(模糊查询) */
name?: string;
/** 状态 */
status?: number;
}
}
export namespace DepartmentDTO {
/** 创建部门参数 */
export interface CreateDepartmentDTO {
/** 部门名称 */
name: string;
/** 父部门ID */
parentId?: number;
/** 备注 */
remark?: string;
/** 状态 */
status?: number;
}
/** 更新部门参数 */
export interface UpdateDepartmentDTO {
/** 部门名称 */
name: string;
/** 父部门ID */
parentId?: number;
/** 备注 */
remark?: string;
/** 状态 */
status?: number;
}
/** 部门过滤条件 */
export interface DepartmentFiltersDTO {
/** 部门名称(模糊查询) */
name?: string;
/** 公司ID */
companyId?: number;
/** 状态 */
status?: number;
}
}
export namespace PositionDTO {
/** 创建岗位参数 */
export interface CreatePositionDTO {
/** 岗位名称 */
name: string;
/** 岗位编码 */
code?: string;
/** 部门ID */
departmentId?: number;
/** 备注 */
remark?: string;
/** 状态 */
status?: number;
}
/** 更新岗位参数 */
export interface UpdatePositionDTO {
/** 岗位名称 */
name: string;
/** 岗位编码 */
code?: string;
/** 部门ID */
departmentId?: number;
/** 备注 */
remark?: string;
/** 状态 */
status?: number;
}
/** 岗位过滤条件 */
export interface PositionFiltersDTO {
/** 岗位名称(模糊查询) */
name?: string;
/** 公司ID */
companyId?: number;
/** 部门ID */
departmentId?: number;
/** 状态 */
status?: number;
}
}
@@ -0,0 +1,91 @@
/**
* 组织管理模块VO类型定义
*/
export namespace CompanyVO {
/** 公司信息 */
export interface CompanyInfoVO {
/** 公司ID */
id: number;
/** 公司名称 */
name: string;
/** 过期时间 */
expiration?: string;
/** 公司地址 */
address?: string;
/** 联系人 */
contactPerson?: string;
/** 联系电话 */
contactPhone?: string;
/** 邮箱 */
email?: string;
/** Logo */
logo?: string;
/** 状态 */
status: number;
/** 订阅到期时间 */
expireTime?: string;
/** 创建时间 */
createTime: string;
/** 更新时间 */
updateTime: string;
/** 是否过期 */
expired?: boolean;
}
}
export namespace DepartmentVO {
/** 部门信息 */
export interface DepartmentInfoVO {
/** 部门ID */
id: number;
/** 部门名称 */
name: string;
/** 父部门ID */
parentId?: number;
/** 公司ID */
companyId: number;
/** 备注 */
remark?: string;
/** 状态 */
status: number;
/** 创建时间 */
createTime: string;
/** 更新时间 */
updateTime: string;
/** 创建人ID */
createBy?: number;
/** 更新人ID */
updateBy?: number;
/** 子部门 */
children?: DepartmentInfoVO[];
}
}
export namespace PositionVO {
/** 岗位信息 */
export interface PositionInfoVO {
/** 岗位ID */
id: number;
/** 岗位名称 */
name: string;
/** 岗位编码 */
code?: string;
/** 部门ID */
departmentId?: number;
/** 备注 */
remark?: string;
/** 状态 */
status: number;
/** 公司ID */
companyId: number;
/** 创建时间 */
createTime: string;
/** 更新时间 */
updateTime: string;
/** 创建人ID */
createBy?: number;
/** 更新人ID */
updateBy?: number;
}
}