feat(*): 生成工作台 - 新增项目画风配置与图片模型能力裁剪
This commit is contained in:
1 parent
2b0d56f8e3
commit
1973afc356
52 files changed
+3309
-361
No files matched your search
@@ -0,0 +1,40 @@
|
||||
import { apiClient, request } from "@/services/api/request";
|
||||
|
||||
export type UserStyleProfile = {
|
||||
id: string;
|
||||
userId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
coverUrl: string;
|
||||
tagsJson: string;
|
||||
profileJson: string;
|
||||
favorite: boolean;
|
||||
lastUsedAt?: string;
|
||||
revision: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export function listStyleProfiles() {
|
||||
return request<{ profiles: UserStyleProfile[] }>(apiClient.get("/style-profiles"));
|
||||
}
|
||||
|
||||
export function createStyleProfile(profileJson: string) {
|
||||
return request<{ profile: UserStyleProfile }>(apiClient.post("/style-profiles", { profileJson }));
|
||||
}
|
||||
|
||||
export function updateStyleProfile(id: string, profileJson: string) {
|
||||
return request<{ profile: UserStyleProfile }>(apiClient.patch(`/style-profiles/${encodeURIComponent(id)}`, { profileJson }));
|
||||
}
|
||||
|
||||
export function setStyleProfileFavorite(id: string, favorite: boolean) {
|
||||
return request<{ id: string; favorite: boolean }>(apiClient.patch(`/style-profiles/${encodeURIComponent(id)}/favorite`, { favorite }));
|
||||
}
|
||||
|
||||
export function touchStyleProfile(id: string) {
|
||||
return request<{ id: string }>(apiClient.post(`/style-profiles/${encodeURIComponent(id)}/use`));
|
||||
}
|
||||
|
||||
export function deleteStyleProfile(id: string) {
|
||||
return request<{ id: string }>(apiClient.delete(`/style-profiles/${encodeURIComponent(id)}`));
|
||||
}
|
||||
Reference in new issue
Block a user