updated from origin
This commit is contained in:
commit
ed26b269d5
|
|
@ -7,7 +7,7 @@ on:
|
|||
tag:
|
||||
description: 'Tag for the Docker image'
|
||||
required: false
|
||||
default: '2.3.6'
|
||||
default: 'v1.2.2'
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
|
|
@ -32,5 +32,5 @@ jobs:
|
|||
context: ./lib
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: xdbin/beancount-alpine:${{ github.event.inputs.tag }}
|
||||
tags: frankwuzp/beancount-gs:${{ github.event.inputs.tag }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ version: "3.9"
|
|||
services:
|
||||
app:
|
||||
container_name: beancount-gs
|
||||
image: frankwuzp/beancount-gs:latest
|
||||
image: xdbin/beancount-gs:${tag:-latest}
|
||||
ports:
|
||||
- "10000:80"
|
||||
volumes:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ COPY public/icons ./public/default_icons
|
|||
RUN go build .
|
||||
|
||||
# 镜像
|
||||
FROM xdbin/beancount-alpine:2.3.6
|
||||
FROM frankwuzp/beancount-gs:v1.2.2
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=go_builder /app/beancount-gs ./
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 9.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
File diff suppressed because it is too large
Load Diff
|
|
@ -6,6 +6,7 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
|
@ -268,14 +269,30 @@ func CleanString(str string) string {
|
|||
if IsComment(str) {
|
||||
return ""
|
||||
}
|
||||
result := getAccountWithNumber(str)
|
||||
// 去除 " ", ";", "\r"
|
||||
result := strings.ReplaceAll(str, ",", "")
|
||||
result = strings.ReplaceAll(result, ",", "")
|
||||
result = strings.ReplaceAll(result, " ", "")
|
||||
// 过滤空白的商户信息 ““
|
||||
result = strings.ReplaceAll(result, "\"\"", "")
|
||||
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.1")
|
||||
OK(c, "v1.2.2")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue