feat: 迁移plant

This commit is contained in:
Blizzard
2026-05-23 13:55:05 +08:00
parent a93477ea8e
commit ae6d03d351
228 changed files with 25296 additions and 917 deletions
@@ -8,18 +8,21 @@ import (
"sundynix-micro-go/app/plant/api/internal/logic/callback"
"sundynix-micro-go/app/plant/api/internal/svc"
"sundynix-micro-go/common/response"
)
// 微信支付回调
// 注意:微信要求必须返回 200 OK,否则会持续重试,此处不走统一 response 包装
func WechatPayCallbackHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := callback.NewWechatPayCallbackLogic(r.Context(), svcCtx)
err := l.WechatPayCallback()
if err != nil {
response.Fail(w, err.Error())
} else {
response.Ok(w)
if err := l.WechatPayCallback(r); err != nil {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusBadRequest)
_, _ = w.Write([]byte(`{"code":"FAIL","message":"处理失败"}`))
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte(`{"code":"SUCCESS","message":"成功"}`))
}
}