Compare commits
No commits in common. "main" and "v1.2.0" have entirely different histories.
Binary file not shown.
|
After Width: | Height: | Size: 8.8 KiB |
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"files": {
|
||||
"main.css": "/web/static/css/main.c87495cb.css",
|
||||
"main.js": "/web/static/js/main.ad3a4211.js",
|
||||
"main.js": "/web/static/js/main.4048a838.js",
|
||||
"static/js/999.1397823d.chunk.js": "/web/static/js/999.1397823d.chunk.js",
|
||||
"static/css/832.a9c07082.chunk.css": "/web/static/css/832.a9c07082.chunk.css",
|
||||
"static/js/832.dcbb6410.chunk.js": "/web/static/js/832.dcbb6410.chunk.js",
|
||||
"static/js/832.9e3b38ee.chunk.js": "/web/static/js/832.9e3b38ee.chunk.js",
|
||||
"static/css/967.892220ee.chunk.css": "/web/static/css/967.892220ee.chunk.css",
|
||||
"static/js/967.86639f46.chunk.js": "/web/static/js/967.86639f46.chunk.js",
|
||||
"static/js/967.25b81fb0.chunk.js": "/web/static/js/967.25b81fb0.chunk.js",
|
||||
"static/css/751.31d6cfe0.chunk.css": "/web/static/css/751.31d6cfe0.chunk.css",
|
||||
"static/js/751.470004cf.chunk.js": "/web/static/js/751.470004cf.chunk.js",
|
||||
"static/css/107.e31e2bec.chunk.css": "/web/static/css/107.e31e2bec.chunk.css",
|
||||
|
|
@ -39,6 +39,6 @@
|
|||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.c87495cb.css",
|
||||
"static/js/main.ad3a4211.js"
|
||||
"static/js/main.4048a838.js"
|
||||
]
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="zh"><head><meta charset="utf-8"/><link rel="icon" href="/web/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"><meta name="theme-color" content="#000000"/><meta name="description" content="beancount-gs,基于beancount的个人记账财务管理软件"/><link rel="apple-touch-icon" href="/web/logo192.png"/><link rel="manifest" href="/web/manifest.json"/><title>你的个人财务管理软件 | beancount-gs</title><script defer="defer" src="/web/static/js/main.ad3a4211.js"></script><link href="/web/static/css/main.c87495cb.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
<!doctype html><html lang="zh"><head><meta charset="utf-8"/><link rel="icon" href="/web/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"><meta name="theme-color" content="#000000"/><meta name="description" content="beancount-gs,基于beancount的个人记账财务管理软件"/><link rel="apple-touch-icon" href="/web/logo192.png"/><link rel="manifest" href="/web/manifest.json"/><title>你的个人财务管理软件 | beancount-gs</title><script defer="defer" src="/web/static/js/main.4048a838.js"></script><link href="/web/static/css/main.c87495cb.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -6,7 +6,6 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
@ -269,30 +268,13 @@ func CleanString(str string) string {
|
|||
if IsComment(str) {
|
||||
return ""
|
||||
}
|
||||
result := getAccountWithNumber(str)
|
||||
// 去除 " ", ";", "\r"
|
||||
result = strings.ReplaceAll(result, ",", "")
|
||||
result = strings.ReplaceAll(result, " ", "")
|
||||
// 过滤空白的商户信息 ““
|
||||
result = strings.ReplaceAll(result, "\"\"", "")
|
||||
result := strings.ReplaceAll(str, " ", "")
|
||||
result = strings.ReplaceAll(result, ";", "")
|
||||
result = strings.ReplaceAll(result, "\r", "")
|
||||
// 清楚汇率转换
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// 正则提取:
|
||||
// Assets:Flow:Cash:现金 -20.00 USD {xxx CNY, 2025-01-01} -> Assets:Flow:Cash:现金 -20.00 USD
|
||||
func getAccountWithNumber(str string) string {
|
||||
// 定义正则表达式模式
|
||||
pattern := `^[^\{]+`
|
||||
// 编译正则表达式
|
||||
re := regexp.MustCompile(pattern)
|
||||
// 使用正则提取匹配的部分
|
||||
return re.FindString(str)
|
||||
}
|
||||
|
||||
func IsComment(line string) bool {
|
||||
trimmed := strings.TrimLeft(line, " ")
|
||||
if strings.HasPrefix(trimmed, ";") {
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ package service
|
|||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func QueryVersion(c *gin.Context) {
|
||||
OK(c, "v1.2.2")
|
||||
OK(c, "v1.2.0")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue