feat 完善注释
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
// 案例库接口(真实后端绑定)
|
||||
// 后端: vermis-maker com.ruoyi.vermins.controller.pc.web.ProjectCaseUserController
|
||||
// 前缀: /web/projectCase
|
||||
//
|
||||
// 使用约定(与项目 SKILL.md 一致):
|
||||
// 页面/组件禁止直接 import axios,一律经 store 调用本模块的 request<T>。
|
||||
// 本文件只放「函数签名 + 请求路径」,不做数据加工、不维护状态。
|
||||
import { request, serializeQuery } from '@/utils/request'
|
||||
import type {
|
||||
CaseSelectionModel,
|
||||
@@ -13,16 +7,6 @@ import type {
|
||||
ProjectCaseVo,
|
||||
} from '@/types/business/cases'
|
||||
|
||||
/**
|
||||
* 案例库分页列表(返回列表 + 业务数据统计)。
|
||||
*
|
||||
* <p>规模区间是嵌套对象(`scales[0].lowerLimit`),必须用 serializeQuery 序列化——
|
||||
* axios 默认的 `scales[0][lowerLimit]` 后端绑不上,实测 HTTP 500。</p>
|
||||
*
|
||||
* @param bo 筛选条件(businessTypes 按案例表 business_type 原值匹配)
|
||||
* @param pageNum 页码,从 1 开始(后端 PageQuery)
|
||||
* @param pageSize 每页条数
|
||||
*/
|
||||
export function getCaseList(
|
||||
bo: ProjectCaseUserBo,
|
||||
pageNum: number,
|
||||
@@ -36,11 +20,6 @@ export function getCaseList(
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 案例详情(含项目背景富文本与附件,并回填当前用户是否已收藏)。
|
||||
*
|
||||
* <p>注意:该接口每次调用都会把案例预览量 +1,勿在轮询 / 重试场景滥用。</p>
|
||||
*/
|
||||
export function getCaseDetail(id: string): Promise<ProjectCaseVo | null> {
|
||||
return request<ProjectCaseVo | null>({
|
||||
url: `/web/projectCase/${id}`,
|
||||
@@ -48,11 +27,6 @@ export function getCaseDetail(id: string): Promise<ProjectCaseVo | null> {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 案例收藏 / 取消收藏。
|
||||
*
|
||||
* <p>后端为 toggle 语义:已收藏则取消收藏。需登录态,匿名调用会被后端拦截。</p>
|
||||
*/
|
||||
export function collectCase(id: string): Promise<void> {
|
||||
return request<void>({
|
||||
url: '/web/projectCase/collect',
|
||||
@@ -61,13 +35,6 @@ export function collectCase(id: string): Promise<void> {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 筛选面板选项(业务类型统计 + 行业 + 规模档位)。
|
||||
*
|
||||
* <p>左侧筛选除完成时间外的选项都由本接口一次下发:业务类型与案例总数在
|
||||
* {@code projectCaseStatisticsVo},行业在 {@code businessIndustry},规模在
|
||||
* {@code upperAndLowerLimits}(label 已由后端拼好)。</p>
|
||||
*/
|
||||
export function getCaseCategories(): Promise<CaseSelectionModel> {
|
||||
return request<CaseSelectionModel>({
|
||||
url: '/web/projectCase/categories',
|
||||
@@ -75,12 +42,6 @@ export function getCaseCategories(): Promise<CaseSelectionModel> {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 案例浏览王(首页「案例库精选」)。
|
||||
*
|
||||
* <p>不传 type 时返回「各业务类型的浏览王」各一条;传 type 时按案例表
|
||||
* business_type 的原值精确匹配,返回该类型全部案例。</p>
|
||||
*/
|
||||
export function getFeaturedCases(type?: string): Promise<ProjectCaseVo[]> {
|
||||
return request<ProjectCaseVo[]>({
|
||||
url: '/web/projectCase/mostViewed',
|
||||
|
||||
Reference in New Issue
Block a user