feat: 实现前端资源管理
This commit is contained in:
@@ -1,19 +1,6 @@
|
||||
import { PublicResource } from "@/lib/types/resource";
|
||||
import { serverFetch } from "../server";
|
||||
|
||||
export type ResourceTagType = {
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface Resource {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
imageUrl: string;
|
||||
link: string;
|
||||
tags: ResourceTagType[];
|
||||
}
|
||||
|
||||
export async function list() {
|
||||
return serverFetch<Resource[]>('/api/resource')
|
||||
return serverFetch<PublicResource[]>('/api/resource')
|
||||
}
|
||||
@@ -3,6 +3,15 @@ export type TagType = {
|
||||
type: string;
|
||||
}
|
||||
|
||||
export interface PublicResource {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
imageUrl: string;
|
||||
link: string;
|
||||
tags: TagType[];
|
||||
}
|
||||
|
||||
export interface Resource {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -10,4 +19,6 @@ export interface Resource {
|
||||
imageUrl: string;
|
||||
link: string;
|
||||
tags: TagType[];
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user