Commit 067c7e80 by lijiabin

【需求 17679】 wip: 加入接口、常量等

parent 5a65d31b
......@@ -47,6 +47,8 @@ declare module 'vue' {
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElUpload: typeof import('element-plus/es')['ElUpload']
......@@ -108,6 +110,8 @@ declare global {
const ElSwitch: typeof import('element-plus/es')['ElSwitch']
const ElTable: typeof import('element-plus/es')['ElTable']
const ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
const ElTabPane: typeof import('element-plus/es')['ElTabPane']
const ElTabs: typeof import('element-plus/es')['ElTabs']
const ElTag: typeof import('element-plus/es')['ElTag']
const ElTooltip: typeof import('element-plus/es')['ElTooltip']
const ElUpload: typeof import('element-plus/es')['ElUpload']
......
import service from '@/utils/request/index'
import type { AddOrUpdateArticleDto, ArticleItemDto, ArticleSearchParams } from './types'
import type { BackendServicePageResult } from '@/utils/request/types'
import { ArticleTypeEnum } from '@/constants'
/**
* 发布文章
*/
......@@ -32,3 +35,14 @@ export const getArticleDetail = (articleId: number | string) => {
method: 'POST',
})
}
/**
* 收藏或者取消收藏
*/
export const addOrCancelCollect = (data: { articleId: number | string; type: ArticleTypeEnum }) => {
return service.request<boolean>({
url: `/api/cultureCollect/addOrCancelCollect`,
method: 'POST',
data,
})
}
......@@ -65,7 +65,7 @@ export interface ArticleItemDto {
createTime: number
viewCount: number
isRecommend: BooleanFlag
type: string
type: ArticleTypeEnum
isRelateColleague: BooleanFlag
releaseStatus: ReleaseStatusEnum
tagNameList: string[]
......
import service from '@/utils/request/index'
import type { UpdateUserInfoDto } from './types'
import type {
BackendServicePageResult,
BackendServiceResult,
PageSearchParams,
} from '@/utils/request/types'
/**
* 更新用户信息
*/
......@@ -10,3 +16,52 @@ export const updateUserInfo = (data: UpdateUserInfoDto) => {
data,
})
}
/**
* 是否有官方账号权限
*/
export const hasOfficialAccount = () => {
return service.request<[]>({
url: '/api/personalCenter/getIsOfficial',
method: 'POST',
data: {},
})
}
/**
* 获取我的收藏列表
*/
export const getSelfCollectList = (data: PageSearchParams) => {
return service.request<
BackendServicePageResult<{
id: number
title: string
content: string
createTime: string
updateTime: string
}>
>({
url: '/api/personalCenter/selfCollect',
method: 'POST',
data,
})
}
/**
* 获取我的点赞列表
*/
export const getSelfPraiseList = (data: PageSearchParams) => {
return service.request<
BackendServicePageResult<{
id: number
title: string
content: string
createTime: string
updateTime: string
}>
>({
url: '/api/personalCenter/selfPraise',
method: 'POST',
data,
})
}
export * from './options'
export * from './enums'
export * from './symbolKey'
import type { InjectionKey, Ref } from 'vue'
export const TABS_REF_KEY = Symbol() as InjectionKey<Ref<HTMLElement | null>>
export const COMMENT_REF_KEY = Symbol() as InjectionKey<Ref<HTMLElement | null>>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment