Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,744 additions
and
71 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
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,7 +1,8 @@ | ||
import { describe, it } from "vitest" | ||
import { getFileHash } from "./lib/utils/md5Util" | ||
|
||
describe("index", () => { | ||
it("test index", () => { | ||
console.log("hello") | ||
console.log(getFileHash("hello")) | ||
}) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* GNU GENERAL PUBLIC LICENSE | ||
* Version 3, 29 June 2007 | ||
* | ||
* Copyright (C) 2023-2024 Terwer, Inc. <https://terwer.space/> | ||
* Everyone is permitted to copy and distribute verbatim copies | ||
* of this license document, but changing it is not allowed. | ||
*/ | ||
|
||
import { getFileHash } from "../utils/md5Util" | ||
|
||
/** | ||
* 图片信息 | ||
*/ | ||
export class ImageItem { | ||
/** | ||
* 文件, | ||
*/ | ||
name: string | ||
/** | ||
* 文件名称的Hash,构造函数指定 | ||
*/ | ||
hash: string | ||
/** | ||
* 原始资源地址 | ||
*/ | ||
originUrl: string | ||
/** | ||
* 资源地址 | ||
*/ | ||
url: string | ||
/** | ||
* 资源备注 | ||
*/ | ||
alt?: string | ||
/** | ||
* 标题 | ||
*/ | ||
title?: string | ||
/** | ||
* 是否本地 | ||
*/ | ||
isLocal: boolean | ||
|
||
constructor(originUrl: string, url: string, isLocal: boolean, alt?: string, title?: string) { | ||
this.originUrl = originUrl | ||
this.name = originUrl.substring(originUrl.lastIndexOf("/") + 1) | ||
this.hash = getFileHash(this.name) | ||
this.url = url | ||
this.isLocal = isLocal | ||
this.alt = alt ?? "" | ||
this.title = title ?? "" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* GNU GENERAL PUBLIC LICENSE | ||
* Version 3, 29 June 2007 | ||
* | ||
* Copyright (C) 2024 Terwer, Inc. <https://terwer.space/> | ||
* Everyone is permitted to copy and distribute verbatim copies | ||
* of this license document, but changing it is not allowed. | ||
*/ | ||
|
||
/** | ||
* 解析的图片 | ||
* | ||
* @author terwer | ||
* @since 0.8.0 | ||
*/ | ||
export class ParsedImage { | ||
/** | ||
* 链接 | ||
*/ | ||
url: string | ||
/** | ||
* 备注 | ||
*/ | ||
alt: string | ||
/** | ||
* 标题 | ||
*/ | ||
title: string | ||
/** | ||
* 是否本地 | ||
*/ | ||
isLocal: boolean | ||
|
||
constructor() { | ||
this.url = "" | ||
this.isLocal = false | ||
this.alt = "" | ||
this.title = "" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* GNU GENERAL PUBLIC LICENSE | ||
* Version 3, 29 June 2007 | ||
* | ||
* Copyright (C) 2022-2024 Terwer, Inc. <https://terwer.space/> | ||
* Everyone is permitted to copy and distribute verbatim copies | ||
* of this license document, but changing it is not allowed. | ||
*/ | ||
|
||
/** | ||
* Picgo处理文章统一返回结果 | ||
*/ | ||
export class PicgoPostResult { | ||
/** | ||
* 是否成功 | ||
*/ | ||
flag: boolean | ||
/** | ||
* 是否有图片 | ||
*/ | ||
hasImages: boolean | ||
/** | ||
* 处理后的文章链接 | ||
*/ | ||
mdContent: string | ||
/** | ||
* 错误信息 | ||
*/ | ||
errmsg: string | ||
|
||
constructor() { | ||
this.flag = false | ||
this.hasImages = false | ||
this.mdContent = "" | ||
this.errmsg = "" | ||
} | ||
} |
Oops, something went wrong.