维护所有模块的多语言功能,对接友情分类接口和友情链接接口
This commit is contained in:
98
src/servers/api/friendLink.ts
Normal file
98
src/servers/api/friendLink.ts
Normal file
@ -0,0 +1,98 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取友情链接分类列表
|
||||
export async function getCategoryList(params: API.PageRequest) {
|
||||
return request('/portals/classification/getPage', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取所有友情链接分类
|
||||
export async function getAllCategories() {
|
||||
return request('/portals/classification/getAll', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取友情链接分类详情
|
||||
export async function getCategoryDetail(id: string) {
|
||||
return request(`/portals/classification/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 添加友情链接分类
|
||||
export async function addCategory(data: API.CategoryRequest) {
|
||||
return request('/portals/classification', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新友情链接分类
|
||||
export async function updateCategory(data: API.CategoryRequest) {
|
||||
return request('/portals/classification', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除友情链接分类
|
||||
export async function deleteCategory(id: string) {
|
||||
return request(`/portals/classification/${id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取友情链接列表
|
||||
export async function getLinkList(params: API.PageRequest) {
|
||||
return request('/portals/links/getPage', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取所有友情链接
|
||||
export async function getAllLinks() {
|
||||
return request('/portals/links/getAll', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 添加友情链接
|
||||
export async function addLink(data: API.LinkRequest) {
|
||||
return request('/portals/links', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新友情链接
|
||||
export async function updateLink(data: API.LinkRequest) {
|
||||
return request('/portals/links', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除友情链接
|
||||
export async function deleteLink(id: string) {
|
||||
return request(`/portals/links/${id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
// 启用友情链接
|
||||
export async function enableLink(id: string) {
|
||||
return request(`/portals/links/up/${id}`, {
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
// 禁用友情链接
|
||||
export async function disableLink(id: string) {
|
||||
return request(`/portals/links/down/${id}`, {
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
85
src/servers/api/typings.d.ts
vendored
85
src/servers/api/typings.d.ts
vendored
@ -409,4 +409,89 @@ declare namespace API {
|
||||
isPublished?: number; // 0-未发布,1-已发布
|
||||
isTop?: number; // 0-未置顶,1-已置顶
|
||||
}
|
||||
// 友情链接分类类型定义
|
||||
interface CategoryType {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
parentId: string;
|
||||
orderBy: string;
|
||||
remark: string;
|
||||
delFlag?: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
createBy?: string;
|
||||
updateBy?: string;
|
||||
key?: string;
|
||||
children?: CategoryType[];
|
||||
}
|
||||
|
||||
// 友情链接类型定义
|
||||
interface LinkType {
|
||||
id: string;
|
||||
classificationId: string;
|
||||
name: string;
|
||||
nameEn: string;
|
||||
thumbnail: string;
|
||||
url: string;
|
||||
status: string;
|
||||
orderBy: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
categoryName?: string; // 用于显示
|
||||
}
|
||||
// 友情链接分类请求参数
|
||||
export interface CategoryRequest {
|
||||
id?: string;
|
||||
name: string;
|
||||
type: string;
|
||||
parentId: string;
|
||||
orderBy: string;
|
||||
remark: string;
|
||||
}
|
||||
|
||||
// 友情链接分类响应数据
|
||||
export interface CategoryItem {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
parentId: string;
|
||||
orderBy: string;
|
||||
remark: string;
|
||||
delFlag: string;
|
||||
createTime: string;
|
||||
updateTime: string;
|
||||
createBy: string;
|
||||
updateBy?: string;
|
||||
}
|
||||
|
||||
// 友情链接请求参数
|
||||
export interface LinkRequest {
|
||||
id?: string | number;
|
||||
classificationId: string;
|
||||
name: string;
|
||||
nameEn: string;
|
||||
thumbnail: string;
|
||||
url: string;
|
||||
orderBy: number | string;
|
||||
}
|
||||
|
||||
// 友情链接响应数据
|
||||
export interface LinkItem {
|
||||
id: string;
|
||||
classificationId: string;
|
||||
name: string;
|
||||
nameEn: string;
|
||||
thumbnail: string;
|
||||
url: string;
|
||||
status: string;
|
||||
orderBy: string;
|
||||
delFlag: string;
|
||||
createTime: string;
|
||||
updateTime: string;
|
||||
createBy: string;
|
||||
updateBy?: string;
|
||||
remark?: string;
|
||||
basePageRequest?: null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user