Compare commits

..

No commits in common. "main" and "1.02" have entirely different histories.
main ... 1.02

30 changed files with 724 additions and 14838 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,2 +0,0 @@
ls pb/bundle/*.pb.go | xargs -n1 -IX bash -c 'sed s/,omitempty// X > X.tmp && mv X{.tmp,}';

View File

@ -1,18 +1,17 @@
package main package main
import ( import (
bundleConfig "micro-bundle/config"
"micro-bundle/internal/controller"
_ "micro-bundle/internal/handler"
"micro-bundle/pkg/app"
"micro-bundle/pkg/tracing"
"dubbo.apache.org/dubbo-go/v3/config" "dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/filter/tps/strategy" _ "dubbo.apache.org/dubbo-go/v3/filter/tps/strategy"
_ "dubbo.apache.org/dubbo-go/v3/imports" _ "dubbo.apache.org/dubbo-go/v3/imports"
"github.com/bwmarrin/snowflake" "github.com/bwmarrin/snowflake"
"go.uber.org/zap" "go.uber.org/zap"
"gorm.io/gorm" "gorm.io/gorm"
bundleConfig "micro-bundle/config"
"micro-bundle/internal/controller"
_ "micro-bundle/internal/handler"
"micro-bundle/pkg/app"
"micro-bundle/pkg/tracing"
) )
func NewApp(Lg *zap.Logger, JaegerTracer *tracing.JaegerProvider, SfNode *snowflake.Node, BundleDB *gorm.DB) *app.App { func NewApp(Lg *zap.Logger, JaegerTracer *tracing.JaegerProvider, SfNode *snowflake.Node, BundleDB *gorm.DB) *app.App {
@ -31,6 +30,7 @@ func main() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
//l, err := net.Listen("tcp", ":8883") //l, err := net.Listen("tcp", ":8883")
//if err != nil { //if err != nil {
// fmt.Printf("failed to listen: %v", err) // fmt.Printf("failed to listen: %v", err)
@ -47,17 +47,4 @@ func main() {
panic(err) panic(err)
} }
select {} select {}
// dao.AddBundleExtendRecord(model.BundleExtensionRecords{
// UserId: 57,
// OperatorId: 87,
// AccountAdditional: 1,
// VideoAdditional: 1,
// AvailableDurationAdditional: 1,
// ImagesAdditional: 1,
// DataAdditional: 1,
// AssociatedOrderNumber: "asda",
// Type: 1,
// Remark: "test",
// CreatedAt: time.Now(),
// })
} }

View File

@ -1267,103 +1267,3 @@
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T07:32:47.170+0800","caller":"zookeeper/listener.go:226","message":"delete zkNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D83612%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743204742%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"} {"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T07:32:47.170+0800","caller":"zookeeper/listener.go:226","message":"delete zkNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D83612%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743204742%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T07:32:47.170+0800","caller":"zookeeper/listener.go:338","message":"listenDirEvent->listenSelf(zk path{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D83612%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743204742%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}) goroutine exit now"} {"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T07:32:47.170+0800","caller":"zookeeper/listener.go:338","message":"listenDirEvent->listenSelf(zk path{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D83612%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743204742%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}) goroutine exit now"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T07:32:47.171+0800","caller":"zookeeper/listener.go:244","message":"delete oldNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D83612%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743204742%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"} {"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T07:32:47.171+0800","caller":"zookeeper/listener.go:244","message":"delete oldNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D83612%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743204742%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.820+0800","caller":"config/root_config.go:129","message":"[Config Center] Config center doesn't start"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.821+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=91640&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1743219000&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.822+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/com.fontree.microservices.fiee.bundle?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=BundleProvider&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=com.fontree.microservices.fiee.bundle&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=91640&registry=zookeeper&registry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider&timestamp=1743219000&tps.limit.interval=1000&tps.limit.rate=30&tps.limit.rejected.handler=DefaultValueHandler&tps.limit.strategy=fixedWindow&tps.limiter=method-service&warmup=100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.822+0800","caller":"zookeeper/registry.go:67","message":"[Zookeeper Registry] New zookeeper registry with url map[host:127.0.0.1 port:2181 protocol:zookeeper registry:zookeeper registry.group: registry.label:true registry.namespace: registry.preferred:false registry.role:3 registry.timeout:10s registry.ttl:10s registry.weight:0 registry.zone: remote-client-name:dubbo.registries-zookeeper-127.0.0.1:2181 simplified:false]"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.823+0800","caller":"zookeeper/client.go:53","message":"[Zookeeper Client] New zookeeper client with name = 127.0.0.1:2181, zkAddress = 127.0.0.1:2181, timeout = 5s"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.882+0800","caller":"zookeeper/registry.go:217","message":"[Zookeeper Registry] Registry instance with root = /dubbo/com.fontree.microservices.fiee.bundle/providers, node = tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.898+0800","caller":"zookeeper/listener.go:392","message":"[Zookeeper Listener] listen dubbo path{/dubbo/com.fontree.microservices.fiee.bundle/providers}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.898+0800","caller":"dubbo/dubbo_protocol.go:83","message":"[DUBBO Protocol] Export service: dubbo://:63140/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=91640&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1743219000&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:00.899+0800","caller":"configurable/exporter.go:77","message":"[Metadata Service] The MetadataService exports urls : [dubbo://:63140/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=91640&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1743219000&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup=] "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:04.962+0800","caller":"config/root_config.go:129","message":"[Config Center] Config center doesn't start"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:30:04.962+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=92796&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1743219004&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:30:04.962+0800","caller":"prometheus/reporter.go:237","message":"new prometheus reporter with error = listen tcp :9092: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:37.321+0800","caller":"config/graceful_shutdown.go:81","message":"get signal interrupt, applicationConfig will shutdown."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:37.321+0800","caller":"config/graceful_shutdown.go:121","message":"Graceful shutdown --- Destroy all registriesConfig. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:37.328+0800","caller":"config/graceful_shutdown.go:162","message":"Graceful shutdown --- Keep waiting and accept new requests for a short time. "}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:37.328+0800","caller":"zookeeper/listener.go:153","message":"get a zookeeper keyEventCh{type:EventNodeDeleted, server:, path:/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100, state:3-zookeeper connected, err:%!s(<nil>)}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:37.328+0800","caller":"zookeeper/listener.go:153","message":"get a zookeeper keyEventCh{type:EventNodeDeleted, server:, path:/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100, state:3-zookeeper connected, err:%!s(<nil>)}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:37.328+0800","caller":"zookeeper/listener.go:179","message":"[ZkEventListener][listenServiceNodeEvent]Get a EventNodeDeleted event for path {/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:37.328+0800","caller":"zookeeper/listener.go:179","message":"[ZkEventListener][listenServiceNodeEvent]Get a EventNodeDeleted event for path {/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:37.328+0800","caller":"zookeeper/listener.go:226","message":"delete zkNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:37.328+0800","caller":"zookeeper/listener.go:338","message":"listenDirEvent->listenSelf(zk path{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}) goroutine exit now"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:37.329+0800","caller":"zookeeper/listener.go:244","message":"delete oldNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D91640%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219000%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"config/graceful_shutdown.go:193","message":"Graceful shutdown --- Keep waiting until sending/accepting requests finish or timeout. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"config/graceful_shutdown.go:129","message":"Graceful shutdown --- Destroy protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"config/graceful_shutdown.go:144","message":"Graceful shutdown --- First destroy provider's protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"protocol/protocol.go:139","message":"Exporter unexport."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"protocol/invoker.go:91","message":"Destroy invoker: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=91640&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1743219000&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"protocol/protocol.go:139","message":"Exporter unexport."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"protocol/invoker.go:91","message":"Destroy invoker: tri://:20201/com.fontree.microservices.fiee.bundle?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=BundleProvider&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=com.fontree.microservices.fiee.bundle&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=91640&registry=zookeeper&registry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider&timestamp=1743219000&tps.limit.interval=1000&tps.limit.rate=30&tps.limit.rejected.handler=DefaultValueHandler&tps.limit.strategy=fixedWindow&tps.limiter=method-service&warmup=100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"config/graceful_shutdown.go:155","message":"Graceful shutdown --- Second Destroy consumer's protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:40.328+0800","caller":"config/graceful_shutdown.go:113","message":"Graceful shutdown --- Execute the custom callbacks."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.827+0800","caller":"config/root_config.go:129","message":"[Config Center] Config center doesn't start"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.828+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=93332&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1743219110&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.829+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/com.fontree.microservices.fiee.bundle?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=BundleProvider&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=com.fontree.microservices.fiee.bundle&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=93332&registry=zookeeper&registry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider&timestamp=1743219110&tps.limit.interval=1000&tps.limit.rate=30&tps.limit.rejected.handler=DefaultValueHandler&tps.limit.strategy=fixedWindow&tps.limiter=method-service&warmup=100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.829+0800","caller":"zookeeper/registry.go:67","message":"[Zookeeper Registry] New zookeeper registry with url map[host:127.0.0.1 port:2181 protocol:zookeeper registry:zookeeper registry.group: registry.label:true registry.namespace: registry.preferred:false registry.role:3 registry.timeout:10s registry.ttl:10s registry.weight:0 registry.zone: remote-client-name:dubbo.registries-zookeeper-127.0.0.1:2181 simplified:false]"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.829+0800","caller":"zookeeper/client.go:53","message":"[Zookeeper Client] New zookeeper client with name = 127.0.0.1:2181, zkAddress = 127.0.0.1:2181, timeout = 5s"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.850+0800","caller":"zookeeper/registry.go:217","message":"[Zookeeper Registry] Registry instance with root = /dubbo/com.fontree.microservices.fiee.bundle/providers, node = tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D93332%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219110%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.861+0800","caller":"zookeeper/listener.go:392","message":"[Zookeeper Listener] listen dubbo path{/dubbo/com.fontree.microservices.fiee.bundle/providers}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.861+0800","caller":"dubbo/dubbo_protocol.go:83","message":"[DUBBO Protocol] Export service: dubbo://:63379/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=93332&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1743219110&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:50.862+0800","caller":"configurable/exporter.go:77","message":"[Metadata Service] The MetadataService exports urls : [dubbo://:63379/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=93332&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1743219110&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup=] "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:52.518+0800","caller":"config/graceful_shutdown.go:81","message":"get signal interrupt, applicationConfig will shutdown."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:52.518+0800","caller":"config/graceful_shutdown.go:121","message":"Graceful shutdown --- Destroy all registriesConfig. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:52.521+0800","caller":"config/graceful_shutdown.go:162","message":"Graceful shutdown --- Keep waiting and accept new requests for a short time. "}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:52.521+0800","caller":"zookeeper/listener.go:153","message":"get a zookeeper keyEventCh{type:EventNodeDeleted, server:, path:/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D93332%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219110%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100, state:3-zookeeper connected, err:%!s(<nil>)}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-03-29T11:31:52.521+0800","caller":"zookeeper/listener.go:179","message":"[ZkEventListener][listenServiceNodeEvent]Get a EventNodeDeleted event for path {/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D93332%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219110%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:52.521+0800","caller":"zookeeper/listener.go:338","message":"listenDirEvent->listenSelf(zk path{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D93332%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219110%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}) goroutine exit now"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-03-29T11:31:52.522+0800","caller":"zookeeper/listener.go:244","message":"delete oldNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F192.168.88.77%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DBundleDetail%2CBundleList%2CCreateBundle%2CCreateOrderRecord%2CCreateValueAddBundle%2CDeleteBundle%2COrderRecordsDetail%2COrderRecordsList%2CUpdateBundle%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CValueAddBundleDetail%2CValueAddBundleList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D93332%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1743219110%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.300+0800","caller":"config/root_config.go:129","message":"[Config Center] Config center doesn't start"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.302+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=32300&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1750930370&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.304+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/com.fontree.microservices.fiee.bundle?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=BundleProvider&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=com.fontree.microservices.fiee.bundle&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=32300&registry=zookeeper&registry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider&timestamp=1750930370&tps.limit.interval=1000&tps.limit.rate=30&tps.limit.rejected.handler=DefaultValueHandler&tps.limit.strategy=fixedWindow&tps.limiter=method-service&warmup=100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.304+0800","caller":"zookeeper/registry.go:67","message":"[Zookeeper Registry] New zookeeper registry with url map[host:127.0.0.1 port:2181 protocol:zookeeper registry:zookeeper registry.group: registry.label:true registry.namespace: registry.preferred:false registry.role:3 registry.timeout:10s registry.ttl:10s registry.weight:0 registry.zone: remote-client-name:dubbo.registries-zookeeper-127.0.0.1:2181 simplified:false]"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.304+0800","caller":"zookeeper/client.go:53","message":"[Zookeeper Client] New zookeeper client with name = 127.0.0.1:2181, zkAddress = 127.0.0.1:2181, timeout = 5s"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.377+0800","caller":"zookeeper/registry.go:217","message":"[Zookeeper Registry] Registry instance with root = /dubbo/com.fontree.microservices.fiee.bundle/providers, node = tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D32300%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930370%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.393+0800","caller":"zookeeper/listener.go:392","message":"[Zookeeper Listener] listen dubbo path{/dubbo/com.fontree.microservices.fiee.bundle/providers}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.395+0800","caller":"dubbo/dubbo_protocol.go:83","message":"[DUBBO Protocol] Export service: dubbo://:53003/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=32300&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1750930370&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:50.395+0800","caller":"configurable/exporter.go:77","message":"[Metadata Service] The MetadataService exports urls : [dubbo://:53003/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=32300&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1750930370&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup=] "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:53.212+0800","caller":"config/graceful_shutdown.go:81","message":"get signal interrupt, applicationConfig will shutdown."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:53.212+0800","caller":"config/graceful_shutdown.go:121","message":"Graceful shutdown --- Destroy all registriesConfig. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:53.218+0800","caller":"config/graceful_shutdown.go:162","message":"Graceful shutdown --- Keep waiting and accept new requests for a short time. "}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:32:53.218+0800","caller":"zookeeper/listener.go:153","message":"get a zookeeper keyEventCh{type:EventNodeDeleted, server:, path:/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D32300%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930370%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100, state:3-zookeeper connected, err:%!s(<nil>)}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:53.218+0800","caller":"zookeeper/listener.go:179","message":"[ZkEventListener][listenServiceNodeEvent]Get a EventNodeDeleted event for path {/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D32300%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930370%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:32:53.218+0800","caller":"zookeeper/listener.go:338","message":"listenDirEvent->listenSelf(zk path{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D32300%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930370%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}) goroutine exit now"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:32:53.219+0800","caller":"zookeeper/listener.go:244","message":"delete oldNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D32300%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930370%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.218+0800","caller":"config/graceful_shutdown.go:193","message":"Graceful shutdown --- Keep waiting until sending/accepting requests finish or timeout. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.218+0800","caller":"config/graceful_shutdown.go:129","message":"Graceful shutdown --- Destroy protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.218+0800","caller":"config/graceful_shutdown.go:144","message":"Graceful shutdown --- First destroy provider's protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.218+0800","caller":"protocol/protocol.go:139","message":"Exporter unexport."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.218+0800","caller":"protocol/invoker.go:91","message":"Destroy invoker: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=32300&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1750930370&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.218+0800","caller":"protocol/protocol.go:139","message":"Exporter unexport."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.218+0800","caller":"protocol/invoker.go:91","message":"Destroy invoker: tri://:20201/com.fontree.microservices.fiee.bundle?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=BundleProvider&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=com.fontree.microservices.fiee.bundle&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=32300&registry=zookeeper&registry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider&timestamp=1750930370&tps.limit.interval=1000&tps.limit.rate=30&tps.limit.rejected.handler=DefaultValueHandler&tps.limit.strategy=fixedWindow&tps.limiter=method-service&warmup=100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.219+0800","caller":"config/graceful_shutdown.go:155","message":"Graceful shutdown --- Second Destroy consumer's protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:32:56.219+0800","caller":"config/graceful_shutdown.go:113","message":"Graceful shutdown --- Execute the custom callbacks."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.831+0800","caller":"config/root_config.go:129","message":"[Config Center] Config center doesn't start"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.832+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=46056&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1750930414&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.833+0800","caller":"dubbo3/dubbo3_protocol.go:81","message":"[Triple Protocol] Export service: tri://:20201/com.fontree.microservices.fiee.bundle?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=BundleProvider&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=com.fontree.microservices.fiee.bundle&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=46056&registry=zookeeper&registry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider&timestamp=1750930414&tps.limit.interval=1000&tps.limit.rate=30&tps.limit.rejected.handler=DefaultValueHandler&tps.limit.strategy=fixedWindow&tps.limiter=method-service&warmup=100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.833+0800","caller":"zookeeper/registry.go:67","message":"[Zookeeper Registry] New zookeeper registry with url map[host:127.0.0.1 port:2181 protocol:zookeeper registry:zookeeper registry.group: registry.label:true registry.namespace: registry.preferred:false registry.role:3 registry.timeout:10s registry.ttl:10s registry.weight:0 registry.zone: remote-client-name:dubbo.registries-zookeeper-127.0.0.1:2181 simplified:false]"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.833+0800","caller":"zookeeper/client.go:53","message":"[Zookeeper Client] New zookeeper client with name = 127.0.0.1:2181, zkAddress = 127.0.0.1:2181, timeout = 5s"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.865+0800","caller":"zookeeper/registry.go:217","message":"[Zookeeper Registry] Registry instance with root = /dubbo/com.fontree.microservices.fiee.bundle/providers, node = tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.881+0800","caller":"zookeeper/listener.go:392","message":"[Zookeeper Listener] listen dubbo path{/dubbo/com.fontree.microservices.fiee.bundle/providers}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.882+0800","caller":"dubbo/dubbo_protocol.go:83","message":"[DUBBO Protocol] Export service: dubbo://:53298/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=46056&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1750930414&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:34.882+0800","caller":"configurable/exporter.go:77","message":"[Metadata Service] The MetadataService exports urls : [dubbo://:53298/org.apache.dubbo.metadata.MetadataService?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=MetadataService&cluster=&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&group=dubbo.io&interface=org.apache.dubbo.metadata.MetadataService&loadbalance=&message_size=0&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=46056&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider&timestamp=1750930414&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&version=1.0.0&warmup=] "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:46.757+0800","caller":"config/graceful_shutdown.go:81","message":"get signal interrupt, applicationConfig will shutdown."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:46.757+0800","caller":"config/graceful_shutdown.go:121","message":"Graceful shutdown --- Destroy all registriesConfig. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:46.761+0800","caller":"config/graceful_shutdown.go:162","message":"Graceful shutdown --- Keep waiting and accept new requests for a short time. "}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:33:46.761+0800","caller":"zookeeper/listener.go:153","message":"get a zookeeper keyEventCh{type:EventNodeDeleted, server:, path:/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100, state:3-zookeeper connected, err:%!s(<nil>)}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:33:46.761+0800","caller":"zookeeper/listener.go:153","message":"get a zookeeper keyEventCh{type:EventNodeDeleted, server:, path:/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100, state:3-zookeeper connected, err:%!s(<nil>)}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:46.761+0800","caller":"zookeeper/listener.go:179","message":"[ZkEventListener][listenServiceNodeEvent]Get a EventNodeDeleted event for path {/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:46.761+0800","caller":"zookeeper/listener.go:179","message":"[ZkEventListener][listenServiceNodeEvent]Get a EventNodeDeleted event for path {/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:33:46.761+0800","caller":"zookeeper/listener.go:226","message":"delete zkNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:33:46.762+0800","caller":"zookeeper/listener.go:338","message":"listenDirEvent->listenSelf(zk path{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}) goroutine exit now"}
{"level":"\u001b[33mWARN\u001b[0m","time":"2025-06-26T17:33:46.762+0800","caller":"zookeeper/listener.go:244","message":"delete oldNode{/dubbo/com.fontree.microservices.fiee.bundle/providers/tri%3A%2F%2F172.23.64.1%3A20201%2Fcom.fontree.microservices.fiee.bundle%3Fanyhost%3Dtrue%26application%3Ddubbo.io%26bean.name%3DBundleProvider%26cluster%3Dfailover%26export%3Dtrue%26interface%3Dcom.fontree.microservices.fiee.bundle%26loadbalance%3Drandom%26message_size%3D4%26metadata-type%3Dlocal%26methods%3DAddBundleBalance%2CBatchGetValueAddServiceLang%2CBundleDetail%2CBundleDetailV2%2CBundleExtend%2CBundleExtendRecordsList%2CBundleLangDetailV2%2CBundleList%2CBundleListH5V2%2CBundleListV2%2CCalculatePrice%2CConfirmWork%2CCreateBundle%2CCreateBundleBalance%2CCreateOrderAddRecord%2CCreateOrderRecord%2CCreateReconciliation%2CCreateValueAddBundle%2CDeleteBundle%2CDeleteValueAddService%2CGetBundleBalanceByUserId%2CGetBundleBalanceList%2CGetImageWorkDetail%2CGetReconciliationList%2CGetUsedRecordList%2CGetVedioWorkDetail%2CHandShelf%2COnlyAddValueListByOrderNo%2COrderListByOrderNo%2COrderRecordsDetail%2COrderRecordsList%2COrderRecordsListV2%2CPackagePriceAndTime%2CSaveBundle%2CSaveValueAddService%2CToBeComfirmedWorks%2CUpdateBundle%2CUpdateFinancialConfirmationStatus%2CUpdateOrderRecord%2CUpdateOrderRecordByOrderNo%2CUpdateReconciliation%2CUpdateReconciliationStatusBySerialNumber%2CValueAddBundleDetail%2CValueAddBundleList%2CValueAddServiceDetail%2CValueAddServiceLangByUuidAndLanguage%2CValueAddServiceList%26module%3Dsample%26name%3Ddubbo.io%26organization%3Ddubbo-go%26owner%3Ddubbo-go%26pid%3D46056%26registry%3Dzookeeper%26registry.role%3D3%26release%3Ddubbo-golang-3.0.0%26retries%3D0%26service.filter%3Dtps%2Ctracing%26side%3Dprovider%26timestamp%3D1750930414%26tps.limit.interval%3D1000%26tps.limit.rate%3D30%26tps.limit.rejected.handler%3DDefaultValueHandler%26tps.limit.strategy%3DfixedWindow%26tps.limiter%3Dmethod-service%26warmup%3D100}"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"config/graceful_shutdown.go:193","message":"Graceful shutdown --- Keep waiting until sending/accepting requests finish or timeout. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"config/graceful_shutdown.go:129","message":"Graceful shutdown --- Destroy protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"config/graceful_shutdown.go:144","message":"Graceful shutdown --- First destroy provider's protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"protocol/protocol.go:139","message":"Exporter unexport."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"protocol/invoker.go:91","message":"Destroy invoker: tri://:20201/com.fontree.microservices.fiee.bundle?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=BundleProvider&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=com.fontree.microservices.fiee.bundle&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=46056&registry=zookeeper&registry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider&timestamp=1750930414&tps.limit.interval=1000&tps.limit.rate=30&tps.limit.rejected.handler=DefaultValueHandler&tps.limit.strategy=fixedWindow&tps.limiter=method-service&warmup=100"}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"protocol/protocol.go:139","message":"Exporter unexport."}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"protocol/invoker.go:91","message":"Destroy invoker: tri://:20201/grpc.reflection.v1alpha.ServerReflection?accesslog=&app.version=&application=dubbo.io&auth=&bean.name=XXX_serverReflectionServer&cluster=failover&config.tracing=&environment=&execute.limit=&execute.limit.rejected.handler=&export=true&interface=grpc.reflection.v1alpha.ServerReflection&loadbalance=random&message_size=4&metadata-type=local&module=sample&name=dubbo.io&organization=dubbo-go&owner=dubbo-go&param.sign=&pid=46056&registry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider&timestamp=1750930414&tps.limit.interval=&tps.limit.rate=&tps.limit.rejected.handler=&tps.limit.strategy=&tps.limiter=&warmup="}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"config/graceful_shutdown.go:155","message":"Graceful shutdown --- Second Destroy consumer's protocols. "}
{"level":"\u001b[34mINFO\u001b[0m","time":"2025-06-26T17:33:49.762+0800","caller":"config/graceful_shutdown.go:113","message":"Graceful shutdown --- Execute the custom callbacks."}

21
go.mod
View File

@ -8,7 +8,6 @@ require (
github.com/bwmarrin/snowflake v0.3.0 github.com/bwmarrin/snowflake v0.3.0
github.com/dubbogo/grpc-go v1.42.9 github.com/dubbogo/grpc-go v1.42.9
github.com/dubbogo/triple v1.1.8 github.com/dubbogo/triple v1.1.8
github.com/duke-git/lancet/v2 v2.3.6
github.com/getsentry/sentry-go v0.28.1 github.com/getsentry/sentry-go v0.28.1
github.com/gin-gonic/gin v1.9.0 github.com/gin-gonic/gin v1.9.0
github.com/go-redis/redis v6.15.9+incompatible github.com/go-redis/redis v6.15.9+incompatible
@ -18,25 +17,19 @@ require (
github.com/mwitkow/go-proto-validators v0.3.2 github.com/mwitkow/go-proto-validators v0.3.2
github.com/natefinch/lumberjack v2.0.0+incompatible github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/opentracing/opentracing-go v1.2.0 github.com/opentracing/opentracing-go v1.2.0
github.com/samber/lo v1.51.0
github.com/shopspring/decimal v1.4.0
github.com/spf13/viper v1.7.1 github.com/spf13/viper v1.7.1
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271 github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271
github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/uber/jaeger-client-go v2.30.0+incompatible
go.uber.org/zap v1.24.0 go.uber.org/zap v1.24.0
google.golang.org/grpc v1.54.0
google.golang.org/protobuf v1.29.1 google.golang.org/protobuf v1.29.1
gorm.io/datatypes v1.2.5 gorm.io/driver/mysql v1.4.7
gorm.io/driver/mysql v1.5.6
gorm.io/gorm v1.25.12 gorm.io/gorm v1.25.12
gorm.io/plugin/soft_delete v1.2.1
) )
require ( require (
cloud.google.com/go/compute v1.15.1 // indirect cloud.google.com/go/compute v1.15.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect
contrib.go.opencensus.io/exporter/prometheus v0.4.1 // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.1 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/RoaringBitmap/roaring v1.2.3 // indirect github.com/RoaringBitmap/roaring v1.2.3 // indirect
github.com/Workiva/go-datastructures v1.0.52 // indirect github.com/Workiva/go-datastructures v1.0.52 // indirect
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 // indirect
@ -75,7 +68,7 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.11.2 // indirect github.com/go-playground/validator/v10 v10.11.2 // indirect
github.com/go-resty/resty/v2 v2.7.0 // indirect github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect github.com/go-sql-driver/mysql v1.7.0 // indirect
github.com/goccy/go-json v0.10.0 // indirect github.com/goccy/go-json v0.10.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
@ -146,16 +139,18 @@ require (
go.uber.org/atomic v1.9.0 // indirect go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect go.uber.org/multierr v1.8.0 // indirect
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
golang.org/x/crypto v0.22.0 // indirect golang.org/x/crypto v0.19.0 // indirect
golang.org/x/net v0.21.0 // indirect golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.4.0 // indirect golang.org/x/oauth2 v0.4.0 // indirect
golang.org/x/sync v0.11.0 // indirect golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.22.0 // indirect golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
google.golang.org/grpc v1.54.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/plugin/soft_delete v1.2.1 // indirect
) )

44
go.sum
View File

@ -45,8 +45,6 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.1/go.mod h1:t9wvfitlUjGXG2IXAZ
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dubbo.apache.org/dubbo-go/v3 v3.0.2 h1:+WuMFN6RSjXHT41QS1Xi5tFfaPuczIVoeQuKq7pISYI= dubbo.apache.org/dubbo-go/v3 v3.0.2 h1:+WuMFN6RSjXHT41QS1Xi5tFfaPuczIVoeQuKq7pISYI=
dubbo.apache.org/dubbo-go/v3 v3.0.2/go.mod h1:bODgByAf72kzG/5YIfZIODXx81pY3gaAdIQ8B4mN/Yk= dubbo.apache.org/dubbo-go/v3 v3.0.2/go.mod h1:bODgByAf72kzG/5YIfZIODXx81pY3gaAdIQ8B4mN/Yk=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
@ -210,8 +208,6 @@ github.com/dubbogo/net v0.0.4/go.mod h1:1CGOnM7X3he+qgGNqjeADuE5vKZQx/eMSeUkpU3u
github.com/dubbogo/triple v1.0.9/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw= github.com/dubbogo/triple v1.0.9/go.mod h1:1t9me4j4CTvNDcsMZy6/OGarbRyAUSY0tFXGXHCp7Iw=
github.com/dubbogo/triple v1.1.8 h1:yE+J3W1NTZCEPa1FoX+VWZH6UF1c0+A2MGfERlU2zbI= github.com/dubbogo/triple v1.1.8 h1:yE+J3W1NTZCEPa1FoX+VWZH6UF1c0+A2MGfERlU2zbI=
github.com/dubbogo/triple v1.1.8/go.mod h1:9pgEahtmsY/avYJp3dzUQE8CMMVe1NtGBmUhfICKLJk= github.com/dubbogo/triple v1.1.8/go.mod h1:9pgEahtmsY/avYJp3dzUQE8CMMVe1NtGBmUhfICKLJk=
github.com/duke-git/lancet/v2 v2.3.6 h1:NKxSSh+dlgp37funvxLCf3xLBeUYa7VW1thYQP6j3Y8=
github.com/duke-git/lancet/v2 v2.3.6/go.mod h1:zGa2R4xswg6EG9I6WnyubDbFO/+A/RROxIbXcwryTsc=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
@ -308,9 +304,8 @@ github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w
github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY=
github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
@ -328,8 +323,6 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA=
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
@ -521,10 +514,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA=
github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw=
github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk=
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag= github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869/go.mod h1:cJ6Cj7dQo+O6GJNiMx+Pa94qKj+TG8ONdKHgMNIyyag=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
@ -624,11 +613,9 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.3/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI=
github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOjvxI=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP3b/PA=
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
@ -795,8 +782,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/samber/lo v1.51.0 h1:kysRYLbHy/MB7kQZf5DSN50JHmMsNEdeY24VzJFu7wI=
github.com/samber/lo v1.51.0/go.mod h1:4+MXEGsJzbKGaUEQFKBq2xtfuznW9oz/WrgyzMzRoM0=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b h1:gQZ0qzfKHQIybLANtM3mBXNUtOfsCFXeTsnBqCsx1KM=
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
@ -805,8 +790,6 @@ github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMT
github.com/shirou/gopsutil/v3 v3.21.6/go.mod h1:JfVbDpIBLVzT8oKbvMg9P3wEIMDDpVn+LwHTKj0ST88= github.com/shirou/gopsutil/v3 v3.21.6/go.mod h1:JfVbDpIBLVzT8oKbvMg9P3wEIMDDpVn+LwHTKj0ST88=
github.com/shirou/gopsutil/v3 v3.22.2 h1:wCrArWFkHYIdDxx/FSfF5RB4dpJYW6t7rcp3+zL8uks= github.com/shirou/gopsutil/v3 v3.22.2 h1:wCrArWFkHYIdDxx/FSfF5RB4dpJYW6t7rcp3+zL8uks=
github.com/shirou/gopsutil/v3 v3.22.2/go.mod h1:WapW1AOOPlHyXr+yOyw3uYx36enocrtSoSBy0L5vUHY= github.com/shirou/gopsutil/v3 v3.22.2/go.mod h1:WapW1AOOPlHyXr+yOyw3uYx36enocrtSoSBy0L5vUHY=
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
@ -994,8 +977,8 @@ golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@ -1128,9 +1111,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@ -1220,8 +1202,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
@ -1241,9 +1223,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@ -1498,17 +1479,12 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/datatypes v1.2.5 h1:9UogU3jkydFVW1bIVVeoYsTpLRgwDVW3rHfJG6/Ek9I= gorm.io/driver/mysql v1.4.7 h1:rY46lkCspzGHn7+IYsNpSfEv9tA+SU4SkkB+GFX125Y=
gorm.io/datatypes v1.2.5/go.mod h1:I5FUdlKpLb5PMqeMQhm30CQ6jXP8Rj89xkTeCSAaAD4= gorm.io/driver/mysql v1.4.7/go.mod h1:SxzItlnT1cb6e1e4ZRpgJN2VYtcqJgqnHxWr4wsP8oc=
gorm.io/driver/mysql v1.5.6 h1:Ld4mkIickM+EliaQZQx3uOJDJHtrd70MxAUqWqlx3Y8=
gorm.io/driver/mysql v1.5.6/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U=
gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c= gorm.io/driver/sqlite v1.1.3/go.mod h1:AKDgRWk8lcSQSw+9kxCJnX/yySj8G3rdwYlU57cB45c=
gorm.io/driver/sqlite v1.4.3 h1:HBBcZSDnWi5BW3B3rwvVTc510KGkBkexlOg0QrmLUuU=
gorm.io/driver/sqlserver v1.5.4 h1:xA+Y1KDNspv79q43bPyjDMUgHoYHLhXYmdFcYPobg8g=
gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw= gorm.io/gorm v1.20.1/go.mod h1:0HFTzE/SqkGTzK6TlDPPQbAYCluiVvhzoA1+aVyzenw=
gorm.io/gorm v1.23.0/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.0/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8= gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ= gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
gorm.io/plugin/soft_delete v1.2.1 h1:qx9D/c4Xu6w5KT8LviX8DgLcB9hkKl6JC9f44Tj7cGU= gorm.io/plugin/soft_delete v1.2.1 h1:qx9D/c4Xu6w5KT8LviX8DgLcB9hkKl6JC9f44Tj7cGU=

View File

@ -34,7 +34,7 @@ func (b *BundleProvider) BundleDetail(_ context.Context, req *bundle.BundleDetai
} }
// 订单相关 // 订单相关
func (b *BundleProvider) CreateOrderRecord(_ context.Context, req *bundle.OrderCreateRecord) (res *bundle.CommonResponse, err error) { func (b *BundleProvider) CreateOrderRecord(_ context.Context, req *bundle.OrderRecord) (res *bundle.CommonResponse, err error) {
return logic.CreateOrderRecord(req) return logic.CreateOrderRecord(req)
} }
@ -72,48 +72,3 @@ func (b *BundleProvider) ValueAddBundleList(_ context.Context, req *bundle.Value
func (b *BundleProvider) ValueAddBundleDetail(_ context.Context, req *bundle.ValueAddBundleDetailRequest) (res *bundle.ValueAddBundleDetailResponse, err error) { func (b *BundleProvider) ValueAddBundleDetail(_ context.Context, req *bundle.ValueAddBundleDetailRequest) (res *bundle.ValueAddBundleDetailResponse, err error) {
return logic.ValueAddBundleDetail(req) return logic.ValueAddBundleDetail(req)
} }
// 财务确认
func (b *BundleProvider) UpdateFinancialConfirmationStatus(_ context.Context, req *bundle.FinancialConfirmationRequest) (res *bundle.CommonResponse, err error) {
return logic.UpdateFinancialConfirmationStatus(req)
}
func (b *BundleProvider) PackagePriceAndTime(_ context.Context, req *bundle.OrderRecord) (res *bundle.PackagePriceAndTimeResponse, err error) {
return logic.PackagePriceAndTime(req)
}
// 创建增值服务订单
func (b *BundleProvider) CreateOrderAddRecord(_ context.Context, req *bundle.OrderAddRecord) (res *bundle.CommonResponse, err error) {
return logic.CreateOrderAddRecord(req)
}
func (b *BundleProvider) OrderRecordsListV2(_ context.Context, req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRecordsResponseV2, err error) {
return logic.OrderRecordsListV2(req)
}
func (b *BundleProvider) OrderListByOrderNo(_ context.Context, req *bundle.OrderInfoByOrderNoRequest) (res *bundle.OrderInfoByOrderNoResp, err error) {
return logic.OrderListByOrderNo(req)
}
// 对账单
func (b *BundleProvider) GetReconciliationList(_ context.Context, req *bundle.GetReconciliationListReq) (res *bundle.GetReconciliationListResp, err error) {
return logic.GetReconciliationList(req)
}
func (b *BundleProvider) CreateReconciliation(_ context.Context, req *bundle.ReconciliationInfo) (res *bundle.CommonResponse, err error) {
return logic.CreateReconciliation(req)
}
func (b *BundleProvider) UpdateReconciliation(_ context.Context, req *bundle.ReconciliationInfo) (res *bundle.CommonResponse, err error) {
return logic.UpdateReconciliation(req)
}
func (b *BundleProvider) OnlyAddValueListByOrderNo(_ context.Context, req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) {
return logic.OnlyAddValueListByOrderNo(req)
}
func (b *BundleProvider) UpdateReconciliationStatusBySerialNumber(_ context.Context, req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
return logic.UpdateReconciliationStatusBySerialNumber(req)
}
// 删除订单
func (b *BundleProvider) DeleteValueAddService(_ context.Context, req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
return logic.DeleteValueAddService(req)
}

View File

@ -1,51 +0,0 @@
package controller
import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
)
func (b *BundleProvider) BundleExtend(_ context.Context, req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
return logic.BundleExtend(req)
}
func (b *BundleProvider) BundleExtendRecordsList(_ context.Context, req *bundle.BundleExtendRecordsListRequest) (*bundle.BundleExtendRecordsListResponse, error) {
return logic.BundleExtendRecordsList(req)
}
func (b *BundleProvider) GetBundleBalanceList(_ context.Context, req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) {
return logic.GetBundleBalanceList(req)
}
func (b *BundleProvider) GetBundleBalanceByUserId(_ context.Context, req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
return logic.GetBundleBalanceByUserId(req)
}
func (b *BundleProvider) CreateBundleBalance(_ context.Context, req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) {
return logic.CreateBundleBalance(req)
}
func (b *BundleProvider) AddBundleBalance(_ context.Context, req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
return logic.AddBundleBalance(req)
}
func (b *BundleProvider) GetUsedRecordList(_ context.Context, req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListResp, error) {
return logic.GetUsedRecord(req)
}
func (b *BundleProvider) GetImageWorkDetail(_ context.Context, req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) {
return logic.GetImageWorkDetail(req)
}
func (b *BundleProvider) GetVedioWorkDetail(_ context.Context, req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) {
return logic.GetVedioWorkDetail(req)
}
func (b *BundleProvider) ToBeComfirmedWorks(_ context.Context, req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) {
return logic.ToBeComfirmedWorks(req)
}
func (b *BundleProvider) ConfirmWork(_ context.Context, req *bundle.ConfirmWorkReq) (*bundle.ConfirmWorkResp, error) {
return logic.ConfirmWork(req)
}

View File

@ -1,53 +0,0 @@
package controller
import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
)
func (b *BundleProvider) SaveBundle(_ context.Context, req *bundle.BundleProfile) (res *bundle.SaveResponse, err error) {
return logic.SaveBundle(req)
}
// 上下架状态更新
func (b *BundleProvider) HandShelf(_ context.Context, req *bundle.HandShelfRequest) (res *bundle.CommonResponse, err error) {
// shelfStatus: 1-上架2-下架
return logic.HandleShelf(req)
}
func (b *BundleProvider) BundleListV2(_ context.Context, req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
return logic.BundleListV2(req)
}
func (b *BundleProvider) BundleDetailV2(_ context.Context, req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
return logic.BundleDetailV2(req)
}
func (b *BundleProvider) BundleLangDetailV2(_ context.Context, req *bundle.BundleDetailRequest) (res *bundle.BundleProfileLang, err error) {
return logic.BundleLangDetailV2(req)
}
// ***************************************************新增值服务***********************
func (b *BundleProvider) SaveValueAddService(_ context.Context, req *bundle.ValueAddServiceLang) (res *bundle.SaveResponse, err error) {
return logic.SaveValueAddService(req)
}
func (b *BundleProvider) ValueAddServiceList(_ context.Context, req *bundle.ValueAddServiceListRequest) (res *bundle.ValueAddServiceListResponse, err error) {
return logic.ValueAddServiceList(req)
}
func (b *BundleProvider) ValueAddServiceDetail(_ context.Context, req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceDetailResponse, err error) {
return logic.ValueAddServiceDetail(req)
}
func (b *BundleProvider) ValueAddServiceLangByUuidAndLanguage(_ context.Context, req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceLang, err error) {
return logic.ValueAddServiceDetailByUuidAndLanguage(req)
}
func (b *BundleProvider) CalculatePrice(ctx context.Context, req *bundle.CalculatePriceRequest) (res *bundle.CalculatePriceResponse, err error) {
return logic.CalculatePrice(req)
}
func (b *BundleProvider) BatchGetValueAddServiceLang(ctx context.Context, req *bundle.BatchGetValueAddServiceLangRequest) (res *bundle.BatchGetValueAddServiceLangResponse, err error) {
return logic.BatchGetValueAddServiceLang(req)
}
// 增加h5套餐列表
func (b *BundleProvider) BundleListH5V2(_ context.Context, req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
return logic.BundleListH5V2(req)
}

View File

@ -6,9 +6,6 @@ import (
"micro-bundle/pkg/app" "micro-bundle/pkg/app"
commonErr "micro-bundle/pkg/err" commonErr "micro-bundle/pkg/err"
"micro-bundle/pkg/msg" "micro-bundle/pkg/msg"
"time"
"gorm.io/gorm"
) )
func CreateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) { func CreateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
@ -24,7 +21,7 @@ func CreateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err err
func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) { func UpdateBundle(req *model.BundleProfile) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse) res = new(bundle.CommonResponse)
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? and language= ?", req.UUID, req.Language).Updates(req).Error err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", req.UUID).Updates(req).Error
if err != nil { if err != nil {
res.Msg = msg.ErrorUpdateBundleInfo res.Msg = msg.ErrorUpdateBundleInfo
return res, commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ") return res, commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
@ -129,319 +126,3 @@ func BundleDetail(uuid string) (res *bundle.BundleProfile, err error) {
} }
return return
} }
func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
res = new(bundle.BundleListResponse)
res.Bundles = make([]*bundle.BundleProfile, 0)
bundles := make([]*model.BundleProfile, 0)
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Preload("BundleProfileLang")
if req.Name != "" {
query = query.Where("name like ?", "%"+req.Name+"%")
}
if req.Content != "" {
query = query.Where("content like ?", "%"+req.Content+"%")
}
if req.Language != "" {
query = query.Where("language like ?", req.Language)
}
count := *query
// 排序sort 升序,相同 sort 按 created_at 倒序
query = query.Order("sort ASC").Order("created_at DESC")
if req.PageSize != 0 && req.Page != 0 {
query = query.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
if err = query.Preload("BundleToValueAddService").Find(&bundles).Error; err != nil {
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐列表失败: ")
}
if len(bundles) > 0 {
for _, bundleProfile := range bundles {
selectValueAddService := make([]*bundle.SelectValueAddService, 0)
if bundleProfile.BundleToValueAddService != nil {
for _, v := range bundleProfile.BundleToValueAddService {
selectValueAddService = append(selectValueAddService, &bundle.SelectValueAddService{
ValueAddUuid: v.ValueUid,
IsDisplay: v.IsDisplay,
})
}
}
bundleProfileLang := []*bundle.BundleProfileLang{}
if len(bundleProfile.BundleProfileLang) > 0 {
for _, lang := range bundleProfile.BundleProfileLang {
bpl := &bundle.BundleProfileLang{
Uuid: lang.UUID,
Name: lang.Name,
Price: lang.Price,
PriceType: lang.PriceType,
Content: lang.Content,
Language: lang.Language,
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
}
bundleProfileLang = append(bundleProfileLang, bpl)
}
}
res.Bundles = append(res.Bundles, &bundle.BundleProfile{
Uuid: bundleProfile.UUID,
Name: bundleProfile.Name,
Content: bundleProfile.Content,
Price: bundleProfile.Price,
PriceType: bundleProfile.PriceType,
Contract: bundleProfile.Contract,
Language: bundleProfile.Language,
CreatedAt: bundleProfile.CreatedAt.Format("2006-01-02 15:04:05"),
UpdatedAt: bundleProfile.UpdatedAt.Format("2006-01-02 15:04:05"),
CompanySign: bundleProfile.CompanySign,
ContractDuration: int64(bundleProfile.ContractDuration),
Sort: bundleProfile.Sort,
ImgOption: int32(bundleProfile.ImgOption),
BgImg1: bundleProfile.BgImg1,
BgImg2: bundleProfile.BgImg2,
SelectValueAddService: selectValueAddService,
BundleProfileLang: bundleProfileLang,
ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor,
})
}
}
var total int64
count.Count(&total)
res.Total = int32(total)
return
}
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *model.BundleProfile, err error) {
var data model.BundleProfile
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ? ", req.Uuid).
Preload("BundleProfileLang").
Preload("BundleToValueAddService").
First(&data).Error
if err != nil {
return res, commonErr.ReturnError(err, msg.ErrorGetBundleInfo, "获取套餐信息失败: ")
}
return &data, nil
}
// 套餐上下架
func HandShelf(uuid string, shelfStatus int64) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", uuid).Update("shelf_status", shelfStatus).Error
if err != nil {
res.Msg = "套餐上下架操作失败"
return res, err
}
res.Msg = "套餐上下架操作成功"
return res, nil
}
// 通过uuid和language查询套餐语言表
func BundleDetailByUuidAndLanguage(uuid string, language string) (bundleProfileLang *model.BundleProfileLang, err error) {
err = app.ModuleClients.BundleDB.Where("uuid = ? AND language = ? AND deleted_at = 0", uuid, language).First(&bundleProfileLang).Error
if err != nil {
return nil, err
}
return
}
// 套餐主表创建
func TxCreateBundle(tx *gorm.DB, req *model.BundleProfile) (err error) {
err = tx.Model(&model.BundleProfile{}).Create(&req).Error
if err != nil {
return commonErr.ReturnError(err, msg.ErrorCreateBundleInfo, "创建套餐信息失败: ")
}
return
}
// 套餐语言表创建
func TxCreateBundleLang(tx *gorm.DB, req *model.BundleProfileLang) (err error) {
err = tx.Model(&model.BundleProfileLang{}).Create(&req).Error
if err != nil {
return commonErr.ReturnError(err, msg.ErrorCreateBundleInfo, "创建套餐信息失败: ")
}
return
}
func TxUpdateBundle(tx *gorm.DB, uuid string, columns map[string]interface{}) (err error) {
err = tx.Model(&model.BundleProfile{}).Where("uuid =?", uuid).Updates(columns).Error
if err != nil {
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败")
}
return
}
func TxUpdateBundles(tx *gorm.DB, uuids []string, columns map[string]interface{}) (err error) {
if len(uuids) == 0 {
return nil
}
err = tx.Model(&model.BundleProfile{}).Where("uuid IN (?)", uuids).Updates(columns).Error
if err != nil {
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败")
}
return
}
func TxUpdateBundleLang(tx *gorm.DB, uuid string, language string, columns map[string]interface{}) (err error) {
err = tx.Model(&model.BundleProfileLang{}).Where("uuid =? and language=? and deleted_at = 0", uuid, language).Updates(columns).Error
if err != nil {
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
}
return
}
func CreateBundleToValueAddService(tx *gorm.DB, records []*model.BundleToValueAddService) error {
return tx.Model(&model.BundleToValueAddService{}).Create(&records).Error
}
func UpdateBundleToValueAddService(tx *gorm.DB, records []*model.BundleToValueAddService) error {
columns := make(map[string]interface{})
for _, record := range records {
columns["is_display"] = record.IsDisplay
err := tx.Model(&model.BundleToValueAddService{}).Where("bundle_uuid = ? AND value_uid = ? AND deleted_at = 0", record.BundleUuid, record.ValueUid).Updates(columns).Error
if err != nil {
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
}
}
return nil
}
func DeleteBundleToValueAddService(tx *gorm.DB, bundleUuid, valueUid string) error {
return tx.Where("bundle_uuid = ? AND value_uid = ? AND deleted_at = 0", bundleUuid, valueUid).Delete(&model.BundleToValueAddService{}).Error
}
func GetValueAddServiceUuidsByBundleUuid(bundleUuid string) ([]string, error) {
var uuids []string
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).Where("bundle_uuid = ? and deleted_at = 0", bundleUuid).Pluck("value_uid", &uuids).Error
return uuids, err
}
// GetBundleToValueAddServiceByBundleUuid 根据套餐UUID获取所有关联的增值服务uuid
func GetBundleToValueAddServiceByBundleUuid(bundleUuid string) ([]*model.BundleToValueAddService, error) {
var result []*model.BundleToValueAddService
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).
Where("bundle_uuid = ? and deleted_at = 0", bundleUuid).
Find(&result).Error
return result, err
}
func GetBundleLangsByUuid(uuid string) ([]*model.BundleProfileLang, error) {
var result []*model.BundleProfileLang
err := app.ModuleClients.BundleDB.Model(&model.BundleProfileLang{}).
Where("uuid =? and deleted_at = 0", uuid).
Find(&result).Error
if err != nil {
return nil, err
}
return result, err
}
func GetBundleDetailByUuid(uuid string) (*model.BundleProfile, error) {
result := &model.BundleProfile{}
err := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).
Preload("BundleToValueAddService", "deleted_at = 0").
Preload("BundleProfileLang", "deleted_at = 0").
Where("uuid =?", uuid).
First(&result).Error
return result, err
}
func CreateBunldeHistory(tx *gorm.DB, req *model.BundleProfileHistory) error {
return tx.Model(&model.BundleProfileHistory{}).Create(req).Error
}
func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
res = new(bundle.BundleListResponse)
res.Bundles = make([]*bundle.BundleProfile, 0)
bundles := make([]*model.BundleProfile, 0)
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("shelf_status = ?", 1).Preload("BundleProfileLang")
//query = query.Where("shelf_status = ?", 1) //上架的
if req.Name != "" {
query = query.Where("name like ?", "%"+req.Name+"%")
}
if req.Content != "" {
query = query.Where("content like ?", "%"+req.Content+"%")
}
if req.Language != "" {
query = query.Where("language like ?", req.Language)
}
count := *query
// 排序sort 升序,相同 sort 按 created_at 倒序
query = query.Order("sort ASC").Order("created_at DESC")
if req.PageSize != 0 && req.Page != 0 {
query = query.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
if err = query.Preload("BundleToValueAddService").Find(&bundles).Error; err != nil {
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐列表失败: ")
}
if len(bundles) > 0 {
for _, bundleProfile := range bundles {
selectValueAddService := make([]*bundle.SelectValueAddService, 0)
if bundleProfile.BundleToValueAddService != nil {
for _, v := range bundleProfile.BundleToValueAddService {
selectValueAddService = append(selectValueAddService, &bundle.SelectValueAddService{
ValueAddUuid: v.ValueUid,
IsDisplay: v.IsDisplay,
})
}
}
bundleProfileLang := []*bundle.BundleProfileLang{}
if len(bundleProfile.BundleProfileLang) > 0 {
for _, lang := range bundleProfile.BundleProfileLang {
bpl := &bundle.BundleProfileLang{
Uuid: lang.UUID,
Name: lang.Name,
Price: lang.Price,
PriceType: lang.PriceType,
Content: lang.Content,
Language: lang.Language,
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
}
bundleProfileLang = append(bundleProfileLang, bpl)
}
}
res.Bundles = append(res.Bundles, &bundle.BundleProfile{
Uuid: bundleProfile.UUID,
Name: bundleProfile.Name,
Content: bundleProfile.Content,
Price: bundleProfile.Price,
PriceType: bundleProfile.PriceType,
Contract: bundleProfile.Contract,
Language: bundleProfile.Language,
CreatedAt: bundleProfile.CreatedAt.Format("2006-01-02 15:04:05"),
UpdatedAt: bundleProfile.UpdatedAt.Format("2006-01-02 15:04:05"),
CompanySign: bundleProfile.CompanySign,
ContractDuration: int64(bundleProfile.ContractDuration),
Sort: bundleProfile.Sort,
ImgOption: int32(bundleProfile.ImgOption),
BgImg1: bundleProfile.BgImg1,
BgImg2: bundleProfile.BgImg2,
SelectValueAddService: selectValueAddService,
BundleProfileLang: bundleProfileLang,
ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor,
})
}
}
var total int64
count.Count(&total)
res.Total = int32(total)
return
}

View File

@ -1,308 +0,0 @@
package dao
import (
"errors"
"fmt"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
"micro-bundle/pkg/utils"
"strconv"
"time"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"github.com/duke-git/lancet/v2/datetime"
"gorm.io/gorm"
)
func AddBundleExtendRecord(data model.BundleExtensionRecords) error {
return app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error {
if err := tx.Create(&data).Error; err != nil {
return err
}
if data.AvailableDurationAdditional != 0 && data.TimeUnit != 0 {
record := model.BundleOrderRecords{}
if err := tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{CustomerID: strconv.Itoa(data.UserId)}).Order("created_at desc").First(&record).Error; err != nil {
return err
}
var expireTime time.Time
if record.ExpirationTime != "" {
loc, _ := time.LoadLocation("Asia/Shanghai")
et, _ := time.ParseInLocation(time.DateTime, record.ExpirationTime, loc)
expireTime = et
} else {
expireTime = time.Now()
logger.Infof("过期时间为空,使用默认过期时间" + expireTime.Format(time.DateTime))
}
switch data.TimeUnit {
case 1:
expireTime = datetime.AddDay(expireTime, int64(data.AvailableDurationAdditional))
case 2:
expireTime = datetime.AddMonth(expireTime, int64(data.AvailableDurationAdditional))
case 3:
expireTime = datetime.AddYear(expireTime, int64(data.AvailableDurationAdditional))
default:
return errors.New("时间单位有误")
}
record.ExpirationTime = expireTime.Format(time.DateTime)
return tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{UUID: record.UUID}).Updates(&record).Error
}
return nil
})
}
func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data []model.BundleExtendRecordItemPo, total int64, err error) {
session := app.ModuleClients.BundleDB.Table("micro_bundle.bundle_extension_records AS ber").
Select(`
ber.*,
rn.name as user_name,
u.tel_num as user_phone_number
`).Joins("LEFT JOIN `micro-account`.`user` u on u.id = user_id").
Joins("LEFT JOIN `micro-account`.`real_name` rn on u.real_name_id = rn.id").
Order("created_at desc")
if req.User != "" {
if utils.IsPhoneNumber(req.User) {
session = session.Where("u.tel_num = ?", req.User)
} else {
session = session.Where("rn.name like ?", "%"+req.User+"%")
}
}
if req.Operator != "" {
if utils.IsPhoneNumber(req.Operator) {
session = session.Where("ber.operator_phone_number = ?", req.Operator)
} else {
session = session.Where("ber.operator_name like ?", "%"+req.Operator+"%")
}
}
if req.Type != 0 {
session = session.Where("ber.`type` = ?", req.Type)
}
if req.StartTime != 0 {
session = session.Where("ber.created_at >= ?", time.UnixMilli(int64(req.StartTime)))
}
if req.EndTime != 0 {
session = session.Where("ber.created_at <= ?", time.UnixMilli(int64(req.EndTime)))
}
if req.AssociatedOrderNumber != "" {
session = session.Where("ber.associated_order_number like ?", "%"+req.AssociatedOrderNumber+"%")
}
if err = session.Count(&total).Error; err != nil {
return
}
if req.Page != 0 && req.PageSize != 0 {
session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
err = session.Find(&data).Error
return
}
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.BundleBalancePo, total int64, err error) {
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
Select("bor1.*").
Joins(`INNER JOIN (
SELECT customer_id, MAX(created_at) AS max_created_time
FROM bundle_order_records
GROUP BY customer_id
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").
Select(`bb.*, bor.expiration_time as expired_time, bor.bundle_name, bor.status,
bor.uuid as order_uuid, rn.name as user_name,
u.tel_num as user_phone_number, u.id as user_id`).
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id").
Joins("LEFT JOIN (?) as bor ON bor.customer_id = u.id", subQuery).
Joins("LEFT JOIN micro_bundle.bundle_balance bb ON u.id = bb.user_id AND bb.order_uuid = bor.uuid").
Where("rn.name IS NOT NULL").
Where("u.deleted_at = 0").
Order("bor.expiration_time desc")
if req.UserName != "" {
if utils.IsPhoneNumber(req.UserName) {
session = session.Where("u.tel_num = ?", req.UserName)
} else {
session = session.Where("rn.name like ?", "%"+req.UserName+"%")
}
}
if req.Status != 0 {
session = session.Where("bor.status = ?", req.Status)
}
if req.BundleName != "" {
session = session.Where("bor.bundle_name like ?", "%"+req.BundleName+"%")
}
if req.ExpiredTimeEnd != 0 {
session = session.Where("bor.expiration_time <= ?", time.UnixMilli(req.ExpiredTimeEnd))
}
if req.ExpiredTimeStart != 0 {
session = session.Where("bor.expiration_time >= ?", time.UnixMilli(req.ExpiredTimeStart))
}
if req.Bought == 2 {
session = session.Where("bor.uuid IS NOT NULL")
}
if req.Bought == 1 {
session = session.Where("bor.uuid IS NULL")
}
err = session.Count(&total).Error
if err != nil {
return
}
if req.Page != 0 && req.PageSize != 0 {
session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
err = session.Find(&data).Error
return
}
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (data model.UserBundleBalancePo, err error) {
err = app.ModuleClients.BundleDB.Table("micro_bundle.bundle_balance AS bb").
Select("bb.*,bor.uuid AS order_uuid, bor.bundle_name AS bundle_name, bor.status AS bundle_status, bor.pay_time AS pay_time, bor.expiration_time AS expired_time,bor.amount AS payment_amount,bor.amount_type AS payment_type").
Joins("LEFT JOIN bundle_order_records bor ON bor.uuid = bb.order_uuid").
Joins("LEFT JOIN `micro-account`.`user` u ON u.id = bb.user_id").
Where("bor.deleted_at IS NULL").
Where("bb.user_id = ?", req.UserId).
// Where("bor.expiration_time > ?", time.Now()).
Order("bb.created_at desc").
First(&data).Error
if err != nil {
return
}
var additionalInfo model.UserBundleBalancePo
err = app.ModuleClients.BundleDB.Model(&model.BundleExtensionRecords{}).
Select("SUM(account_additional) as account_additional, SUM(images_additional) as image_additional, SUM(video_additional) as video_additional, SUM(data_additional) as data_additional").
Where("type = 1"). // 手动扩展
Where("user_id = ?", req.UserId).
Where("created_at > ?", data.PayTime). // 判断扩展是否生效
First(&additionalInfo).Error
if err != nil {
return
}
data.AccountAdditional = additionalInfo.AccountAdditional
data.VideoAdditional = additionalInfo.VideoAdditional
data.ImageAdditional = additionalInfo.ImageAdditional
data.DataAnalysisAdditional = additionalInfo.DataAnalysisAdditional
return
}
func AddBundleBalanceByUserId(data model.BundleBalance) error {
return app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error {
oldData := model.BundleBalance{}
if err := tx.Model(&model.BundleBalance{}).Where("user_id = ?", data.UserId).Order("created_at desc").First(&oldData).Error; err != nil {
return errors.New("用户还没有套餐信息")
}
newData := model.BundleBalance{
Model: oldData.Model,
UserId: oldData.UserId,
OrderUUID: oldData.OrderUUID,
AccountNumber: oldData.AccountNumber + data.AccountNumber,
AccountConsumptionNumber: oldData.AccountConsumptionNumber + data.AccountConsumptionNumber,
VideoNumber: oldData.VideoNumber + data.VideoNumber,
VideoConsumptionNumber: oldData.VideoConsumptionNumber + data.VideoConsumptionNumber,
ImageNumber: oldData.ImageNumber + data.ImageNumber,
ImageConsumptionNumber: oldData.ImageConsumptionNumber + data.ImageConsumptionNumber,
DataAnalysisNumber: oldData.DataAnalysisNumber + data.DataAnalysisNumber,
DataAnalysisConsumptionNumber: oldData.DataAnalysisConsumptionNumber + data.DataAnalysisConsumptionNumber,
ExpansionPacksNumber: oldData.ExpansionPacksNumber + data.ExpansionPacksNumber,
}
if newData.AccountConsumptionNumber > newData.AccountNumber ||
newData.VideoConsumptionNumber > newData.VideoNumber ||
newData.ImageConsumptionNumber > newData.ImageNumber ||
newData.DataAnalysisConsumptionNumber > newData.DataAnalysisNumber {
return errors.New("套餐余量不足")
}
return tx.Model(&model.BundleBalance{}).Where("id = ?", oldData.ID).Save(&newData).Error
})
}
func CreateBundleBalance(data model.BundleBalance) error {
return app.ModuleClients.BundleDB.Create(&data).Error
}
func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, total int64, err error) {
session := app.ModuleClients.BundleDB.Model(&model.CostLog{})
if req.Title != "" {
session = session.Where("title = ?", req.Title)
}
if req.Platform != 0 {
session = session.Where(fmt.Sprintf("JSON_CONTAINS(platform_ids,'%d')", req.Platform))
}
if req.Account != "" {
session = session.Where(fmt.Sprintf(`JSON_CONTAINS(media_names,'"%s"')`, req.Account))
}
if req.SubmitTimeEnd != 0 {
session = session.Where("submit_time <= ?", time.UnixMilli(req.SubmitTimeEnd))
}
if req.SubmitTimeStart != 0 {
session = session.Where("submit_time >= ?", time.UnixMilli(req.SubmitTimeStart))
}
if req.User != "" {
if utils.IsPhoneNumber(req.User) {
session = session.Where("artist_phone = ?", req.User)
} else {
session = session.Where("artist_name like ?", "%"+req.User+"%")
}
}
if req.Operator != "" {
if utils.IsPhoneNumber(req.Operator) {
session = session.Where("operator_phone = ?", req.Operator)
} else {
session = session.Where("operator_name like ?", "%"+req.Operator+"%")
}
}
if req.Type != 0 {
session = session.Where("work_category = ?", req.Type)
}
if err = session.Count(&total).Error; err != nil {
return
}
if req.Page != 0 && req.PageSize != 0 {
session = session.Offset(int(req.Page-1) * int(req.PageSize)).Limit(int(req.PageSize))
}
err = session.Order("updated_at desc").Find(&data).Error
return
}
func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (data model.CastWorkImage, err error) {
err = app.ModuleClients.BundleDB.Where(&model.CastWorkImage{WorkUuid: req.WorkId}).First(&data).Error
return
}
func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (data model.CastWorkVideo, err error) {
err = app.ModuleClients.BundleDB.Where(&model.CastWorkVideo{WorkUuid: req.WorkId}).First(&data).Error
return
}
func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWorkLog, total int64, unconfirmed int64, err error) {
unConfirmSubQuery := app.ModuleClients.BundleDB.
Table("cast_work_log").
Select("work_uuid, MAX(update_time) AS max_update_time").
Group("work_uuid").Where("work_status = ?", 4)
err = app.ModuleClients.BundleDB.
Table("cast_work_log AS cwl").
Joins("INNER JOIN (?) AS t ON cwl.work_uuid = t.work_uuid AND cwl.update_time = t.max_update_time", unConfirmSubQuery).
Where("artist_uuid = ?", req.ArtistUuid).Where("confirmed_at = ?", 0).Count(&unconfirmed).Error
if err != nil {
return
}
subQuery := app.ModuleClients.BundleDB.
Table("cast_work_log").
Select("work_uuid, MAX(update_time) AS max_update_time").
Group("work_uuid").Where("work_status in ?", []int{4, 5, 6, 7})
session := app.ModuleClients.BundleDB.
Table("cast_work_log AS cwl").
Joins("INNER JOIN (?) AS t ON cwl.work_uuid = t.work_uuid AND cwl.update_time = t.max_update_time", subQuery).
Where("artist_uuid = ?", req.ArtistUuid)
err = session.Count(&total).Error
if err != nil {
return
}
if req.Page != 0 && req.PageSize != 0 {
session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
err = session.Order("created_at desc").Find(&data).Error
return
}
func ConfirmWork(req *bundle.ConfirmWorkReq) error {
return app.ModuleClients.BundleDB.Model(&model.CastWorkLog{}).Where(&model.CastWorkLog{WorkUuid: req.WorkUuid}).Update("confirmed_at", time.Now().Unix()).Error
}

View File

@ -1,94 +1,46 @@
package dao package dao
import ( import (
"encoding/json"
"errors"
"fmt"
"github.com/jinzhu/copier"
"gorm.io/gorm"
"micro-bundle/internal/model" "micro-bundle/internal/model"
"micro-bundle/pb/bundle" "micro-bundle/pb/bundle"
"micro-bundle/pkg/app" "micro-bundle/pkg/app"
commonErr "micro-bundle/pkg/err" commonErr "micro-bundle/pkg/err"
"micro-bundle/pkg/msg" "micro-bundle/pkg/msg"
"micro-bundle/pkg/utils" "micro-bundle/pkg/utils"
"strconv"
"time"
) )
func CreateOrderRecord(orderRecord *model.BundleOrderRecords) (res *bundle.CommonResponse, err error) { func CreateOrderRecord(orderRecord *model.BundleOrderRecords) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse) res = new(bundle.CommonResponse)
var bundleInfo model.BundleProfile orderRecord.UUID = app.ModuleClients.SfNode.Generate().Base64()
// 查询套餐主表并预加载 orderRecord.OrderNo = utils.GetOrderNo()
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).
Where("uuid = ?", orderRecord.BundleUUID). // 开启事务
Preload("BundleToValueAddService"). tx := app.ModuleClients.BundleDB.Begin()
Preload("BundleProfileLang", "language = ?", orderRecord.Language). defer func() {
First(&bundleInfo).Error if r := recover(); r != nil {
if err != nil { tx.Rollback()
res.Msg = msg.ErrorBundleNotFound }
return res, commonErr.ReturnError(err, msg.ErrorBundleNotFound, "查询Bundle信息失败: ") }()
}
// 填充BundleCommonJson字段 // 创建主订单
if bundleJson, e := json.Marshal(bundleInfo); e == nil { if err = tx.Model(&model.BundleOrderRecords{}).Create(&orderRecord).Error; err != nil {
orderRecord.BundleCommonJson = bundleJson tx.Rollback()
} else {
res.Msg = msg.ErrorDataConvert
return res, commonErr.ReturnError(e, msg.ErrorDataConvert, "Bundle信息转换失败: ")
}
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).Create(orderRecord).Error
if err != nil {
res.Msg = msg.ErrorCreateOrderInfo res.Msg = msg.ErrorCreateOrderInfo
return res, commonErr.ReturnError(err, msg.ErrorCreateOrderInfo, "创建订单信息失败: ") return res, commonErr.ReturnError(err, msg.ErrorCreateOrderInfo, "创建订单信息失败: ")
} }
// 提交事务
if err = tx.Commit().Error; err != nil {
res.Msg = msg.ErrorCommitTransaction
return res, commonErr.ReturnError(err, msg.ErrorCommitTransaction, "提交事务失败: ")
}
res.Uuid = orderRecord.UUID res.Uuid = orderRecord.UUID
res.OrderNo = orderRecord.OrderNo res.OrderNo = orderRecord.OrderNo
res.Msg = msg.SuccessCreateOrderInfo res.Msg = msg.SuccessCreateOrderInfo
return return
} }
// calculateAmount 计算子订单金额
func calculateAmount(valueUid string, req *bundle.OrderRecord) (amount float64, valueAddServiceLang *model.ValueAddServiceLang, num int32, expirationDay string, err error) {
err = app.ModuleClients.BundleDB.
Where("uuid = ? AND language = ?", valueUid, req.Language).
First(&valueAddServiceLang).Error
if err != nil {
return
}
for _, opt := range valueAddServiceLang.Options {
for _, p := range req.PriceOptionsInfo {
if p.ValueUid == valueUid && opt.Id == p.Id {
num = opt.Num
if valueAddServiceLang.PriceMode == 1 {
amount = float64(float32(opt.Num) * opt.Price)
} else if valueAddServiceLang.PriceMode == 2 {
amount = float64(opt.Price)
}
}
}
// 计算过期时间
if valueAddServiceLang.ServiceType == 5 {
expirationDay = calculateExpirationDay(opt.Num, valueAddServiceLang.Unit)
}
}
return
}
// calculateExpirationDay 计算到期日
func calculateExpirationDay(num int32, unit string) string {
now := time.Now()
switch unit {
case "天":
return now.AddDate(0, 0, int(num)).Format("2006-01-02")
case "月":
return now.AddDate(0, int(num), 0).Format("2006-01-02")
case "年":
return now.AddDate(int(num), 0, 0).Format("2006-01-02")
default:
return ""
}
}
func UpdateOrderRecord(orderRecord *model.BundleOrderRecords) (res *bundle.CommonResponse, err error) { func UpdateOrderRecord(orderRecord *model.BundleOrderRecords) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse) res = new(bundle.CommonResponse)
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).Where("uuid = ?", orderRecord.UUID).Updates(orderRecord).Error err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).Where("uuid = ?", orderRecord.UUID).Updates(orderRecord).Error
@ -103,46 +55,14 @@ func UpdateOrderRecord(orderRecord *model.BundleOrderRecords) (res *bundle.Commo
func UpdateOrderRecordByOrderNO(orderRecord *model.BundleOrderRecords) (res *bundle.CommonResponse, err error) { func UpdateOrderRecordByOrderNO(orderRecord *model.BundleOrderRecords) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse) res = new(bundle.CommonResponse)
// Step 1: 先更新子订单(增值服务)的支付状态 err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).Where("order_no = ?", orderRecord.OrderNo).Updates(orderRecord).Error
valueAdd := &model.BundleOrderValueAdd{
PaymentStatus: int(orderRecord.Status),
PaymentTime: orderRecord.PayTime,
}
if orderRecord.CheckoutSessionId != "" {
valueAdd.CheckoutSessionId = orderRecord.CheckoutSessionId
valueAdd.CheckoutSessionUrl = orderRecord.CheckoutSessionUrl
}
if orderRecord.Status == 2 {
tempValues := make([]*model.BundleOrderValueAdd, 0)
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Where("order_no = ?", orderRecord.OrderNo).
Find(&tempValues).Error
if len(tempValues) > 0 {
for _, value := range tempValues {
if value.PaymentStatus == 2 {
fmt.Println("====================已经付过了")
return nil, errors.New("已付款了")
}
}
}
}
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Where("order_no = ?", orderRecord.OrderNo).
Updates(valueAdd).Error
if err != nil { if err != nil {
res.Msg = msg.ErrorUpdateOrderInfo res.Msg = msg.ErrorUpdateOrderInfo
return res, commonErr.ReturnError(err, msg.ErrorUpdateOrderInfo, "更新增值服务支付状态失败: ") return res, commonErr.ReturnError(err, msg.ErrorUpdateOrderInfo, "更新订单信息失败: ")
} }
// Step 2: 再更新主订单信息(如果存在)
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Where("order_no = ?", orderRecord.OrderNo).
Updates(orderRecord).Error
// Step 3: 返回结果(即使主订单更新失败,也视为成功)
res.Uuid = orderRecord.UUID res.Uuid = orderRecord.UUID
res.Msg = msg.SuccessUpdateOrderInfo res.Msg = msg.SuccessUpdateOrderInfo
return res, nil return
} }
func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecordsResponse, err error) { func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecordsResponse, err error) {
@ -152,8 +72,6 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
query := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}) query := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{})
query.Joins("left join `micro-account`.`user` on `micro-account`.`user`.`id` = `bundle_order_records`.`customer_id`")
if req.CustomerID != "" { if req.CustomerID != "" {
query = query.Where("customer_id = ?", req.CustomerID) query = query.Where("customer_id = ?", req.CustomerID)
} }
@ -179,7 +97,7 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
} }
if req.Status != 0 { if req.Status != 0 {
query = query.Where("`bundle_order_records`.status = ?", req.Status) query = query.Where("status = ?", req.Status)
} }
if req.StartSignedTime != "" { if req.StartSignedTime != "" {
@ -204,14 +122,6 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
query = query.Where("IFNULL(value_add_bundle_uuid,'') = ''") query = query.Where("IFNULL(value_add_bundle_uuid,'') = ''")
} }
if req.FinancialConfirmation != 0 {
query = query.Where("financial_confirmation = ?", req.FinancialConfirmation)
}
if req.TelNum != "" {
query = query.Where("`micro-account`.`user`.`tel_num` like ?", "%"+req.TelNum+"%")
}
count := *query count := *query
if req.PageSize != 0 && req.Page != 0 { if req.PageSize != 0 && req.Page != 0 {
@ -255,8 +165,6 @@ func OrderRecordsList(req *bundle.OrderRecordsRequest) (res *bundle.OrderRecords
Num: record.Num, Num: record.Num,
BundleCommonUid: record.BundleCommonUid, BundleCommonUid: record.BundleCommonUid,
AddBundleCommonUid: record.AddBundleCommonUid, AddBundleCommonUid: record.AddBundleCommonUid,
FinancialConfirmation: record.FinancialConfirmation,
ExpirationTime: record.ExpirationTime,
}) })
} }
@ -286,36 +194,13 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order
if req.CustomerID != "" { if req.CustomerID != "" {
query = query.Where("customer_id = ?", req.CustomerID) query = query.Where("customer_id = ?", req.CustomerID)
} }
if req.BundleUUID != "" {
query = query.Where("bundle_uuid = ?", req.BundleUUID) err = query.First(&orderRecord).Error
}
if req.Status != 0 {
query = query.Where("status = ?", req.Status)
}
err = query.Order("created_at desc").First(&orderRecord).Error
if err != nil { if err != nil {
return res, commonErr.ReturnError(err, msg.ErrorGetOrderInfo, "获取订单信息失败: ") return res, commonErr.ReturnError(err, msg.ErrorGetOrderInfo, "获取订单信息失败: ")
} }
//_ = copier.CopyWithOption(&res, orderRecord, copier.Option{DeepCopy: true}) //_ = copier.CopyWithOption(&res, orderRecord, copier.Option{DeepCopy: true})
addBundles := make([]model.BundleOrderValueAdd, 0)
addInfos := make([]*bundle.AddInfo, 0)
if req.OrderNo == "" {
req.OrderNo = orderRecord.OrderNo
err = app.ModuleClients.BundleDB.Model(model.BundleOrderValueAdd{}).Where("deleted_at is null and source = 1 and order_no = ?", req.OrderNo).Find(&addBundles).Error
if err != nil {
return res, commonErr.ReturnError(err, "增值订单信息", "获取增值订单信息失败: ")
}
for _, addBundle := range addBundles {
addInfo := &bundle.AddInfo{
OrderNo: addBundle.OrderNo,
Num: addBundle.Num,
ValueAddUUID: addBundle.ValueAddUUID,
}
addInfos = append(addInfos, addInfo)
}
}
res = &bundle.OrderRecord{ res = &bundle.OrderRecord{
Uuid: orderRecord.UUID, Uuid: orderRecord.UUID,
OrderNo: orderRecord.OrderNo, OrderNo: orderRecord.OrderNo,
@ -338,446 +223,6 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order
ValueAddBundleUuid: orderRecord.ValueAddBundleUUID, ValueAddBundleUuid: orderRecord.ValueAddBundleUUID,
ValueAddBundleAmount: orderRecord.ValueAddBundleAmount, ValueAddBundleAmount: orderRecord.ValueAddBundleAmount,
TotalAmount: orderRecord.TotalAmount, TotalAmount: orderRecord.TotalAmount,
ExpirationTime: orderRecord.ExpirationTime,
}
res.AddInfos = make([]*bundle.AddInfo, 0)
res.AddInfos = addInfos
return
}
func PackagePriceAndTime(orderRecord *bundle.OrderRecord) (res *bundle.PackagePriceAndTimeResponse, err error) {
res = new(bundle.PackagePriceAndTimeResponse)
bundleInfo := new(model.BundleProfile)
// 查询套餐主表并预加载
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).
Where("uuid = ?", orderRecord.BundleUuid).
Preload("BundleToValueAddService").
Preload("BundleProfileLang", "language = ?", orderRecord.Language).
First(&bundleInfo).Error
if err != nil {
return res, commonErr.ReturnError(err, msg.ErrorBundleNotFound, "查询Bundle信息失败: ")
}
var (
valueAddAmount float64
expirationTime = "9999-12-31"
)
for _, service := range bundleInfo.BundleToValueAddService {
amount, _, _, day, e := calculateAmount(service.ValueUid, orderRecord)
if e != nil {
return res, commonErr.ReturnError(e, msg.ErrorDataConvert, "子订单金额计算失败: ")
}
if day != "" {
expirationTime = day
}
valueAddAmount = valueAddAmount + amount
}
res = &bundle.PackagePriceAndTimeResponse{
Price: float32(valueAddAmount),
Time: expirationTime,
} }
return return
} }
func CreateOrderAddRecord(req *bundle.OrderAddRecord) (res *bundle.CommonResponse, err error) {
tx := app.ModuleClients.BundleDB.Begin()
defer func() {
if r := recover(); r != nil {
tx.Rollback()
}
}()
orderNo := utils.GetOrderNo()
var childOrders []*model.BundleOrderValueAdd
for _, i := range req.AddPriceOptionsList {
childOrder := &model.BundleOrderValueAdd{
UUID: app.ModuleClients.SfNode.Generate().Base64(),
OrderUUID: req.OrderUUID, // 修正: 这里应使用主订单UUID
CustomerID: req.CustomerID,
CustomerNum: req.CustomerNum,
CustomerName: req.CustomerName,
ServiceType: i.ServiceType,
CurrencyType: i.CurrencyType,
Amount: float64(i.Amount),
OrderNo: orderNo,
Num: i.Num,
Unit: i.Unit,
ValueAddUUID: i.ValueUid,
Source: 2,
PaymentStatus: 1,
SignContract: req.SignContract,
Signature: req.Signature,
SignedTime: req.SignedTime,
Snapshot: req.Snapshot,
}
childOrders = append(childOrders, childOrder)
// 如果是类型5服务更新主订单的过期时间
if i.ServiceType == 5 && req.ExpirationDate != "" {
if err := tx.Model(&model.BundleOrderRecords{}).
Where("uuid = ?", req.BundleUuid).
Update("expiration_time", req.ExpirationDate).Error; err != nil {
tx.Rollback()
return nil, commonErr.ReturnError(err, msg.ErrorCreateOrderInfo, "更新主订单过期时间失败: ")
}
}
}
// 批量创建子订单(提高性能)
if err = tx.Model(&model.BundleOrderValueAdd{}).Create(childOrders).Error; err != nil {
tx.Rollback()
return res, commonErr.ReturnError(err, msg.ErrorCreateOrderInfo, "批量创建子订单失败")
}
// 提交事务
if err := tx.Commit().Error; err != nil {
tx.Rollback()
return nil, commonErr.ReturnError(err, msg.ErrorCreateOrderInfo, "提交事务失败: ")
}
return &bundle.CommonResponse{
Uuid: req.BundleUuid,
OrderNo: orderNo,
Msg: msg.SuccessCreateOrderInfo,
}, nil
}
func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRecordsResponseV2, err error) {
res = new(bundle.OrderRecordsResponseV2)
var count int64
modelObj := app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Select("bundle_order_records.*,a.name as bundle_name").
Preload("BundleOrderValueAdd").
Joins("left join bundle_profile a on bundle_order_records.bundle_uuid = a.uuid")
//Joins("left join bundle_order_value_add on bundle_order_records.uuid = bundle_order_value_add.order_uuid")
if len(req.UserIds) != 0 {
modelObj = modelObj.Where("bundle_order_records.customer_id in ?", req.UserIds)
}
if req.BundleName != "" {
modelObj = modelObj.Where("a.name like ?", "%"+req.BundleName+"%")
}
if req.PayStatus != 0 {
modelObj = modelObj.Where("bundle_order_records.status = ?", req.PayStatus)
}
if req.AddPayStatus != 0 {
modelObj = modelObj.Where("exists (select 1 from bundle_order_value_add where bundle_order_value_add.order_uuid = bundle_order_records.uuid and bundle_order_value_add.payment_status = ?)", req.AddPayStatus)
}
if req.OrderNo != "" {
modelObj = modelObj.Where("bundle_order_records.order_no = ?", req.OrderNo)
}
if req.OrderAddNo != "" {
modelObj = modelObj.Where("exists (select 1 from bundle_order_value_add where bundle_order_value_add.order_uuid = bundle_order_records.uuid and bundle_order_value_add.order_no = ?)", req.OrderAddNo)
}
if req.BundleCreateAtStart != "" && req.BundleCreateAtEnd != "" {
modelObj = modelObj.Where("bundle_order_records.created_at between ? and ?", req.BundleCreateAtStart, req.BundleCreateAtEnd)
}
if req.OrderAddCreateAtStart != "" && req.OrderAddCreateAtEnd != "" {
modelObj = modelObj.Where("bundle_order_records.created_at between ? and ?", req.OrderAddCreateAtStart, req.OrderAddCreateAtEnd)
}
if req.BundlePayStart != "" && req.BundlePayEnd != "" {
modelObj = modelObj.Where("bundle_order_records.pay_time between ? and ?", req.BundlePayStart, req.BundlePayEnd)
}
err = modelObj.Count(&count).Error
if req.PageSize != 0 && req.Page != 0 {
modelObj = modelObj.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
type OrderRecords struct {
model.BundleOrderRecords
BundleName string `json:"bundleName"`
}
var records []OrderRecords
err = modelObj.Order("bundle_order_records.created_at desc").Find(&records).Error
if err != nil {
return nil, err
}
for _, record := range records {
customerID, _ := strconv.ParseInt(record.CustomerID, 10, 64)
orderItem := &bundle.OrderBundleRecordInfo{
OrderNo: record.OrderNo,
BundleName: record.BundleName,
PayStatus: int32(record.Status),
TelNum: "",
CustomerName: record.CustomerName,
BundleCreateAt: record.CreatedAt.Format("2006-01-02 15:04:05"),
Amount: record.Amount,
CustomerId: customerID,
PayTime: record.PayTime,
}
// 聚合子订单
addMap := make(map[string]*bundle.OrderAddBundleRecordInfo)
for _, sub := range record.BundleOrderValueAdd {
orderAddNo := sub.OrderNo
amount := float32(sub.Amount)
if existing, ok := addMap[orderAddNo]; ok {
existing.Amount += amount
} else {
addMap[orderAddNo] = &bundle.OrderAddBundleRecordInfo{
OrderAddNo: orderAddNo,
Amount: amount,
CurrencyType: int32(sub.CurrencyType),
HandlingFee: sub.HandlingFee, //手续费
OrderAddCreateAt: sub.CreatedAt.Format("2006-01-02 15:04:05"),
AddPayStatus: int32(sub.PaymentStatus),
Contract: sub.SignContract,
Snapshot: sub.Snapshot,
CheckoutSessionId: sub.CheckoutSessionId,
CustomerID: sub.CustomerID,
}
}
}
// 设置 SettlementAmount 并追加到主订单中
for orderAddNo, addInfo := range addMap {
if orderAddNo == record.OrderNo {
addInfo.SettlementAmount = record.TotalAmount
} else {
addInfo.SettlementAmount = addInfo.Amount
}
orderItem.AddBundleInfo = append(orderItem.AddBundleInfo, addInfo)
}
res.BundleInfo = append(res.BundleInfo, orderItem)
}
res.Total = int32(count)
res.Page = req.Page
res.PageSize = req.PageSize
return res, nil
}
func OrderListByOrderNo(req *bundle.OrderInfoByOrderNoRequest) (*bundle.OrderInfoByOrderNoResp, error) {
if req == nil || req.OrderNo == "" {
return nil, errors.New("invalid request")
}
var addOrder []*model.BundleOrderValueAdd
if err := app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Where("order_no = ?", req.OrderNo).
Find(&addOrder).Error; err != nil {
return nil, err
}
if len(addOrder) == 0 {
return &bundle.OrderInfoByOrderNoResp{}, nil
}
//订单类型 1:套餐 2:单独购买
userID, err := strconv.ParseInt(addOrder[0].CustomerID, 10, 64)
if err != nil {
return nil, err
}
res := &bundle.OrderInfoByOrderNoResp{
Type: int32(addOrder[0].Source),
UserId: uint64(userID),
OrderUUID: addOrder[0].OrderUUID,
UserName: addOrder[0].CustomerName,
}
for _, item := range addOrder {
switch item.ServiceType {
case 1:
res.VideoNumber += item.Num // 使用 += 而不是直接赋值
case 2:
res.ImageNumber += item.Num
case 3:
res.DataNumber += item.Num
case 4:
res.AccountNumber += item.Num
case 5:
res.Duration += item.Num
res.Unit = item.Unit // 如果有多个duration记录最后一个unit会覆盖前面的
}
}
return res, nil
}
// 对账单
func GetReconciliationList(req *bundle.GetReconciliationListReq) (*bundle.GetReconciliationListResp, error) {
var records []*model.Reconciliation
res := &bundle.GetReconciliationListResp{
Page: req.Page,
PageSize: req.PageSize,
}
modelObj := app.ModuleClients.BundleDB.Model(&model.Reconciliation{})
if len(req.UserIDS) != 0 {
modelObj = modelObj.Where("user_id in (?)", req.UserIDS)
}
if req.UserName != "" {
modelObj = modelObj.Where("user_name like ?", "%"+req.UserName+"%")
}
if req.BundleName != "" {
modelObj = modelObj.Where("bundle_name like ?", "%"+req.BundleName+"%")
}
if req.PayStatus != 0 {
modelObj = modelObj.Where("pay_status = ?", req.PayStatus)
}
if req.PayChannel != 0 {
modelObj = modelObj.Where("pay_channel = ?", req.PayChannel)
}
if req.BundleOrderOn != "" {
modelObj = modelObj.Where("bundle_order_on like ?", "%"+req.BundleOrderOn+"%")
}
if req.BundleAddOrderOn != "" {
modelObj = modelObj.Where("bundle_add_order_on like ?", "%"+req.BundleAddOrderOn+"%")
}
if req.CreatedStart != "" && req.CreatedEnd != "" {
modelObj = modelObj.Where("created_at between ? and ?", req.CreatedStart, req.CreatedEnd)
}
if req.PayTimeStart != "" && req.PayTimeEnd != "" {
modelObj = modelObj.Where("pay_time between ? and ?", req.PayTimeStart, req.PayTimeEnd)
}
if req.SerialNumber != "" {
modelObj = modelObj.Where("serial_number like ?", "%"+req.SerialNumber+"%")
}
if err := modelObj.Count(&res.Total).Error; err != nil {
return nil, fmt.Errorf("查询总数失败: %v", err)
}
// 无数据时提前返回
if res.Total == 0 {
return res, nil
}
offset := (req.Page - 1) * req.PageSize
if err := modelObj.Offset(int(offset)).Limit(int(req.PageSize)).Order("created_at desc").Find(&records).Error; err != nil {
return nil, fmt.Errorf("查询记录失败: %v", err)
}
// 转换结果
if err := copier.Copy(&res.List, records); err != nil {
return nil, fmt.Errorf("数据转换失败: %v", err)
}
return res, nil
}
func CreateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonResponse, err error) {
if req.SerialNumber != "" {
var existing model.Reconciliation
err = app.ModuleClients.BundleDB.Where("serial_number = ?", req.SerialNumber).First(&existing).Error
if err == nil {
// 说明这笔流水存在对账单
return &bundle.CommonResponse{Msg: "创建对账单成功"}, nil
}
}
record := &model.Reconciliation{
BundleOrderOn: req.BundleOrderOn,
BundleAddOrderOn: req.BundleAddOrderOn,
UserID: req.UserID,
UserName: req.UserName,
UserTel: req.UserTel,
BundleName: req.BundleName,
PayAmount: req.PayAmount,
CurrencyType: int(req.CurrencyType),
PayChannel: int(req.PayChannel),
PayTime: req.PayTime,
PayStatus: int(req.PayStatus),
SerialNumber: req.SerialNumber,
CreationTime: time.Now().Format("2006-01-02 15:04:05"),
}
// 创建记录
if err := app.ModuleClients.BundleDB.Create(record).Error; err != nil {
return nil, fmt.Errorf("创建对账单失败: %v", err)
}
// 返回成功响应
return &bundle.CommonResponse{Msg: "创建对账单成功"}, nil
}
func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonResponse, err error) {
var existing model.Reconciliation
if err := app.ModuleClients.BundleDB.Where("id = ?", req.ID).First(&existing).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("对账单记录不存在")
}
return nil, fmt.Errorf("查询对账单失败: %v", err)
}
updates := model.Reconciliation{
BundleOrderOn: req.BundleOrderOn,
BundleAddOrderOn: req.BundleAddOrderOn,
UserName: req.UserName,
UserTel: req.UserTel,
BundleName: req.BundleName,
PayAmount: req.PayAmount,
CurrencyType: int(req.CurrencyType),
PayChannel: int(req.PayChannel),
PayTime: req.PayTime,
PayStatus: int(req.PayStatus),
SerialNumber: req.SerialNumber,
}
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
return nil, fmt.Errorf("更新对账单失败: %v", err)
}
// 返回成功响应
return &bundle.CommonResponse{Msg: "更新成功"}, nil
}
func OnlyAddValueListByOrderNo(req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) {
response := new(bundle.OnlyAddValueListByOrderNoResp)
response.AddBundleInfos = make([]*bundle.AddBundleInfo, 0)
addBundles := make([]model.BundleOrderValueAdd, 0)
err = app.ModuleClients.BundleDB.Model(model.BundleOrderValueAdd{}).Where("deleted_at is null and source = 2 and order_no = ?", req.OrderNo).Find(&addBundles).Error
if err != nil {
return res, commonErr.ReturnError(err, "增值订单信息", "获取增值订单信息失败: ")
}
for _, addBundle := range addBundles {
response.AddBundleInfos = append(response.AddBundleInfos, &bundle.AddBundleInfo{
CheckOutSessionId: addBundle.CheckoutSessionId,
Amount: float32(addBundle.Amount),
OrderNo: addBundle.OrderNo,
PaymentStatus: int32(addBundle.PaymentStatus),
CustomerID: addBundle.CustomerID,
})
}
// 返回成功响应
return response, nil
}
func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
var existing model.Reconciliation
if err := app.ModuleClients.BundleDB.Where("serial_number = ?", req.SerialNumber).First(&existing).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, errors.New("对账单记录不存在")
}
return nil, fmt.Errorf("查询对账单失败: %v", err)
}
updates := model.Reconciliation{
PayTime: req.PayTime,
PayStatus: int(req.PaymentStatus),
SerialNumber: req.SerialNumber,
}
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
return nil, fmt.Errorf("更新对账单失败: %v", err)
}
// 返回成功响应
return &bundle.CommonResponse{Msg: "更新成功"}, nil
}
func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
var paidServices []*model.BundleOrderValueAdd
if err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
Where("order_no = ? AND payment_status = 2 and customer_id = ?", req.OrderNo, req.UserID).
Find(&paidServices).Error; err != nil {
res.Msg = msg.ErrorUpdateOrderInfo
return res, commonErr.ReturnError(err, msg.ErrorUpdateOrderInfo, "查询增值服务支付状态失败: ")
}
if len(paidServices) > 0 {
res.Msg = "订单已支付,无法删除"
return res, nil
}
if err = app.ModuleClients.BundleDB.Where("order_no = ?", req.OrderNo).
Delete(&model.BundleOrderValueAdd{}).Error; err != nil {
res.Msg = msg.ErrorDeleteOrderInfo
return res, commonErr.ReturnError(err, msg.ErrorDeleteOrderInfo, "删除增值服务失败: ")
}
var order model.BundleOrderRecords
if err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
Where("order_no = ? and customer_id = ?", req.OrderNo, req.UserID).
First(&order).Error; err != nil {
if !errors.Is(err, gorm.ErrRecordNotFound) {
return nil, nil
}
} else if order.PayType == 2 {
res.Msg = "订单已支付,无法删除"
return res, nil
}
if err = app.ModuleClients.BundleDB.Where("order_no = ?", order.OrderNo).
Delete(&model.BundleOrderRecords{}).Error; err != nil {
res.Msg = msg.ErrorDeleteOrderInfo
return res, commonErr.ReturnError(err, msg.ErrorDeleteOrderInfo, "删除套餐订单服务失败: ")
}
res.Msg = msg.SuccessDeletedOrderInfo
return res, nil
}

View File

@ -1,12 +1,8 @@
package dao package dao
import ( import (
"fmt"
"micro-bundle/internal/model" "micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app" "micro-bundle/pkg/app"
"gorm.io/gorm"
) )
// 增值套餐创建 // 增值套餐创建
@ -68,138 +64,12 @@ func GetBundleOrderRecordsByUserIdAndBundleUuid(userId int32, uuid string) (bund
return return
} }
func GetBundleOrderRecordsByCommonUidAndUserId(commonUid string, userId int32) (bundleOrderRecords *model.BundleOrderRecords, err error) { func GetBundleOrderRecordsByCommonUid(commonUid string) (bundleOrderRecords *model.BundleOrderRecords, err error) {
err = app.ModuleClients.BundleDB.Where("bundle_common_uid = ? AND customer_id = ?", commonUid, userId).First(&bundleOrderRecords).Error err = app.ModuleClients.BundleDB.Where("bundle_common_uid = ?", commonUid).First(&bundleOrderRecords).Error
if err != nil { if err != nil {
return return
} }
return return
} }
// ***************************************新增值服务*****************************
// 增值套餐主表创建
func CreateValueAddService(tx *gorm.DB, req *model.ValueAddService) (err error) {
if err := tx.Model(&model.ValueAddService{}).Create(req).Error; err != nil {
return err
}
return
}
// 增值套餐语言表创建
func CreateValueAddServiceLang(tx *gorm.DB, req *model.ValueAddServiceLang) (err error) {
if err := tx.Model(&model.ValueAddServiceLang{}).Create(req).Error; err != nil {
return err
}
return
}
// 增值套餐主表更新
func UpdateValueAddService(tx *gorm.DB, columns map[string]interface{}) (err error) {
err = tx.Model(&model.ValueAddService{}).Where("uuid = ? and deleted_at = 0", columns["uuid"]).Updates(columns).Error
if err != nil {
return
}
return
}
func UpdateValueAddServiceLang(tx *gorm.DB, columns map[string]interface{}) (err error) {
err = tx.Model(&model.ValueAddServiceLang{}).Where("uuid =? and deleted_at = 0", columns["uuid"]).
Where("language = ?", columns["language"]).Updates(columns).Error
if err != nil {
return
}
return
}
// 增值套餐列表
func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res []*model.ValueAddService, total int64, err error) {
query := app.ModuleClients.BundleDB.Model(&model.ValueAddService{}).
Where("deleted_at = 0").
Preload("ValueAddServiceLang", func(db *gorm.DB) *gorm.DB {
return db.Select("uuid,service_name,service_type,price_mode,original_price,unit,language,price_type,options,created_at,updated_at")
})
count := *query
if req.PageSize != 0 && req.Page != 0 {
query = query.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
}
if err = query.Find(&res).Error; err != nil {
return
}
// 统计不同uuid的数量
err = count.Select("uuid").Group("uuid").Count(&total).Error
return
}
// 增值套餐详情
func ValueAddServiceDetail(uuid string) (valueAddServiceDetail *model.ValueAddService, err error) {
var data model.ValueAddService
err = app.ModuleClients.BundleDB.Where("uuid = ? and deleted_at = 0", uuid).Preload("ValueAddServiceLang").First(&data).Error
if err != nil {
return nil, err
}
return &data, nil
}
// 通过uuid和language查询增值套餐
func ValueAddServiceDetailByUuidAndLanguage(uuid string, language string) (valueAddServiceLang *model.ValueAddServiceLang, err error) {
err = app.ModuleClients.BundleDB.Where("uuid = ? AND language = ? and deleted_at = 0", uuid, language).First(&valueAddServiceLang).Error
if err != nil {
return nil, err
}
return
}
// 通过增值服务UUID查询所有关联套餐
func GetBundleToValueAddServiceByValueUid(valueUid string) ([]model.BundleToValueAddService, error) {
var rels []model.BundleToValueAddService
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).
Where("value_uid = ? and deleted_at = 0", valueUid).
Find(&rels).Error
return rels, err
}
func GetValueAddServiceDetailByUuid(tx *gorm.DB, uuid string) (*model.ValueAddService, error) {
result := &model.ValueAddService{}
err := tx.Model(&model.ValueAddService{}).
Preload("ValueAddServiceLang", "deleted_at = 0").
Where("uuid =? and deleted_at=0", uuid).
First(&result).Error
return result, err
}
func CreateValueAddServiceHistory(tx *gorm.DB, req *model.ValueAddServiceHistory) error {
return tx.Model(&model.ValueAddServiceHistory{}).Create(req).Error
}
func BatchValueAddServiceDetailTx(tx *gorm.DB, uids []string) (map[string]*model.ValueAddService, error) {
if len(uids) == 0 {
return map[string]*model.ValueAddService{}, nil // 返回空 map避免 nil panic
}
var results []*model.ValueAddService
err := tx.Model(&model.ValueAddService{}).
Where("uuid IN ? AND deleted_at = 0", uids).
Preload("ValueAddServiceLang", "deleted_at = 0").
Find(&results).Error
if err != nil {
return nil, fmt.Errorf("批量查询增值服务失败: %w", err)
}
resultMap := make(map[string]*model.ValueAddService, len(results))
for _, detail := range results {
resultMap[detail.UUID] = detail
}
return resultMap, nil
}
func BatchGetValueAddServiceLang(uuids []string, language string) (map[string]*model.ValueAddServiceLang, error) {
var results []*model.ValueAddServiceLang
err := app.ModuleClients.BundleDB.Model(&model.ValueAddServiceLang{}).
Where("uuid IN ? AND language = ? AND deleted_at = 0", uuids, language).
Find(&results).Error
if err != nil {
return nil, fmt.Errorf("批量查询增值服务语言失败: %w", err)
}
resultMap := make(map[string]*model.ValueAddServiceLang, len(results))
for _, detail := range results {
resultMap[detail.UUID] = detail
}
return resultMap, nil
}

View File

@ -1,176 +0,0 @@
package logic
import (
"errors"
"micro-bundle/internal/dao"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"time"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"github.com/jinzhu/copier"
"github.com/samber/lo"
)
func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
data := model.BundleExtensionRecords{}
if err := copier.CopyWithOption(&data, req, copier.Option{DeepCopy: true}); err != nil {
return nil, err
}
if err := dao.AddBundleBalanceByUserId(model.BundleBalance{
UserId: int(req.UserId),
VideoNumber: int(req.VideoAdditional),
ImageNumber: int(req.ImagesAdditional),
DataAnalysisNumber: int(req.DataAdditional),
AccountNumber: int(req.AccountAdditional),
ExpansionPacksNumber: 1,
}); err != nil {
return nil, errors.New("用户没有余量信息")
}
err := dao.AddBundleExtendRecord(data)
if err != nil {
logger.Error(err)
return nil, errors.New("创建扩展记录失败")
}
return nil, nil
}
func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundle.BundleExtendRecordsListResponse, error) {
data, total, err := dao.GetBundleExtendRecordList(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
resp := &bundle.BundleExtendRecordsListResponse{}
resp.Total = total
resp.Data = lo.Map(data, func(m model.BundleExtendRecordItemPo, _ int) *bundle.BundleExtendRecordItem {
result := &bundle.BundleExtendRecordItem{}
copier.Copy(result, &m)
result.CreatedAt = uint64(m.CreatedAt.UnixMilli())
return result
})
return resp, nil
}
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) {
data, total, err := dao.GetBundleBalanceList(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
resp := &bundle.GetBundleBalanceListResp{}
resp.Total = total
resp.Data = lo.Map(data, func(m model.BundleBalancePo, _ int) *bundle.BundleBalanceItem {
result := &bundle.BundleBalanceItem{}
copier.Copy(result, &m)
loc, _ := time.LoadLocation("Asia/Shanghai")
t, _ := time.ParseInLocation(time.DateTime, m.ExpirationTime, loc)
if m.OrderUUID != "" {
result.Bought = 2
} else {
result.Bought = 1
}
result.ExpiredTime = t.UnixMilli()
return result
})
return resp, nil
}
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
data, err := dao.GetBundleBalanceByUserId(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
result := &bundle.GetBundleBalanceByUserIdResp{}
copier.Copy(result, &data)
loc, _ := time.LoadLocation("Asia/Shanghai")
t, _ := time.ParseInLocation(time.DateTime, data.ExpiredTime, loc)
result.ExpiredTime = t.UnixMilli()
t, _ = time.ParseInLocation(time.DateTime, data.PayTime, loc)
result.PayTime = t.UnixMilli()
return result, nil
}
func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
var data model.BundleBalance
if err := copier.Copy(&data, req); err != nil {
logger.Error(err)
return nil, errors.New("操作失败")
}
return nil, dao.AddBundleBalanceByUserId(data)
}
func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) {
var data model.BundleBalance
if err := copier.Copy(&data, req); err != nil {
logger.Error(err)
return nil, errors.New("操作失败")
}
err := dao.CreateBundleBalance(data)
if err != nil {
logger.Error(err)
return nil, errors.New("创建余量信息失败")
}
return nil, nil
}
func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListResp, error) {
data, total, err := dao.GetUsedRecord(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
resp := &bundle.GetUsedRecordListResp{}
resp.Total = total
resp.Data = lo.Map(data, func(m model.CostLog, _ int) *bundle.WorkCastItem {
result := &bundle.WorkCastItem{}
copier.Copy(result, &m)
return result
})
return resp, nil
}
func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) {
data, err := dao.GetImageWorkDetail(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
result := &bundle.GetImageWorkDetailResp{}
err = copier.Copy(result, &data)
return result, err
}
func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) {
data, err := dao.GetVedioWorkDetail(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
result := &bundle.GetVedioeWorkDetailResp{}
err = copier.Copy(result, &data)
return result, err
}
func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) {
data, total, unconfirmed, err := dao.ToBeComfirmedWorks(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
}
result := &bundle.ToBeComfirmedWorksResp{
Total: total,
Unconfirmed: unconfirmed,
}
result.Data = lo.Map(data, func(m model.CastWorkLog, _ int) *bundle.WorkItem {
result := &bundle.WorkItem{}
copier.Copy(result, &m)
return result
})
return result, nil
}
func ConfirmWork(req *bundle.ConfirmWorkReq) (*bundle.ConfirmWorkResp, error) {
return nil, dao.ConfirmWork(req)
}

View File

@ -1,20 +1,12 @@
package logic package logic
import ( import (
"encoding/json"
"errors"
"micro-bundle/internal/dao"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
"micro-bundle/pkg/msg"
"time"
"micro-bundle/internal/model"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
"github.com/jinzhu/copier" "github.com/jinzhu/copier"
"gorm.io/datatypes" "micro-bundle/internal/dao"
"gorm.io/gorm"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
) )
func CreateBundle(req *bundle.BundleProfile) (res *bundle.CommonResponse, err error) { func CreateBundle(req *bundle.BundleProfile) (res *bundle.CommonResponse, err error) {
@ -55,473 +47,3 @@ func BundleDetail(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResp
} }
return return
} }
func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error) {
res = &bundle.SaveResponse{}
if req.Language == "" {
return res, errors.New("语言不能为空")
}
if req.Sort <= 0 {
return res, errors.New("排序参数需为正整数")
}
bundleProfile := &model.BundleProfile{
Name: req.Name,
Sort: req.Sort,
Content: req.Content,
Price: req.Price,
PriceType: req.PriceType,
Contract: "https://e-cdn.fontree.cn/fonchain-main/prod/file/saas/contract/template-25032801.pdf",
ImgOption: int8(req.ImgOption),
BgImg1: req.BgImg1,
BgImg2: req.BgImg2,
ShelfStatus: 2, //默认初始状态为2-下架
FontColor: req.FontColor,
}
bundleLang := &model.BundleProfileLang{
Name: req.Name,
Content: req.Content,
Price: req.Price,
PriceType: req.PriceType,
Language: req.Language,
}
if req.Uuid == "" && req.Language != msg.ZH_CN {
return res, errors.New("请先创建中文版本套餐")
}
// var existValueService = make(map[string]string)
// if req.Uuid != "" {
// valueService, existErr := dao.GetValueAddServiceUuidsByBundleUuid(req.Uuid)
// if existErr != nil {
// return res, errors.New("查询增值服务失败")
// }
// if valueService != nil && len(valueService) > 0 {
// for _, v := range valueService {
// existValueService[v] = v
// }
// }
// }
selectService := make([]*model.BundleToValueAddService, 0)
var selectValueAddServiceCount = make(map[int]struct{}) //增值服务类型数量
if req.Language == msg.ZH_CN && req.SelectValueAddService != nil && len(req.SelectValueAddService) > 0 {
for _, v := range req.SelectValueAddService {
detail, checkErr := dao.ValueAddServiceDetailByUuidAndLanguage(v.ValueAddUuid, req.Language)
if checkErr != nil {
if checkErr == gorm.ErrRecordNotFound {
return res, errors.New("增值服务不存在")
} else {
return res, errors.New("查询增值服务失败")
}
}
if _, exists := selectValueAddServiceCount[int(detail.ServiceType)]; exists {
return res, errors.New("每种增值服务类型只可选择一个")
}
selectValueAddServiceCount[int(detail.ServiceType)] = struct{}{}
selectService = append(selectService, &model.BundleToValueAddService{
ValueUid: v.ValueAddUuid,
IsDisplay: v.IsDisplay,
})
}
}
tx := app.ModuleClients.BundleDB.Begin()
defer func() {
if err != nil {
tx.Rollback()
} else {
tx.Commit()
}
}()
_, err = dao.BundleDetailByUuidAndLanguage(req.Uuid, req.Language)
if err != nil {
if err == gorm.ErrRecordNotFound {
if req.Language != msg.ZH_CN {
_, err = dao.BundleDetailByUuidAndLanguage(req.Uuid, msg.ZH_CN)
if err != nil {
if err == gorm.ErrRecordNotFound {
res.Msg = "请先创建中文版本套餐"
return res, errors.New("请先创建中文版本套餐")
} else {
return res, errors.New("获取套餐信息失败")
}
}
}
if req.Language == msg.ZH_CN {
bundleProfile.UUID = utils.GetUUID()
if err = dao.TxCreateBundle(tx, bundleProfile); err != nil {
return res, errors.New("创建套餐信息失败")
}
bundleLang.UUID = bundleProfile.UUID
res.Uuid = bundleProfile.UUID
// 新建套餐时插入中间表
for _, s := range selectService {
s.BundleUuid = bundleProfile.UUID
}
if len(selectService) > 0 {
if err = dao.CreateBundleToValueAddService(tx, selectService); err != nil {
return res, errors.New("保存套餐与增值服务关联失败")
}
}
if err = dao.TxCreateBundleLang(tx, bundleLang); err != nil {
return res, errors.New("创建套餐信息失败")
}
}
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JA_JP}
for _, lang := range langList {
otherLang := &model.BundleProfileLang{
UUID: bundleLang.UUID,
Name: bundleLang.Name,
Content: bundleLang.Content,
Price: bundleLang.Price,
PriceType: bundleLang.PriceType,
}
otherLang.Language = lang
if err = dao.TxCreateBundleLang(tx, otherLang); err != nil {
return res, errors.New("创建套餐信息失败")
}
}
res.Msg = "创建套餐信息成功"
return
} else {
return
}
} else { // 已存在,进行更新
// 更新前保存历史记录
if saveErr := saveBundleHistory(tx, req.Uuid, "", 0); saveErr != nil {
return res, saveErr
}
if req.Language == msg.ZH_CN {
updateBundle := map[string]interface{}{
"name": req.Name,
"sort": req.Sort,
"content": req.Content,
"price": req.Price,
"price_type": req.PriceType,
"img_option": req.ImgOption,
"bg_img1": req.BgImg1,
"bg_img2": req.BgImg2,
"font_color": req.FontColor,
}
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
return res, errors.New("更新套餐信息失败")
}
//更新中间表函数
if err = diffUpdateBundleToValueAddService(tx, req.Uuid, selectService); err != nil {
tx.Rollback()
return res, errors.New("更新套餐与增值服务关联失败")
}
}
updateBundleLang := map[string]interface{}{
"name": req.Name,
"content": req.Content,
"price": req.Price,
"price_type": req.PriceType,
}
if err = dao.TxUpdateBundleLang(tx, req.Uuid, req.Language, updateBundleLang); err != nil {
return res, errors.New("更新套餐信息失败")
}
res.Uuid = req.Uuid
res.Msg = "保存成功"
}
return res, nil
}
func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
res = new(bundle.BundleListResponse)
res, err = dao.BundleListV2(req)
if err != nil {
return res, errors.New("获取套餐列表失败")
}
return res, nil
}
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
res = new(bundle.BundleDetailResponseV2)
bundleProfile := &bundle.BundleProfile{}
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0)
selectValueAddServices := make([]*bundle.SelectValueAddService, 0) //已选增值服务
if req.Uuid == "" {
return res, errors.New("缺少套餐UUID")
}
detail, err := dao.BundleDetailV2(req)
if err != nil {
return res, errors.New("获取套餐信息失败")
}
if detail != nil {
bundleProfile.Uuid = detail.UUID
bundleProfile.Name = detail.Name
bundleProfile.Content = detail.Content
bundleProfile.Price = detail.Price
bundleProfile.PriceType = detail.PriceType
bundleProfile.ImgOption = int32(detail.ImgOption)
bundleProfile.BgImg1 = detail.BgImg1
bundleProfile.BgImg2 = detail.BgImg2
bundleProfile.FontColor = detail.FontColor
bundleProfile.Sort = detail.Sort
bundleProfile.ShelfStatus = detail.ShelfStatus
bundleProfile.CreatedAt = detail.CreatedAt.Format("2006-01-02 15:04:05")
bundleProfile.UpdatedAt = detail.UpdatedAt.Format("2006-01-02 15:04:05")
bundleProfile.Contract = detail.Contract
if len(detail.BundleToValueAddService) > 0 {
for _, valueAddService := range detail.BundleToValueAddService {
valueAddDetail, err := dao.ValueAddServiceDetailByUuidAndLanguage(valueAddService.ValueUid, req.Language)
if err != nil {
return res, errors.New("查询增值服务失败")
}
selectValueAddService := &bundle.SelectValueAddService{
ValueAddUuid: valueAddService.ValueUid,
IsDisplay: valueAddService.IsDisplay,
ServiceName: valueAddDetail.ServiceName,
ServiceType: valueAddDetail.ServiceType,
}
selectValueAddServices = append(selectValueAddServices, selectValueAddService)
}
}
if len(detail.BundleProfileLang) > 0 {
for _, lang := range detail.BundleProfileLang {
bundleProfileLang := &bundle.BundleProfileLang{
Uuid: lang.UUID,
Name: lang.Name,
Price: lang.Price,
PriceType: lang.PriceType,
Content: lang.Content,
Language: lang.Language,
ImgOption: int32(detail.ImgOption),
BgImg1: detail.BgImg1,
BgImg2: detail.BgImg2,
FontColor: detail.FontColor,
Sort: detail.Sort,
ShelfStatus: detail.ShelfStatus,
CreatedAt: time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05"),
}
bundleProfileLangs = append(bundleProfileLangs, bundleProfileLang)
}
}
}
if len(selectValueAddServices) > 0 {
bundleProfile.SelectValueAddService = selectValueAddServices
}
bundleProfile.BundleProfileLang = bundleProfileLangs
res.Bundle = bundleProfile
return
}
func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProfileLang, err error) {
res = new(bundle.BundleProfileLang)
if req.Uuid == "" {
return res, errors.New("缺少套餐UUID")
}
if req.Language == "" {
return res, errors.New("language不能为空")
}
detail, err := dao.BundleDetailV2(req)
if err != nil {
return res, errors.New("获取套餐信息失败")
}
lang, err := dao.BundleDetailByUuidAndLanguage(req.Uuid, req.Language)
if err != nil {
return res, errors.New("获取套餐信息失败")
}
if detail != nil {
res.Uuid = detail.UUID
res.ImgOption = int32(detail.ImgOption)
res.BgImg1 = detail.BgImg1
res.BgImg2 = detail.BgImg2
res.FontColor = detail.FontColor
res.Sort = detail.Sort
res.ShelfStatus = detail.ShelfStatus
res.Contract = detail.Contract
}
if lang != nil {
res.Name = lang.Name
res.Price = lang.Price
res.PriceType = lang.PriceType
res.Content = lang.Content
res.Language = lang.Language
res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05")
res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05")
}
return
}
func HandleShelf(req *bundle.HandShelfRequest) (*bundle.CommonResponse, error) {
res := new(bundle.CommonResponse)
if req.Uuid == "" {
return res, errors.New("缺少套餐UUID")
}
if req.ShelfStatus != 1 && req.ShelfStatus != 2 {
return res, errors.New("状态值无效")
}
detail, err := dao.GetBundleDetailByUuid(req.Uuid)
if err != nil {
return res, errors.New("获取套餐信息失败")
}
if detail.ShelfStatus == req.ShelfStatus {
switch detail.ShelfStatus {
case 1:
return res, errors.New("套餐已上架,请勿重复操作")
case 2:
return res, errors.New("套餐已下架,请勿重复操作")
}
}
bundleDetailLangs, err := dao.GetBundleLangsByUuid(req.Uuid)
if err != nil {
return res, errors.New("获取套餐信息失败")
}
var langToPriceType = make(map[string]int64)
for _, bundleLang := range bundleDetailLangs {
langToPriceType[bundleLang.Language] = bundleLang.PriceType
}
tx := app.ModuleClients.BundleDB.Begin()
defer func() {
if err != nil {
tx.Rollback()
} else {
tx.Commit()
}
}()
if req.ShelfStatus == 1 {
valueAddUuids, err := dao.GetValueAddServiceUuidsByBundleUuid(req.Uuid)
if err != nil {
return res, errors.New("查询增值服务失败")
}
//判断时长类型是否存在
isExist := false
for _, valueUid := range valueAddUuids {
detail, err := dao.ValueAddServiceDetail(valueUid)
if err != nil {
return res, errors.New("查询增值服务失败")
}
if detail.ServiceType == 5 {
isExist = true
break
}
}
if !isExist {
return res, errors.New("缺失可用时长服务类型")
}
//校验币种
valueAddServices, er := dao.BatchValueAddServiceDetailTx(tx, valueAddUuids)
if er != nil {
return res, errors.New("查询增值服务详情失败")
}
for _, valueAddService := range valueAddServices {
if len(valueAddService.ValueAddServiceLang) > 0 {
for _, lang := range valueAddService.ValueAddServiceLang {
if langToPriceType[lang.Language] != lang.PriceType {
return res, errors.New("所选增值服务币种与套餐币种不一致")
}
}
}
}
}
res, err = dao.HandShelf(req.Uuid, req.ShelfStatus)
if err != nil {
return res, errors.New("更新套餐状态失败")
}
res.Msg = "更新成功"
return res, nil
}
// 差异更新套餐与增值服务中间表
func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectService []*model.BundleToValueAddService) error {
oldUuids, err := dao.GetValueAddServiceUuidsByBundleUuid(bundleUuid)
if err != nil {
return errors.New("查询套餐与增值服务关联失败")
}
newUuids := make(map[string]*model.BundleToValueAddService)
for _, s := range selectService {
newUuids[s.ValueUid] = s
}
oldSet := make(map[string]struct{})
for _, uid := range oldUuids {
oldSet[uid] = struct{}{}
}
// 需要新增的
toAdd := make([]*model.BundleToValueAddService, 0)
toDel := make([]string, 0)
toUpdate := make([]*model.BundleToValueAddService, 0)
for uid, s := range newUuids {
if _, exist := oldSet[uid]; !exist {
s.BundleUuid = bundleUuid
toAdd = append(toAdd, s)
} else {
s.BundleUuid = bundleUuid
toUpdate = append(toUpdate, s)
}
}
// 需要删除的
for _, uid := range oldUuids {
if _, exist := newUuids[uid]; !exist {
toDel = append(toDel, uid)
}
}
if len(toDel) > 0 {
if err = tx.Where("bundle_uuid = ? AND value_uid IN ?", bundleUuid, toDel).Delete(&model.BundleToValueAddService{}).Error; err != nil {
return errors.New("删除套餐与增值服务关联失败")
}
}
if len(toAdd) > 0 {
if err = dao.CreateBundleToValueAddService(tx, toAdd); err != nil {
return errors.New("保存套餐与增值服务关联失败")
}
}
if len(toUpdate) > 0 {
updates := make(map[string]interface{})
var uids []string
for _, record := range toUpdate {
uids = append(uids, record.ValueUid)
updates["is_display"] = record.IsDisplay
}
if err = dao.UpdateBundleToValueAddService(tx, toUpdate); err != nil {
return errors.New("保存套餐与增值服务关联失败")
}
}
return nil
}
func saveBundleHistory(tx *gorm.DB, bundleUuid string, operator string, operatorId uint64) error {
// 保存历史记录
data, err := dao.GetBundleDetailByUuid(bundleUuid)
if err != nil {
return errors.New("获取套餐信息失败")
}
bundleToValueAddService := data.BundleToValueAddService
data.BundleToValueAddService = nil
var valueUuid []string
if len(bundleToValueAddService) > 0 {
for _, v := range bundleToValueAddService {
valueUuid = append(valueUuid, v.ValueUid)
}
}
valueData, err := dao.BatchValueAddServiceDetailTx(tx, valueUuid)
if err != nil {
return errors.New("查询增值服务详情失败")
}
j, err := json.Marshal(data)
if err != nil {
return errors.New("序列化转换失败")
}
vJ, err := json.Marshal(valueData)
if err != nil {
return errors.New("序列化转换失败")
}
history := &model.BundleProfileHistory{
Uuid: bundleUuid,
BundleProfile: datatypes.JSON(j),
ValueAddService: datatypes.JSON(vJ),
Operator: operator,
OperatorId: operatorId,
}
if err := tx.Create(history).Error; err != nil {
return errors.New("保存套餐历史记录失败")
}
return nil
}
// 增加h5套餐列表
func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
res = new(bundle.BundleListResponse)
res, err = dao.BundleListH5V2(req)
if err != nil {
return res, errors.New("获取套餐列表失败")
}
return res, nil
}

View File

@ -1,65 +1,24 @@
package logic package logic
import ( import (
"github.com/jinzhu/copier"
"micro-bundle/internal/dao" "micro-bundle/internal/dao"
"micro-bundle/internal/model" "micro-bundle/internal/model"
"micro-bundle/pb/bundle" "micro-bundle/pb/bundle"
"micro-bundle/pkg/app" "micro-bundle/pkg/app"
"micro-bundle/pkg/utils" "micro-bundle/pkg/utils"
"github.com/jinzhu/copier"
) )
func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonResponse, err error) { func CreateOrderRecord(req *bundle.OrderRecord) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse) res = new(bundle.CommonResponse)
orderUUID := app.ModuleClients.SfNode.Generate().Base64() orderRecord := new(model.BundleOrderRecords)
orderNo := utils.GetOrderNo() _ = copier.CopyWithOption(&orderRecord, req, copier.Option{DeepCopy: true})
var addRecords []model.BundleOrderValueAdd orderRecord.UUID = app.ModuleClients.SfNode.Generate().Base64()
for _, i := range req.AddRecords { orderRecord.OrderNo = utils.GetOrderNo()
addRecords = append(addRecords, model.BundleOrderValueAdd{ orderRecord.BundleUUID = req.BundleUuid
UUID: app.ModuleClients.SfNode.Generate().Base64(), orderRecord.ValueAddBundleUUID = req.ValueAddBundleUuid
OrderNo: orderNo,
OrderUUID: orderUUID,
CustomerID: req.CustomerID,
CustomerNum: req.CustomerNum,
CustomerName: req.CustomerName,
ServiceType: i.ServiceType,
CurrencyType: i.CurrencyType,
Amount: float64(i.Amount),
Num: i.Num,
Unit: i.Unit,
ValueAddUUID: i.ValueUid,
Source: int(i.Source),
PaymentStatus: int(i.PaymentStatus),
SignContract: req.SignContract,
Signature: req.Signature,
SignedTime: req.SignedTime,
Snapshot: req.Snapshot,
})
}
orderRecord := &model.BundleOrderRecords{
UUID: orderUUID,
OrderNo: orderNo,
BundleUUID: req.BundleUuid,
BundleName: req.BundleName,
CustomerID: req.CustomerID,
CustomerNum: req.CustomerNum,
CustomerName: req.CustomerName,
Amount: req.Amount,
AmountType: req.AmountType,
TotalAmount: req.TotalAmount,
SignContract: req.SignContract,
Signature: req.Signature,
SignedTime: req.SignedTime,
PayType: int64(req.PayType),
PayTime: req.PayTime,
Status: req.Status,
ContractNo: req.ContractNo,
BundleCommonUid: req.BundleCommonUid,
FinancialConfirmation: model.ConfirmationNotConfirmed,
ExpirationTime: req.ExpirationTime,
Language: req.Language,
BundleOrderValueAdd: addRecords,
}
res, err = dao.CreateOrderRecord(orderRecord) res, err = dao.CreateOrderRecord(orderRecord)
return return
} }
@ -99,65 +58,3 @@ func OrderRecordsDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Orde
} }
return return
} }
func UpdateFinancialConfirmationStatus(req *bundle.FinancialConfirmationRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).Where("order_no = ?", req.OrderNo).Update("financial_confirmation", model.ConfirmationConfirmed).Error
if err != nil {
res.Msg = "更新财务确认状态失败"
return res, err
}
res.Msg = "更新财务确认状态成功"
return
}
func PackagePriceAndTime(req *bundle.OrderRecord) (res *bundle.PackagePriceAndTimeResponse, err error) {
res = new(bundle.PackagePriceAndTimeResponse)
res, err = dao.PackagePriceAndTime(req)
return
}
func CreateOrderAddRecord(req *bundle.OrderAddRecord) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
res, err = dao.CreateOrderAddRecord(req)
return
}
func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRecordsResponseV2, err error) {
res = new(bundle.OrderRecordsResponseV2)
res, err = dao.OrderRecordsListV2(req)
return
}
func OrderListByOrderNo(req *bundle.OrderInfoByOrderNoRequest) (res *bundle.OrderInfoByOrderNoResp, err error) {
res = new(bundle.OrderInfoByOrderNoResp)
res, err = dao.OrderListByOrderNo(req)
return
}
func GetReconciliationList(req *bundle.GetReconciliationListReq) (res *bundle.GetReconciliationListResp, err error) {
res = new(bundle.GetReconciliationListResp)
res, err = dao.GetReconciliationList(req)
return
}
func CreateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
res, err = dao.CreateReconciliation(req)
return
}
func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
res, err = dao.UpdateReconciliation(req)
return
}
func OnlyAddValueListByOrderNo(req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) {
res = new(bundle.OnlyAddValueListByOrderNoResp)
res, err = dao.OnlyAddValueListByOrderNo(req)
return
}
func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
res, err = dao.UpdateReconciliationStatusBySerialNumber(req)
return
}
func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
res, err = dao.DeleteValueAddService(req)
return
}

View File

@ -1,21 +1,12 @@
package logic package logic
import ( import (
"encoding/json"
"errors"
"fmt"
"micro-bundle/internal/dao" "micro-bundle/internal/dao"
"micro-bundle/internal/model" "micro-bundle/internal/model"
"micro-bundle/pb/bundle" "micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
"micro-bundle/pkg/msg" "micro-bundle/pkg/msg"
"strconv"
"time"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils" "github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
"github.com/shopspring/decimal"
"gorm.io/datatypes"
"gorm.io/gorm"
) )
// 增值套餐创建 // 增值套餐创建
@ -59,7 +50,7 @@ func ValueAddBundleList(req *bundle.ValueAddBundleListRequest) (res *bundle.Valu
return return
} else { } else {
var bundleOrderRecord *model.BundleOrderRecords var bundleOrderRecord *model.BundleOrderRecords
bundleOrderRecord, err = dao.GetBundleOrderRecordsByCommonUidAndUserId(bundleProfile.BundleCommonUid, req.UserId) bundleOrderRecord, err = dao.GetBundleOrderRecordsByCommonUid(bundleProfile.BundleCommonUid)
if err != nil { if err != nil {
err = nil err = nil
} else { } else {
@ -140,480 +131,3 @@ func ValueAddBundleDetail(req *bundle.ValueAddBundleDetailRequest) (res *bundle.
res.Msg = "SUCCESS" res.Msg = "SUCCESS"
return return
} }
//*******************************************************************新增值服务***********************
// 增值套餐保存(无则新增,有则更新)
func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveResponse, err error) {
res = &bundle.SaveResponse{}
if in.Language == "" {
return res, errors.New("语言不能为空")
}
var options model.PriceOptions
var originalPrice float64
if in.PriceMode == 1 {
if in.OriginalPrice == "" {
return res, errors.New("原价不能为空")
}
originalPrice, err = strconv.ParseFloat(in.OriginalPrice, 32)
if err != nil {
return res, errors.New("原价格式转换失败")
}
}
index := 1
for _, option := range in.Options {
price, parseErr1 := strconv.ParseFloat(option.Price, 32)
if parseErr1 != nil {
fmt.Println("优惠单价转换失败: ", parseErr1)
return res, errors.New("优惠单价转换失败")
}
if option.Num < 0 || option.Num > 99 {
return res, errors.New("数量参数需为0-99")
}
if in.PriceMode == 1 && price > originalPrice {
return res, errors.New("优惠单价需小于等于原价")
}
options = append(options, &model.PriceOption{
Id: int32(index),
Num: option.Num,
Symbol: option.Symbol,
Price: float32(price),
})
index++
}
ok, err := model.ValidateOptions(options)
if !ok {
return res, err
}
valueAddService := &model.ValueAddService{
ServiceName: in.ServiceName,
ServiceType: in.ServiceType,
}
valueAddServiceLang := &model.ValueAddServiceLang{
ServiceName: in.ServiceName,
ServiceType: in.ServiceType,
PriceMode: int32(in.PriceMode),
OriginalPrice: float32(originalPrice),
Unit: in.Unit,
Language: in.Language,
PriceType: in.PriceType,
Options: options,
}
if in.Uuid == "" && in.Language != msg.ZH_CN {
return res, errors.New("请先创建中文版本增值服务")
}
tx := app.ModuleClients.BundleDB.Begin()
defer func() {
if err != nil {
tx.Rollback()
} else {
tx.Commit()
}
}()
// 检查当前语言套餐是否存在
_, err = dao.ValueAddServiceDetailByUuidAndLanguage(in.Uuid, in.Language)
if err != nil {
if err == gorm.ErrRecordNotFound { // 当前语言套餐不存在
if in.Language != msg.ZH_CN {
_, err = dao.ValueAddServiceDetailByUuidAndLanguage(in.Uuid, msg.ZH_CN)
if err != nil {
if err != gorm.ErrRecordNotFound {
return res, errors.New("请先创建中文版本增值服务")
} else {
// // 新语言补充只要UUID存在即可直接插入新语言
// if in.Uuid != "" {
// valueAddServiceLang.UUID = in.Uuid
// if err = dao.CreateValueAddServiceLang(tx, valueAddServiceLang); err != nil {
// return res, errors.New("补充新语言套餐失败: " + err.Error())
// }
// res.Uuid = in.Uuid
// res.Msg = "补充新语言套餐成功"
// return
// }
return
}
}
}
if in.Language == msg.ZH_CN {
valueAddService.UUID = utils.GetUUID()
err = dao.CreateValueAddService(tx, valueAddService)
if err != nil {
return res, errors.New("保存增值服务失败")
}
valueAddServiceLang.UUID = valueAddService.UUID
res.Uuid = valueAddService.UUID
if err = dao.CreateValueAddServiceLang(tx, valueAddServiceLang); err != nil {
return res, errors.New("保存增值服务失败")
}
}
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JA_JP}
for _, lang := range langList {
otherLang := model.ValueAddServiceLang{
UUID: valueAddServiceLang.UUID,
ServiceName: valueAddServiceLang.ServiceName,
ServiceType: valueAddServiceLang.ServiceType,
PriceMode: valueAddServiceLang.PriceMode,
OriginalPrice: valueAddServiceLang.OriginalPrice,
TotalPrice: valueAddServiceLang.TotalPrice,
Unit: valueAddServiceLang.Unit,
Language: lang,
PriceType: valueAddServiceLang.PriceType,
Options: valueAddServiceLang.Options,
}
otherLang.Language = lang
if err = dao.CreateValueAddServiceLang(tx, &otherLang); err != nil {
return res, errors.New("保存增值服务失败")
}
}
res.Msg = "新增增值服务成功"
return
} else {
return
}
} else {
// 已存在,进行更新
if err = saveValueAddServiceHistory(tx, in.Uuid); err != nil {
return res, errors.New("保存增值服务历史记录失败")
}
//中文状态下,更新主表和语言表
if in.Language == msg.ZH_CN {
updateService := map[string]interface{}{
"uuid": in.Uuid,
"service_name": in.ServiceName,
"service_type": in.ServiceType,
}
if err = dao.UpdateValueAddService(tx, updateService); err != nil {
return res, errors.New("更新增值服务失败")
}
}
//更新语言表
updateLangService := map[string]interface{}{
"uuid": in.Uuid,
"service_name": in.ServiceName,
"service_type": in.ServiceType,
"price_mode": in.PriceMode,
"original_price": in.OriginalPrice,
"unit": in.Unit,
"price_type": in.PriceType,
"options": options,
"language": in.Language,
}
if err := dao.UpdateValueAddServiceLang(tx, updateLangService); err != nil {
return res, errors.New("更新增值服务失败")
}
data, err := dao.GetBundleToValueAddServiceByValueUid(in.Uuid)
if err != nil {
return res, errors.New("获取套餐信息失败")
}
bundleUuids := []string{}
if len(data) > 0 {
for _, bundle := range data {
bundleUuids = append(bundleUuids, bundle.BundleUuid)
}
}
columns := map[string]interface{}{
"updated_at": time.Now(),
}
if err = dao.TxUpdateBundles(tx, bundleUuids, columns); err != nil {
return res, errors.New("更新套餐信息失败")
}
res.Uuid = in.Uuid
res.Msg = "保存成功"
}
return
}
// 增值套餐列表
func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.ValueAddServiceListResponse, err error) {
res = &bundle.ValueAddServiceListResponse{}
list, total, err := dao.ValueAddServiceList(req)
if err != nil {
return res, errors.New("查询增值服务列表失败")
}
for _, valueAddService := range list {
serviceInfo := &bundle.ValueAddService{
Uuid: valueAddService.UUID,
ServiceName: valueAddService.ServiceName,
ServiceType: valueAddService.ServiceType,
}
for _, serviceLang := range valueAddService.ValueAddServiceLang {
serviceLangInfo := &bundle.ValueAddServiceLang{
Uuid: valueAddService.UUID,
ServiceName: serviceLang.ServiceName,
ServiceType: serviceLang.ServiceType,
PriceMode: serviceLang.PriceMode,
OriginalPrice: fmt.Sprintf("%.2f", serviceLang.OriginalPrice),
Unit: serviceLang.Unit,
PriceType: int64(serviceLang.PriceType),
Language: serviceLang.Language,
CreatedAt: time.Unix(serviceLang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(serviceLang.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
}
if len(serviceLang.Options) > 0 {
var options []*bundle.ValueAddPriceOptions
for _, option := range serviceLang.Options {
var saveAmount decimal.Decimal
switch serviceLang.PriceMode {
case 1:
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
price := decimal.NewFromFloat(float64(option.Price))
num := decimal.NewFromInt(int64(option.Num))
saveAmount = original.Sub(price).Mul(num)
case 2:
//original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
//price := decimal.NewFromFloat(float64(option.Price))
saveAmount = decimal.NewFromInt(int64(0))
default:
return nil, errors.New("无效的价格模式")
}
options = append(options, &bundle.ValueAddPriceOptions{
Id: int64(option.Id),
Num: option.Num,
Symbol: option.Symbol,
Price: fmt.Sprintf("%.2f", option.Price),
SaveAmount: saveAmount.StringFixed(2),
})
}
serviceLangInfo.Options = options
}
serviceInfo.ServiceLang = append(serviceInfo.ServiceLang, serviceLangInfo)
}
res.ValueAddServiceList = append(res.ValueAddServiceList, serviceInfo)
}
res.Total = int32(total)
return
}
// 增值套餐详情
func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceDetailResponse, err error) {
res = &bundle.ValueAddServiceDetailResponse{}
valueAddService := &bundle.ValueAddService{}
serviceLangs := []*bundle.ValueAddServiceLang{}
if req.Uuid == "" {
res.Msg = msg.ErrorValueAddServiceInfo
return res, errors.New("缺少套餐UUID")
}
// if req.Language == "" {
// res.Msg = msg.ErrorValueAddServiceInfo
// return res, errors.New("语言选项不能为空")
// }
detail, err := dao.ValueAddServiceDetail(req.Uuid)
if err != nil {
return res, errors.New("查询增值服务详情失败")
}
if detail != nil && len(detail.ValueAddServiceLang) > 0 {
valueAddService.Uuid = detail.UUID
valueAddService.ServiceName = detail.ServiceName
valueAddService.ServiceType = detail.ServiceType
for _, serviceLang := range detail.ValueAddServiceLang {
langOptions := []*bundle.ValueAddPriceOptions{}
if len(serviceLang.Options) > 0 {
for _, opt := range serviceLang.Options {
var saveAmount decimal.Decimal
switch serviceLang.PriceMode {
case 1:
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
price := decimal.NewFromFloat(float64(opt.Price))
num := decimal.NewFromInt(int64(opt.Num))
saveAmount = original.Sub(price).Mul(num)
case 2:
//original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
//price := decimal.NewFromFloat(float64(opt.Price))
saveAmount = decimal.NewFromInt(int64(0))
default:
return nil, errors.New("无效的价格模式")
}
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
Id: int64(opt.Id),
Num: opt.Num,
Symbol: opt.Symbol,
Price: fmt.Sprintf("%.2f", opt.Price),
SaveAmount: saveAmount.StringFixed(2),
})
}
}
serviceLangInfo := &bundle.ValueAddServiceLang{
Uuid: serviceLang.UUID,
ServiceName: serviceLang.ServiceName,
ServiceType: serviceLang.ServiceType,
Language: serviceLang.Language,
PriceMode: serviceLang.PriceMode,
OriginalPrice: fmt.Sprintf("%.2f", serviceLang.OriginalPrice),
Unit: serviceLang.Unit,
PriceType: int64(serviceLang.PriceType),
Options: langOptions,
CreatedAt: time.Unix(serviceLang.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(serviceLang.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
}
serviceLangs = append(serviceLangs, serviceLangInfo)
}
}
valueAddService.ServiceLang = serviceLangs
res.ValueAddService = valueAddService
return
}
func saveValueAddServiceHistory(tx *gorm.DB, uuid string) (err error) {
// 保存历史记录
data, err := dao.GetValueAddServiceDetailByUuid(tx, uuid)
if err != nil {
return errors.New("查询增值服务详情失败")
}
j, err := json.Marshal(data)
if err != nil {
return errors.New("序列化转换失败")
}
history := &model.ValueAddServiceHistory{
Uuid: uuid,
ValueAddService: datatypes.JSON(j),
//Operator: operator,
//OperatorId: operatorId,
}
if err := tx.Create(history).Error; err != nil {
return errors.New("保存增值服务历史记录失败")
}
return nil
}
func ValueAddServiceDetailByUuidAndLanguage(req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceLang, err error) {
res = &bundle.ValueAddServiceLang{}
if req.Uuid == "" {
return res, errors.New("缺少套餐UUID")
}
if req.Language == "" {
return res, errors.New("语言不能为空")
}
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
if err != nil {
return res, errors.New("查询增值服务详情失败")
}
if detail == nil {
return res, errors.New("增值服务不存在")
}
langOptions := []*bundle.ValueAddPriceOptions{}
if len(detail.Options) > 0 {
for _, opt := range detail.Options {
var saveAmount decimal.Decimal
switch detail.PriceMode {
case 1:
original := decimal.NewFromFloat(float64(detail.OriginalPrice))
price := decimal.NewFromFloat(float64(opt.Price))
num := decimal.NewFromInt(int64(opt.Num))
saveAmount = original.Sub(price).Mul(num)
case 2:
//original := decimal.NewFromFloat(float64(detail.OriginalPrice))
//price := decimal.NewFromFloat(float64(opt.Price))
saveAmount = decimal.NewFromInt(int64(0))
default:
return nil, errors.New("无效的价格模式")
}
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
Id: int64(opt.Id),
Num: opt.Num,
Symbol: opt.Symbol,
Price: fmt.Sprintf("%.2f", opt.Price),
SaveAmount: saveAmount.StringFixed(2),
})
}
}
res = &bundle.ValueAddServiceLang{
Uuid: detail.UUID,
ServiceName: detail.ServiceName,
ServiceType: detail.ServiceType,
Language: detail.Language,
PriceMode: detail.PriceMode,
OriginalPrice: fmt.Sprintf("%.2f", detail.OriginalPrice),
Unit: detail.Unit,
PriceType: int64(detail.PriceType),
Options: langOptions,
CreatedAt: time.Unix(detail.CreatedAt, 0).Format("2006-01-02 15:04:05"),
UpdatedAt: time.Unix(detail.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
}
return
}
func CalculatePrice(req *bundle.CalculatePriceRequest) (res *bundle.CalculatePriceResponse, err error) {
res = &bundle.CalculatePriceResponse{}
if req.Uuid == "" {
return res, errors.New("缺少套餐UUID")
}
if req.Language == "" {
return res, errors.New("语言不能为空")
}
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
if err != nil {
return res, errors.New("查询增值服务详情失败")
}
if detail == nil {
return res, errors.New("增值服务不存在")
}
// langOptions := []*bundle.ValueAddPriceOptions{}
// if detail.Options != nil && len(detail.Options) > 0 {
// for _, opt := range detail.Options {
// langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
// Id: int64(opt.Id),
// Num: opt.Num,
// Symbol: opt.Symbol,
// Price: fmt.Sprintf("%.2f", opt.Price),
// })
// }
// }
price, err := detail.Options.CalculatePrice(detail.PriceMode, req.Num)
if err != nil {
return res, errors.New("计算价格失败")
}
res.Price = price
return
}
func BatchGetValueAddServiceLang(req *bundle.BatchGetValueAddServiceLangRequest) (res *bundle.BatchGetValueAddServiceLangResponse, err error) {
res = &bundle.BatchGetValueAddServiceLangResponse{}
if len(req.Uuids) == 0 {
return res, errors.New("缺少套餐UUID")
}
if req.Language == "" {
return res, errors.New("语言不能为空")
}
detail, err := dao.BatchGetValueAddServiceLang(req.Uuids, req.Language)
if err != nil {
return res, errors.New("查询增值服务详情失败")
}
for _, v := range detail {
langOptions := []*bundle.ValueAddPriceOptions{}
if len(v.Options) > 0 {
for _, opt := range v.Options {
var saveAmount decimal.Decimal
switch v.PriceMode {
case 1:
original := decimal.NewFromFloat(float64(v.OriginalPrice))
price := decimal.NewFromFloat(float64(opt.Price))
num := decimal.NewFromInt(int64(opt.Num))
saveAmount = original.Sub(price).Mul(num)
case 2:
//original := decimal.NewFromFloat(float64(v.OriginalPrice))
//price := decimal.NewFromFloat(float64(opt.Price))
saveAmount = decimal.NewFromInt(int64(0))
default:
return nil, errors.New("无效的价格模式")
}
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
Id: int64(opt.Id),
Num: opt.Num,
Symbol: opt.Symbol,
Price: fmt.Sprintf("%.2f", opt.Price),
SaveAmount: saveAmount.StringFixed(2),
})
}
}
res.ValueAddServiceLangList = append(res.ValueAddServiceLangList, &bundle.ValueAddServiceLang{
Uuid: v.UUID,
ServiceName: v.ServiceName,
ServiceType: v.ServiceType,
Language: v.Language,
PriceMode: v.PriceMode,
OriginalPrice: fmt.Sprintf("%.2f", v.OriginalPrice),
Unit: v.Unit,
PriceType: int64(v.PriceType),
Options: langOptions,
})
}
return
}

View File

@ -1,205 +1,18 @@
package model package model
import ( import "gorm.io/gorm"
"time"
"gorm.io/datatypes"
"gorm.io/gorm"
"gorm.io/plugin/soft_delete"
)
type BundleProfile struct { type BundleProfile struct {
gorm.Model gorm.Model
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
Contract string `json:"contract" gorm:"type:varchar(1024);comment:合同"`
ContractDuration int `json:"contractDuration" gorm:"column:contract_duration;type:int;comment:合同有效时长"`
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
CompanySign string `json:"companySign" gorm:"column:company_sign;type:varchar(1024);comment:公司签名"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN EN"`
BundleCommonUid string `json:"bundleCommonUid" gorm:"column:bundle_common_uid;type:varchar(1024);comment:套餐公共ID"`
Sort int64 `json:"sort" gorm:"column:sort;type:int;comment:套餐排序"` //数字越小越靠前,同大小后创建优先
ShelfStatus int64 `json:"shelfStatus" gorm:"column:shelf_status;type:int;default:2;comment:上架状态 1:上架 2:下架"`
ImgOption int8 `json:"imgOption" gorm:"column:img_option;type:int;default:0;comment:图片选择 1:背景图1 2 3"`
FontColor string `json:"fontColor" gorm:"column:font_color;type:varchar(32);comment:字体颜色"`
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"`
BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;type:varchar(1024);comment:背景图-我的"`
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`
BundleProfileLang []BundleProfileLang `gorm:"foreignKey:UUID;references:UUID" json:"bundleProfileLang"`
}
type BundleProfileLang struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"` UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:套餐UUID"`
Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"` Name string `json:"name" gorm:"column:name;type:varchar(2048);comment:套餐名称"`
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"` Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"` PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐价格类型 1:人民币 2:美元"`
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"` Contract string `json:"contract" gorm:"type:varchar(1024);comment:合同"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"` // 合同有效时长
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"` ContractDuration int `json:"contractDuration" gorm:"column:contract_duration;type:int;comment:合同有效时长"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"` Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
DeletedAt soft_delete.DeletedAt CompanySign string `json:"companySign" gorm:"column:company_sign;type:varchar(1024);comment:公司签名"`
} Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN EN"`
type BundleToValueAddService struct { BundleCommonUid string `json:"bundleCommonUid" gorm:"column:bundle_common_uid;type:varchar(1024);comment:套餐公共ID"`
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
BundleUuid string `json:"bundleUuid" gorm:"column:bundle_uuid;type:varchar(1024);comment:套餐UUID"`
BundleProfile BundleProfile `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleProfile"`
ValueUid string `json:"valueUid" gorm:"column:value_uid;type:varchar(1024);comment:增值服务UUID"`
ValueAddService ValueAddService `gorm:"foreignKey:ValueUid;references:UUID" json:"valueAddService"`
IsDisplay bool `json:"isDisplay" gorm:"column:is_display;type:tinyint(1);comment:是否显示"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
// todo套餐修改历史
type BundleProfileHistory struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Uuid string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:UUID"`
BundleProfile datatypes.JSON `json:"bundleProfile" gorm:"column:bundle_profile;type:json;comment:套餐信息"`
ValueAddService datatypes.JSON `json:"valueAddService" gorm:"column:value_add_service;type:json;comment:增值服务信息"`
Operator string `json:"operator" gorm:"column:operator;type:varchar(1024);comment:操作人"`
OperatorId uint64 `json:"operatorId" gorm:"column:operator_id;type:int;comment:操作人ID"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
func (m *BundleProfile) TableName() string {
return "bundle_profile"
}
func (m *BundleProfileLang) TableName() string {
return "bundle_profile_lang"
}
func (m *BundleToValueAddService) TableName() string {
return "bundle_to_value_add_service"
}
func (m *BundleProfileHistory) TableName() string {
return "bundle_profile_history"
}
// 套餐扩容记录表
type BundleExtensionRecords struct {
gorm.Model
UserId int `gorm:"column:user_id;type:int(11);comment:艺人id;NOT NULL" json:"user_id"`
AccountAdditional uint `gorm:"column:account_additional;type:int(11) unsigned;comment:账号额外增加" json:"account_additional"`
VideoAdditional uint `gorm:"column:video_additional;type:int(11) unsigned;comment:图文额外增加" json:"video_additional"`
ImagesAdditional uint `gorm:"column:images_additional;type:int(11) unsigned;comment:图文额外增加" json:"images_additional"`
DataAdditional uint `gorm:"column:data_additional;type:int(11) unsigned;comment:数据额外增加" json:"data_additional"`
AvailableDurationAdditional uint `gorm:"column:available_duration_additional;type:int(11) unsigned;comment:可用时长增加" json:"available_duration_additional"`
Type int `gorm:"column:type;type:tinyint(4);comment:类型 1:手动操作 2:自行购买" json:"type"`
Remark string `gorm:"column:remark;type:text;comment:备注" json:"remark"`
AssociatedorderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联订单号" json:"associatedOrderNumber"`
OperatorId int `gorm:"column:operator_id;type:int(11);comment:操作人id" json:"operator_id"`
OperatorName string `gorm:"column:operator_name;type:varchar(256)" json:"operatorName"`
OperatorPhoneNumber string `gorm:"column:operator_phone_number;type:varchar(256)" json:"operatorPhoneNumber"`
TimeUnit uint `gorm:"column:time_unit;type:int(11) unsigned;comment:时间单位" json:"timeUnit"`
}
// TableName 表名称
func (*BundleExtensionRecords) TableName() string {
return "bundle_extension_records"
}
type BundleExtendRecordItemPo struct {
UserName string
UserPhoneNumber string
AccountAdditional int
ImagesAdditional int
DataAdditional int
VideoAdditional int
AvailableDurationAdditional uint `gorm:"column:available_duration_additional;type:int(11) unsigned;comment:可用时长增加" json:"available_duration_additional"`
Type int
Remark string
OperatorName string
OperatorPhoneNumber string
AssociatedOrderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联订单号" json:"associatedOrderNumber"`
OrderUUID string
CreatedAt time.Time
}
type BundleExtendRecordItemDto struct {
ID uint `gorm:"primarykey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt soft_delete.DeletedAt
UserId int `gorm:"column:user_id;type:int(11);comment:艺人id;NOT NULL" json:"user_id"`
AccountAdditional uint `gorm:"column:account_additional;type:int(11) unsigned;comment:账号额外增加" json:"account_additional"`
VideoAdditional uint `gorm:"column:video_additional;type:int(11) unsigned;comment:图文额外增加" json:"video_additional"`
ImagesAdditional uint `gorm:"column:images_additional;type:int(11) unsigned;comment:图文额外增加" json:"images_additional"`
DataAdditional uint `gorm:"column:data_additional;type:int(11) unsigned;comment:数据额外增加" json:"data_additional"`
AvailableDurationAdditional uint `gorm:"column:available_duration_additional;type:int(11) unsigned;comment:可用时长增加" json:"available_duration_additional"`
Type int `gorm:"column:type;type:tinyint(4);comment:类型 0:手动操作" json:"type"`
Remark string `gorm:"column:remark;type:text;comment:备注" json:"remark"`
AssociatedOrderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联增值服务订单号" json:"associated_order_number"`
OperatorId int `gorm:"column:operator_id;type:int(11);comment:操作人id" json:"operator_id"`
OperatorName string `gorm:"column:operator_name;type:varchar(256)" json:"operatorName"`
OperatorPhoneNumber string `gorm:"column:operator_phone_number;type:varchar(256)" json:"operatorPhoneNumber"`
UserName string `json:"userName" gorm:"column:user_name"`
UserPhoneNumber string `json:"userPhoneNumber" gorm:"column:user_phone_number"`
}
type BundleBalancePo struct {
UserId int `gorm:"column:user_id"`
UserName string `gorm:"column:user_name"`
UserPhoneNumber string `gorm:"column:user_phone_number"`
BundleName string `gorm:"column:bundle_name"`
ExpirationTime string `gorm:"column:expired_time"`
Status int `gorm:"column:status"`
OrderUUID string `gorm:"column:order_uuid"`
AccountNumber int `gorm:"column:account_number;not null"`
AccountConsumptionNumber int `gorm:"column:account_consumption_number;not null"`
VideoNumber int `gorm:"column:video_number;not null"`
VideoConsumptionNumber int `gorm:"column:video_consumption_number;not null"`
ImageNumber int `gorm:"column:image_number;not null"`
ImageConsumptionNumber int `gorm:"column:image_consumption_number;not null"`
DataAnalysisNumber int `gorm:"column:data_analysis_number;not null"`
DataAnalysisConsumptionNumber int `gorm:"column:data_analysis_consumption_number;not null"`
ExpansionPacksNumber int `gorm:"column:expansion_packs_number;not null"`
}
type UserBundleBalancePo struct {
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid"`
BundleUuid string `json:"bundleUuid" gorm:"column:bundle_uuid"`
BundleName string `json:"bundleName" gorm:"column:bundle_name"`
BundleStatus string `json:"bundleStatus" gorm:"column:bundle_status"`
PayTime string `json:"payTime" gorm:"column:pay_time"`
ExpiredTime string `json:"expiredTime" gorm:"column:expired_time"`
PaymentAmount string `json:"paymentAmount" gorm:"column:payment_amount"`
PaymentType int32 `json:"paymentType" gorm:"column:payment_type"`
AccountNumber int32 `json:"accountNumber" gorm:"column:account_number"`
AccountAdditional int32 `json:"accountAdditional" gorm:"column:account_additional"`
AccountConsumptionNumber int32 `json:"accountConsumptionNumber" gorm:"column:account_consumption_number"`
VideoNumber int32 `json:"videoNumber" gorm:"column:video_number"`
VideoAdditional int32 `json:"videoAdditional" gorm:"column:video_additional"`
VideoConsumptionNumber int32 `json:"videoConsumptionNumber" gorm:"column:video_consumption_number"`
ImageNumber int32 `json:"imageNumber" gorm:"column:image_number"`
ImageAdditional int32 `json:"imageAdditional" gorm:"column:image_additional"`
ImageConsumptionNumber int32 `json:"imageConsumptionNumber" gorm:"column:image_consumption_number"`
DataAnalysisNumber int32 `json:"dataAnalysisNumber" gorm:"column:data_analysis_number"`
DataAnalysisAdditional int32 `json:"dataAnalysisAdditional" gorm:"column:data_analysis_additional"`
DataAnalysisConsumptionNumber int32 `json:"dataAnalysisConsumptionNumber" gorm:"column:data_analysis_consumption_number"`
ExpansionPacksNumber int32 `json:"expansionPacksNumber" gorm:"column:expansion_packs_number"`
}
type BundleBalance struct {
gorm.Model
UserId int `gorm:"column:user_id;not null"`
OrderUUID string `gorm:"column:order_uuid;type:varchar(1024);not null"`
AccountNumber int `gorm:"column:account_number;not null"`
AccountConsumptionNumber int `gorm:"column:account_consumption_number;not null"`
VideoNumber int `gorm:"column:video_number;not null"`
VideoConsumptionNumber int `gorm:"column:video_consumption_number;not null"`
ImageNumber int `gorm:"column:image_number;not null"`
ImageConsumptionNumber int `gorm:"column:image_consumption_number;not null"`
DataAnalysisNumber int `gorm:"column:data_analysis_number;not null"`
DataAnalysisConsumptionNumber int `gorm:"column:data_analysis_consumption_number;not null"`
ExpansionPacksNumber int `gorm:"column:expansion_packs_number;not null"`
}
// TableName 表名称
func (*BundleBalance) TableName() string {
return "bundle_balance"
} }

View File

@ -1,75 +1,35 @@
package model package model
import ( import "gorm.io/gorm"
"encoding/json"
"gorm.io/gorm"
)
// BundleOrderRecords struct // BundleOrderRecords struct
type BundleOrderRecords struct { type BundleOrderRecords struct {
gorm.Model gorm.Model
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:UUID"` UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:UUID"`
OrderNo string `json:"orderNo" gorm:"column:order_no;type:varchar(1024);comment:交易编号"` OrderNo string `json:"orderNo" gorm:"column:order_no;type:varchar(1024);comment:交易编号"`
BundleUUID string `json:"bundleUUID" gorm:"column:bundle_uuid;type:varchar(1024);comment:套餐UUID"` BundleUUID string `json:"bundleUUID" gorm:"column:bundle_uuid;type:varchar(1024);comment:套餐UUID"`
BundleName string `json:"bundleName" gorm:"column:bundle_name;type:varchar(2048);comment:套餐名"` BundleName string `json:"bundleName" gorm:"column:bundle_name;type:varchar(2048);comment:套餐名"`
CustomerID string `json:"customerID" gorm:"column:customer_id;type:varchar(1024);comment:客户ID"` CustomerID string `json:"customerID" gorm:"column:customer_id;type:varchar(1024);comment:客户ID"`
CustomerNum string `json:"customerNum" gorm:"column:customer_num;type:varchar(1024);comment:客户编号"` CustomerNum string `json:"customerNum" gorm:"column:customer_num;type:varchar(1024);comment:客户编号"`
CustomerName string `json:"customerName" gorm:"column:customer_name;type:varchar(1024);comment:客户名"` CustomerName string `json:"customerName" gorm:"column:customer_name;type:varchar(1024);comment:客户名"`
Amount float32 `json:"amount" gorm:"column:amount;type:decimal(12,2);comment:套餐金额"` Amount float32 `json:"amount" gorm:"column:amount;type:decimal(12,2);comment:套餐金额"`
AmountType int64 `json:"amountType" gorm:"column:amount_type;type:int;comment:金额类型"` AmountType int64 `json:"amountType" gorm:"column:amount_type;type:int;comment:金额类型"`
ValueAddBundleUUID string `json:"valueAddBundleUUID" gorm:"column:value_add_bundle_uuid;type:varchar(1024);comment:增值套餐记录UUID"` ValueAddBundleUUID string `json:"valueAddBundleUUID" gorm:"column:value_add_bundle_uuid;type:varchar(1024);comment:增值套餐记录UUID"`
ValueAddBundleAmount float32 `json:"valueAddBundleAmount" gorm:"column:value_add_bundle_amount;type:decimal(12,2);comment:增值套餐金额"` ValueAddBundleAmount float32 `json:"valueAddBundleAmount" gorm:"column:value_add_bundle_amount;type:decimal(12,2);comment:增值套餐金额"`
ValueAddOriginalPrice float32 `json:"valueAddOriginalPrice" gorm:"column:value_add_original_price;type:decimal(12,2);comment:原单价"` ValueAddOriginalPrice float32 `json:"valueAddOriginalPrice" gorm:"column:value_add_original_price;type:decimal(12,2);comment:原单价"`
ValueAddDiscountPrice float32 `json:"valueAddDiscountPrice" gorm:"column:value_add_discount_price;type:decimal(12,2);comment:优惠单价"` ValueAddDiscountPrice float32 `json:"valueAddDiscountPrice" gorm:"column:value_add_discount_price;type:decimal(12,2);comment:优惠单价"`
ValueAddSavedAmount float32 `json:"valueAddSavedAmount" gorm:"column:value_add_saved_amount;type:decimal(12,2);comment:节省金额"` ValueAddSavedAmount float32 `json:"valueAddSavedAmount" gorm:"column:value_add_saved_amount;type:decimal(12,2);comment:节省金额"`
TotalAmount float32 `json:"totalAmount" gorm:"column:total_amount;type:decimal(12,2);comment:总金额"` TotalAmount float32 `json:"totalAmount" gorm:"column:total_amount;type:decimal(12,2);comment:总金额"`
Num int32 `json:"num" gorm:"column:num;type:int;comment:视频数量"` Num int32 `json:"num" gorm:"column:num;type:int;comment:视频数量"`
SignContract string `json:"signContract" gorm:"column:sign_contract;type:varchar(1024);comment:签约合同"` SignContract string `json:"signContract" gorm:"column:sign_contract;type:varchar(1024);comment:签约合同"`
Signature string `json:"signature" gorm:"column:signature;type:text;comment:签字"` Signature string `json:"signature" gorm:"column:signature;type:text;comment:签字"`
SignedTime string `json:"signedTime" gorm:"column:signed_time;type:varchar(1024);comment:签约时间(北京时间)"` SignedTime string `json:"signedTime" gorm:"column:signed_time;type:varchar(1024);comment:签约时间(北京时间)"`
PayType int64 `json:"payType" gorm:"column:pay_type;type:int;comment:支付类型"` PayType int64 `json:"payType" gorm:"column:pay_type;type:int;comment:支付类型"`
PayTime string `json:"payTime" gorm:"column:pay_time;type:varchar(1024);comment:支付时间(北京时间)"` PayTime string `json:"payTime" gorm:"column:pay_time;type:varchar(1024);comment:支付时间(北京时间)"`
CheckoutSessionId string `json:"checkoutSessionId" gorm:"column:checkout_session_id;type:varchar(1024);default:null;comment:checkoutSessionId"` CheckoutSessionId string `json:"checkoutSessionId" gorm:"column:checkout_session_id;type:varchar(1024);default:null;comment:checkoutSessionId"`
CheckoutSessionUrl string `json:"checkoutSessionUrl" gorm:"column:checkout_session_url;type:varchar(1024);default:null;comment:checkoutSessionUrl"` CheckoutSessionUrl string `json:"checkoutSessionUrl" gorm:"column:checkout_session_url;type:varchar(1024);default:null;comment:checkoutSessionUrl"`
Status int64 `json:"status" gorm:"column:status;type:int;comment:状态 1:已签未支付 2:已签已支付"` Status int64 `json:"status" gorm:"column:status;type:int;comment:状态 1:已签未支付 2:已签已支付"`
ContractNo string `json:"contractNo" gorm:"column:contract_no;type:varchar(1024);comment:合同编号"` ContractNo string `json:"contractNo" gorm:"column:contract_no;type:varchar(1024);comment:合同编号"`
BundleCommonUid string `json:"bundleCommonUid" gorm:"column:bundle_common_uid;type:text;comment:套餐公共ID"` BundleCommonUid string `json:"bundleCommonUid" gorm:"column:bundle_common_uid;type:text;comment:套餐公共ID"`
AddBundleCommonUid string `json:"addBundleCommonUid" gorm:"column:add_bundle_common_uid;type:text;comment:附加套餐公共ID"` AddBundleCommonUid string `json:"addBundleCommonUid" gorm:"column:add_bundle_common_uid;type:text;comment:附加套餐公共ID"`
FinancialConfirmation int32 `json:"financialConfirmation" gorm:"column:financial_confirmation;type:int;comment:财务确认 1:未确认 2:已确认"`
ExpirationTime string `json:"expirationTime" gorm:"column:expiration_time;comment:套餐过期时间"`
BundleCommonJson json.RawMessage `json:"bundle_common_json" gorm:"column:bundle_common_json;type:json;serializer:json;comment:套餐信息"`
Language string `gorm:"column:language;comment:语言" json:"language"`
BundleOrderValueAdd []BundleOrderValueAdd `gorm:"foreignKey:OrderUUID;references:UUID" json:"bundleOrderValueAdd"`
} }
type BundleOrderValueAdd struct {
gorm.Model
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:UUID"`
OrderNo string `json:"orderNo" gorm:"column:order_no;type:varchar(1024);comment:交易编号"`
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid;type:varchar(1024);comment:套餐UUID"`
CustomerID string `json:"customerID" gorm:"column:customer_id;type:varchar(1024);comment:客户ID"`
CustomerNum string `json:"customerNum" gorm:"column:customer_num;type:varchar(1024);comment:客户编号"`
CustomerName string `json:"customerName" gorm:"column:customer_name;type:varchar(1024);comment:客户名"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长"`
CurrencyType int64 `json:"currencyType" gorm:"column:currency_type;type:int;comment:货币类型"`
Amount float64 `json:"amount" gorm:"column:amount;type:decimal(12,2);comment:金额"`
Num int32 `json:"num" gorm:"column:num;type:int;comment:数量"`
Unit string `json:"unit" gorm:"column:unit;type:varchar(1024);comment:单位 1个 2条 3天 4月 5年"`
ValueAddUUID string `json:"valueAddUUID" gorm:"column:value_add_uuid;type:varchar(1024);comment:增值服务UUID"`
Source int `json:"source" gorm:"column:source;comment:增加方式 1套餐 2单独购买 3拓展"`
Remark string `json:"remark" gorm:"column:remark;comment:备注"`
PaymentStatus int `json:"paymentStatus" gorm:"column:payment_status;comment:支付状态 1未支付 2已支付"`
PaymentTime string `gorm:"column:payment_time;comment:支付时间" json:"paymentTime"`
SignContract string `json:"signContract" gorm:"column:sign_contract;type:varchar(1024);comment:签约合同"`
Signature string `json:"signature" gorm:"column:signature;type:text;comment:签字"`
SignedTime string `json:"signedTime" gorm:"column:signed_time;type:varchar(1024);comment:签约时间(北京时间)"`
Snapshot string `gorm:"column:snapshot;comment:快照" json:"snapshot"` //订单快照
CheckoutSessionId string `json:"checkoutSessionId" gorm:"column:checkout_session_id;type:varchar(1024);default:null;comment:checkoutSessionId"`
CheckoutSessionUrl string `json:"checkoutSessionUrl" gorm:"column:checkout_session_url;type:varchar(1024);default:null;comment:checkoutSessionUrl"`
HandlingFee string `gorm:"column:handling_fee;comment:手续费" json:"handlingFee"`
}
// 财务确认状态
const (
ConfirmationNotConfirmed = 1
ConfirmationConfirmed = 2
)

View File

@ -1,112 +0,0 @@
package model
import (
"gorm.io/plugin/soft_delete"
)
type CostLog struct {
Uuid string `gorm:"column:uuid;type:varchar(50);NOT NULL;primary_key;" json:"id"`
ArtistUuid string `gorm:"column:artist_uuid;type:varchar(50);NOT NULL;index:idx_artist_uuid;default:'';comment:艺人ID" json:"artistUuid"`
ArtistName string `gorm:"column:artist_name;type:varchar(50);NOT NULL;default:'';comment:艺人名称" json:"artistName"`
ArtistPhone string `gorm:"column:artist_phone;type:varchar(50);NOT NULL;default:'';comment:艺人手机号" json:"artistPhone"`
WorkUuid string `gorm:"column:work_uuid;type:varchar(50);NOT NULL;index:idx_work_uuid;default:'';comment:作品uuid" json:"workUuid"`
WorkCategory uint8 `gorm:"column:work_category;type:tinyint(1);NOT NULL;default:1;comment: 1 图文 2 视频" json:"workCategory"`
BundleUuid string `gorm:"column:bundle_uuid;type:varchar(50);NOT NULL;index:idx_bundle_uuid;default:'';comment:套餐ID uuid" json:"bundleUuid"`
BundleName string `gorm:"column:bundle_name;type:varchar(50);NOT NULL;default:'';comment:套餐名称" json:"bundleName"`
PlatformIds string `gorm:"column:platform_ids;type:json;NOT NULL;comment:发布平台ID集合" json:"platformIDs"`
MediaNames string `gorm:"column:media_names;type:varchar(600);NOT NULL;default:'';comment:自媒体账号名称集合" json:"mediaNames"`
MediaAccIDs string `gorm:"column:media_acc_ids;type:varchar(600);NOT NULL;default:'';comment:自媒体账号ID集合" json:"mediaAccIDs"`
WorkTitle string `gorm:"column:work_title;type:varchar(50);NOT NULL;" json:"workTitle"`
SubmitTime string `gorm:"column:submit_time;type:varchar(50);NOT NULL;default:'';comment:提交时间" json:"submitTime"`
OperatorName string `gorm:"column:operator_name;type:varchar(50);NOT NULL;default:'';comment:操作人名称" json:"operatorName"`
OperatorID string `gorm:"column:operator_id;type:varchar(50);NOT NULL;default:'';comment:操作人ID" json:"operatorID"`
OperatorPhone string `gorm:"column:operator_phone;type:varchar(50);NOT NULL;default:'';comment:操作人手机号" json:"operatorPhone"`
Status uint8 `gorm:"column:status;type:tinyint(1);NOT NULL;default:1;comment: 1 有效 2 失效" json:"status"`
CreatedAt int `gorm:"column:created_at;type:int(11);autoCreateTime" json:"createdAt"`
UpdatedAt int `gorm:"column:updated_at;type:int(11);autoCreateTime" json:"updatedAt"`
DeletedAt soft_delete.DeletedAt
}
func (CostLog) TableName() string {
return "cast_cost_log"
}
type CastWorkImage struct {
Uuid string `json:"uuid" gorm:"uuid"`
WorkUuid string `json:"work_uuid" gorm:"work_uuid"` // 作品uuid
ImageUrls string `json:"image_urls" gorm:"image_urls"` // 图片url集合
CreatedAt int64 `json:"created_at" gorm:"created_at"`
UpdatedAt int64 `json:"updated_at" gorm:"updated_at"`
DeletedAt int64 `json:"deleted_at" gorm:"deleted_at"`
}
// TableName 表名称
func (*CastWorkImage) TableName() string {
return "cast_work_image"
}
type CastWorkVideo struct {
Uuid string `json:"uuid" gorm:"uuid"`
WorkUuid string `json:"work_uuid" gorm:"work_uuid"` // 作品uuid
CoverUrl string `json:"cover_url" gorm:"cover_url"` // 封面url
VideoUrl string `json:"video_url" gorm:"video_url"` // 视频url
CreatedAt int64 `json:"created_at" gorm:"created_at"`
UpdatedAt int64 `json:"updated_at" gorm:"updated_at"`
DeletedAt int64 `json:"deleted_at" gorm:"deleted_at"`
}
// TableName 表名称
func (*CastWorkVideo) TableName() string {
return "cast_work_video"
}
// CastWork undefined
type CastWork struct {
Uuid string `json:"uuid" gorm:"uuid"`
ArtistUuid string `json:"artist_uuid" gorm:"artist_uuid"` // 艺人ID
MediaAccUserIds string `json:"media_acc_user_ids" gorm:"media_acc_user_ids"` // 自媒体账号user_ids集合
MediaNames string `json:"media_names" gorm:"media_names"` // 自媒体账号名称集合
ArtistName string `json:"artist_name" gorm:"artist_name"` // 艺人名称
ArtistPhone string `json:"artist_phone" gorm:"artist_phone"` // 艺人手机号
WorkCategory int8 `json:"work_category" gorm:"work_category"` // 1 图文 2 视频
SubmitTime string `json:"submit_time" gorm:"submit_time"` // 提交时间
StatusUpdateTime string `json:"status_update_time" gorm:"status_update_time"` // 状态更新时间
Status int8 `json:"status" gorm:"status"` // 1 待提交 2 审核中 3 审核失败 4 待艺人确认 5 艺人驳回 6 发布成功 7 发布失败
Title string `json:"title" gorm:"title"`
Content string `json:"content" gorm:"content"`
PublishConfig string `json:"publish_config" gorm:"publish_config"` // 发布配置
CreatedAt int64 `json:"created_at" gorm:"created_at"`
UpdatedAt int64 `json:"updated_at" gorm:"updated_at"`
DeletedAt int64 `json:"deleted_at" gorm:"deleted_at"`
Cost int8 `json:"cost" gorm:"cost"` // 1 消耗 2 未消耗
ConfirmRemark string `json:"confirm_remark" gorm:"confirm_remark"` // 艺人确认备注
ApprovalId string `json:"approval_id" gorm:"approval_id"` // 审批ID
}
// TableName 表名称
func (*CastWork) TableName() string {
return "cast_work"
}
type CastWorkLog struct {
Uuid string `gorm:"column:uuid;type:varchar(50);primary_key" json:"uuid"`
WorkUuid string `gorm:"column:work_uuid;type:varchar(50);comment:作品uuid;NOT NULL" json:"work_uuid"`
Title string `gorm:"column:title;type:varchar(50);NOT NULL" json:"title"`
Content string `gorm:"column:content;type:varchar(2000);NOT NULL" json:"content"`
WorkCategory int `gorm:"column:work_category;type:tinyint(1);default:1;comment: 1 图文 2 视频;NOT NULL" json:"work_category"`
UpdateTime string `gorm:"column:update_time;type:varchar(50);comment:更新时间;NOT NULL" json:"update_time"`
WorkStatus int `gorm:"column:work_status;type:tinyint(1);default:1;comment: 1 待提交 2 审核中 3 审核失败 4 待艺人确认 5 艺人驳回 6 发布成功 7 发布失败;NOT NULL" json:"work_status"`
PlatformIds string `gorm:"column:platform_ids;type:json;comment:发布平台ID集合 TIKTOK= 1, YOUTUBE = 2, INS = 3;NOT NULL" json:"platform_ids"`
ArtistName string `gorm:"column:artist_name;type:varchar(50);comment:艺人名称;NOT NULL" json:"artist_name"`
ArtistUuid string `gorm:"column:artist_uuid;type:varchar(50);comment:艺人ID;NOT NULL" json:"artist_uuid"`
MediaAccUserIds string `gorm:"column:media_acc_user_ids;type:json;comment:自媒体账号user_ids集合;NOT NULL" json:"media_acc_user_ids"`
MediaNames string `gorm:"column:media_names;type:varchar(600);comment:自媒体账号名称集合;NOT NULL" json:"media_names"`
ConfirmedAt int64 `gorm:"column:confirmed_at;type:int(11)" json:"confirmedAt"`
CreatedAt int `gorm:"column:created_at;type:int(11)" json:"created_at"`
UpdatedAt int `gorm:"column:updated_at;type:int(11)" json:"updated_at"`
DeletedAt uint64 `gorm:"column:deleted_at;type:bigint(20) unsigned" json:"deleted_at"`
}
func (m *CastWorkLog) TableName() string {
return "cast_work_log"
}

View File

@ -1,20 +0,0 @@
package model
import "gorm.io/gorm"
type Reconciliation struct {
gorm.Model
BundleOrderOn string `gorm:"column:bundle_order_on;comment:套餐交易编号" json:"bundleOrderOn"`
BundleAddOrderOn string `gorm:"column:bundle_add_order_on;comment:增值套餐交易编号" json:"bundleAddOrderOn"`
UserID uint64 `gorm:"column:user_id;comment:艺人id" json:"userId"`
UserName string `gorm:"column:user_name;comment:艺人" json:"userName"`
UserTel string `gorm:"column:user_tel;comment:艺人手机号" json:"userTel"`
BundleName string `gorm:"column:bundle_name;comment:套餐名称" json:"bundleName"`
PayAmount float32 `gorm:"column:pay_amount;comment:支付金额" json:"payAmount"`
CurrencyType int `gorm:"column:currency_type;comment:币种1:人民币 2美元" json:"currencyType"`
PayChannel int `gorm:"column:pay_channel;comment:支付渠道" json:"payChannel"`
PayTime string `gorm:"column:pay_time;comment:支付渠道" json:"payTime"`
PayStatus int `gorm:"column:pay_status;comment:支付状态" json:"payStatus"`
SerialNumber string `gorm:"column:serial_number;comment:流水号" json:"serialNumber"`
CreationTime string `gorm:"column:creation_time;comment:创建时间" json:"creationTime"`
}

View File

@ -1,12 +1,6 @@
package model package model
import ( import (
"database/sql/driver"
"encoding/json"
"errors"
"fmt"
"gorm.io/datatypes"
"gorm.io/plugin/soft_delete" "gorm.io/plugin/soft_delete"
) )
@ -30,152 +24,16 @@ type ValueAddBundleProfile struct {
DeletedAt soft_delete.DeletedAt DeletedAt soft_delete.DeletedAt
} }
// 新增值套餐主表 //func (ValueAddBundleProfile) TableName() string {
type ValueAddService struct { // return "value_add_bundle_profile2"
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` //}
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长"`
ValueAddServiceLang []ValueAddServiceLang `gorm:"foreignKey:UUID;references:UUID"`
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:ValueUid;references:UUID"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
// 新增值套餐语言表 //type ValueAddBundleRecord struct {
type ValueAddServiceLang struct { // gorm.Model
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"` // UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"`
UUID string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:增值套餐UUID"` // OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"`
ServiceName string `json:"serviceName" gorm:"column:service_name;type:varchar(1024);comment:增值服务名称"` // ValueAddBundleNum int `json:"valueAddBundleNum" gorm:"column:value_add_bundle_num;type:int;comment:增值套餐数量"`
ServiceType int32 `json:"serviceType" gorm:"column:service_type;type:int;comment:服务类型 1:视频 2:图文 3:数据报表 4:账号数 5:可用时长"` // DiscountPrice float32 `json:"discountPrice" gorm:"column:discount_price;type:decimal(12,2);comment:优惠单价"`
PriceMode int32 `json:"priceMode" gorm:"column:price_mode;type:int;comment:套餐价格类型 1:单价 2:总价"` // SavedAmount float32 `json:"savedAmount" gorm:"column:saved_amount;type:decimal(12,2);comment:节省金额"`
OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"` // TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值套餐总价"`
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"` //}
Unit string `json:"unit" gorm:"column:unit;type:varchar(50);comment:单位 1:个 2:条 3:天 4:月 5:年"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:币种 1:人民币 2:美元 3:日元 4:欧元"`
Options PriceOptions `gorm:"column:options;type:json" json:"options"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
type ValueAddServiceHistory struct {
Id int32 `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT" json:"id"`
Uuid string `json:"uuid" gorm:"column:uuid;type:varchar(1024);comment:UUID"`
ValueAddService datatypes.JSON `json:"valueAddService" gorm:"column:value_add_service;type:json;comment:增值服务"`
Operator string `json:"operator" gorm:"column:operator;type:varchar(1024);comment:操作人"`
OperatorId uint64 `json:"operatorId" gorm:"column:operator_id;type:int;comment:操作人ID"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
}
type PriceOptions []*PriceOption
type PriceOption struct {
Id int32 `json:"id"`
Num int32 `json:"num"`
Symbol string `json:"symbol"` // 符号> < = >= <=
Price float32 `json:"price"` // 价格(根据priceMode决定是单价还是总价)
}
// 实现 driver.Valuer 接口
func (o PriceOptions) Value() (driver.Value, error) {
return json.Marshal(o)
}
// 实现 sql.Scanner 接口
func (o *PriceOptions) Scan(value interface{}) error {
bytes, ok := value.([]byte)
if !ok {
return errors.New("实现 sql.Scanner 接口 failed: type assertion to []byte failed")
}
return json.Unmarshal(bytes, o)
}
// 校验Options是否合法避免同一数字被多个规则覆盖
func ValidateOptions(options PriceOptions) (bool, error) {
symbolSet := map[string]struct{}{">": {}, "<": {}, ">=": {}, "<=": {}, "=": {}}
cover := make(map[int]struct{})
for _, opt := range options {
if opt.Num < 0 || opt.Num > 100 {
return false, errors.New("数量参数需为0-99")
}
if _, ok := symbolSet[opt.Symbol]; !ok {
return false, errors.New("符号错误")
}
var nums []int
switch opt.Symbol {
case "=":
nums = []int{int(opt.Num)}
case ">":
for i := int(opt.Num) + 1; i <= 100; i++ {
nums = append(nums, i)
}
case ">=":
for i := int(opt.Num); i <= 100; i++ {
nums = append(nums, i)
}
case "<":
for i := 1; i < int(opt.Num); i++ {
nums = append(nums, i)
}
case "<=":
for i := 1; i <= int(opt.Num); i++ {
nums = append(nums, i)
}
}
for _, n := range nums {
if _, exist := cover[n]; exist {
return false, errors.New("条件存在冲突,请重新设置")
}
cover[n] = struct{}{}
}
}
return true, nil
}
func (m *ValueAddService) TableName() string {
return "value_add_service"
}
func (m *ValueAddServiceLang) TableName() string {
return "value_add_service_lang"
}
func (m *ValueAddServiceHistory) TableName() string {
return "value_add_service_history"
}
func (options PriceOptions) CalculatePrice(priceMode, target int32) (float32, error) {
for _, opt := range options {
match := false
switch opt.Symbol {
case "=":
match = target == opt.Num
case ">":
match = target > opt.Num
case ">=":
match = target >= opt.Num
case "<":
match = target < opt.Num
case "<=":
match = target <= opt.Num
default:
return 0, fmt.Errorf("不支持的符号: %s", opt.Symbol)
}
if match {
switch priceMode { //1 单价模式
case 1:
return float32(target) * opt.Price, nil
case 2:
return opt.Price, nil
default:
return 0, fmt.Errorf("未知价格模式: %d", priceMode)
}
}
}
return 0, fmt.Errorf("未找到匹配规则")
}

View File

@ -11,213 +11,20 @@ service Bundle {
rpc CreateBundle(BundleProfile) returns (CommonResponse) {} rpc CreateBundle(BundleProfile) returns (CommonResponse) {}
rpc UpdateBundle(BundleProfile) returns (CommonResponse) {} rpc UpdateBundle(BundleProfile) returns (CommonResponse) {}
rpc DeleteBundle(DelBundleRequest) returns (CommonResponse) {} rpc DeleteBundle(DelBundleRequest) returns (CommonResponse) {}
rpc HandShelf(HandShelfRequest) returns(CommonResponse) {} //
rpc SaveBundle(BundleProfile)returns (SaveResponse) {}
rpc BundleListV2(BundleListRequest) returns(BundleListResponse) {}
rpc BundleDetailV2(BundleDetailRequest) returns(BundleDetailResponseV2) {}
rpc BundleListH5V2(BundleListRequest) returns(BundleListResponse) {}
rpc BundleLangDetailV2(BundleDetailRequest) returns(BundleProfileLang) {}
rpc BundleList(BundleListRequest) returns (BundleListResponse) {} rpc BundleList(BundleListRequest) returns (BundleListResponse) {}
rpc BundleDetail(BundleDetailRequest) returns (BundleDetailResponse) {} rpc BundleDetail(BundleDetailRequest) returns (BundleDetailResponse) {}
rpc CreateOrderRecord(OrderCreateRecord) returns (CommonResponse) {} rpc CreateOrderRecord(OrderRecord) returns (CommonResponse) {}
rpc UpdateOrderRecord(OrderRecord) returns (CommonResponse) {} rpc UpdateOrderRecord(OrderRecord) returns (CommonResponse) {}
rpc UpdateOrderRecordByOrderNo(OrderRecord) returns (CommonResponse) {} rpc UpdateOrderRecordByOrderNo(OrderRecord) returns (CommonResponse) {}
rpc OrderRecordsList(OrderRecordsRequest) returns (OrderRecordsResponse) {} rpc OrderRecordsList(OrderRecordsRequest) returns (OrderRecordsResponse) {}
rpc OrderRecordsDetail(OrderRecordsDetailRequest) returns (OrderRecordsDetailResponse) {} rpc OrderRecordsDetail(OrderRecordsDetailRequest) returns (OrderRecordsDetailResponse) {}
rpc UpdateFinancialConfirmationStatus(FinancialConfirmationRequest) returns (CommonResponse) {}
rpc CreateOrderAddRecord(OrderAddRecord) returns (CommonResponse) {}
rpc PackagePriceAndTime(OrderRecord) returns (PackagePriceAndTimeResponse) {}//
rpc OrderRecordsListV2(OrderRecordsRequestV2) returns (OrderRecordsResponseV2) {}
rpc OrderListByOrderNo(OrderInfoByOrderNoRequest) returns (OrderInfoByOrderNoResp) {}
rpc OnlyAddValueListByOrderNo(OnlyAddValueListByOrderNoRequest) returns (OnlyAddValueListByOrderNoResp) {} // orderNo只查增值服务
// //
rpc CreateValueAddBundle(CreateValueAddBundleRequest) returns (CreateValueAddBundleResponse) {} rpc CreateValueAddBundle(CreateValueAddBundleRequest) returns (CreateValueAddBundleResponse) {}
rpc ValueAddBundleList(ValueAddBundleListRequest) returns (ValueAddBundleListResponse) {} rpc ValueAddBundleList(ValueAddBundleListRequest) returns (ValueAddBundleListResponse) {}
rpc ValueAddBundleDetail(ValueAddBundleDetailRequest) returns (ValueAddBundleDetailResponse) {} rpc ValueAddBundleDetail(ValueAddBundleDetailRequest) returns (ValueAddBundleDetailResponse) {}
//
rpc SaveValueAddService(ValueAddServiceLang) returns (SaveResponse) {}
rpc ValueAddServiceList(ValueAddServiceListRequest) returns (ValueAddServiceListResponse) {}
rpc ValueAddServiceDetail(ValueAddServiceDetailRequest) returns (ValueAddServiceDetailResponse) {}
rpc ValueAddServiceLangByUuidAndLanguage(ValueAddServiceDetailRequest)returns (ValueAddServiceLang) {}
rpc CalculatePrice(CalculatePriceRequest) returns (CalculatePriceResponse) {}
rpc BatchGetValueAddServiceLang(BatchGetValueAddServiceLangRequest) returns (BatchGetValueAddServiceLangResponse) {}
rpc DeleteValueAddService(DeleteValueAddServiceRequest) returns (CommonResponse) {}
//
rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} //
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} //
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} //
rpc GetBundleBalanceByUserId(GetBundleBalanceByUserIdReq) returns (GetBundleBalanceByUserIdResp) {} //
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} //
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} //
// 使
rpc GetUsedRecordList(GetUsedRecordListReq) returns (GetUsedRecordListResp) {} // 使
rpc GetImageWorkDetail(GetImageWorkDetailReq) returns (GetImageWorkDetailResp) {} //
rpc GetVedioWorkDetail(GetVedioWorkDetailReq) returns (GetVedioeWorkDetailResp) {} //
rpc ToBeComfirmedWorks(ToBeComfirmedWorksReq) returns (ToBeComfirmedWorksResp) {} //
rpc ConfirmWork(ConfirmWorkReq) returns (ConfirmWorkResp) {} //
//
rpc GetReconciliationList(GetReconciliationListReq) returns (GetReconciliationListResp) {} //
rpc CreateReconciliation(ReconciliationInfo) returns (CommonResponse) {} //
rpc UpdateReconciliation(ReconciliationInfo) returns (CommonResponse) {} //
rpc UpdateReconciliationStatusBySerialNumber(UpdateStatusAndPayTimeBySerialNumber) returns (CommonResponse) {} //
}
message DeleteValueAddServiceRequest{
string orderNo = 1;
uint64 userID = 2;
}
message GetReconciliationListReq{
string userName = 1;
string bundleName = 2;
int32 payStatus = 3;
int32 payChannel = 4;
string bundleOrderOn = 5;
string createdStart = 6;
string createdEnd = 7;
string payTimeStart = 8;
string payTimeEnd = 9;
string serialNumber = 10;
int32 page = 11;
int32 pageSize = 12;
repeated uint64 userIDS = 13;
string bundleAddOrderOn = 14;
}
message GetReconciliationListResp{
repeated ReconciliationInfo list = 1;
int64 total = 2;
int32 page = 3;
int32 pageSize = 4;
}
message ReconciliationInfo{
uint64 ID = 1;
string bundleOrderOn = 2;
string bundleAddOrderOn = 3;
string CreationTime = 4;
string userName = 5;
string userTel = 6;
string bundleName = 7;
float payAmount = 8;
int32 currencyType = 9;
int32 payChannel = 10;
string payTime = 11;
int32 payStatus = 12;
string serialNumber = 13;
uint64 userID = 14;
}
message OrderInfoByOrderNoRequest{
string orderNo = 1;
}
message OrderInfoByOrderNoResp{
int32 type = 1;
uint64 userId = 2;
string orderUUID = 3;
int32 accountNumber = 4;
int32 videoNumber = 5;
int32 imageNumber = 6;
int32 dataNumber = 7;
int32 duration = 8;
string unit = 9;
string userName = 10;
}
message OrderCreateRecord{
string bundleUuid = 1 [json_name = "bundleUuid"];
string language = 2 [json_name = "language"];
string expirationTime = 3 [json_name = "expirationTime"];
string bundleName = 4 [json_name = "bundleName"];
string customerID = 5 [json_name = "customerID"];
string customerNum = 6 [json_name = "customerNum"];
string customerName = 7 [json_name = "customerName"];
float amount = 8 [json_name = "amount"];
int64 amountType = 9 [json_name = "amountType"];
string signContract = 10 [json_name = "signContract"];
string signature = 11 [json_name = "signature"];
string signedTime = 12 [json_name = "signedTime"];
int64 status = 13 [json_name = "status"];
string payTime = 14 [json_name = "payTime"];
string contractNo = 15 [json_name = "contractNo"];
float totalAmount = 16 [json_name = "totalAmount"]; //
string bundleCommonUid = 17 [json_name = "bundleCommonUid"];
string snapshot = 18 [json_name = "snapshot"];
int32 payType = 19 [json_name = "payType"];
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //
}
message OrderCreateAddRecord{
int32 serviceType = 1 [json_name = "serviceType"];
string valueUid = 2 [json_name = "valueUid"];
int64 currencyType = 3 [json_name = "currencyType"];
float amount = 4 [json_name = "amount"];
int32 num = 5 [json_name = "num"];
string unit = 6 [json_name = "unit"];
int32 source = 7 [json_name = "source"];
int32 paymentStatus = 8 [json_name = "paymentStatus"];
}
message OrderRecordsRequestV2{
string customerName = 1;
string telNum = 2;
string bundleName = 3;
int32 payStatus = 4;
int32 addPayStatus = 5;
string orderNo = 6;
string orderAddNo = 7;
string bundleCreateAtStart = 8;
string bundleCreateAtEnd = 9;
string orderAddCreateAtStart = 10;
string orderAddCreateAtEnd = 11;
int32 page = 12;
int32 pageSize = 13;
repeated int64 userIds = 14;
string bundlePayStart = 15;
string bundlePayEnd = 16;
}
message OrderRecordsResponseV2{
repeated OrderBundleRecordInfo bundleInfo = 1;
int32 page = 2;
int32 pageSize = 3;
int32 total = 4;
}
message OrderBundleRecordInfo{
string orderNo = 1;
string bundleName = 2;
int32 payStatus = 3;
string telNum = 4;
string customerName = 5;
string bundleCreateAt = 6;
float amount = 7;
repeated OrderAddBundleRecordInfo addBundleInfo = 8;
int64 customerId = 9;
string payTime = 10;
}
message OrderAddBundleRecordInfo{
string orderAddNo = 1;
float amount = 2;
float settlementAmount = 3;
int32 currencyType = 4;
string handlingFee = 5;
float exchangeRate = 6;
string orderAddCreateAt = 7;
int32 addPayStatus = 8;
string contract = 9;
string snapshot = 10;
string CheckoutSessionId = 11;
string CustomerID = 12;
}
message PackagePriceAndTimeResponse{
float price = 1 [json_name = "price"];
string time = 2 [json_name = "time"];
} }
message CommonResponse { message CommonResponse {
@ -239,47 +46,8 @@ message BundleProfile {
string companySign = 10 [json_name = "companySign"]; string companySign = 10 [json_name = "companySign"];
int64 contractDuration = 11 [json_name = "contractDuration"]; int64 contractDuration = 11 [json_name = "contractDuration"];
string bundleCommonUid = 12 [json_name = "bundleCommonUid"]; string bundleCommonUid = 12 [json_name = "bundleCommonUid"];
int64 sort = 13 [json_name = "sort"];
string bgImg1 = 14 [json_name = "bgImg1"];
string bgImg2 = 15 [json_name = "bgImg2"];
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 2
repeated SelectValueAddService selectValueAddService = 17 [json_name = "SelectValueAddService"];
repeated BundleProfileLang bundleProfileLang = 18 [json_name = "bundleProfileLang"];
int32 imgOption = 19 [json_name = "imgOption"];
string fontColor = 20 [json_name = "fontColor"];
} }
message BundleProfileLang {
string uuid = 1 [json_name = "uuid"];
string name = 2 [json_name = "name"];
float price = 3 [json_name = "price"];
int64 priceType = 4 [json_name = "priceType"];
string content = 5 [json_name = "content"];
string language = 6 [json_name = "language"];
string createdAt = 7 [json_name = "createdAt"];
string updatedAt = 8 [json_name = "updatedAt"];
string contract = 9 [json_name = "contract"];
string companySign = 10 [json_name = "companySign"];
int64 contractDuration = 11 [json_name = "contractDuration"];
string fontColor = 12 [json_name = "fontColor"];
int64 sort = 13 [json_name = "sort"];
string bgImg1 = 14 [json_name = "bgImg1"];
string bgImg2 = 15 [json_name = "bgImg2"];
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 2
int32 imgOption = 17 [json_name = "imgOption"];
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
}
message SaveResponse {
string msg = 1 [json_name = "msg"];
string uuid = 2 [json_name = "uuid"];
int64 cancelNum = 3 [json_name = "cancelNum"];
}
message SelectValueAddService {
string valueAddUuid = 1 [json_name = "valueAddUuid"];
string serviceName= 2 [json_name = "serviceName"];
bool isDisplay = 3 [json_name = "isDisplay"];
int32 serviceType = 4 [json_name = "serviceType"];
}
message DelBundleRequest { message DelBundleRequest {
string uuid = 1 [json_name = "uuid"]; string uuid = 1 [json_name = "uuid"];
} }
@ -299,20 +67,13 @@ message BundleListResponse {
message BundleDetailRequest { message BundleDetailRequest {
string uuid = 1 [json_name = "uuid"]; string uuid = 1 [json_name = "uuid"];
string language = 2 [json_name = "language"]; // zh-CN zh-CN zh-TW EN de-DE js-JP
}
message HandShelfRequest {
string uuid = 1 [json_name = "uuid"];
int64 shelfStatus = 2 [json_name = "shelfStatus"]; // 1 2
} }
message BundleDetailResponse { message BundleDetailResponse {
BundleProfile bundle = 1 [json_name = "bundle"]; BundleProfile bundle = 1 [json_name = "bundle"];
string msg = 2 [json_name = "msg"]; string msg = 2 [json_name = "msg"];
} }
message BundleDetailResponseV2{
BundleProfile bundle = 1 [json_name = "bundle"];
string msg =2 [json_name = "msg"];
}
message OrderRecord { message OrderRecord {
string uuid = 1 [json_name = "uuid"]; string uuid = 1 [json_name = "uuid"];
string bundleUuid = 2 [json_name = "bundleUuid"]; string bundleUuid = 2 [json_name = "bundleUuid"];
@ -337,59 +98,17 @@ message OrderRecord {
float valueAddOriginalPrice= 21 [json_name= "valueAddOriginalPrice"]; // float valueAddOriginalPrice= 21 [json_name= "valueAddOriginalPrice"]; //
float valueAddDiscountPrice= 22 [json_name= "valueAddDiscountPrice"]; // float valueAddDiscountPrice= 22 [json_name= "valueAddDiscountPrice"]; //
float valueAddSavedAmount= 23 [json_name= "valueAddSavedAmount"]; // float valueAddSavedAmount= 23 [json_name= "valueAddSavedAmount"]; //
int32 num = 24 [json_name = "num"]; int32 num = 24 [json_name = "sex"];
float totalAmount = 25 [json_name = "totalAmount"]; // float totalAmount = 25 [json_name = "totalAmount"]; //
string sex = 26 [json_name = "sex"]; int32 sex = 26 [json_name = "sex"];
string nationality = 27 [json_name = "nationality"]; string nationality = 27 [json_name = "nationality"];
string certificatePicture = 28 [json_name = "certificatePicture"]; string certificatePicture = 28 [json_name = "certificatePicture"];
string placeOfResidence = 29 [json_name = "placeOfResidence"]; string placeOfResidence = 29 [json_name = "placeOfResidence"];
string groupPhoto = 30 [json_name = "groupPhoto"]; string groupPhoto = 30 [json_name = "groupPhoto"];
string bundleCommonUid = 31 [json_name = "bundleCommonUid"]; string bundleCommonUid = 31 [json_name = "bundleCommonUid"];
string addBundleCommonUid = 32 [json_name = "addBundleCommonUid"]; string addBundleCommonUid = 32 [json_name = "addBundleCommonUid"];
int32 financialConfirmation = 33 [json_name = "financialConfirmation"];
string telNum = 34 [json_name = "telNum"];
string language = 35 [json_name = "language"];
repeated PriceOptionsInfo priceOptionsInfo = 36 [json_name = "priceOptionsInfo"];
string expirationTime = 37 [json_name = "expirationTime"];
string snapshot = 38 [json_name = "snapshot"];
repeated AddInfo addInfos = 39 [json_name = "addInfos"];
}
message AddInfo{
string orderNo = 1 [json_name = "orderNo"];
int32 num = 2 [json_name = "num"];
string valueAddUUID = 3 [json_name = "valueAddUUID"];
} }
message OrderAddRecord{
string bundleUuid = 1 [json_name = "bundleUuid"];
repeated AddPriceOptionsInfo addPriceOptionsList = 2 [json_name = "addPriceOptionsList"];
string language = 3 [json_name = "language"];
string customerID = 4 [json_name = "customerID"];
string customerNum = 5 [json_name = "customerNum"];
string customerName = 6 [json_name = "customerName"];
// string valueAddUUID = 12 [json_name = "valueAddUUID"];
int32 source = 7 [json_name = "source"];
string signContract = 8 [json_name = "signContract"];
string signature = 9 [json_name = "signature"];
string signedTime = 10 [json_name = "signedTime"];
string expirationDate = 11 [json_name = "expirationDate"];
string snapshot = 38 [json_name = "snapshot"];
string orderUUID = 39 [json_name = "orderUUID"];
}
message AddPriceOptionsInfo {
int32 id = 1 [json_name = "id"];
string valueUid = 2 [json_name = "valueUid"];
int32 serviceType = 3 [json_name = "serviceType"];
int64 currencyType = 4 [json_name = "currencyType"];
float amount = 5 [json_name = "amount"];
int32 num = 6 [json_name = "num"];
string unit = 7 [json_name = "unit"];
}
message PriceOptionsInfo {
int32 id = 1 [json_name = "id"];
string valueUid = 2 [json_name = "valueUid"];
int32 num = 3 [json_name = "num"];
}
message OrderRecordsRequest { message OrderRecordsRequest {
int32 page = 1 [json_name = "page"]; int32 page = 1 [json_name = "page"];
int32 pageSize = 2 [json_name = "pageSize"]; int32 pageSize = 2 [json_name = "pageSize"];
@ -405,8 +124,6 @@ message OrderRecordsRequest {
string endPayTime = 12 [json_name = "endPayTime"]; string endPayTime = 12 [json_name = "endPayTime"];
string customerID = 13 [json_name = "customerID"]; string customerID = 13 [json_name = "customerID"];
int64 isHaveValueAdd = 14 [json_name = "isHaveValueAdd"];// int64 isHaveValueAdd = 14 [json_name = "isHaveValueAdd"];//
int32 financialConfirmation = 15 [json_name = "financialConfirmation"];
string telNum = 16 [json_name = "telNum"];
} }
message OrderRecordsResponse { message OrderRecordsResponse {
@ -418,8 +135,6 @@ message OrderRecordsDetailRequest {
string uuid = 1 [json_name = "uuid"]; string uuid = 1 [json_name = "uuid"];
string orderNo = 2 [json_name = "orderNo"]; string orderNo = 2 [json_name = "orderNo"];
string customerID = 3 [json_name = "customerID"]; string customerID = 3 [json_name = "customerID"];
string bundleUUID = 4 [json_name = "bundleUUID"];
uint64 status = 5 [json_name = "status"];
} }
message OrderRecordsDetailResponse { message OrderRecordsDetailResponse {
@ -481,353 +196,3 @@ message ValueAddBundleDetailResponse {
string payTime = 2 [json_name = "payTime"]; string payTime = 2 [json_name = "payTime"];
string msg = 3 [json_name = "msg"]; string msg = 3 [json_name = "msg"];
} }
message FinancialConfirmationRequest {
string orderNo = 1 [json_name = "orderNo"];
}
// ***************************************************************************
//
message ValueAddService {
string uuid = 1 [json_name = "uuid"];
string serviceName = 2 [json_name = "serviceName"]; //
int32 serviceType = 3 [json_name = "serviceType"];
repeated ValueAddServiceLang serviceLang = 4 [json_name = "serviceLang"];
}
message ValueAddServiceLang {
string uuid = 1 [json_name = "uuid"];
string serviceName = 2 [json_name = "serviceName"]; //
int32 serviceType = 3 [json_name = "serviceType"];
int32 priceMode = 4 [json_name = "priceMode"];
string originalPrice = 5 [json_name = "originalPrice"];
string unit = 6 [json_name = "unit"];
int64 priceType = 7 [json_name = "priceType"];
string language = 8 [json_name = "language"];
string createdAt = 9 [json_name = "createdAt"];
string updatedAt = 10 [json_name = "updatedAt"];
repeated ValueAddPriceOptions options = 12 [json_name = "options"];
}
//
message ValueAddPriceOptions {
int64 id = 1 [json_name = "id"];
int32 num = 2 [json_name = "num"];
string symbol = 3 [json_name = "symbol"];
string price = 4 [json_name = "price"];
string saveAmount = 5 [json_name = "saveAmount"];
}
//
message ValueAddServiceListRequest {
int32 page = 1 [json_name = "page"];
int32 pageSize = 2 [json_name = "pageSize"];
string name = 3 [json_name = "name"];
string language = 4 [json_name = "language"];
}
message ValueAddServiceListResponse {
int32 total = 1 [json_name = "total"];
string msg = 2 [json_name = "msg"];
repeated ValueAddService valueAddServiceList = 3 [json_name = "valueAddServiceList"];
}
//
message ValueAddServiceDetailRequest {
string uuid = 1 [json_name = "uuid"];
string language = 2 [json_name = "language"]; // zh-CN zh-CN zh-TW EN de-DE js-JP
}
message ValueAddServiceDetailResponse {
string msg = 1 [json_name = "msg"];
ValueAddService valueAddService = 2 [json_name = "valueAddService"];
}
message CalculatePriceRequest{
string uuid = 1;
int32 num = 2;
string language = 3;
}
message CalculatePriceResponse{
string msg = 1;
float price = 2;
}
message BatchGetValueAddServiceLangRequest{
repeated string uuids = 1;
string language = 2;
}
message BatchGetValueAddServiceLangResponse{
string msg = 1;
repeated ValueAddServiceLang valueAddServiceLangList = 2;
}
//*********************************-over******************************************
message BundleExtendRequest{
int64 userId = 1;
uint32 accountAdditional = 2;
uint32 videoAdditional = 3;
uint32 imagesAdditional = 4;
uint32 dataAdditional = 5;
uint32 availableDurationAdditional = 6;
uint32 timeUnit = 7; // 1 2 3
string remark = 8;
string associatedorderNumber = 9;
uint64 operatorId = 10;
string operatorName = 11;
string operatorPhoneNumber = 12;
int32 type = 13;
}
message BundleExtendResponse{
}
message BundleExtendRecordsListRequest{
int32 page = 1;
int32 pageSize = 2;
string user = 3;
string operator = 4;
uint64 startTime = 5;
uint64 endTime = 6;
uint32 type = 7;
string associatedOrderNumber = 8;
}
message BundleExtendRecordsListResponse{
int64 total = 1;
repeated BundleExtendRecordItem data = 2;
}
message BundleExtendRecordItem{
string userName = 1;
string userPhoneNumber = 2;
uint32 accountAdditional = 3;
uint32 videoAdditional = 4;
uint32 imagesAdditional = 5;
uint32 dataAdditional = 6;
uint32 availableDurationAdditional = 7;
int32 type = 8;
uint64 createdAt = 9;
string remark = 10;
string associatedOrderNumber = 11;
string operatorName = 12;
string operatorPhoneNumber = 13;
}
message GetBundleBalanceListReq{
string userName = 1;
int32 status = 2;
string bundleName = 3;
int32 bought = 4;
int64 expiredTimeStart = 5;
int64 expiredTimeEnd = 6;
int32 page = 7;
int32 pageSize = 8;
}
message GetBundleBalanceReq{
string userName = 1;
int32 status = 2;
string bundleName = 3;
int64 expiredTimeStart = 4;
int64 expiredTimeEnd = 5;
int32 page = 6;
int32 pageSize = 7;
}
message BundleBalanceItem{
int32 userId = 1;
string userName = 2;
string userPhoneNumber = 3;
int32 status = 4;
string bundleName = 5;
int64 expiredTime = 6;
int32 accountNumber = 7;
int32 accountConsumptionNumber = 8;
int32 videoNumber = 9;
int32 videoConsumptionNumber = 10;
int32 imageNumber = 11;
int32 imageConsumptionNumber = 12;
int32 dataAnalysisNumber = 13;
int32 dataAnalysisConsumptionNumber = 14;
int32 expansionPacksNumber = 15;
int32 bought = 16;
}
message GetBundleBalanceListResp{
int64 total = 1;
repeated BundleBalanceItem data = 2;
}
message CreateBundleBalanceReq{
int32 userId = 1;
string orderUUID = 2;
int32 accountNumber = 3;
int32 accountConsumptionNumber = 4;
int32 videoNumber = 5;
int32 videoConsumptionNumber = 6;
int32 imageNumber = 7;
int32 imageConsumptionNumber = 8;
int32 dataAnalysisNumber = 9;
int32 dataAnalysisConsumptionNumber = 10;
int32 expansionPacksNumber = 11;
}
message CreateBundleBalanceResp{
}
message AddBundleBalanceReq{
int32 id = 1;
int32 userId = 2;
string orderUUID = 3;
int32 accountNumber = 4;
int32 accountConsumptionNumber = 5;
int32 videoNumber = 6;
int32 videoConsumptionNumber = 7;
int32 imageNumber = 8;
int32 imageConsumptionNumber = 9;
int32 dataAnalysisNumber = 10;
int32 dataAnalysisConsumptionNumber = 11;
int32 expansionPacksNumber = 12;
}
message AddBundleBalanceResp{
}
message GetUsedRecordListReq{
string user = 1;
string operator = 2;
string account = 3;
int32 platform = 4;
int32 type = 5;
string title = 6;
int64 submitTimeStart = 7;
int64 submitTimeEnd = 8;
int32 page = 9;
int32 pageSize = 10;
}
message GetUsedRecordListResp {
int64 total = 1;
repeated WorkCastItem data = 2;
}
message WorkCastItem{
string artistUuid = 1; // ID
string artistName = 2; //
string artistPhone = 3; //
string workUuid = 4; // uuid
uint32 workCategory = 5; // 1 2
string bundleUuid = 6; // ID uuid
string bundleName = 7; //
string platformIds = 8; // ID集合 (json )
string mediaNames = 9; //
string mediaAccIDs = 10; // ID集合
string workTitle = 11; //
string submitTime = 12; //
string operatorName = 13; //
string operatorPhone = 14; //
uint32 status = 15; // 1 2
}
message GetImageWorkDetailReq {
string workId = 1;
}
message GetVedioWorkDetailReq {
string workId = 1;
}
message GetImageWorkDetailResp{
string workId = 1;
string coverUrl = 2;
string videoUrl = 3;
int64 createdAt = 4;
}
message GetVedioeWorkDetailResp{
string workId = 1;
repeated string imageUrls = 2;
int64 createdAt = 3;
}
message ToBeComfirmedWorksReq{
string artistUuid = 1;
int32 page = 2;
int32 pageSize =3;
}
message workItem{
string uuid = 1;
string workUuid = 2;
string title = 3;
string content = 4;
uint32 workCategory = 5;
uint32 workStatus = 6;
string platformIds = 7;
string mediaNames = 8;
string mediaAccUserIds = 9;
int64 confirmedAt = 10;
int64 createdAt = 11; //
string artistName = 12;
string artistUuid = 13;
}
message ToBeComfirmedWorksResp{
int64 total = 1;
int64 unconfirmed = 2;
repeated workItem data = 3;
}
message GetBundleBalanceByUserIdReq{
int32 userId = 1;
}
message GetBundleBalanceByUserIdResp{
string orderUUID = 1;
string bundleUuid = 2; // ID uuid
string bundleName = 3; //
string bundleStatus = 4; //
int64 payTime = 5;
int64 expiredTime = 6;
string paymentAmount = 7;
int32 paymentType = 8;
int32 accountNumber = 9;
int32 accountAdditional = 10;
int32 accountConsumptionNumber = 11;
int32 videoNumber = 12;
int32 videoAdditional = 13;
int32 videoConsumptionNumber = 14;
int32 imageNumber = 15;
int32 imageAdditional = 16;
int32 imageConsumptionNumber = 17;
int32 dataAnalysisNumber = 18;
int32 dataAnalysisAdditional = 19;
int32 dataAnalysisConsumptionNumber = 20;
int32 expansionPacksNumber = 21;
}
message OnlyAddValueListByOrderNoRequest{
string orderNo = 1;
}
message OnlyAddValueListByOrderNoResp{
repeated AddBundleInfo AddBundleInfos = 1;
}
message AddBundleInfo {
string customerID = 1;
float amount = 2;
string checkOutSessionId = 3;
string orderNo = 4;
int32 paymentStatus = 5;
}
message UpdateStatusAndPayTimeBySerialNumber {
string serialNumber = 1;
string payTime = 2;
int32 paymentStatus = 3;
}
message ConfirmWorkReq{
string workUuid = 1;
}
message ConfirmWorkResp{
}

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,8 @@ import (
fmt "fmt" fmt "fmt"
math "math" math "math"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/descriptorpb" _ "google.golang.org/protobuf/types/descriptorpb"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
) )
@ -17,100 +17,10 @@ var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
func (this *DeleteValueAddServiceRequest) Validate() error {
return nil
}
func (this *GetReconciliationListReq) Validate() error {
return nil
}
func (this *GetReconciliationListResp) Validate() error {
for _, item := range this.List {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
}
}
}
return nil
}
func (this *ReconciliationInfo) Validate() error {
return nil
}
func (this *OrderInfoByOrderNoRequest) Validate() error {
return nil
}
func (this *OrderInfoByOrderNoResp) Validate() error {
return nil
}
func (this *OrderCreateRecord) Validate() error {
for _, item := range this.AddRecords {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddRecords", err)
}
}
}
return nil
}
func (this *OrderCreateAddRecord) Validate() error {
return nil
}
func (this *OrderRecordsRequestV2) Validate() error {
return nil
}
func (this *OrderRecordsResponseV2) Validate() error {
for _, item := range this.BundleInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleInfo", err)
}
}
}
return nil
}
func (this *OrderBundleRecordInfo) Validate() error {
for _, item := range this.AddBundleInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleInfo", err)
}
}
}
return nil
}
func (this *OrderAddBundleRecordInfo) Validate() error {
return nil
}
func (this *PackagePriceAndTimeResponse) Validate() error {
return nil
}
func (this *CommonResponse) Validate() error { func (this *CommonResponse) Validate() error {
return nil return nil
} }
func (this *BundleProfile) Validate() error { func (this *BundleProfile) Validate() error {
for _, item := range this.SelectValueAddService {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("SelectValueAddService", err)
}
}
}
for _, item := range this.BundleProfileLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("BundleProfileLang", err)
}
}
}
return nil
}
func (this *BundleProfileLang) Validate() error {
return nil
}
func (this *SaveResponse) Validate() error {
return nil
}
func (this *SelectValueAddService) Validate() error {
return nil return nil
} }
func (this *DelBundleRequest) Validate() error { func (this *DelBundleRequest) Validate() error {
@ -132,9 +42,6 @@ func (this *BundleListResponse) Validate() error {
func (this *BundleDetailRequest) Validate() error { func (this *BundleDetailRequest) Validate() error {
return nil return nil
} }
func (this *HandShelfRequest) Validate() error {
return nil
}
func (this *BundleDetailResponse) Validate() error { func (this *BundleDetailResponse) Validate() error {
if this.Bundle != nil { if this.Bundle != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
@ -143,48 +50,7 @@ func (this *BundleDetailResponse) Validate() error {
} }
return nil return nil
} }
func (this *BundleDetailResponseV2) Validate() error {
if this.Bundle != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Bundle); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Bundle", err)
}
}
return nil
}
func (this *OrderRecord) Validate() error { func (this *OrderRecord) Validate() error {
for _, item := range this.PriceOptionsInfo {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("PriceOptionsInfo", err)
}
}
}
for _, item := range this.AddInfos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddInfos", err)
}
}
}
return nil
}
func (this *AddInfo) Validate() error {
return nil
}
func (this *OrderAddRecord) Validate() error {
for _, item := range this.AddPriceOptionsList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddPriceOptionsList", err)
}
}
}
return nil
}
func (this *AddPriceOptionsInfo) Validate() error {
return nil
}
func (this *PriceOptionsInfo) Validate() error {
return nil return nil
} }
func (this *OrderRecordsRequest) Validate() error { func (this *OrderRecordsRequest) Validate() error {
@ -250,200 +116,3 @@ func (this *ValueAddBundleDetailResponse) Validate() error {
} }
return nil return nil
} }
func (this *FinancialConfirmationRequest) Validate() error {
return nil
}
func (this *ValueAddService) Validate() error {
for _, item := range this.ServiceLang {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ServiceLang", err)
}
}
}
return nil
}
func (this *ValueAddServiceLang) Validate() error {
for _, item := range this.Options {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Options", err)
}
}
}
return nil
}
func (this *ValueAddPriceOptions) Validate() error {
return nil
}
func (this *ValueAddServiceListRequest) Validate() error {
return nil
}
func (this *ValueAddServiceListResponse) Validate() error {
for _, item := range this.ValueAddServiceList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceList", err)
}
}
}
return nil
}
func (this *ValueAddServiceDetailRequest) Validate() error {
return nil
}
func (this *ValueAddServiceDetailResponse) Validate() error {
if this.ValueAddService != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.ValueAddService); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddService", err)
}
}
return nil
}
func (this *CalculatePriceRequest) Validate() error {
return nil
}
func (this *CalculatePriceResponse) Validate() error {
return nil
}
func (this *BatchGetValueAddServiceLangRequest) Validate() error {
return nil
}
func (this *BatchGetValueAddServiceLangResponse) Validate() error {
for _, item := range this.ValueAddServiceLangList {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("ValueAddServiceLangList", err)
}
}
}
return nil
}
func (this *BundleExtendRequest) Validate() error {
return nil
}
func (this *BundleExtendResponse) Validate() error {
return nil
}
func (this *BundleExtendRecordsListRequest) Validate() error {
return nil
}
func (this *BundleExtendRecordsListResponse) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *BundleExtendRecordItem) Validate() error {
return nil
}
func (this *GetBundleBalanceListReq) Validate() error {
return nil
}
func (this *GetBundleBalanceReq) Validate() error {
return nil
}
func (this *BundleBalanceItem) Validate() error {
return nil
}
func (this *GetBundleBalanceListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *CreateBundleBalanceReq) Validate() error {
return nil
}
func (this *CreateBundleBalanceResp) Validate() error {
return nil
}
func (this *AddBundleBalanceReq) Validate() error {
return nil
}
func (this *AddBundleBalanceResp) Validate() error {
return nil
}
func (this *GetUsedRecordListReq) Validate() error {
return nil
}
func (this *GetUsedRecordListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *WorkCastItem) Validate() error {
return nil
}
func (this *GetImageWorkDetailReq) Validate() error {
return nil
}
func (this *GetVedioWorkDetailReq) Validate() error {
return nil
}
func (this *GetImageWorkDetailResp) Validate() error {
return nil
}
func (this *GetVedioeWorkDetailResp) Validate() error {
return nil
}
func (this *ToBeComfirmedWorksReq) Validate() error {
return nil
}
func (this *WorkItem) Validate() error {
return nil
}
func (this *ToBeComfirmedWorksResp) Validate() error {
for _, item := range this.Data {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
}
}
}
return nil
}
func (this *GetBundleBalanceByUserIdReq) Validate() error {
return nil
}
func (this *GetBundleBalanceByUserIdResp) Validate() error {
return nil
}
func (this *OnlyAddValueListByOrderNoRequest) Validate() error {
return nil
}
func (this *OnlyAddValueListByOrderNoResp) Validate() error {
for _, item := range this.AddBundleInfos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleInfos", err)
}
}
}
return nil
}
func (this *AddBundleInfo) Validate() error {
return nil
}
func (this *UpdateStatusAndPayTimeBySerialNumber) Validate() error {
return nil
}
func (this *ConfirmWorkReq) Validate() error {
return nil
}
func (this *ConfirmWorkResp) Validate() error {
return nil
}

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,10 @@
package db package db
import ( import (
bundleConfig "micro-bundle/config"
"strings"
"github.com/google/wire" "github.com/google/wire"
"gorm.io/gorm" "gorm.io/gorm"
bundleConfig "micro-bundle/config"
"strings"
) )
var Provider = wire.NewSet(NewBundleDB) var Provider = wire.NewSet(NewBundleDB)
@ -13,7 +12,7 @@ var Provider = wire.NewSet(NewBundleDB)
func NewBundleDB() *gorm.DB { func NewBundleDB() *gorm.DB {
connBundleDB := strings.Join([]string{bundleConfig.Data.BundleDB.User, ":", bundleConfig.Data.BundleDB.Password, connBundleDB := strings.Join([]string{bundleConfig.Data.BundleDB.User, ":", bundleConfig.Data.BundleDB.Password,
"@tcp(", bundleConfig.Data.BundleDB.Host, ":", bundleConfig.Data.BundleDB.Port, ")/", "@tcp(", bundleConfig.Data.BundleDB.Host, ":", bundleConfig.Data.BundleDB.Port, ")/",
bundleConfig.Data.BundleDB.DbName, "?charset=utf8mb4&parseTime=true&loc=Local"}, "") bundleConfig.Data.BundleDB.DbName, "?charset=utf8mb4&parseTime=true"}, "")
DciDB := loadMysqlConn(connBundleDB) DciDB := loadMysqlConn(connBundleDB)
return DciDB return DciDB
} }

View File

@ -45,16 +45,6 @@ func loadMysqlConn(conn string) *gorm.DB {
&model.BundleOrderRecords{}, &model.BundleOrderRecords{},
&model.ValueAddBundleProfile{}, &model.ValueAddBundleProfile{},
//&model.ValueAddBundleRecord{} //&model.ValueAddBundleRecord{}
&model.BundleProfileLang{},
&model.ValueAddService{},
&model.ValueAddServiceLang{},
&model.BundleToValueAddService{},
&model.BundleProfileHistory{},
&model.ValueAddServiceHistory{},
&model.BundleOrderValueAdd{},
&model.BundleExtensionRecords{},
&model.BundleBalance{},
&model.Reconciliation{},
) )
if err != nil { if err != nil {

View File

@ -10,13 +10,6 @@ const (
Success = "操作成功" Success = "操作成功"
Failed = "操作失败" Failed = "操作失败"
) )
const (
ZH_CN = "zh-CN" //简体中文
ZH_TW = "zh-TW" //繁体中文
EN = "EN" //英文
DE_DE = "de-DE" //德语
JA_JP = "ja-JP" //日语
)
const ( const (
Http = 200 Http = 200
@ -51,16 +44,12 @@ const (
ErrorCreateOrderInfo = "创建订单信息失败" ErrorCreateOrderInfo = "创建订单信息失败"
SuccessCreateOrderInfo = "创建订单信息成功" SuccessCreateOrderInfo = "创建订单信息成功"
ErrorUpdateOrderInfo = "更新订单信息失败" ErrorUpdateOrderInfo = "更新订单信息失败"
ErrorDeleteOrderInfo = "删除增值服务失败" SuccessUpdateOrderInfo = "更新订单信息成功"
SuccessUpdateOrderInfo = "更新订单信息成功"
SuccessDeletedOrderInfo = "删除订单信息成功"
ErrorGetOrderInfo = "获取订单信息失败" ErrorGetOrderInfo = "获取订单信息失败"
ErrorGetOrderList = "获取订单列表失败" ErrorGetOrderList = "获取订单列表失败"
ErrorBundleNotFound = "套餐不存在"
ErrorDataConvert = "数据转换失败"
) )
// 增值套餐信息 // 增值套餐信息
@ -83,20 +72,3 @@ const (
ErrorTransaction = "事务失败" ErrorTransaction = "事务失败"
ErrorCommitTransaction = "提交事务失败" ErrorCommitTransaction = "提交事务失败"
) )
// 增值服务信息
const (
ErrorCreateValueAddServiceInfo = "创建增值服务信息失败"
SuccessCreateValueAddServiceInfo = "创建增值服务信息成功"
ErrorUpdateValueAddServiceInfo = "更新增值服务信息失败"
SuccessUpdateValueAddServiceInfo = "更新增值服务信息成功"
ErrorValueAddServiceList = "获取增值服务列表失败"
SuccessValueAddServiceList = "获取增值服务列表成功"
ErrorValueAddServiceInfo = "获取增值服务详情失败"
SuccessValueAddServiceInfo = "获取增值服务详情成功"
//校验
ErrorValueServiceNameEmpty = "增值服务名称不能为空"
ErrorValueServiceTypeEmpty = "增值服务类型不能为空"
ErrorValueServicePriceModeEmpty = "增值服务价格模式不能为空"
ErrorValueServiceOptionsEmpty = "增值服务选项不能为空"
)

View File

@ -1,20 +0,0 @@
package utils
import "regexp"
func IsPhoneNumber(phone string) bool {
// 正则表达式匹配常见的电话号码格式
// 1. 11位手机号13x, 14x, 15x, 16x, 17x, 18x, 19x开头
// 2. 3-4位区号+7-8位号码可含-或空格分隔)
// 3. 国际号码(+开头)
pattern := `^(?:\+?[0-9]{1,4}[- ]?)?` + // 国际前缀
`(?:\([0-9]{1,4}\)[- ]?)?` + // 可能有括号的区号
`(?:[0-9]{7,15}|` + // 7-15位数字或
`1[3-9][0-9]{9})$` // 11位手机号
matched, err := regexp.MatchString(pattern, phone)
if err != nil {
return false
}
return matched
}