Compare commits

...

21 Commits
pro ... pre

Author SHA1 Message Date
fuzhongyun 5b159cd8e5 Merge branch 'pro' into pre 2026-09-23 18:19:22 +08:00
fuzhongyun bd670ee717 Merge branch 'pro' into pre 2026-09-23 18:14:27 +08:00
fuzhongyun 3906fb9690 Merge branch 'feature/fzy/multi-notify' into pre 2026-05-29 10:26:19 +08:00
李子铭 ed44b84d31 Merge branch 'dev' into pre 2025-09-11 10:16:50 +08:00
李子铭 3dd5f2efa5 Merge branch 'dev' into pre 2025-09-11 10:10:42 +08:00
李子铭 f20310775d Merge branch 'dev' into pre 2025-09-11 09:22:25 +08:00
ziming bd72f853a5 Merge branch 'pro' into pre 2025-06-09 09:30:02 +08:00
ziming c222b06fab Merge branch 'pro' into pre
# Conflicts:
#	internal/service/cmb.go
#	internal/service/mock.go
2025-06-06 09:18:18 +08:00
ziming a4e4dbda83 Merge branch 'dev' into pre 2025-05-16 13:41:33 +08:00
ziming 729a23e410 Merge branch 'pro' into pre 2025-05-12 09:52:37 +08:00
ziming ae34f4153a Merge branch 'pro' into pre 2025-05-12 09:41:16 +08:00
ziming 77e2b82aa9 Merge branch 'pro' into pre 2025-05-12 09:19:21 +08:00
ziming 9cfd31b1e7 Merge branch 'pro' into pre 2025-05-06 14:57:44 +08:00
ziming f85cf646f9 Merge branch 'dev' into pre 2025-05-06 11:15:40 +08:00
ziming fb8330888b request.WithTimeout 2025-05-06 09:44:50 +08:00
ziming c209c645f7 Merge branch 'pro' into pre
# Conflicts:
#	internal/server/http.go
#	internal/service/cmb.go
2025-05-06 09:42:12 +08:00
ziming 21743caae9 order query 2025-04-29 15:54:50 +08:00
ziming b20fa8ad35 order query 2025-04-29 15:54:29 +08:00
ziming a5e48469f1 order query 2025-04-29 13:42:27 +08:00
ziming 465192e6fd order query 2025-04-29 11:31:18 +08:00
ziming 295923cccc order query 2025-04-29 11:21:39 +08:00
4 changed files with 81 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import (
"github.com/nacos-group/nacos-sdk-go/common/constant"
_ "go.uber.org/automaxprocs"
"gopkg.in/yaml.v2"
"html/template"
"os"
"voucher/internal/conf"
log2 "voucher/internal/pkg/log"
@ -127,7 +128,7 @@ func main() {
businessLogger := log2.NewBusinessLogger(bc.Logs.Business, Name, Name, Version)
accessLogger := log2.NewAccessLogger(bc.Logs.Access, id, Name, Version)
app, cleanup, err := wireApp(bc, businessLogger, accessLogger)
app, cleanup, err := wireApp(bc, temp(), businessLogger, accessLogger)
if err != nil {
panic(err)
}
@ -138,3 +139,17 @@ func main() {
panic(err)
}
}
func temp() *template.Template {
wd, err := os.Getwd()
if err != nil {
panic(fmt.Sprintf("获取当前工作目录失败:", err))
}
templatePath := fmt.Sprintf("%s/templates/index.tmpl", wd)
tmpl, err := template.ParseFiles(templatePath)
if err != nil {
panic(err)
}
return tmpl
}

View File

@ -10,6 +10,7 @@ import (
"github.com/go-kratos/kratos/v2/log"
"github.com/google/wire"
"github.com/robfig/cron"
"html/template"
"voucher/internal/biz"
"voucher/internal/biz/cmb"
"voucher/internal/biz/timeslicequery"
@ -24,7 +25,7 @@ import (
)
// wireApp init kratos application.
func wireApp(*conf.Bootstrap, log.Logger, *log2.AccessLogger) (*kratos.App, func(), error) {
func wireApp(*conf.Bootstrap, *template.Template, log.Logger, *log2.AccessLogger) (*kratos.App, func(), error) {
panic(wire.Build(
server.ProviderSetServer,
service.ProviderSetService,

View File

@ -11,6 +11,7 @@ docker stop $server && docker rm $server
docker run --network=merketing-network -itd --name $server --restart=always \
-p $http_port:13000 \
-v /var/www/marketing/cert:/app/cert \
-v /var/www/marketing/templates:/app/templates \
registry.cn-chengdu.aliyuncs.com/lsxdjr/$image:"${CI_COMMIT_ID}" \
./server -nacosIp "47.110.74.203" -nacosPort 8848 -nacosSpace "voucher" -nacosUsername "" -nacosPassword ""
docker image prune -f

62
templates/index.tmpl Normal file
View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{.Title}}</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
h1 {
color: #FF6600; /* 设置为橙色,可替换为其他颜色代码 */
text-align: center;
margin-bottom: 30px;
}
pre {
background-color: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
white-space: pre-line;
line-height: 1.6;
font-size: 16px;
}
pre strong {
color: #007BFF;
}
</style>
</head>
<body>
<pre>
{{if.Order}}
<strong>订单号:</strong> {{.Order.OrderNo}}
<strong>招行订单号:</strong> {{.Order.OutBizNo}}
<strong>订单状态:</strong> {{.Order.Status.GetText}}
<strong>openid:</strong> {{.Order.Account}}
<strong>微信券ID:</strong> {{.Order.VoucherNo}}
<strong>商品编号:</strong> {{.Order.ProductNo}}
<strong>批次号:</strong> {{.Order.BatchNo}}
<strong>商户号:</strong> {{.Order.MerchantNo}}
<strong>appId:</strong> {{.Order.AppID}}
<strong>订单创建时间:</strong> {{.Order.CreateTime}}
<strong>领取成功时间(成功即有该值):</strong> {{.Order.ReceiveSuccessTime}}
<strong>最后一次核销时间(核销即有该值):</strong> {{.Order.LastUseTime}}
<strong>订单备注说明(失败说明):</strong> {{.Order.Remark}}
{{else}}
<h1 style="color: #FF6600">{{.ErrMsg}}</h1>
{{end}}
</pre>
</body>
</html>