-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from terwer/dev
feat:#18 实现metaweblog-api客户端-通用设置模板
- Loading branch information
Showing
28 changed files
with
436 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,4 @@ dist-ssr | |
.vercel | ||
*.private.env.json | ||
__snapshots__ | ||
test/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
src/components/tab/setting/commonsettingadaptor/KmsSetting.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
src/components/tab/setting/commonsettingadaptor/LiandiSetting.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 12 additions & 1 deletion
13
src/components/tab/setting/commonsettingadaptor/YuqueSetting.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,40 @@ | ||
import {IApi} from "../../api"; | ||
import {Post} from "../../common/post"; | ||
import {UserBlog} from "../../common/userBlog"; | ||
import {getJSONConf} from "../../config"; | ||
import {ICommonblogCfg} from "./commonblogCfg"; | ||
|
||
/** | ||
* 通用平台接口适配器 | ||
*/ | ||
export class CommonblogApiAdaptor implements IApi { | ||
deletePost(postid: string): Promise<boolean> { | ||
return Promise.resolve(false); | ||
protected cfg: ICommonblogCfg | ||
|
||
constructor(apiType: string) { | ||
this.cfg = getJSONConf<ICommonblogCfg>(apiType) | ||
} | ||
|
||
public async deletePost(postid: string): Promise<boolean> { | ||
throw new Error("该功能未实现,请在子类重写改方法") | ||
} | ||
|
||
editPost(postid: string, post: Post, publish?: boolean): Promise<boolean> { | ||
return Promise.resolve(false); | ||
public async editPost(postid: string, post: Post, publish?: boolean): Promise<boolean> { | ||
throw new Error("该功能未实现,请在子类重写改方法") | ||
} | ||
|
||
getPost(postid: string, useSlug?: boolean): Promise<Post> { | ||
return Promise.resolve(new Post()); | ||
public async getPost(postid: string, useSlug?: boolean): Promise<Post> { | ||
throw new Error("该功能未实现,请在子类重写改方法") | ||
} | ||
|
||
getRecentPosts(numOfPosts: number, page?: number, keyword?: string): Promise<Array<Post>> { | ||
return Promise.resolve([]); | ||
public async getRecentPosts(numOfPosts: number, page?: number, keyword?: string): Promise<Array<Post>> { | ||
throw new Error("该功能未实现,请在子类重写改方法") | ||
} | ||
|
||
getUsersBlogs(): Promise<Array<UserBlog>> { | ||
return Promise.resolve([]); | ||
public async getUsersBlogs(): Promise<Array<UserBlog>> { | ||
throw new Error("该功能未实现,请在子类重写改方法") | ||
} | ||
|
||
newPost(post: Post, publish?: boolean): Promise<string> { | ||
return Promise.resolve(""); | ||
public async newPost(post: Post, publish?: boolean): Promise<string> { | ||
throw new Error("该功能未实现,请在子类重写改方法") | ||
} | ||
} |
Oops, something went wrong.
0c93281
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
src-sy-post-publisher – ./
src-sy-post-publisher-git-main-terwergreen.vercel.app
src-sy-post-publisher.vercel.app
publish.terwer.space
src-sy-post-publisher-terwergreen.vercel.app