Compare commits

..

No commits in common. "main" and "feat-zjy-issue-008" have entirely different histories.

23 changed files with 2267 additions and 4985 deletions

View File

@ -1314,56 +1314,3 @@
{"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."}

View File

@ -112,18 +112,3 @@ func (b *BundleProvider) OnlyAddValueListByOrderNo(_ context.Context, req *bundl
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)
}
// 自动创建用户且实名且下订单
func (b *BundleProvider) ListUnfinishedInfos(_ context.Context, req *bundle.AutoCreateUserAndOrderRequest) (res *bundle.UnfinishedInfos, err error) {
return logic.ListUnfinishedInfos(req)
}
// 自动创建用户且实名且下订单
func (b *BundleProvider) SoftDeleteUnfinishedInfo(_ context.Context, req *bundle.SoftDeleteUnfinishedInfoRequest) (res *bundle.CommonResponse, err error) {
return logic.SoftDeleteUnfinishedInfo(req)
}

View File

@ -4,6 +4,9 @@ import (
"context"
"micro-bundle/internal/logic"
"micro-bundle/pb/bundle"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
func (b *BundleProvider) BundleExtend(_ context.Context, req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse, error) {
@ -18,10 +21,6 @@ func (b *BundleProvider) GetBundleBalanceList(_ context.Context, req *bundle.Get
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)
}
@ -43,9 +42,5 @@ func (b *BundleProvider) GetVedioWorkDetail(_ context.Context, req *bundle.GetVe
}
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)
return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented")
}

View File

@ -22,9 +22,6 @@ func (b *BundleProvider) BundleListV2(_ context.Context, req *bundle.BundleListR
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) {
@ -42,12 +39,3 @@ func (b *BundleProvider) ValueAddServiceLangByUuidAndLanguage(_ context.Context,
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

@ -136,6 +136,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
bundles := make([]*model.BundleProfile, 0)
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Preload("BundleProfileLang")
//query = query.Where("shelf_status = ?", 1) //上架的
if req.Name != "" {
query = query.Where("name like ?", "%"+req.Name+"%")
@ -160,7 +161,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
if err = query.Preload("BundleToValueAddService").Find(&bundles).Error; err != nil {
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐列表失败: ")
}
if len(bundles) > 0 {
if bundles != nil && len(bundles) > 0 {
for _, bundleProfile := range bundles {
selectValueAddService := make([]*bundle.SelectValueAddService, 0)
if bundleProfile.BundleToValueAddService != nil {
@ -172,7 +173,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
}
}
bundleProfileLang := []*bundle.BundleProfileLang{}
if len(bundleProfile.BundleProfileLang) > 0 {
if bundleProfile.BundleProfileLang != nil && len(bundleProfile.BundleProfileLang) > 0 {
for _, lang := range bundleProfile.BundleProfileLang {
bpl := &bundle.BundleProfileLang{
Uuid: lang.UUID,
@ -206,7 +207,6 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
SelectValueAddService: selectValueAddService,
BundleProfileLang: bundleProfileLang,
ShelfStatus: int64(bundleProfile.ShelfStatus),
FontColor: bundleProfile.FontColor,
})
}
}
@ -223,7 +223,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
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).
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", req.Uuid).
Preload("BundleProfileLang").
Preload("BundleToValueAddService").
First(&data).Error
@ -237,7 +237,6 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *model.BundleProfile,
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
@ -248,8 +247,7 @@ func HandShelf(uuid string, shelfStatus int64) (res *bundle.CommonResponse, err
// 通过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
err = app.ModuleClients.BundleDB.Where("uuid = ? AND language = ?", uuid, language).First(&bundleProfileLang).Error
if err != nil {
return nil, err
}
@ -276,23 +274,12 @@ func TxCreateBundleLang(tx *gorm.DB, req *model.BundleProfileLang) (err error) {
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 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
err = tx.Model(&model.BundleProfileLang{}).Where("uuid =? and language=?", uuid, language).Updates(columns).Error
if err != nil {
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
}
@ -301,24 +288,13 @@ func TxUpdateBundleLang(tx *gorm.DB, uuid string, language string, columns map[s
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 DeleteBundleToValueAddService(tx *gorm.DB, bundleUuid, valueUid string) error {
return tx.Where("bundle_uuid = ? AND value_uid = ?", 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
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).Where("bundle_uuid = ?", bundleUuid).Pluck("value_uid", &uuids).Error
return uuids, err
}
@ -326,7 +302,7 @@ func GetValueAddServiceUuidsByBundleUuid(bundleUuid string) ([]string, error) {
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).
Where("bundle_uuid = ?", bundleUuid).
Find(&result).Error
return result, err
}
@ -334,11 +310,8 @@ func GetBundleToValueAddServiceByBundleUuid(bundleUuid string) ([]*model.BundleT
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).
Where("uuid =?", uuid).
Find(&result).Error
if err != nil {
return nil, err
}
return result, err
}
func GetBundleDetailByUuid(uuid string) (*model.BundleProfile, error) {
@ -353,95 +326,3 @@ func GetBundleDetailByUuid(uuid string) (*model.BundleProfile, error) {
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

@ -2,7 +2,6 @@ package dao
import (
"errors"
"fmt"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
@ -10,7 +9,6 @@ import (
"strconv"
"time"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"github.com/duke-git/lancet/v2/datetime"
"gorm.io/gorm"
@ -23,20 +21,14 @@ func AddBundleExtendRecord(data model.BundleExtensionRecords) error {
}
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 {
if err := tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{CustomerID: strconv.Itoa(data.UserId)}).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 {
t, _ := time.Parse("2006-01-02 15:04:05", record.PayTime)
expireTime = t
logger.Infof("过期时间为空,使用默认过期时间" + expireTime.Format(time.DateTime))
}
expireTime, err := time.Parse(time.DateOnly, record.ExpirationTime)
if err != nil {
return err
}
switch data.TimeUnit {
case 1:
expireTime = datetime.AddDay(expireTime, int64(data.AvailableDurationAdditional))
@ -47,51 +39,45 @@ func AddBundleExtendRecord(data model.BundleExtensionRecords) error {
default:
return errors.New("时间单位有误")
}
record.ExpirationTime = expireTime.Format(time.DateTime)
return tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{UUID: record.UUID}).Updates(&record).Error
record.ExpirationTime = expireTime.Format(time.DateOnly)
err = tx.Model(&model.BundleOrderRecords{}).Save(&record).Error
return err
}
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").
session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_extension_records AS ber").
Select(`
ber.*,
rn.name as user_name,
u.nickname 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")
`).Joins("LEFT JOIN `micro-account`.`user` u on u.id = user_id")
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+"%")
session = session.Where("u.nickname 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+"%")
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))
}
@ -100,48 +86,30 @@ func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data
}
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")
session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_balance AS bb").
Select(`
bb .*,
bor.expiration_time as expired_time,
bor.bundle_name,
bor.status,
bor.uuid as order_uuid,
u.nickname as user_name,
u.tel_num as user_phone_number
`).
Joins("LEFT JOIN bundle_order_records bor on bor.customer_id = bb .user_id").
Joins("LEFT JOIN `micro-account`.`user` u on u.id = bb.user_id")
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+"%")
}
session = session.Where("u.nickname 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
@ -153,36 +121,6 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
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{}
@ -190,7 +128,9 @@ func AddBundleBalanceByUserId(data model.BundleBalance) error {
return errors.New("用户还没有套餐信息")
}
newData := model.BundleBalance{
Model: oldData.Model,
Model: gorm.Model{
ID: data.Model.ID,
},
UserId: oldData.UserId,
OrderUUID: oldData.OrderUUID,
AccountNumber: oldData.AccountNumber + data.AccountNumber,
@ -210,7 +150,7 @@ func AddBundleBalanceByUserId(data model.BundleBalance) error {
newData.DataAnalysisConsumptionNumber > newData.DataAnalysisNumber {
return errors.New("套餐余量不足")
}
return tx.Model(&model.BundleBalance{}).Where("id = ?", oldData.ID).Save(&newData).Error
return tx.Model(&model.BundleBalance{}).Where("id = ?", oldData.ID).Updates(&newData).Error
})
}
@ -224,10 +164,10 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, tota
session = session.Where("title = ?", req.Title)
}
if req.Platform != 0 {
session = session.Where(fmt.Sprintf("JSON_CONTAINS(platform_ids,'%d')", req.Platform))
session = session.Where("JSON_CONTAINS(platform_ids,?)", req.Platform)
}
if req.Account != "" {
session = session.Where(fmt.Sprintf(`JSON_CONTAINS(media_names,'"%s"')`, req.Account))
if req.Account != 0 {
session = session.Where("JSON_CONTAINS(media_names,?)", req.Account)
}
if req.SubmitTimeEnd != 0 {
session = session.Where("submit_time <= ?", time.UnixMilli(req.SubmitTimeEnd))
@ -258,7 +198,7 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, tota
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
err = session.Find(&data).Error
return
}
@ -272,38 +212,8 @@ func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (data model.CastWorkV
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
}
// func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWork, err error) {
// // app.ModuleClients.BundleDB.Where(&model.CastWork{
// // ArtistUuid: req.ArtistUuid,
// // })
// }

View File

@ -112,22 +112,6 @@ func UpdateOrderRecordByOrderNO(orderRecord *model.BundleOrderRecords) (res *bun
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
@ -289,10 +273,7 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order
if req.BundleUUID != "" {
query = query.Where("bundle_uuid = ?", req.BundleUUID)
}
if req.Status != 0 {
query = query.Where("status = ?", req.Status)
}
err = query.Order("created_at desc").First(&orderRecord).Error
err = query.Order("expiration_time desc").First(&orderRecord).Error
if err != nil {
return res, commonErr.ReturnError(err, msg.ErrorGetOrderInfo, "获取订单信息失败: ")
}
@ -468,9 +449,6 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
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))
@ -486,7 +464,6 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
}
for _, record := range records {
customerID, _ := strconv.ParseInt(record.CustomerID, 10, 64)
orderItem := &bundle.OrderBundleRecordInfo{
OrderNo: record.OrderNo,
BundleName: record.BundleName,
@ -496,24 +473,30 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
BundleCreateAt: record.CreatedAt.Format("2006-01-02 15:04:05"),
Amount: record.Amount,
CustomerId: customerID,
PayTime: record.PayTime,
}
// 聚合子订单
// 构建子订单 map按 orderAddNo 聚合
addMap := make(map[string]*bundle.OrderAddBundleRecordInfo)
for _, sub := range record.BundleOrderValueAdd {
orderAddNo := sub.OrderNo
amount := float32(sub.Amount)
// SettlementAmount 规则
settlementAmount := float32(sub.Amount)
if sub.OrderNo == record.OrderNo {
settlementAmount = record.TotalAmount
}
if existing, ok := addMap[orderAddNo]; ok {
existing.Amount += amount
existing.Amount += float32(sub.Amount)
existing.SettlementAmount += settlementAmount
} else {
addMap[orderAddNo] = &bundle.OrderAddBundleRecordInfo{
OrderAddNo: orderAddNo,
Amount: amount,
CurrencyType: int32(sub.CurrencyType),
HandlingFee: sub.HandlingFee, //手续费
OrderAddNo: orderAddNo,
Amount: float32(sub.Amount),
SettlementAmount: settlementAmount,
CurrencyType: int32(sub.CurrencyType),
//HandlingFee: float32(sub.HandlingFee),
//ExchangeRate: float32(sub.ExchangeRate),
OrderAddCreateAt: sub.CreatedAt.Format("2006-01-02 15:04:05"),
AddPayStatus: int32(sub.PaymentStatus),
Contract: sub.SignContract,
@ -524,16 +507,10 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
}
}
// 设置 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)
// 将聚合后的子订单添加到主订单返回结构中
for _, v := range addMap {
orderItem.AddBundleInfo = append(orderItem.AddBundleInfo, v)
}
res.BundleInfo = append(res.BundleInfo, orderItem)
}
res.Total = int32(count)
@ -563,7 +540,6 @@ func OrderListByOrderNo(req *bundle.OrderInfoByOrderNoRequest) (*bundle.OrderInf
Type: int32(addOrder[0].Source),
UserId: uint64(userID),
OrderUUID: addOrder[0].OrderUUID,
UserName: addOrder[0].CustomerName,
}
for _, item := range addOrder {
switch item.ServiceType {
@ -606,11 +582,8 @@ func GetReconciliationList(req *bundle.GetReconciliationListReq) (*bundle.GetRec
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.OrderNo != "" {
modelObj = modelObj.Where("order_no like ?", "%"+req.OrderNo+"%")
}
if req.CreatedStart != "" && req.CreatedEnd != "" {
modelObj = modelObj.Where("created_at between ? and ?", req.CreatedStart, req.CreatedEnd)
@ -629,7 +602,7 @@ func GetReconciliationList(req *bundle.GetReconciliationListReq) (*bundle.GetRec
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 {
if err := modelObj.Offset(int(offset)).Limit(int(req.PageSize)).Find(&records).Error; err != nil {
return nil, fmt.Errorf("查询记录失败: %v", err)
}
@ -663,7 +636,6 @@ func CreateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
PayStatus: int(req.PayStatus),
SerialNumber: req.SerialNumber,
CreationTime: time.Now().Format("2006-01-02 15:04:05"),
HandlingFee: req.HandlingFee,
}
// 创建记录
@ -694,7 +666,6 @@ func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
PayTime: req.PayTime,
PayStatus: int(req.PayStatus),
SerialNumber: req.SerialNumber,
HandlingFee: req.HandlingFee,
}
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
return nil, fmt.Errorf("更新对账单失败: %v", err)
@ -743,105 +714,3 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
// 返回成功响应
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
}
func ListUnfinishedInfos(req *bundle.AutoCreateUserAndOrderRequest) (res *bundle.UnfinishedInfos, err error) {
res = new(bundle.UnfinishedInfos)
res.UnfinishedInfos = make([]*bundle.UnfinishedInfo, 0)
// TODO 0.捞出指定数量的数据
infos := make([]*model.FieePaymentAuto, 0)
query := app.ModuleClients.BundleDB.Where("deleted_at is null")
if req.Num != 0 {
query.Limit(int(req.Num))
}
err = query.Find(&infos).Error
if err != nil {
return nil, err
}
for _, info := range infos {
unfinishedInfo := new(bundle.UnfinishedInfo)
unfinishedInfo.ID = uint32(info.ID)
unfinishedInfo.UserNum = info.UserNum
unfinishedInfo.UserName = info.UserName
unfinishedInfo.UserTelArea = info.UserTelArea
unfinishedInfo.UserTel = info.UserTel
unfinishedInfo.UserSex = info.UserSex
unfinishedInfo.Nationality = info.Nationality
unfinishedInfo.PlaceOfResidence = info.PlaceOfResidence
unfinishedInfo.DocumentType = int32(info.DocumentType)
unfinishedInfo.UserIdCardFrontUrl = info.UserIdCardFrontUrl
unfinishedInfo.UserIdCardReverseUrl = info.UserIdCardReverseUrl
unfinishedInfo.UserIdCardValidity = info.UserIdCardValidity
unfinishedInfo.OrderNo = info.OrderNo
unfinishedInfo.OrderPayAmount = info.OrderPayAmount
unfinishedInfo.OrderSettlementAmount = info.OrderSettlementAmount
unfinishedInfo.OrderFeeAmount = info.OrderFeeAmount
unfinishedInfo.OrderPayCurrency = info.OrderPayCurrency
unfinishedInfo.OrderAccountCurrency = info.OrderAccountCurrency
unfinishedInfo.PayTime = info.PayTime.Format("2006-01-02 15:04:05")
res.UnfinishedInfos = append(res.UnfinishedInfos, unfinishedInfo)
}
return res, nil
}
func SoftDeleteUnfinishedInfo(req *bundle.SoftDeleteUnfinishedInfoRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
exist := new(model.FieePaymentAuto)
// 查询未处理的数据
err = app.ModuleClients.BundleDB.Model(&model.FieePaymentAuto{}).
Where("id = ?", req.ID).
First(&exist).Error
if err != nil {
return nil, errors.New("数据不存在")
}
if err = app.ModuleClients.BundleDB.Where("id = ?", req.ID).
Delete(&model.FieePaymentAuto{}).Error; err != nil {
return res, errors.New("删除自动导入表数据失败")
}
return res, nil
}

View File

@ -97,15 +97,15 @@ func CreateValueAddServiceLang(tx *gorm.DB, req *model.ValueAddServiceLang) (err
// 增值套餐主表更新
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
err = tx.Model(&model.ValueAddService{}).Where("uuid = ?", 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
err = tx.Model(&model.ValueAddServiceLang{}).Where("uuid =?", columns["uuid"]).
Where("language", columns["language"]).Updates(columns).Error
if err != nil {
return
}
@ -115,7 +115,6 @@ func UpdateValueAddServiceLang(tx *gorm.DB, columns map[string]interface{}) (err
// 增值套餐列表
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")
})
@ -135,7 +134,7 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res []*model.V
// 增值套餐详情
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
err = app.ModuleClients.BundleDB.Where("uuid = ?", uuid).Preload("ValueAddServiceLang").First(&data).Error
if err != nil {
return nil, err
}
@ -144,8 +143,7 @@ func ValueAddServiceDetail(uuid string) (valueAddServiceDetail *model.ValueAddSe
// 通过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
err = app.ModuleClients.BundleDB.Where("uuid = ? AND language = ?", uuid, language).First(&valueAddServiceLang).Error
if err != nil {
return nil, err
}
@ -156,7 +154,7 @@ func ValueAddServiceDetailByUuidAndLanguage(uuid string, language string) (value
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).
Where("value_uid = ?", valueUid).
Find(&rels).Error
return rels, err
}
@ -189,17 +187,3 @@ func BatchValueAddServiceDetailTx(tx *gorm.DB, uids []string) (map[string]*model
}
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,13 +1,11 @@
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"
)
@ -25,28 +23,21 @@ func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse
AccountNumber: int(req.AccountAdditional),
ExpansionPacksNumber: 1,
}); err != nil {
return nil, errors.New("用户没有余量信息")
return nil, err
}
err := dao.AddBundleExtendRecord(data)
if err != nil {
logger.Error(err)
return nil, errors.New("创建扩展记录失败")
}
return nil, nil
return nil, dao.AddBundleExtendRecord(data)
}
func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundle.BundleExtendRecordsListResponse, error) {
data, total, err := dao.GetBundleExtendRecordList(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
return nil, err
}
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
@ -55,48 +46,24 @@ func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundl
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) {
data, total, err := dao.GetBundleBalanceList(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
return nil, err
}
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
}
t, _ := time.Parse("2006-01-02", m.ExpirationTime)
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, err
}
return nil, dao.AddBundleBalanceByUserId(data)
}
@ -104,22 +71,15 @@ func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalance
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("操作失败")
return nil, err
}
err := dao.CreateBundleBalance(data)
if err != nil {
logger.Error(err)
return nil, errors.New("创建余量信息失败")
}
return nil, nil
return nil, dao.CreateBundleBalance(data)
}
func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListResp, error) {
data, total, err := dao.GetUsedRecord(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
return nil, err
}
resp := &bundle.GetUsedRecordListResp{}
resp.Total = total
@ -134,8 +94,7 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListR
func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) {
data, err := dao.GetImageWorkDetail(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
return nil, err
}
result := &bundle.GetImageWorkDetailResp{}
err = copier.Copy(result, &data)
@ -145,8 +104,7 @@ func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWork
func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) {
data, err := dao.GetVedioWorkDetail(req)
if err != nil {
logger.Error(err)
return nil, errors.New("查询失败")
return nil, err
}
result := &bundle.GetVedioeWorkDetailResp{}
err = copier.Copy(result, &data)
@ -154,23 +112,6 @@ func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWor
}
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)
// data, err := dao.ToBeComfirmedWorks(req)
return nil, nil
}

View File

@ -3,13 +3,14 @@ package logic
import (
"encoding/json"
"errors"
"fmt"
"micro-bundle/internal/dao"
"micro-bundle/pb/bundle"
"micro-bundle/pkg/app"
"micro-bundle/pkg/msg"
"time"
"micro-bundle/internal/model"
"micro-bundle/pb/bundle"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
"github.com/jinzhu/copier"
@ -59,7 +60,7 @@ func BundleDetail(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResp
func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error) {
res = &bundle.SaveResponse{}
if req.Language == "" {
return res, errors.New("语言不能为空")
return res, errors.New("语言参数不能为空")
}
if req.Sort <= 0 {
return res, errors.New("排序参数需为正整数")
@ -75,7 +76,6 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
BgImg1: req.BgImg1,
BgImg2: req.BgImg2,
ShelfStatus: 2, //默认初始状态为2-下架
FontColor: req.FontColor,
}
bundleLang := &model.BundleProfileLang{
Name: req.Name,
@ -87,32 +87,50 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
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
// }
// }
// }
var existValueService = make(map[string]string)
if req.Uuid != "" {
valueService, existErr := dao.GetValueAddServiceUuidsByBundleUuid(req.Uuid)
if existErr != nil {
return res, existErr
}
if valueService != nil && len(valueService) > 0 {
for _, v := range valueService {
existValueService[v] = v
}
}
}
var cancelValueAddService = make(map[string]string)
selectService := make([]*model.BundleToValueAddService, 0)
var selectValueAddServiceCount = make(map[int]struct{}) //增值服务类型数量
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("增值服务不存在")
return res, errors.New(fmt.Sprintf("所选增值服务[%s]%s版不存在,请先创建对应增值套餐", v.ServiceName, req.Language))
} else {
return res, errors.New("查询增值服务失败")
return res, checkErr
}
}
if detail.PriceType != req.PriceType {
if req.Uuid == "" {
//中文套餐创建时,币种不一致直接返回错误
return res, errors.New(fmt.Sprintf("所选增值服务[%s]%s币种与套餐币种不一致", detail.ServiceName, req.Language))
} else {
//更新时,判断是否已存在,存在则取消关联
_, ok := existValueService[v.ValueAddUuid]
if ok {
cancelValueAddService[v.ValueAddUuid] = detail.ServiceName
continue
} else {
//币种不一致,新加币种时返回错误
return res, errors.New(fmt.Sprintf("所选增值服务[%s]%s币种与套餐币种不一致", detail.ServiceName, req.Language))
}
}
}
if _, exists := selectValueAddServiceCount[int(detail.ServiceType)]; exists {
return res, errors.New("每种增值服务类型只可选择一个")
return res, errors.New(fmt.Sprintf("所选增值服务[%s]类型存在多个", detail.ServiceName))
}
selectValueAddServiceCount[int(detail.ServiceType)] = struct{}{}
selectService = append(selectService, &model.BundleToValueAddService{
@ -132,6 +150,9 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
_, err = dao.BundleDetailByUuidAndLanguage(req.Uuid, req.Language)
if err != nil {
if err == gorm.ErrRecordNotFound {
// if req.Uuid != "" {
// return res, errors.New("套餐不存在")
// }
if req.Language != msg.ZH_CN {
_, err = dao.BundleDetailByUuidAndLanguage(req.Uuid, msg.ZH_CN)
if err != nil {
@ -139,14 +160,14 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
res.Msg = "请先创建中文版本套餐"
return res, errors.New("请先创建中文版本套餐")
} else {
return res, errors.New("获取套餐信息失败")
return res, err
}
}
}
if req.Language == msg.ZH_CN {
bundleProfile.UUID = utils.GetUUID()
if err = dao.TxCreateBundle(tx, bundleProfile); err != nil {
return res, errors.New("创建套餐信息失败")
return res, errors.New("保存中文语言套餐失败: " + err.Error())
}
bundleLang.UUID = bundleProfile.UUID
res.Uuid = bundleProfile.UUID
@ -156,29 +177,39 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
}
if len(selectService) > 0 {
if err = dao.CreateBundleToValueAddService(tx, selectService); err != nil {
return res, errors.New("保存套餐与增值服务关联失败")
return res, errors.New("保存套餐与增值服务关联失败: " + err.Error())
}
}
if err = dao.TxCreateBundleLang(tx, bundleLang); err != nil {
return res, errors.New("创建套餐信息失败")
} else {
bundleLang.UUID = req.Uuid
res.Uuid = req.Uuid
valueUuid, err1 := dao.GetValueAddServiceUuidsByBundleUuid(bundleLang.UUID)
if err1 != nil {
return res, err1
}
count := 0
if valueUuid != nil && len(valueUuid) > 0 {
for _, v := range valueUuid {
//可以改成批量获取
valueDetail, err2 := dao.ValueAddServiceDetailByUuidAndLanguage(v, req.Language)
if err2 != nil {
return res, err2
}
if valueDetail.PriceType != req.PriceType {
if err = tx.Where("bundle_uuid =? AND value_uid =?", bundleLang.UUID, v).Delete(&model.BundleToValueAddService{}).Error; err != nil {
return res, errors.New("删除套餐与增值服务关联失败: " + err.Error())
}
count++
}
}
}
res.CancelNum = int64(count)
}
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("创建套餐信息失败")
}
if err = dao.TxCreateBundleLang(tx, bundleLang); err != nil {
return res, errors.New("保存语言套餐失败: " + err.Error())
}
res.Msg = "创建套餐信息成功"
return
res.Msg = "保存成功"
return res, nil
} else {
return
}
@ -188,7 +219,20 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
if saveErr := saveBundleHistory(tx, req.Uuid, "", 0); saveErr != nil {
return res, saveErr
}
if req.Language == msg.ZH_CN {
if len(cancelValueAddService) > 0 {
cancel := "以下增值服务:"
for _, v := range cancelValueAddService {
cancel += fmt.Sprintf("[%s]%s", v, req.Language)
if err = tx.Where("bundle_uuid = ? AND value_uid = ?", req.Uuid, v).Delete(&model.BundleToValueAddService{}).Error; err != nil {
return res, errors.New("删除套餐与增值服务关联失败: " + err.Error())
}
}
cancel += "版币种与套餐币种不一致"
res.Msg = "保存cn成功 " + cancel
}
res.CancelNum = int64(len(cancelValueAddService))
updateBundle := map[string]interface{}{
"name": req.Name,
"sort": req.Sort,
@ -198,15 +242,47 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
"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("更新套餐信息失败")
return res, err
}
//更新中间表函数
// 更新中间表函数
if err = diffUpdateBundleToValueAddService(tx, req.Uuid, selectService); err != nil {
tx.Rollback()
return res, errors.New("更新套餐与增值服务关联失败")
return res, err
}
} else {
//更新其他语言时 先获取所有关联增值服务,判断币种是否一致,不一致则取消关联
valueAddService, err := dao.GetBundleToValueAddServiceByBundleUuid(req.Uuid)
if err != nil {
return res, err
}
cancelValueService := make(map[string]string)
for _, v := range valueAddService {
detail, checkErr := dao.ValueAddServiceDetailByUuidAndLanguage(v.ValueUid, req.Language)
if checkErr != nil {
if checkErr == gorm.ErrRecordNotFound {
continue
} else {
return res, checkErr
}
}
if detail.PriceType != req.PriceType {
cancelValueService[v.ValueUid] = detail.ServiceName
continue
}
}
if int64(len(cancelValueService)) > 0 {
cancel := "以下增值服务:"
for k, v := range cancelValueService {
cancel += fmt.Sprintf("[%s]%s", v, req.Language)
if err = tx.Where("bundle_uuid = ? AND value_uid = ?", req.Uuid, k).Delete(&model.BundleToValueAddService{}).Error; err != nil {
return res, errors.New("删除套餐与增值服务关联失败: " + err.Error())
}
}
cancel += "版币种与套餐币种不一致,已取消相关关联"
res.Msg = "保存成功 " + cancel
res.CancelNum = int64(len(cancelValueService))
}
}
updateBundleLang := map[string]interface{}{
@ -216,10 +292,13 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
"price_type": req.PriceType,
}
if err = dao.TxUpdateBundleLang(tx, req.Uuid, req.Language, updateBundleLang); err != nil {
return res, errors.New("更新套餐信息失败")
return res, err
}
res.Uuid = req.Uuid
res.Msg = "保存成功"
if res.Msg == "" {
res.Msg = "保存成功"
}
}
return res, nil
}
@ -227,10 +306,7 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
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
return
}
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
res = new(bundle.BundleDetailResponseV2)
@ -238,11 +314,14 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0)
selectValueAddServices := make([]*bundle.SelectValueAddService, 0) //已选增值服务
if req.Uuid == "" {
return res, errors.New("缺少套餐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("获取套餐信息失败")
res.Msg = err.Error()
}
if detail != nil {
bundleProfile.Uuid = detail.UUID
@ -253,171 +332,88 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
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 {
if detail.BundleToValueAddService != nil && 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 {
if detail.BundleProfileLang != nil && 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"),
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"),
}
// 通过中间表拼接增值服务数据
// if detail.BundleToValueAddService != nil && len(detail.BundleToValueAddService) > 0 {
// for _, valueAddService := range detail.BundleToValueAddService {
// valueAddDeatilData, err := dao.ValueAddServiceDetailByUuidAndLanguage(valueAddService.ValueUid, bundleProfileLang.Language)
// if err != nil {
// return res, err
// }
//if valueAddService.IsDisplay{}
// ValueAddServiceLang := &bundle.ValueAddServiceLang{
// Uuid: valueAddDeatilData.UUID,
// ServiceName: valueAddDeatilData.ServiceName,
// ServiceType: int32(valueAddDeatilData.ServiceType),
// PriceMode: int32(valueAddDeatilData.PriceMode),
// PriceType: int64(valueAddDeatilData.PriceType),
// OriginalPrice: fmt.Sprintf("%.2f", float32(valueAddDeatilData.OriginalPrice)),
// Unit: string(valueAddDeatilData.Unit),
// Language: valueAddDeatilData.Language,
// CreatedAt: time.Unix(valueAddDeatilData.CreatedAt, 0).Format("2006-01-02 15:04:05"),
// UpdatedAt: time.Unix(valueAddDeatilData.UpdatedAt, 0).Format("2006-01-02 15:04:05"),
// }
//bundleProfileLang.ValueAddServiceLang = append(bundleProfileLang.ValueAddServiceLang, ValueAddServiceLang)
// selectValueAddService = append(selectValueAddService, &bundle.SelectValueAddService{
// ValueAddUuid: valueAddService.ValueUid,
// ServiceName: valueAddDeatilData.ServiceName,
// IsDisplay: valueAddService.IsDisplay,
// })
// }
// }
bundleProfileLangs = append(bundleProfileLangs, bundleProfileLang)
}
}
}
if len(selectValueAddServices) > 0 {
if selectValueAddServices != nil && 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)
func HandleShelf(req *bundle.HandShelfRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
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")
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("所选增值服务币种与套餐币种不一致")
}
}
}
}
return res, errors.New("Invalid shelf status")
}
res, err = dao.HandShelf(req.Uuid, req.ShelfStatus)
if err != nil {
return res, errors.New("更新套餐状态失败")
res.Msg = err.Error()
return res, err
}
res.Msg = "更新成功"
res.Msg = "Operation success"
return res, nil
}
@ -425,7 +421,7 @@ func HandleShelf(req *bundle.HandShelfRequest) (*bundle.CommonResponse, error) {
func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectService []*model.BundleToValueAddService) error {
oldUuids, err := dao.GetValueAddServiceUuidsByBundleUuid(bundleUuid)
if err != nil {
return errors.New("查询套餐与增值服务关联失败")
return errors.New("查询套餐与增值服务关联失败: " + err.Error())
}
newUuids := make(map[string]*model.BundleToValueAddService)
for _, s := range selectService {
@ -437,18 +433,14 @@ func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectSer
}
// 需要新增的
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)
}
}
// 需要删除的
toDel := make([]string, 0)
for _, uid := range oldUuids {
if _, exist := newUuids[uid]; !exist {
toDel = append(toDel, uid)
@ -456,23 +448,12 @@ func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectSer
}
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("删除套餐与增值服务关联失败")
return errors.New("删除套餐与增值服务关联失败: " + err.Error())
}
}
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 errors.New("保存套餐与增值服务关联失败: " + err.Error())
}
}
return nil
@ -481,27 +462,27 @@ func saveBundleHistory(tx *gorm.DB, bundleUuid string, operator string, operator
// 保存历史记录
data, err := dao.GetBundleDetailByUuid(bundleUuid)
if err != nil {
return errors.New("获取套餐信息失败")
return errors.New("查询套餐详情失败: " + err.Error())
}
bundleToValueAddService := data.BundleToValueAddService
data.BundleToValueAddService = nil
var valueUuid []string
if len(bundleToValueAddService) > 0 {
if bundleToValueAddService != nil && len(bundleToValueAddService) > 0 {
for _, v := range bundleToValueAddService {
valueUuid = append(valueUuid, v.ValueUid)
}
}
valueData, err := dao.BatchValueAddServiceDetailTx(tx, valueUuid)
if err != nil {
return errors.New("查询增值服务详情失败")
return errors.New("查询增值服务详情失败: " + err.Error())
}
j, err := json.Marshal(data)
if err != nil {
return errors.New("序列化转换失败")
return errors.New("套餐json转换失败: " + err.Error())
}
vJ, err := json.Marshal(valueData)
if err != nil {
return errors.New("序列化转换失败")
return errors.New("增值服务json转换失败: " + err.Error())
}
history := &model.BundleProfileHistory{
Uuid: bundleUuid,
@ -511,17 +492,7 @@ func saveBundleHistory(tx *gorm.DB, bundleUuid string, operator string, operator
OperatorId: operatorId,
}
if err := tx.Create(history).Error; err != nil {
return errors.New("保存套餐历史记录失败")
return errors.New("保存套餐历史记录失败: " + err.Error())
}
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

@ -13,9 +13,6 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
res = new(bundle.CommonResponse)
orderUUID := app.ModuleClients.SfNode.Generate().Base64()
orderNo := utils.GetOrderNo()
if req.OrderNo != "" {
orderNo = req.OrderNo
}
var addRecords []model.BundleOrderValueAdd
for _, i := range req.AddRecords {
addRecords = append(addRecords, model.BundleOrderValueAdd{
@ -37,7 +34,6 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
Signature: req.Signature,
SignedTime: req.SignedTime,
Snapshot: req.Snapshot,
HandlingFee: i.HandlingFee,
})
}
orderRecord := &model.BundleOrderRecords{
@ -160,20 +156,3 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
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
}
func ListUnfinishedInfos(req *bundle.AutoCreateUserAndOrderRequest) (res *bundle.UnfinishedInfos, err error) {
res = new(bundle.UnfinishedInfos)
res, err = dao.ListUnfinishedInfos(req)
return
}
func SoftDeleteUnfinishedInfo(req *bundle.SoftDeleteUnfinishedInfoRequest) (res *bundle.CommonResponse, err error) {
res = new(bundle.CommonResponse)
res, err = dao.SoftDeleteUnfinishedInfo(req)
return
}

View File

@ -147,31 +147,14 @@ func ValueAddBundleDetail(req *bundle.ValueAddBundleDetailRequest) (res *bundle.
func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveResponse, err error) {
res = &bundle.SaveResponse{}
if in.Language == "" {
return res, errors.New("语言不能为空")
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("优惠单价需小于等于原价")
price, parseErr := strconv.ParseFloat(option.Price, 32)
if parseErr != nil {
return res, parseErr
}
options = append(options, &model.PriceOption{
Id: int32(index),
@ -189,6 +172,10 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
ServiceName: in.ServiceName,
ServiceType: in.ServiceType,
}
originalPrice, err := strconv.ParseFloat(in.OriginalPrice, 32)
if err != nil {
return res, err
}
valueAddServiceLang := &model.ValueAddServiceLang{
ServiceName: in.ServiceName,
ServiceType: in.ServiceType,
@ -200,7 +187,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
Options: options,
}
if in.Uuid == "" && in.Language != msg.ZH_CN {
return res, errors.New("请先创建中文版本增值服务")
return res, errors.New("请先新增简体中文套餐,再添加其他语言版本")
}
tx := app.ModuleClients.BundleDB.Begin()
defer func() {
@ -218,7 +205,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
_, err = dao.ValueAddServiceDetailByUuidAndLanguage(in.Uuid, msg.ZH_CN)
if err != nil {
if err != gorm.ErrRecordNotFound {
return res, errors.New("请先创建中文版本增值服务")
return res, errors.New("请先创建中文套餐")
} else {
// // 新语言补充只要UUID存在即可直接插入新语言
// if in.Uuid != "" {
@ -238,15 +225,15 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
valueAddService.UUID = utils.GetUUID()
err = dao.CreateValueAddService(tx, valueAddService)
if err != nil {
return res, errors.New("保存增值服务失败")
return res, errors.New("保存中文语言套餐失败: " + err.Error())
}
valueAddServiceLang.UUID = valueAddService.UUID
res.Uuid = valueAddService.UUID
if err = dao.CreateValueAddServiceLang(tx, valueAddServiceLang); err != nil {
return res, errors.New("保存增值服务失败")
return res, errors.New("保存语言套餐失败: " + err.Error())
}
}
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JA_JP}
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JS_JP}
for _, lang := range langList {
otherLang := model.ValueAddServiceLang{
UUID: valueAddServiceLang.UUID,
@ -262,18 +249,18 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
}
otherLang.Language = lang
if err = dao.CreateValueAddServiceLang(tx, &otherLang); err != nil {
return res, errors.New("保存增值服务失败")
return res, errors.New(fmt.Sprintf("保存%s语言套餐失败: ", lang) + err.Error())
}
}
res.Msg = "新增增值服务成功"
res.Msg = "保存成功"
return
} else {
return
}
} else {
// 已存在,进行更新
if err = saveValueAddServiceHistory(tx, in.Uuid); err != nil {
return res, errors.New("保存增值服务历史记录失败")
if err := saveValueAddServiceHistory(tx, in.Uuid); err != nil {
return res, err
}
//中文状态下,更新主表和语言表
if in.Language == msg.ZH_CN {
@ -283,7 +270,17 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
"service_type": in.ServiceType,
}
if err = dao.UpdateValueAddService(tx, updateService); err != nil {
return res, errors.New("更新增值服务失败")
return res, err
}
}
// 查找所有与该增值服务关联的套餐,若币种不一致则取消关联并统计
var cancelNum int64 = 0
bundleToValueAddList, _ := dao.GetBundleToValueAddServiceByValueUid(in.Uuid)
for _, rel := range bundleToValueAddList {
bundleProfile, _ := dao.BundleDetailByUuidAndLanguage(rel.BundleUuid, in.Language)
if bundleProfile != nil && bundleProfile.PriceType != in.PriceType {
dao.DeleteBundleToValueAddService(tx, rel.BundleUuid, in.Uuid)
cancelNum++
}
}
//更新语言表
@ -299,26 +296,11 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
"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("更新套餐信息失败")
return res, err
}
res.Uuid = in.Uuid
res.Msg = "保存成功"
res.CancelNum = cancelNum
}
return
}
@ -328,7 +310,8 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
res = &bundle.ValueAddServiceListResponse{}
list, total, err := dao.ValueAddServiceList(req)
if err != nil {
return res, errors.New("查询增值服务列表失败")
res.Msg = msg.ErrorValueAddServiceList
return res, err
}
for _, valueAddService := range list {
serviceInfo := &bundle.ValueAddService{
@ -349,22 +332,19 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
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 {
if serviceLang.Options != nil && len(serviceLang.Options) > 0 {
var options []*bundle.ValueAddPriceOptions
for _, option := range serviceLang.Options {
var saveAmount decimal.Decimal
switch serviceLang.PriceMode {
case 1:
if serviceLang.PriceMode == 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("无效的价格模式")
} else if serviceLang.PriceMode == 2 {
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
price := decimal.NewFromFloat(float64(option.Price))
saveAmount = original.Sub(price)
}
options = append(options, &bundle.ValueAddPriceOptions{
Id: int64(option.Id),
@ -381,6 +361,7 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
res.ValueAddServiceList = append(res.ValueAddServiceList, serviceInfo)
}
res.Total = int32(total)
res.Msg = msg.SuccessValueAddServiceList
return
}
@ -392,7 +373,7 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
serviceLangs := []*bundle.ValueAddServiceLang{}
if req.Uuid == "" {
res.Msg = msg.ErrorValueAddServiceInfo
return res, errors.New("缺少套餐UUID")
return res, errors.New("uuid不能为空")
}
// if req.Language == "" {
// res.Msg = msg.ErrorValueAddServiceInfo
@ -400,7 +381,8 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
// }
detail, err := dao.ValueAddServiceDetail(req.Uuid)
if err != nil {
return res, errors.New("查询增值服务详情失败")
res.Msg = msg.ErrorValueAddServiceInfo
return res, err
}
if detail != nil && len(detail.ValueAddServiceLang) > 0 {
valueAddService.Uuid = detail.UUID
@ -408,21 +390,18 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
valueAddService.ServiceType = detail.ServiceType
for _, serviceLang := range detail.ValueAddServiceLang {
langOptions := []*bundle.ValueAddPriceOptions{}
if len(serviceLang.Options) > 0 {
if serviceLang.Options != nil && len(serviceLang.Options) > 0 {
for _, opt := range serviceLang.Options {
var saveAmount decimal.Decimal
switch serviceLang.PriceMode {
case 1:
if serviceLang.PriceMode == 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("无效的价格模式")
} else if serviceLang.PriceMode == 2 {
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
price := decimal.NewFromFloat(float64(opt.Price))
saveAmount = original.Sub(price)
}
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
Id: int64(opt.Id),
@ -450,7 +429,9 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
}
}
valueAddService.ServiceLang = serviceLangs
res.ValueAddService = valueAddService
res.Msg = msg.SuccessValueAddServiceInfo
return
}
@ -458,11 +439,11 @@ func saveValueAddServiceHistory(tx *gorm.DB, uuid string) (err error) {
// 保存历史记录
data, err := dao.GetValueAddServiceDetailByUuid(tx, uuid)
if err != nil {
return errors.New("查询增值服务详情失败")
return errors.New("查询增值服务详情失败: " + err.Error())
}
j, err := json.Marshal(data)
if err != nil {
return errors.New("序列化转换失败")
return errors.New("json转换失败: " + err.Error())
}
history := &model.ValueAddServiceHistory{
Uuid: uuid,
@ -471,48 +452,33 @@ func saveValueAddServiceHistory(tx *gorm.DB, uuid string) (err error) {
//OperatorId: operatorId,
}
if err := tx.Create(history).Error; err != nil {
return errors.New("保存增值服务历史记录失败")
return errors.New("保存增值服务历史记录失败: " + err.Error())
}
return nil
}
func ValueAddServiceDetailByUuidAndLanguage(req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceLang, err error) {
res = &bundle.ValueAddServiceLang{}
if req.Uuid == "" {
return res, errors.New("缺少套餐UUID")
return res, errors.New("uuid不能为空")
}
if req.Language == "" {
return res, errors.New("语言不能为空")
return res, errors.New("语言选项不能为空")
}
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
if err != nil {
return res, errors.New("查询增值服务详情失败")
return res, err
}
if detail == nil {
return res, errors.New("增值服务不存在")
}
langOptions := []*bundle.ValueAddPriceOptions{}
if len(detail.Options) > 0 {
if detail.Options != nil && 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),
Id: int64(opt.Id),
Num: opt.Num,
Symbol: opt.Symbol,
Price: fmt.Sprintf("%.2f", opt.Price),
})
}
}
@ -526,22 +492,20 @@ func ValueAddServiceDetailByUuidAndLanguage(req *bundle.ValueAddServiceDetailReq
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")
return res, errors.New("uuid不能为空")
}
if req.Language == "" {
return res, errors.New("语言不能为空")
return res, errors.New("语言选项不能为空")
}
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
if err != nil {
return res, errors.New("查询增值服务详情失败")
return res, err
}
if detail == nil {
return res, errors.New("增值服务不存在")
@ -559,61 +523,8 @@ func CalculatePrice(req *bundle.CalculatePriceRequest) (res *bundle.CalculatePri
// }
price, err := detail.Options.CalculatePrice(detail.PriceMode, req.Num)
if err != nil {
return res, errors.New("计算价格失败")
return res, err
}
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

@ -23,8 +23,7 @@ type BundleProfile struct {
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:字体颜色"`
ImgOption int8 `json:"imgOption" gorm:"column:img_option;type:int;default:1;comment:图片选择 1:背景图1 2 3"`
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"`
@ -37,7 +36,7 @@ type BundleProfileLang struct {
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:美元"`
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE js-JP(中繁英德日)"`
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
DeletedAt soft_delete.DeletedAt
@ -89,13 +88,12 @@ type BundleExtensionRecords struct {
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"`
TimeUnit uint `gorm:"column:time_unit;type:int(11) unsigned;comment:时间单位" json:"timeUnit"`
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:"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 表名称
@ -104,21 +102,16 @@ func (*BundleExtensionRecords) TableName() string {
}
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"`
TimeUnit uint `gorm:"column:time_unit;type:int(11) unsigned;comment:时间单位" json:"timeUnit"`
OrderUUID string
CreatedAt time.Time
UserName string
UserPhoneNumber string
AccountAdditional int
ImagesAdditional int
DataAdditional int
VideoAdditional int
OperatorName string
OperatorPhoneNumber string
OrderUUID string
CreatedAt time.Time
}
type BundleExtendRecordItemDto struct {
@ -145,10 +138,10 @@ type BundleExtendRecordItemDto struct {
type BundleBalancePo struct {
UserId int `gorm:"column:user_id"`
UserName string `gorm:"column:user_name"`
UserPhoneNumber string `gorm:"column:user_phone_number"`
UserPhoneNumber string `gorm:"column:user_phone_nmber"`
BundleName string `gorm:"column:bundle_name"`
ExpirationTime string `gorm:"column:expired_time"`
Status int `gorm:"column:status"`
BundleStatus int `gorm:"column:bundle_status"`
OrderUUID string `gorm:"column:order_uuid"`
AccountNumber int `gorm:"column:account_number;not null"`
AccountConsumptionNumber int `gorm:"column:account_consumption_number;not null"`
@ -161,30 +154,6 @@ type BundleBalancePo struct {
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"`

View File

@ -65,7 +65,6 @@ type BundleOrderValueAdd struct {
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"`
}
// 财务确认状态

View File

@ -1,8 +1,6 @@
package model
import (
"gorm.io/plugin/soft_delete"
)
import "gorm.io/plugin/soft_delete"
type CostLog struct {
Uuid string `gorm:"column:uuid;type:varchar(50);NOT NULL;primary_key;" json:"id"`
@ -13,7 +11,7 @@ type CostLog struct {
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"`
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"`
@ -87,26 +85,3 @@ type CastWork struct {
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,29 +0,0 @@
package model
import (
"gorm.io/gorm"
"time"
)
// 用来自动导入 来创建用户和订单的 数据
type FieePaymentAuto struct {
gorm.Model
UserNum string `json:"userNum" gorm:"column:user_num;type:varchar(64);comment:用户编号"`
UserName string `json:"userName" gorm:"column:user_name;type:varchar(128);comment:用户姓名"`
UserTelArea string `json:"userTelArea" gorm:"column:user_tel_area;type:varchar(32);comment:用户手机号区号"`
UserTel string `json:"userTel" gorm:"column:user_tel;type:varchar(32);comment:用户手机号"`
UserSex string `json:"userSex" gorm:"column:user_sex;type:varchar(16);comment:用户性别"`
Nationality string `json:"nationality" gorm:"column:nationality;type:varchar(128);comment:国籍"`
PlaceOfResidence string `json:"placeOfResidence" gorm:"column:place_of_residence;type:varchar(512);comment:用户居住地"`
DocumentType int `json:"documentType" gorm:"column:document_type;type:varchar(512);comment:证件类型:1护照 2身份证 3驾驶证 4居住证 5自拍照 6社保卡"`
UserIdCardFrontUrl string `json:"userIdCardFrontUrl" gorm:"column:user_id_card_front_url;type:varchar(1024);comment:用户身份证正面"`
UserIdCardReverseUrl string `json:"userIdCardReverseUrl" gorm:"column:user_id_card_reverse_url;type:varchar(1024);comment:用户身份证反面"`
UserIdCardValidity string `json:"userIdCardValidity" gorm:"column:user_id_card_validity;type:varchar(64);comment:证件有效期"`
OrderNo string `json:"orderNo" gorm:"column:order_no;type:varchar(128);comment:订单编号"`
OrderPayAmount string `gorm:"column:order_pay_amount;type:decimal(20,2);comment:订单支付金额" json:"orderPayAmount"`
OrderSettlementAmount string `gorm:"column:order_settlement_amount;type:decimal(20,2);comment:订单结算金额" json:"orderSettlementAmount"`
OrderFeeAmount string `gorm:"column:order_fee_amount;type:decimal(20,2);comment:订单手续费金额" json:"orderFeeAmount"`
OrderPayCurrency string `json:"orderPayCurrency" gorm:"column:order_pay_currency;type:varchar(16);comment:支付时的币种cny人民币usd美元"`
OrderAccountCurrency string `json:"orderAccountCurrency" gorm:"column:order_account_currency;type:varchar(16);comment:账户上的币种: 暂时固定usd美元"`
PayTime time.Time `gorm:"column:pay_time;type:datetime;default:null;comment:支付成功时间" json:"payTime"`
}

View File

@ -17,5 +17,4 @@ type Reconciliation struct {
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"`
HandlingFee string `gorm:"column:handling_fee;comment:手续费" json:"handlingFee"`
}

View File

@ -53,7 +53,7 @@ type ValueAddServiceLang struct {
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:增值服务总价"`
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(中繁英德日)"`
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE js-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"`
@ -76,7 +76,7 @@ type PriceOptions []*PriceOption
type PriceOption struct {
Id int32 `json:"id"`
Num int32 `json:"num"`
Symbol string `json:"symbol"` // 符号> < = >= <=
Symbol string `json:"symbol"` // 符号> < = <= =>
Price float32 `json:"price"` // 价格(根据priceMode决定是单价还是总价)
}
@ -100,7 +100,7 @@ func ValidateOptions(options PriceOptions) (bool, error) {
cover := make(map[int]struct{})
for _, opt := range options {
if opt.Num < 0 || opt.Num > 100 {
return false, errors.New("数量参数需为0-99")
return false, errors.New("数字范围错误")
}
if _, ok := symbolSet[opt.Symbol]; !ok {
@ -130,7 +130,7 @@ func ValidateOptions(options PriceOptions) (bool, error) {
}
for _, n := range nums {
if _, exist := cover[n]; exist {
return false, errors.New("条件存在冲突,请重新设置")
return false, errors.New("逻辑存在冲突,请重新设置")
}
cover[n] = struct{}{}
@ -166,7 +166,7 @@ func (options PriceOptions) CalculatePrice(priceMode, target int32) (float32, er
}
if match {
switch priceMode { //1 单价模式
switch priceMode {
case 1:
return float32(target) * opt.Price, nil
case 2:

View File

@ -17,10 +17,6 @@ service Bundle {
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) {}
@ -49,17 +45,15 @@ service Bundle {
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 AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} //
// 使
rpc GetUsedRecordList(GetUsedRecordListReq) returns (GetUsedRecordListResp) {} // 使
@ -67,28 +61,20 @@ service Bundle {
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) {} //
}
//
rpc ListUnfinishedInfos(AutoCreateUserAndOrderRequest) returns (UnfinishedInfos) {} //
rpc SoftDeleteUnfinishedInfo(SoftDeleteUnfinishedInfoRequest) 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 orderNo = 5;
string createdStart = 6;
string createdEnd = 7;
string payTimeStart = 8;
@ -97,7 +83,6 @@ message GetReconciliationListReq{
int32 page = 11;
int32 pageSize = 12;
repeated uint64 userIDS = 13;
string bundleAddOrderOn = 14;
}
message GetReconciliationListResp{
repeated ReconciliationInfo list = 1;
@ -120,7 +105,6 @@ message ReconciliationInfo{
int32 payStatus = 12;
string serialNumber = 13;
uint64 userID = 14;
string handlingFee = 15;
}
message OrderInfoByOrderNoRequest{
string orderNo = 1;
@ -135,7 +119,6 @@ message OrderInfoByOrderNoResp{
int32 dataNumber = 7;
int32 duration = 8;
string unit = 9;
string userName = 10;
}
message OrderCreateRecord{
@ -159,7 +142,6 @@ message OrderCreateRecord{
string snapshot = 18 [json_name = "snapshot"];
int32 payType = 19 [json_name = "payType"];
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //
string orderNo = 21 [json_name = "orderNo"];
}
message OrderCreateAddRecord{
int32 serviceType = 1 [json_name = "serviceType"];
@ -170,7 +152,6 @@ message OrderCreateAddRecord{
string unit = 6 [json_name = "unit"];
int32 source = 7 [json_name = "source"];
int32 paymentStatus = 8 [json_name = "paymentStatus"];
string handlingFee = 9 [json_name = "handlingFee"];
}
message OrderRecordsRequestV2{
string customerName = 1;
@ -187,8 +168,6 @@ message OrderRecordsRequestV2{
int32 page = 12;
int32 pageSize = 13;
repeated int64 userIds = 14;
string bundlePayStart = 15;
string bundlePayEnd = 16;
}
message OrderRecordsResponseV2{
repeated OrderBundleRecordInfo bundleInfo = 1;
@ -206,14 +185,13 @@ message OrderBundleRecordInfo{
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 handlingFee = 5;
float exchangeRate = 6;
string orderAddCreateAt = 7;
int32 addPayStatus = 8;
@ -253,7 +231,6 @@ message BundleProfile {
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"];
@ -264,15 +241,9 @@ message BundleProfileLang {
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"];
//string bgImg1 = 9 [json_name = "bgImg1"];
//string bgImg2 = 10 [json_name = "bgImg2"];
// int64 sort = 11 [json_name = "sort"];
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
}
message SaveResponse {
@ -284,8 +255,6 @@ 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 {
string uuid = 1 [json_name = "uuid"];
@ -426,7 +395,6 @@ message OrderRecordsDetailRequest {
string orderNo = 2 [json_name = "orderNo"];
string customerID = 3 [json_name = "customerID"];
string bundleUUID = 4 [json_name = "bundleUUID"];
uint64 status = 5 [json_name = "status"];
}
message OrderRecordsDetailResponse {
@ -553,14 +521,6 @@ 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{
@ -573,10 +533,8 @@ message BundleExtendRequest{
uint32 timeUnit = 7; // 1 2 3
string remark = 8;
string associatedorderNumber = 9;
uint64 operatorId = 10;
string operatorName = 11;
string operatorPhoneNumber = 12;
int32 type = 13;
string operatorName = 10;
string operatorPhoneNumber = 11;
}
message BundleExtendResponse{
@ -610,20 +568,18 @@ message BundleExtendRecordItem{
uint64 createdAt = 9;
string remark = 10;
string associatedOrderNumber = 11;
uint32 timeUnit = 12;
string operatorName = 13;
string operatorPhoneNumber = 14;
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;
int64 expiredTimeStart = 4;
int64 expiredTimeEnd = 5;
int32 page = 6;
int32 pageSize = 7;
}
message GetBundleBalanceReq{
@ -652,9 +608,11 @@ message BundleBalanceItem{
int32 dataAnalysisNumber = 13;
int32 dataAnalysisConsumptionNumber = 14;
int32 expansionPacksNumber = 15;
int32 bought = 16;
}
message GetBundleBalanceResp{
int64 total = 1;
repeated BundleBalanceItem data = 2;
}
message GetBundleBalanceListResp{
int64 total = 1;
repeated BundleBalanceItem data = 2;
@ -700,7 +658,7 @@ message AddBundleBalanceResp{
message GetUsedRecordListReq{
string user = 1;
string operator = 2;
string account = 3;
int32 account = 3;
int32 platform = 4;
int32 type = 5;
string title = 6;
@ -723,7 +681,7 @@ message WorkCastItem{
uint32 workCategory = 5; // 1 2
string bundleUuid = 6; // ID uuid
string bundleName = 7; //
string platformIds = 8; // ID集合 (json )
string platformIDs = 8; // ID集合 (json )
string mediaNames = 9; //
string mediaAccIDs = 10; // ID集合
string workTitle = 11; //
@ -760,54 +718,18 @@ message ToBeComfirmedWorksReq{
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;
string uuid = 1; // uuid
uint32 workCategory = 2; // 1 2
string platformIDs = 3; // ID集合 (json )
string mediaNames = 4; //
string mediaAccIDs = 5; // ID集合
string title = 6; //
string content = 7; //
string submitTime = 8; //
string operatorName = 9; //
string operatorPhone = 10; //
uint32 status = 11; // 1 2 3 4 5 6 7
}
message OnlyAddValueListByOrderNoRequest{
@ -831,45 +753,3 @@ message UpdateStatusAndPayTimeBySerialNumber {
string payTime = 2;
int32 paymentStatus = 3;
}
message ConfirmWorkReq{
string workUuid = 1;
}
message ConfirmWorkResp{
}
message AutoCreateUserAndOrderRequest {
int32 num = 1; //
}
message UnfinishedInfos {
repeated UnfinishedInfo unfinishedInfos = 1;
}
message UnfinishedInfo {
uint32 ID = 1;
string userNum = 2;
string userName = 3;
string userTelArea = 4;
string userTel = 5;
string userSex = 6;
string nationality = 7;
string placeOfResidence = 8;
int32 documentType = 9;
string userIdCardFrontUrl = 10;
string userIdCardReverseUrl = 11;
string userIdCardValidity = 12;
string orderNo = 13;
string orderPayAmount = 14;
string orderSettlementAmount = 15;
string orderFeeAmount = 16;
string orderPayCurrency = 17;
string orderAccountCurrency = 18;
string payTime = 19;
}
message SoftDeleteUnfinishedInfoRequest {
uint32 ID = 1;
}

File diff suppressed because it is too large Load Diff

View File

@ -5,11 +5,11 @@ package bundle
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/descriptorpb"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
_ "google.golang.org/protobuf/types/descriptorpb"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -17,9 +17,6 @@ var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *DeleteValueAddServiceRequest) Validate() error {
return nil
}
func (this *GetReconciliationListReq) Validate() error {
return nil
}
@ -306,19 +303,6 @@ func (this *CalculatePriceRequest) Validate() error {
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
}
@ -350,6 +334,16 @@ func (this *GetBundleBalanceReq) Validate() error {
func (this *BundleBalanceItem) Validate() error {
return nil
}
func (this *GetBundleBalanceResp) 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 *GetBundleBalanceListResp) Validate() error {
for _, item := range this.Data {
if item != nil {
@ -403,23 +397,7 @@ func (this *GetVedioeWorkDetailResp) Validate() error {
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 {
@ -441,28 +419,3 @@ func (this *AddBundleInfo) Validate() error {
func (this *UpdateStatusAndPayTimeBySerialNumber) Validate() error {
return nil
}
func (this *ConfirmWorkReq) Validate() error {
return nil
}
func (this *ConfirmWorkResp) Validate() error {
return nil
}
func (this *AutoCreateUserAndOrderRequest) Validate() error {
return nil
}
func (this *UnfinishedInfos) Validate() error {
for _, item := range this.UnfinishedInfos {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("UnfinishedInfos", err)
}
}
}
return nil
}
func (this *UnfinishedInfo) Validate() error {
return nil
}
func (this *SoftDeleteUnfinishedInfoRequest) Validate() error {
return nil
}

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
// versions:
// - protoc-gen-go-triple v1.0.8
// - protoc v4.24.0--rc1
// - protoc v5.26.1
// source: pb/bundle.proto
package bundle
@ -35,8 +35,6 @@ type BundleClient interface {
SaveBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
BundleListV2(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment)
BundleDetailV2(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponseV2, common.ErrorWithAttachment)
BundleListH5V2(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment)
BundleLangDetailV2(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleProfileLang, common.ErrorWithAttachment)
BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment)
BundleDetail(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleDetailResponse, common.ErrorWithAttachment)
CreateOrderRecord(ctx context.Context, in *OrderCreateRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
@ -50,23 +48,20 @@ type BundleClient interface {
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, common.ErrorWithAttachment)
OrderListByOrderNo(ctx context.Context, in *OrderInfoByOrderNoRequest, opts ...grpc_go.CallOption) (*OrderInfoByOrderNoResp, common.ErrorWithAttachment)
OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, common.ErrorWithAttachment)
//增值套餐
// 增值套餐
CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment)
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment)
//新增值服务
// 新增值服务
SaveValueAddService(ctx context.Context, in *ValueAddServiceLang, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
ValueAddServiceList(ctx context.Context, in *ValueAddServiceListRequest, opts ...grpc_go.CallOption) (*ValueAddServiceListResponse, common.ErrorWithAttachment)
ValueAddServiceDetail(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceDetailResponse, common.ErrorWithAttachment)
ValueAddServiceLangByUuidAndLanguage(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceLang, common.ErrorWithAttachment)
CalculatePrice(ctx context.Context, in *CalculatePriceRequest, opts ...grpc_go.CallOption) (*CalculatePriceResponse, common.ErrorWithAttachment)
BatchGetValueAddServiceLang(ctx context.Context, in *BatchGetValueAddServiceLangRequest, opts ...grpc_go.CallOption) (*BatchGetValueAddServiceLangResponse, common.ErrorWithAttachment)
DeleteValueAddService(ctx context.Context, in *DeleteValueAddServiceRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
// 余量管理
BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment)
BundleExtendRecordsList(ctx context.Context, in *BundleExtendRecordsListRequest, opts ...grpc_go.CallOption) (*BundleExtendRecordsListResponse, common.ErrorWithAttachment)
GetBundleBalanceList(ctx context.Context, in *GetBundleBalanceListReq, opts ...grpc_go.CallOption) (*GetBundleBalanceListResp, common.ErrorWithAttachment)
GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment)
CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment)
AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment)
// 使用记录
@ -74,15 +69,11 @@ type BundleClient interface {
GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment)
GetVedioWorkDetail(ctx context.Context, in *GetVedioWorkDetailReq, opts ...grpc_go.CallOption) (*GetVedioeWorkDetailResp, common.ErrorWithAttachment)
ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmedWorksReq, opts ...grpc_go.CallOption) (*ToBeComfirmedWorksResp, common.ErrorWithAttachment)
ConfirmWork(ctx context.Context, in *ConfirmWorkReq, opts ...grpc_go.CallOption) (*ConfirmWorkResp, common.ErrorWithAttachment)
//对账单
// 对账单
GetReconciliationList(ctx context.Context, in *GetReconciliationListReq, opts ...grpc_go.CallOption) (*GetReconciliationListResp, common.ErrorWithAttachment)
CreateReconciliation(ctx context.Context, in *ReconciliationInfo, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
UpdateReconciliation(ctx context.Context, in *ReconciliationInfo, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
UpdateReconciliationStatusBySerialNumber(ctx context.Context, in *UpdateStatusAndPayTimeBySerialNumber, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
// 查出没处理的数据
ListUnfinishedInfos(ctx context.Context, in *AutoCreateUserAndOrderRequest, opts ...grpc_go.CallOption) (*UnfinishedInfos, common.ErrorWithAttachment)
SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
}
type bundleClient struct {
@ -97,8 +88,6 @@ type BundleClientImpl struct {
SaveBundle func(ctx context.Context, in *BundleProfile) (*SaveResponse, error)
BundleListV2 func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleDetailV2 func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponseV2, error)
BundleListH5V2 func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleLangDetailV2 func(ctx context.Context, in *BundleDetailRequest) (*BundleProfileLang, error)
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecord func(ctx context.Context, in *OrderCreateRecord) (*CommonResponse, error)
@ -120,25 +109,19 @@ type BundleClientImpl struct {
ValueAddServiceDetail func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
ValueAddServiceLangByUuidAndLanguage func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error)
CalculatePrice func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, error)
BatchGetValueAddServiceLang func(ctx context.Context, in *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error)
DeleteValueAddService func(ctx context.Context, in *DeleteValueAddServiceRequest) (*CommonResponse, error)
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
GetBundleBalanceByUserId func(ctx context.Context, in *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
GetImageWorkDetail func(ctx context.Context, in *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
GetVedioWorkDetail func(ctx context.Context, in *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
ToBeComfirmedWorks func(ctx context.Context, in *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
ConfirmWork func(ctx context.Context, in *ConfirmWorkReq) (*ConfirmWorkResp, error)
GetReconciliationList func(ctx context.Context, in *GetReconciliationListReq) (*GetReconciliationListResp, error)
CreateReconciliation func(ctx context.Context, in *ReconciliationInfo) (*CommonResponse, error)
UpdateReconciliation func(ctx context.Context, in *ReconciliationInfo) (*CommonResponse, error)
UpdateReconciliationStatusBySerialNumber func(ctx context.Context, in *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error)
ListUnfinishedInfos func(ctx context.Context, in *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
SoftDeleteUnfinishedInfo func(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
}
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
@ -195,18 +178,6 @@ func (c *bundleClient) BundleDetailV2(ctx context.Context, in *BundleDetailReque
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleDetailV2", in, out)
}
func (c *bundleClient) BundleListH5V2(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) {
out := new(BundleListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleListH5V2", in, out)
}
func (c *bundleClient) BundleLangDetailV2(ctx context.Context, in *BundleDetailRequest, opts ...grpc_go.CallOption) (*BundleProfileLang, common.ErrorWithAttachment) {
out := new(BundleProfileLang)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleLangDetailV2", in, out)
}
func (c *bundleClient) BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) {
out := new(BundleListResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -333,18 +304,6 @@ func (c *bundleClient) CalculatePrice(ctx context.Context, in *CalculatePriceReq
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CalculatePrice", in, out)
}
func (c *bundleClient) BatchGetValueAddServiceLang(ctx context.Context, in *BatchGetValueAddServiceLangRequest, opts ...grpc_go.CallOption) (*BatchGetValueAddServiceLangResponse, common.ErrorWithAttachment) {
out := new(BatchGetValueAddServiceLangResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BatchGetValueAddServiceLang", in, out)
}
func (c *bundleClient) DeleteValueAddService(ctx context.Context, in *DeleteValueAddServiceRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteValueAddService", in, out)
}
func (c *bundleClient) BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) {
out := new(BundleExtendResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -363,12 +322,6 @@ func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBa
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceList", in, out)
}
func (c *bundleClient) GetBundleBalanceByUserId(ctx context.Context, in *GetBundleBalanceByUserIdReq, opts ...grpc_go.CallOption) (*GetBundleBalanceByUserIdResp, common.ErrorWithAttachment) {
out := new(GetBundleBalanceByUserIdResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceByUserId", in, out)
}
func (c *bundleClient) CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment) {
out := new(CreateBundleBalanceResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -405,12 +358,6 @@ func (c *bundleClient) ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmed
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ToBeComfirmedWorks", in, out)
}
func (c *bundleClient) ConfirmWork(ctx context.Context, in *ConfirmWorkReq, opts ...grpc_go.CallOption) (*ConfirmWorkResp, common.ErrorWithAttachment) {
out := new(ConfirmWorkResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ConfirmWork", in, out)
}
func (c *bundleClient) GetReconciliationList(ctx context.Context, in *GetReconciliationListReq, opts ...grpc_go.CallOption) (*GetReconciliationListResp, common.ErrorWithAttachment) {
out := new(GetReconciliationListResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
@ -435,18 +382,6 @@ func (c *bundleClient) UpdateReconciliationStatusBySerialNumber(ctx context.Cont
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateReconciliationStatusBySerialNumber", in, out)
}
func (c *bundleClient) ListUnfinishedInfos(ctx context.Context, in *AutoCreateUserAndOrderRequest, opts ...grpc_go.CallOption) (*UnfinishedInfos, common.ErrorWithAttachment) {
out := new(UnfinishedInfos)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListUnfinishedInfos", in, out)
}
func (c *bundleClient) SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
out := new(CommonResponse)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SoftDeleteUnfinishedInfo", in, out)
}
// BundleServer is the server API for Bundle service.
// All implementations must embed UnimplementedBundleServer
// for forward compatibility
@ -458,8 +393,6 @@ type BundleServer interface {
SaveBundle(context.Context, *BundleProfile) (*SaveResponse, error)
BundleListV2(context.Context, *BundleListRequest) (*BundleListResponse, error)
BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error)
BundleListH5V2(context.Context, *BundleListRequest) (*BundleListResponse, error)
BundleLangDetailV2(context.Context, *BundleDetailRequest) (*BundleProfileLang, error)
BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error)
BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error)
CreateOrderRecord(context.Context, *OrderCreateRecord) (*CommonResponse, error)
@ -473,23 +406,20 @@ type BundleServer interface {
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
//增值套餐
// 增值套餐
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
//新增值服务
// 新增值服务
SaveValueAddService(context.Context, *ValueAddServiceLang) (*SaveResponse, error)
ValueAddServiceList(context.Context, *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
ValueAddServiceDetail(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
ValueAddServiceLangByUuidAndLanguage(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error)
CalculatePrice(context.Context, *CalculatePriceRequest) (*CalculatePriceResponse, error)
BatchGetValueAddServiceLang(context.Context, *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error)
DeleteValueAddService(context.Context, *DeleteValueAddServiceRequest) (*CommonResponse, error)
// 余量管理
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
// 使用记录
@ -497,15 +427,11 @@ type BundleServer interface {
GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
ConfirmWork(context.Context, *ConfirmWorkReq) (*ConfirmWorkResp, error)
//对账单
// 对账单
GetReconciliationList(context.Context, *GetReconciliationListReq) (*GetReconciliationListResp, error)
CreateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)
UpdateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)
UpdateReconciliationStatusBySerialNumber(context.Context, *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error)
// 查出没处理的数据
ListUnfinishedInfos(context.Context, *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
mustEmbedUnimplementedBundleServer()
}
@ -535,12 +461,6 @@ func (UnimplementedBundleServer) BundleListV2(context.Context, *BundleListReques
func (UnimplementedBundleServer) BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleDetailV2 not implemented")
}
func (UnimplementedBundleServer) BundleListH5V2(context.Context, *BundleListRequest) (*BundleListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleListH5V2 not implemented")
}
func (UnimplementedBundleServer) BundleLangDetailV2(context.Context, *BundleDetailRequest) (*BundleProfileLang, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleLangDetailV2 not implemented")
}
func (UnimplementedBundleServer) BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleList not implemented")
}
@ -604,12 +524,6 @@ func (UnimplementedBundleServer) ValueAddServiceLangByUuidAndLanguage(context.Co
func (UnimplementedBundleServer) CalculatePrice(context.Context, *CalculatePriceRequest) (*CalculatePriceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CalculatePrice not implemented")
}
func (UnimplementedBundleServer) BatchGetValueAddServiceLang(context.Context, *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BatchGetValueAddServiceLang not implemented")
}
func (UnimplementedBundleServer) DeleteValueAddService(context.Context, *DeleteValueAddServiceRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteValueAddService not implemented")
}
func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BundleExtend not implemented")
}
@ -619,9 +533,6 @@ func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *Bundl
func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented")
}
func (UnimplementedBundleServer) GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceByUserId not implemented")
}
func (UnimplementedBundleServer) CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateBundleBalance not implemented")
}
@ -640,9 +551,6 @@ func (UnimplementedBundleServer) GetVedioWorkDetail(context.Context, *GetVedioWo
func (UnimplementedBundleServer) ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented")
}
func (UnimplementedBundleServer) ConfirmWork(context.Context, *ConfirmWorkReq) (*ConfirmWorkResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ConfirmWork not implemented")
}
func (UnimplementedBundleServer) GetReconciliationList(context.Context, *GetReconciliationListReq) (*GetReconciliationListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetReconciliationList not implemented")
}
@ -655,12 +563,6 @@ func (UnimplementedBundleServer) UpdateReconciliation(context.Context, *Reconcil
func (UnimplementedBundleServer) UpdateReconciliationStatusBySerialNumber(context.Context, *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateReconciliationStatusBySerialNumber not implemented")
}
func (UnimplementedBundleServer) ListUnfinishedInfos(context.Context, *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListUnfinishedInfos not implemented")
}
func (UnimplementedBundleServer) SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SoftDeleteUnfinishedInfo not implemented")
}
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl
}
@ -892,64 +794,6 @@ func _Bundle_BundleDetailV2_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleListH5V2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleListRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("BundleListH5V2", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleLangDetailV2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleDetailRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("BundleLangDetailV2", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleListRequest)
if err := dec(in); err != nil {
@ -1559,64 +1403,6 @@ func _Bundle_CalculatePrice_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler)
}
func _Bundle_BatchGetValueAddServiceLang_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BatchGetValueAddServiceLangRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("BatchGetValueAddServiceLang", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_DeleteValueAddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteValueAddServiceRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("DeleteValueAddService", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_BundleExtend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(BundleExtendRequest)
if err := dec(in); err != nil {
@ -1704,35 +1490,6 @@ func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetBundleBalanceByUserId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBundleBalanceByUserIdReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("GetBundleBalanceByUserId", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_CreateBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateBundleBalanceReq)
if err := dec(in); err != nil {
@ -1907,35 +1664,6 @@ func _Bundle_ToBeComfirmedWorks_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
func _Bundle_ConfirmWork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ConfirmWorkReq)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ConfirmWork", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_GetReconciliationList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(GetReconciliationListReq)
if err := dec(in); err != nil {
@ -2052,64 +1780,6 @@ func _Bundle_UpdateReconciliationStatusBySerialNumber_Handler(srv interface{}, c
return interceptor(ctx, in, info, handler)
}
func _Bundle_ListUnfinishedInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(AutoCreateUserAndOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("ListUnfinishedInfos", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
func _Bundle_SoftDeleteUnfinishedInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(SoftDeleteUnfinishedInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
base := srv.(dubbo3.Dubbo3GrpcService)
args := []interface{}{}
args = append(args, in)
md, _ := metadata.FromIncomingContext(ctx)
invAttachment := make(map[string]interface{}, len(md))
for k, v := range md {
invAttachment[k] = v
}
invo := invocation.NewRPCInvocation("SoftDeleteUnfinishedInfo", args, invAttachment)
if interceptor == nil {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
info := &grpc_go.UnaryServerInfo{
Server: srv,
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
return result, result.Error()
}
return interceptor(ctx, in, info, handler)
}
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
// It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -2145,14 +1815,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "BundleDetailV2",
Handler: _Bundle_BundleDetailV2_Handler,
},
{
MethodName: "BundleListH5V2",
Handler: _Bundle_BundleListH5V2_Handler,
},
{
MethodName: "BundleLangDetailV2",
Handler: _Bundle_BundleLangDetailV2_Handler,
},
{
MethodName: "BundleList",
Handler: _Bundle_BundleList_Handler,
@ -2237,14 +1899,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "CalculatePrice",
Handler: _Bundle_CalculatePrice_Handler,
},
{
MethodName: "BatchGetValueAddServiceLang",
Handler: _Bundle_BatchGetValueAddServiceLang_Handler,
},
{
MethodName: "DeleteValueAddService",
Handler: _Bundle_DeleteValueAddService_Handler,
},
{
MethodName: "BundleExtend",
Handler: _Bundle_BundleExtend_Handler,
@ -2257,10 +1911,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "GetBundleBalanceList",
Handler: _Bundle_GetBundleBalanceList_Handler,
},
{
MethodName: "GetBundleBalanceByUserId",
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
},
{
MethodName: "CreateBundleBalance",
Handler: _Bundle_CreateBundleBalance_Handler,
@ -2285,10 +1935,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "ToBeComfirmedWorks",
Handler: _Bundle_ToBeComfirmedWorks_Handler,
},
{
MethodName: "ConfirmWork",
Handler: _Bundle_ConfirmWork_Handler,
},
{
MethodName: "GetReconciliationList",
Handler: _Bundle_GetReconciliationList_Handler,
@ -2305,14 +1951,6 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "UpdateReconciliationStatusBySerialNumber",
Handler: _Bundle_UpdateReconciliationStatusBySerialNumber_Handler,
},
{
MethodName: "ListUnfinishedInfos",
Handler: _Bundle_ListUnfinishedInfos_Handler,
},
{
MethodName: "SoftDeleteUnfinishedInfo",
Handler: _Bundle_SoftDeleteUnfinishedInfo_Handler,
},
},
Streams: []grpc_go.StreamDesc{},
Metadata: "pb/bundle.proto",

View File

@ -15,7 +15,7 @@ const (
ZH_TW = "zh-TW" //繁体中文
EN = "EN" //英文
DE_DE = "de-DE" //德语
JA_JP = "ja-JP" //日语
JS_JP = "js-JP" //日语
)
const (
@ -51,10 +51,8 @@ const (
ErrorCreateOrderInfo = "创建订单信息失败"
SuccessCreateOrderInfo = "创建订单信息成功"
ErrorUpdateOrderInfo = "更新订单信息失败"
ErrorDeleteOrderInfo = "删除增值服务失败"
SuccessUpdateOrderInfo = "更新订单信息成功"
SuccessDeletedOrderInfo = "删除订单信息成功"
ErrorUpdateOrderInfo = "更新订单信息失败"
SuccessUpdateOrderInfo = "更新订单信息成功"
ErrorGetOrderInfo = "获取订单信息失败"