完成 微前端拆分 提交遗漏文件
This commit is contained in:
3
front-end/main-app/src/shared/index.ts
Normal file
3
front-end/main-app/src/shared/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./config/HttpConfig"
|
||||
export * from "./config/ThemeConfig"
|
||||
export { default as http } from "./infra/AxiosInfra"
|
||||
41
front-end/main-app/src/shared/types/product-federation.d.ts
vendored
Normal file
41
front-end/main-app/src/shared/types/product-federation.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// 声明领域层类型
|
||||
declare module 'productModule/ProductDomain' {
|
||||
import type { DefineComponent } from 'vue';
|
||||
// 商品实体类型(与联邦模块一致)
|
||||
export class Product {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
price: number;
|
||||
imageUrl: string;
|
||||
stock: number;
|
||||
categoryId: number;
|
||||
}
|
||||
// 应用服务类型
|
||||
export class ProductApplicationService {
|
||||
constructor(repo: ProductRepository);
|
||||
findAll(): Promise<Array<any>>; // TODO any 需要修改
|
||||
findById(id: number): Promise<Product>
|
||||
}
|
||||
|
||||
export class HttpProductRepository implements ProductRepository {
|
||||
findAll(): Promise<Array<any>>; // TODO any 需要修改
|
||||
findById(id: number): Promise<Product>
|
||||
}
|
||||
|
||||
export class ProductRepository {
|
||||
findAll(): Promise<Array<any>>; // TODO any 需要修改
|
||||
findById(id: number): Promise<Product>
|
||||
}
|
||||
}
|
||||
|
||||
// 声明视图类型(同理补充其他模块)
|
||||
// declare module 'productModule/ProductViews' {
|
||||
// import type { DefineComponent } from 'vue';
|
||||
// export const ProductList: DefineComponent; // 商品列表页
|
||||
// export const ProductDetail: DefineComponent; // 商品详情页
|
||||
// }
|
||||
|
||||
declare module 'productModule/ProductRouter' {
|
||||
export const productRouter: RouteRecordRaw[];
|
||||
}
|
||||
Reference in New Issue
Block a user