feat: update go module, add recharge wechat
Some checks failed
build quyun / Build (push) Failing after 12m45s

This commit is contained in:
2025-12-04 11:47:37 +08:00
parent b678ef1f9e
commit bc495544c8
10 changed files with 72 additions and 58 deletions

View File

@@ -10,6 +10,7 @@ import (
"quyun/app/requests"
"quyun/database/fields"
"quyun/providers/ali"
"quyun/providers/app"
"quyun/providers/job"
"quyun/providers/wepay"
@@ -29,6 +30,7 @@ type posts struct {
wepay *wepay.Client
oss *ali.OSSClient
job *job.Job
app *app.Config
}
// List posts
@@ -81,16 +83,17 @@ func (ctl *posts) List(
_, bought := userBoughtIds[item.ID]
return PostItem{
ID: item.ID,
Title: item.Title,
Description: item.Description,
Price: item.Price,
Discount: item.Discount,
Views: item.Views,
Likes: item.Likes,
Tags: item.Tags.Data,
HeadImages: mediaUrls,
Bought: bought,
ID: item.ID,
Title: item.Title,
Description: item.Description,
Price: item.Price,
Discount: item.Discount,
Views: item.Views,
Likes: item.Likes,
Tags: item.Tags.Data,
HeadImages: mediaUrls,
Bought: bought,
RechargeWechat: ctl.app.RechargeWechat,
}, true
})
@@ -101,17 +104,18 @@ func (ctl *posts) List(
}
type PostItem struct {
ID int64 `json:"id"`
Bought bool `json:"bought"`
Title string `json:"title"`
Description string `json:"description"`
Content string `json:"content"`
Price int64 `json:"price"`
Discount int16 `json:"discount"`
Views int64 `json:"views"`
Likes int64 `json:"likes"`
Tags []string `json:"tags"`
HeadImages []string `json:"head_images"`
ID int64 `json:"id"`
Bought bool `json:"bought"`
Title string `json:"title"`
Description string `json:"description"`
Content string `json:"content"`
Price int64 `json:"price"`
Discount int16 `json:"discount"`
Views int64 `json:"views"`
Likes int64 `json:"likes"`
Tags []string `json:"tags"`
HeadImages []string `json:"head_images"`
RechargeWechat string `json:"recharge_wechat,omitempty"`
}
// Show
@@ -148,17 +152,18 @@ func (ctl *posts) Show(ctx fiber.Ctx, id int64, user *model.Users) (*PostItem, e
})
return &PostItem{
ID: post.ID,
Title: post.Title,
Description: post.Description,
Content: post.Content,
Price: post.Price,
Discount: post.Discount,
Views: post.Views,
Likes: post.Likes,
Tags: post.Tags.Data,
HeadImages: mediaUrls,
Bought: bought,
ID: post.ID,
Title: post.Title,
Description: post.Description,
Content: post.Content,
Price: post.Price,
Discount: post.Discount,
Views: post.Views,
Likes: post.Likes,
Tags: post.Tags.Data,
HeadImages: mediaUrls,
Bought: bought,
RechargeWechat: ctl.app.RechargeWechat,
}, nil
}
@@ -262,15 +267,16 @@ func (ctl *posts) Mine(
})
return PostItem{
ID: item.ID,
Title: item.Title,
Description: item.Description,
Price: item.Price,
Discount: item.Discount,
Views: item.Views,
Likes: item.Likes,
Tags: item.Tags.Data,
HeadImages: mediaUrls,
ID: item.ID,
Title: item.Title,
Description: item.Description,
Price: item.Price,
Discount: item.Discount,
Views: item.Views,
Likes: item.Likes,
Tags: item.Tags.Data,
HeadImages: mediaUrls,
RechargeWechat: ctl.app.RechargeWechat,
}, true
})

View File

@@ -2,6 +2,7 @@ package http
import (
"quyun/providers/ali"
"quyun/providers/app"
"quyun/providers/job"
"quyun/providers/jwt"
"quyun/providers/wechat"
@@ -44,11 +45,13 @@ func Provide(opts ...opt.Option) error {
job *job.Job,
oss *ali.OSSClient,
wepay *wepay.Client,
appConfig *app.Config,
) (*posts, error) {
obj := &posts{
job: job,
oss: oss,
wepay: wepay,
app: appConfig,
}
return obj, nil

View File

@@ -4,6 +4,7 @@ BaseURI = "https://mp.jdwan.com"
StoragePath = "/app/downloads"
DistAdmin = "/app/dist/admin"
DistWeChat = "/app/dist/wechat"
RechargeWechat = "13932043996"
[Http]
Port = 9888

View File

@@ -5,6 +5,7 @@ BaseURI = "baseURI"
StoragePath = "/Users/rogee/Projects/self/quyun/fixtures"
DistAdmin = "frontend/admin/dist"
DistWeChat = "frontend/wechat/dist"
RechargeWechat = "13932043996"
[Http]
Port = 8088
@@ -84,4 +85,4 @@ tjNmYNK/H5FLuZVVUilEiWn8XskxGEKiGh0KhMEl3YRPPzguADPck9Ip4tgn4UDt
fUs5UFrzH3A4cpuc1Je3wJ3vqztu3sr+G3LBSXCvYD7EkDhXMHCv01cJBxBN876T
442YAFX94VJ79/xwwmXOgCLz1QegDd6M+Um0l5BkQoOIqDlEkWsOvRo9iOsZ25H9
kQIDAQAB
-----END PUBLIC KEY-----"""
-----END PUBLIC KEY-----"""

View File

@@ -2,6 +2,7 @@
Mode = "development"
BaseURI = "baseURI"
StoragePath = "/Users/rogee/Projects/self/quyun/fixtures"
RechargeWechat = "13932043996"
[Http]
Port = 8088
@@ -82,4 +83,4 @@ tjNmYNK/H5FLuZVVUilEiWn8XskxGEKiGh0KhMEl3YRPPzguADPck9Ip4tgn4UDt
fUs5UFrzH3A4cpuc1Je3wJ3vqztu3sr+G3LBSXCvYD7EkDhXMHCv01cJBxBN876T
442YAFX94VJ79/xwwmXOgCLz1QegDd6M+Um0l5BkQoOIqDlEkWsOvRo9iOsZ25H9
kQIDAQAB
-----END PUBLIC KEY-----"""
-----END PUBLIC KEY-----"""

View File

@@ -37,7 +37,7 @@ require (
github.com/stretchr/testify v1.10.0
github.com/swaggo/files/v2 v2.0.2
github.com/uber/jaeger-client-go v2.30.0+incompatible
go.ipao.vip/atom v1.1.8
go.ipao.vip/atom v1.2.1
go.opentelemetry.io/contrib/instrumentation/runtime v0.60.0
go.opentelemetry.io/otel v1.35.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0
@@ -50,6 +50,7 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.35.0
go.opentelemetry.io/otel/trace v1.35.0
go.uber.org/dig v1.18.1
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e
golang.org/x/net v0.35.0
golang.org/x/sync v0.12.0
google.golang.org/grpc v1.71.0
@@ -152,7 +153,6 @@ require (
go.uber.org/mock v0.5.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect

View File

@@ -337,8 +337,8 @@ github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcY
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.ipao.vip/atom v1.1.8 h1:xiEpK2RPv/kxwxvN9tzJ8uClsmVskLEjnyZKoGfm04U=
go.ipao.vip/atom v1.1.8/go.mod h1:woAv+rZf0xd+7mEtKWv4PyazQARFLnrV/qA4qlAK008=
go.ipao.vip/atom v1.2.1 h1:7VlDLSkGNVEZLVM/JVcXXdMTO0+sFsxe1vfIM4Xz8uc=
go.ipao.vip/atom v1.2.1/go.mod h1:woAv+rZf0xd+7mEtKWv4PyazQARFLnrV/qA4qlAK008=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/runtime v0.60.0 h1:0NgN/3SYkqYJ9NBlDfl/2lzVlwos/YQLvi8sUrzJRBE=

View File

@@ -21,12 +21,13 @@ func DefaultProvider() container.ProviderContainer {
type AppMode string
type Config struct {
Mode AppMode
Cert *Cert
BaseURI *string
StoragePath string
DistAdmin string
DistWeChat string
Mode AppMode
Cert *Cert
BaseURI *string
StoragePath string
DistAdmin string
DistWeChat string
RechargeWechat string
}
func (c *Config) IsDevMode() bool {