Refactor code structure and remove redundant changes
This commit is contained in:
110
api/home/index.ts
Normal file
110
api/home/index.ts
Normal file
@ -0,0 +1,110 @@
|
||||
import { get } from '@/utils/axios'
|
||||
import {
|
||||
ThotTopReq,
|
||||
ProjectDrawPageRespVO,
|
||||
ProjectDictNodeVO,
|
||||
ProjectDrawStatisticAppRespVO,
|
||||
ProjectTrendingScoreUserInfoVO,
|
||||
PageResultIndexSettingRespVO,
|
||||
} from './type'
|
||||
|
||||
/**
|
||||
* 获取热门信息的top信息
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const hotTop = (params: ThotTopReq) => {
|
||||
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||
url: '/prod-api/app-api/business/app/project-draw/hot-top',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推荐信息的top信息
|
||||
* @param params
|
||||
* @returns
|
||||
*/
|
||||
export const recommendTop = (params: ThotTopReq) => {
|
||||
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||
url: '/prod-api/app-api/business/app/project-draw/recommend-top',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新图纸信息
|
||||
*/
|
||||
export const newDraw = (params: { type: number; limit: number }) => {
|
||||
return get<IResponse<ProjectDrawPageRespVO[]>>({
|
||||
url: '/prod-api/app-api/business/project/index/draw-new',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页-热点标签
|
||||
*/
|
||||
export const hotTag = (params: { type: number; limit: number; size: number }) => {
|
||||
return get<IResponse<ProjectDictNodeVO[]>>({
|
||||
url: '/prod-api/app-api/business/project/index/index-hot-tab',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页-标签
|
||||
*/
|
||||
export const tag = () => {
|
||||
return get<IResponse<ProjectDictNodeVO[]>>({
|
||||
url: '/prod-api/app-api/business/project/index/index-tab',
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取top数据
|
||||
*/
|
||||
export const top = (params: { type: number; limit: number }) => {
|
||||
return get<IResponse<ProjectDrawStatisticAppRespVO[]>>({
|
||||
url: '/prod-api/app-api/business/project/index/top',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户top数据
|
||||
*/
|
||||
export const userTop = (params: { type?: number }) => {
|
||||
return get<IResponse<ProjectTrendingScoreUserInfoVO[]>>({
|
||||
url: '/prod-api/app-api/business/project/index/user-top',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置首页设置信息分页
|
||||
*/
|
||||
export const settinngPage = (params: { pageNo?: number; pageSize: number; type: number; status: number; innerType?: number }) => {
|
||||
return get<IResponse<PageResultIndexSettingRespVO>>({
|
||||
url: '/prod-api/admin-api/system/index-setting/page',
|
||||
params,
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获得首页设置信息分页
|
||||
*/
|
||||
export const getSettingPage = (params: { type: number }) => {
|
||||
return get<IResponse<PageResultIndexSettingRespVO[]>>({
|
||||
url: '/prod-api/app-api/system/index-setting/list',
|
||||
params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页-标签2
|
||||
*/
|
||||
export const tab2 = () => {
|
||||
return get<IResponse<ProjectDictNodeVO[]>>({
|
||||
url: '/prod-api/app-api/business/project/index/index-tab2',
|
||||
})
|
||||
}
|
||||
107
api/home/type.ts
Normal file
107
api/home/type.ts
Normal file
@ -0,0 +1,107 @@
|
||||
export interface ThotTopReq {
|
||||
/** 类型: 1 图纸 2 文本 3 模型 */
|
||||
type: number
|
||||
/** 项目分类 */
|
||||
projectType: string
|
||||
/** 是否国内 0 国外 1 国内 */
|
||||
isDomestic: number
|
||||
projectTypeTop?: string
|
||||
}
|
||||
export interface ProjectDrawPageRespVO {
|
||||
/** 主键 */
|
||||
id: number
|
||||
/** 项目id */
|
||||
projectId: number
|
||||
/** 标题 */
|
||||
title: string
|
||||
/** 版本 */
|
||||
editions: any[]
|
||||
/** 类型: 1 图纸 2 文本 3 模型 */
|
||||
type: number
|
||||
/** 创建时间 */
|
||||
createTime: string
|
||||
/** 项目分类 */
|
||||
projectType: any[]
|
||||
/** 状态 */
|
||||
status: number
|
||||
/** 是否推荐 */
|
||||
recommend: boolean
|
||||
/** 金币 */
|
||||
points: number
|
||||
/** 封面图片 */
|
||||
iconUrl: string
|
||||
/** 热度 */
|
||||
hotPoint: number
|
||||
/** 描述 */
|
||||
description: string
|
||||
}
|
||||
|
||||
export interface ProjectDictNodeVO {
|
||||
id?: string
|
||||
parentId?: string
|
||||
name?: string
|
||||
isChildren?: true
|
||||
sort?: number
|
||||
level?: number
|
||||
children?: {
|
||||
id?: string
|
||||
parentId?: string
|
||||
name?: string
|
||||
isChildren?: true
|
||||
sort?: number
|
||||
level?: number
|
||||
children?: any[]
|
||||
parent?: any
|
||||
type?: number
|
||||
checked?: true
|
||||
}[]
|
||||
|
||||
parent?: any
|
||||
type?: number
|
||||
checked?: true
|
||||
}
|
||||
|
||||
export interface ProjectDrawStatisticAppRespVO {
|
||||
pairs?: {
|
||||
id: string
|
||||
name: string
|
||||
}[]
|
||||
projectType?: number | any[]
|
||||
projectTypeName?: string
|
||||
count?: number
|
||||
type?: number
|
||||
title?: string
|
||||
}
|
||||
|
||||
export interface ProjectTrendingScoreUserInfoVO {
|
||||
avatar: string
|
||||
memberId: number
|
||||
nickname: string
|
||||
isDomestic: number
|
||||
area: string
|
||||
country: string
|
||||
province: string
|
||||
city: string
|
||||
county: string
|
||||
labels: any[]
|
||||
description: string
|
||||
files: any
|
||||
fansCount: number
|
||||
projectCount: number
|
||||
ownUserId: number
|
||||
projectType: string
|
||||
score: number
|
||||
}
|
||||
|
||||
export interface PageResultIndexSettingRespVO {
|
||||
id: number
|
||||
name: string
|
||||
url: string
|
||||
sort: number
|
||||
type: number
|
||||
innerType: number
|
||||
rowType: number
|
||||
content: string
|
||||
status: number
|
||||
createTime: string
|
||||
}
|
||||
Reference in New Issue
Block a user