Compare commits
133 Commits
e9f12cd0eb
...
d5e4c9590f
Author | SHA1 | Date | |
---|---|---|---|
d5e4c9590f | |||
76e2b893a1 | |||
57a3154634 | |||
a556777369 | |||
4ec5bb8915 | |||
335a61d6e7 | |||
b06d06c8e2 | |||
1f1fbed3a8 | |||
9c3c441eda | |||
8fe858aa03 | |||
f3e29cb7e8 | |||
ae4bbe29c0 | |||
bfc409ed70 | |||
a01be125e6 | |||
0a4218757e | |||
4f9b72928b | |||
7468c2f442 | |||
9c9e9c0663 | |||
e4a9c3ac4d | |||
92c8e4d574 | |||
1b5b6037fd | |||
1885d2b8dc | |||
f55af5f719 | |||
668b7eb06e | |||
56c17a709f | |||
043274e61f | |||
0167e40f9e | |||
eca1a2329e | |||
3c1984be81 | |||
46a6c5723f | |||
bfa9fc4026 | |||
fb3b33a817 | |||
70c4eacce4 | |||
52d9baf2e6 | |||
ed0f0c9584 | |||
f82a96907c | |||
24c701d9a1 | |||
37bae4398d | |||
d3b82f4352 | |||
75a75e9480 | |||
8528412c33 | |||
d0dfb7ff96 | |||
4e2faf05cb | |||
c6a65f4589 | |||
a6d315a283 | |||
9e36dfde6b | |||
9f5798c2be | |||
952caaaf91 | |||
e26829e19b | |||
089d8af480 | |||
bff2938313 | |||
0fae4587d8 | |||
2d9d620062 | |||
97c4bda203 | |||
14415f07f5 | |||
3bc6a5caa0 | |||
f933e4887f | |||
94e5c77f90 | |||
d95dccf7c0 | |||
bcdb764522 | |||
99c4b85a62 | |||
16f5e1f7ec | |||
0429854814 | |||
9b6549f141 | |||
d85bfa4fa0 | |||
f612f8ad23 | |||
fbea508cfe | |||
33073667e8 | |||
02d0de5dad | |||
ac14519c91 | |||
bdc9706125 | |||
734c0b2c1f | |||
75aad32c7e | |||
51e3d24f23 | |||
fec7641edb | |||
0dce0b80a6 | |||
0057fa5856 | |||
e081b5f23b | |||
b151326427 | |||
e7727141d8 | |||
5086802f1b | |||
fdf2d5a09b | |||
3d226f9c8d | |||
a6fddccda9 | |||
53fdc7c4b6 | |||
eac7c759f6 | |||
000de78286 | |||
df0b742168 | |||
a71942b0d4 | |||
370f0a08c1 | |||
90928cf5c8 | |||
3cce79adab | |||
6107e35aca | |||
4c027c4a08 | |||
2a137ad3fb | |||
3fae4f4ab7 | |||
32de65196b | |||
379cc1b1e7 | |||
0c5ffdcc90 | |||
412350cf8a | |||
8a14905343 | |||
38f03838a5 | |||
8793f023c9 | |||
9bffde4a62 | |||
8b2e7c541e | |||
8fe2ea816f | |||
07b6296867 | |||
8c36da313e | |||
1d9b8bda3a | |||
2fe368cace | |||
7367bf1639 | |||
fb413f80bc | |||
6c7a1f9d44 | |||
cb21e13c4e | |||
5205119945 | |||
50b4009043 | |||
55bbe63158 | |||
21504e78f2 | |||
e6eb835a01 | |||
74277a50ef | |||
3e6382481c | |||
459ae0d6fb | |||
edbe9f2c0a | |||
99f04c1de2 | |||
ed66051786 | |||
c4ef0b5f96 | |||
f042ca7891 | |||
497bdf894d | |||
c79569b421 | |||
abb53ac651 | |||
39a172f3dd | |||
15e313f053 | |||
868c51ddcf |
@ -1314,3 +1314,56 @@
|
||||
{"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¶m.sign=&pid=32300®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider×tamp=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¶m.sign=&pid=32300®istry=zookeeper®istry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider×tamp=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¶m.sign=&pid=32300®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider×tamp=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¶m.sign=&pid=32300®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider×tamp=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¶m.sign=&pid=32300®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider×tamp=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¶m.sign=&pid=32300®istry=zookeeper®istry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider×tamp=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¶m.sign=&pid=46056®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider×tamp=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¶m.sign=&pid=46056®istry=zookeeper®istry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider×tamp=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¶m.sign=&pid=46056®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider×tamp=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¶m.sign=&pid=46056®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=echo%2Cmetrics%2Ctoken%2Caccesslog%2Ctps%2Cgeneric_service%2Cexecute%2Cpshutdown&side=provider×tamp=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¶m.sign=&pid=46056®istry=zookeeper®istry.role=3&release=dubbo-golang-3.0.0&retries=0&serialization=&service.filter=tps%2Ctracing&side=provider×tamp=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¶m.sign=&pid=46056®istry.role=3&release=dubbo-golang-3.0.0&retries=&serialization=&service.filter=tracing&side=provider×tamp=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."}
|
||||
|
@ -105,6 +105,14 @@ func (b *BundleProvider) UpdateReconciliation(_ context.Context, req *bundle.Rec
|
||||
return logic.UpdateReconciliation(req)
|
||||
}
|
||||
|
||||
func (b *BundleProvider) OnlyAddValueListByOrderNo(_ context.Context, req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) {
|
||||
return logic.OnlyAddValueListByOrderNo(req)
|
||||
}
|
||||
|
||||
func (b *BundleProvider) UpdateReconciliationStatusBySerialNumber(_ context.Context, req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
|
||||
return logic.UpdateReconciliationStatusBySerialNumber(req)
|
||||
}
|
||||
|
||||
// 删除订单
|
||||
func (b *BundleProvider) DeleteValueAddService(_ context.Context, req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
|
||||
return logic.DeleteValueAddService(req)
|
||||
|
@ -4,9 +4,6 @@ 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) {
|
||||
@ -21,6 +18,10 @@ 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)
|
||||
}
|
||||
@ -42,5 +43,9 @@ func (b *BundleProvider) GetVedioWorkDetail(_ context.Context, req *bundle.GetVe
|
||||
}
|
||||
|
||||
func (b *BundleProvider) ToBeComfirmedWorks(_ context.Context, req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented")
|
||||
return logic.ToBeComfirmedWorks(req)
|
||||
}
|
||||
|
||||
func (b *BundleProvider) ConfirmWork(_ context.Context, req *bundle.ConfirmWorkReq) (*bundle.ConfirmWorkResp, error) {
|
||||
return logic.ConfirmWork(req)
|
||||
}
|
||||
|
@ -22,6 +22,9 @@ 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) {
|
||||
@ -39,3 +42,12 @@ 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)
|
||||
}
|
||||
|
@ -136,7 +136,6 @@ 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+"%")
|
||||
@ -161,7 +160,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 bundles != nil && len(bundles) > 0 {
|
||||
if len(bundles) > 0 {
|
||||
for _, bundleProfile := range bundles {
|
||||
selectValueAddService := make([]*bundle.SelectValueAddService, 0)
|
||||
if bundleProfile.BundleToValueAddService != nil {
|
||||
@ -173,7 +172,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
||||
}
|
||||
}
|
||||
bundleProfileLang := []*bundle.BundleProfileLang{}
|
||||
if bundleProfile.BundleProfileLang != nil && len(bundleProfile.BundleProfileLang) > 0 {
|
||||
if len(bundleProfile.BundleProfileLang) > 0 {
|
||||
for _, lang := range bundleProfile.BundleProfileLang {
|
||||
bpl := &bundle.BundleProfileLang{
|
||||
Uuid: lang.UUID,
|
||||
@ -207,6 +206,7 @@ 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,6 +237,7 @@ 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
|
||||
@ -247,7 +248,8 @@ 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 = ?", uuid, language).First(&bundleProfileLang).Error
|
||||
err = app.ModuleClients.BundleDB.Where("uuid = ? AND language = ? AND deleted_at = 0", uuid, language).First(&bundleProfileLang).Error
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -274,12 +276,23 @@ 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 commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败")
|
||||
}
|
||||
return
|
||||
}
|
||||
func TxUpdateBundles(tx *gorm.DB, uuids []string, columns map[string]interface{}) (err error) {
|
||||
if len(uuids) == 0 {
|
||||
return nil
|
||||
}
|
||||
err = tx.Model(&model.BundleProfile{}).Where("uuid IN (?)", uuids).Updates(columns).Error
|
||||
if err != nil {
|
||||
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败")
|
||||
}
|
||||
return
|
||||
}
|
||||
func TxUpdateBundleLang(tx *gorm.DB, uuid string, language string, columns map[string]interface{}) (err error) {
|
||||
err = tx.Model(&model.BundleProfileLang{}).Where("uuid =? and language=?", uuid, language).Updates(columns).Error
|
||||
err = tx.Model(&model.BundleProfileLang{}).Where("uuid =? and language=? and deleted_at = 0", uuid, language).Updates(columns).Error
|
||||
|
||||
if err != nil {
|
||||
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
|
||||
}
|
||||
@ -288,13 +301,24 @@ 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 = ?", bundleUuid, valueUid).Delete(&model.BundleToValueAddService{}).Error
|
||||
return tx.Where("bundle_uuid = ? AND value_uid = ? AND deleted_at = 0", bundleUuid, valueUid).Delete(&model.BundleToValueAddService{}).Error
|
||||
|
||||
}
|
||||
func GetValueAddServiceUuidsByBundleUuid(bundleUuid string) ([]string, error) {
|
||||
var uuids []string
|
||||
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).Where("bundle_uuid = ?", bundleUuid).Pluck("value_uid", &uuids).Error
|
||||
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).Where("bundle_uuid = ? and deleted_at = 0", bundleUuid).Pluck("value_uid", &uuids).Error
|
||||
return uuids, err
|
||||
}
|
||||
|
||||
@ -302,7 +326,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 = ?", bundleUuid).
|
||||
Where("bundle_uuid = ? and deleted_at = 0", bundleUuid).
|
||||
Find(&result).Error
|
||||
return result, err
|
||||
}
|
||||
@ -310,8 +334,11 @@ 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 =?", uuid).
|
||||
Where("uuid =? and deleted_at = 0", uuid).
|
||||
Find(&result).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
func GetBundleDetailByUuid(uuid string) (*model.BundleProfile, error) {
|
||||
@ -326,3 +353,95 @@ 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
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package dao
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"micro-bundle/internal/model"
|
||||
"micro-bundle/pb/bundle"
|
||||
"micro-bundle/pkg/app"
|
||||
@ -9,6 +10,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||
"github.com/duke-git/lancet/v2/datetime"
|
||||
|
||||
"gorm.io/gorm"
|
||||
@ -21,14 +23,19 @@ 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)}).First(&record).Error; err != nil {
|
||||
if err := tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{CustomerID: strconv.Itoa(data.UserId)}).Order("created_at desc").First(&record).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
var expireTime time.Time
|
||||
if record.ExpirationTime != "" {
|
||||
loc, _ := time.LoadLocation("Asia/Shanghai")
|
||||
et, _ := time.ParseInLocation(time.DateTime, record.ExpirationTime, loc)
|
||||
expireTime = et
|
||||
} else {
|
||||
expireTime = time.Now()
|
||||
logger.Infof("过期时间为空,使用默认过期时间" + expireTime.Format(time.DateTime))
|
||||
}
|
||||
|
||||
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))
|
||||
@ -39,45 +46,51 @@ func AddBundleExtendRecord(data model.BundleExtensionRecords) error {
|
||||
default:
|
||||
return errors.New("时间单位有误")
|
||||
}
|
||||
record.ExpirationTime = expireTime.Format(time.DateOnly)
|
||||
err = tx.Model(&model.BundleOrderRecords{}).Save(&record).Error
|
||||
return err
|
||||
record.ExpirationTime = expireTime.Format(time.DateTime)
|
||||
return tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{UUID: record.UUID}).Updates(&record).Error
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data []model.BundleExtendRecordItemPo, total int64, err error) {
|
||||
session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_extension_records AS ber").
|
||||
session := app.ModuleClients.BundleDB.Table("micro_bundle.bundle_extension_records AS ber").
|
||||
Select(`
|
||||
ber.*,
|
||||
u.nickname as user_name,
|
||||
rn.name as user_name,
|
||||
u.tel_num as user_phone_number
|
||||
`).Joins("LEFT JOIN `micro-account`.`user` u on u.id = user_id")
|
||||
`).Joins("LEFT JOIN `micro-account`.`user` u on u.id = user_id").
|
||||
Joins("LEFT JOIN `micro-account`.`real_name` rn on u.real_name_id = rn.id").
|
||||
Order("created_at desc")
|
||||
if req.User != "" {
|
||||
if utils.IsPhoneNumber(req.User) {
|
||||
session = session.Where("u.tel_num = ?", req.User)
|
||||
} else {
|
||||
session = session.Where("u.nickname like ?", req.User)
|
||||
session = session.Where("rn.name like ?", "%"+req.User+"%")
|
||||
}
|
||||
}
|
||||
if req.Operator != "" {
|
||||
if utils.IsPhoneNumber(req.Operator) {
|
||||
session = session.Where("ber.operator_phone_number = ?", req.Operator)
|
||||
} else {
|
||||
session = session.Where("ber.operator_name like ?", req.Operator)
|
||||
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))
|
||||
}
|
||||
@ -86,30 +99,48 @@ func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data
|
||||
}
|
||||
|
||||
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.BundleBalancePo, total int64, err error) {
|
||||
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")
|
||||
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
|
||||
Select("bor1.*").
|
||||
Joins(`INNER JOIN (
|
||||
SELECT customer_id, MAX(created_at) AS max_created_time
|
||||
FROM bundle_order_records
|
||||
GROUP BY customer_id
|
||||
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
|
||||
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").
|
||||
Select(`bb.*, bor.expiration_time as expired_time, bor.bundle_name, bor.status,
|
||||
bor.uuid as order_uuid, rn.name as user_name,
|
||||
u.tel_num as user_phone_number, u.id as user_id`).
|
||||
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id").
|
||||
Joins("LEFT JOIN (?) as bor ON bor.customer_id = u.id", subQuery).
|
||||
Joins("LEFT JOIN micro_bundle.bundle_balance bb ON u.id = bb.user_id AND bb.order_uuid = bor.uuid").
|
||||
Where("rn.name IS NOT NULL").
|
||||
Where("u.deleted_at = 0").
|
||||
Order("bor.expiration_time desc")
|
||||
if req.UserName != "" {
|
||||
session = session.Where("u.nickname like ?", "%"+req.UserName+"%")
|
||||
if utils.IsPhoneNumber(req.UserName) {
|
||||
session = session.Where("u.tel_num = ?", req.UserName)
|
||||
} else {
|
||||
session = session.Where("rn.name like ?", "%"+req.UserName+"%")
|
||||
}
|
||||
}
|
||||
if req.Status != 0 {
|
||||
session = session.Where("bor.status = ?", req.Status)
|
||||
}
|
||||
if req.BundleName != "" {
|
||||
session = session.Where("bor.bundle_name like ?", "%"+req.BundleName+"%")
|
||||
}
|
||||
if req.ExpiredTimeEnd != 0 {
|
||||
session = session.Where("bor.expiration_time <= ?", time.UnixMilli(req.ExpiredTimeEnd))
|
||||
}
|
||||
if req.ExpiredTimeStart != 0 {
|
||||
session = session.Where("bor.expiration_time >= ?", time.UnixMilli(req.ExpiredTimeStart))
|
||||
}
|
||||
if req.Bought == 2 {
|
||||
session = session.Where("bor.uuid IS NOT NULL")
|
||||
}
|
||||
if req.Bought == 1 {
|
||||
session = session.Where("bor.uuid IS NULL")
|
||||
}
|
||||
err = session.Count(&total).Error
|
||||
if err != nil {
|
||||
return
|
||||
@ -121,6 +152,36 @@ 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{}
|
||||
@ -128,9 +189,7 @@ func AddBundleBalanceByUserId(data model.BundleBalance) error {
|
||||
return errors.New("用户还没有套餐信息")
|
||||
}
|
||||
newData := model.BundleBalance{
|
||||
Model: gorm.Model{
|
||||
ID: data.Model.ID,
|
||||
},
|
||||
Model: oldData.Model,
|
||||
UserId: oldData.UserId,
|
||||
OrderUUID: oldData.OrderUUID,
|
||||
AccountNumber: oldData.AccountNumber + data.AccountNumber,
|
||||
@ -150,7 +209,7 @@ func AddBundleBalanceByUserId(data model.BundleBalance) error {
|
||||
newData.DataAnalysisConsumptionNumber > newData.DataAnalysisNumber {
|
||||
return errors.New("套餐余量不足")
|
||||
}
|
||||
return tx.Model(&model.BundleBalance{}).Where("id = ?", oldData.ID).Updates(&newData).Error
|
||||
return tx.Model(&model.BundleBalance{}).Where("id = ?", oldData.ID).Save(&newData).Error
|
||||
})
|
||||
}
|
||||
|
||||
@ -164,10 +223,10 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, tota
|
||||
session = session.Where("title = ?", req.Title)
|
||||
}
|
||||
if req.Platform != 0 {
|
||||
session = session.Where("JSON_CONTAINS(platform_ids,?)", req.Platform)
|
||||
session = session.Where(fmt.Sprintf("JSON_CONTAINS(platform_ids,'%d')", req.Platform))
|
||||
}
|
||||
if req.Account != 0 {
|
||||
session = session.Where("JSON_CONTAINS(media_names,?)", req.Account)
|
||||
if req.Account != "" {
|
||||
session = session.Where(fmt.Sprintf(`JSON_CONTAINS(media_names,'"%s"')`, req.Account))
|
||||
}
|
||||
if req.SubmitTimeEnd != 0 {
|
||||
session = session.Where("submit_time <= ?", time.UnixMilli(req.SubmitTimeEnd))
|
||||
@ -198,7 +257,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.Find(&data).Error
|
||||
err = session.Order("updated_at desc").Find(&data).Error
|
||||
return
|
||||
}
|
||||
|
||||
@ -212,8 +271,38 @@ func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (data model.CastWorkV
|
||||
return
|
||||
}
|
||||
|
||||
// func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWork, err error) {
|
||||
// // app.ModuleClients.BundleDB.Where(&model.CastWork{
|
||||
// // ArtistUuid: req.ArtistUuid,
|
||||
// // })
|
||||
// }
|
||||
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
|
||||
}
|
||||
|
@ -112,6 +112,22 @@ 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
|
||||
@ -282,6 +298,24 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order
|
||||
}
|
||||
//_ = copier.CopyWithOption(&res, orderRecord, copier.Option{DeepCopy: true})
|
||||
|
||||
addBundles := make([]model.BundleOrderValueAdd, 0)
|
||||
addInfos := make([]*bundle.AddInfo, 0)
|
||||
if req.OrderNo == "" {
|
||||
req.OrderNo = orderRecord.OrderNo
|
||||
err = app.ModuleClients.BundleDB.Model(model.BundleOrderValueAdd{}).Where("deleted_at is null and source = 1 and order_no = ?", req.OrderNo).Find(&addBundles).Error
|
||||
if err != nil {
|
||||
return res, commonErr.ReturnError(err, "增值订单信息", "获取增值订单信息失败: ")
|
||||
}
|
||||
for _, addBundle := range addBundles {
|
||||
addInfo := &bundle.AddInfo{
|
||||
OrderNo: addBundle.OrderNo,
|
||||
Num: addBundle.Num,
|
||||
ValueAddUUID: addBundle.ValueAddUUID,
|
||||
}
|
||||
addInfos = append(addInfos, addInfo)
|
||||
}
|
||||
}
|
||||
|
||||
res = &bundle.OrderRecord{
|
||||
Uuid: orderRecord.UUID,
|
||||
OrderNo: orderRecord.OrderNo,
|
||||
@ -306,6 +340,8 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order
|
||||
TotalAmount: orderRecord.TotalAmount,
|
||||
ExpirationTime: orderRecord.ExpirationTime,
|
||||
}
|
||||
res.AddInfos = make([]*bundle.AddInfo, 0)
|
||||
res.AddInfos = addInfos
|
||||
return
|
||||
}
|
||||
func PackagePriceAndTime(orderRecord *bundle.OrderRecord) (res *bundle.PackagePriceAndTimeResponse, err error) {
|
||||
@ -604,6 +640,15 @@ func GetReconciliationList(req *bundle.GetReconciliationListReq) (*bundle.GetRec
|
||||
return res, nil
|
||||
}
|
||||
func CreateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonResponse, err error) {
|
||||
if req.SerialNumber != "" {
|
||||
var existing model.Reconciliation
|
||||
err = app.ModuleClients.BundleDB.Where("serial_number = ?", req.SerialNumber).First(&existing).Error
|
||||
if err == nil {
|
||||
// 说明这笔流水存在对账单
|
||||
return &bundle.CommonResponse{Msg: "创建对账单成功"}, nil
|
||||
}
|
||||
}
|
||||
|
||||
record := &model.Reconciliation{
|
||||
BundleOrderOn: req.BundleOrderOn,
|
||||
BundleAddOrderOn: req.BundleAddOrderOn,
|
||||
@ -655,6 +700,47 @@ func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
|
||||
// 返回成功响应
|
||||
return &bundle.CommonResponse{Msg: "更新成功"}, nil
|
||||
}
|
||||
func OnlyAddValueListByOrderNo(req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) {
|
||||
response := new(bundle.OnlyAddValueListByOrderNoResp)
|
||||
response.AddBundleInfos = make([]*bundle.AddBundleInfo, 0)
|
||||
|
||||
addBundles := make([]model.BundleOrderValueAdd, 0)
|
||||
err = app.ModuleClients.BundleDB.Model(model.BundleOrderValueAdd{}).Where("deleted_at is null and source = 2 and order_no = ?", req.OrderNo).Find(&addBundles).Error
|
||||
if err != nil {
|
||||
return res, commonErr.ReturnError(err, "增值订单信息", "获取增值订单信息失败: ")
|
||||
}
|
||||
|
||||
for _, addBundle := range addBundles {
|
||||
response.AddBundleInfos = append(response.AddBundleInfos, &bundle.AddBundleInfo{
|
||||
CheckOutSessionId: addBundle.CheckoutSessionId,
|
||||
Amount: float32(addBundle.Amount),
|
||||
OrderNo: addBundle.OrderNo,
|
||||
PaymentStatus: int32(addBundle.PaymentStatus),
|
||||
CustomerID: addBundle.CustomerID,
|
||||
})
|
||||
}
|
||||
// 返回成功响应
|
||||
return response, nil
|
||||
}
|
||||
func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
|
||||
var existing model.Reconciliation
|
||||
if err := app.ModuleClients.BundleDB.Where("serial_number = ?", req.SerialNumber).First(&existing).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return nil, errors.New("对账单记录不存在")
|
||||
}
|
||||
return nil, fmt.Errorf("查询对账单失败: %v", err)
|
||||
}
|
||||
updates := model.Reconciliation{
|
||||
PayTime: req.PayTime,
|
||||
PayStatus: int(req.PaymentStatus),
|
||||
SerialNumber: req.SerialNumber,
|
||||
}
|
||||
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
|
||||
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
||||
}
|
||||
// 返回成功响应
|
||||
return &bundle.CommonResponse{Msg: "更新成功"}, nil
|
||||
}
|
||||
func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
|
||||
res = new(bundle.CommonResponse)
|
||||
var paidServices []*model.BundleOrderValueAdd
|
||||
|
@ -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 = ?", columns["uuid"]).Updates(columns).Error
|
||||
err = tx.Model(&model.ValueAddService{}).Where("uuid = ? and deleted_at = 0", columns["uuid"]).Updates(columns).Error
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
func UpdateValueAddServiceLang(tx *gorm.DB, columns map[string]interface{}) (err error) {
|
||||
err = tx.Model(&model.ValueAddServiceLang{}).Where("uuid =?", columns["uuid"]).
|
||||
Where("language", columns["language"]).Updates(columns).Error
|
||||
err = tx.Model(&model.ValueAddServiceLang{}).Where("uuid =? and deleted_at = 0", columns["uuid"]).
|
||||
Where("language = ?", columns["language"]).Updates(columns).Error
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
@ -115,6 +115,7 @@ 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")
|
||||
})
|
||||
@ -134,7 +135,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 = ?", uuid).Preload("ValueAddServiceLang").First(&data).Error
|
||||
err = app.ModuleClients.BundleDB.Where("uuid = ? and deleted_at = 0", uuid).Preload("ValueAddServiceLang").First(&data).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -143,7 +144,8 @@ 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 = ?", uuid, language).First(&valueAddServiceLang).Error
|
||||
err = app.ModuleClients.BundleDB.Where("uuid = ? AND language = ? and deleted_at = 0", uuid, language).First(&valueAddServiceLang).Error
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -154,7 +156,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 = ?", valueUid).
|
||||
Where("value_uid = ? and deleted_at = 0", valueUid).
|
||||
Find(&rels).Error
|
||||
return rels, err
|
||||
}
|
||||
@ -187,3 +189,17 @@ 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
|
||||
}
|
||||
|
@ -1,11 +1,13 @@
|
||||
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"
|
||||
)
|
||||
@ -23,21 +25,28 @@ func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse
|
||||
AccountNumber: int(req.AccountAdditional),
|
||||
ExpansionPacksNumber: 1,
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
return nil, errors.New("用户没有余量信息")
|
||||
}
|
||||
return nil, dao.AddBundleExtendRecord(data)
|
||||
err := dao.AddBundleExtendRecord(data)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return nil, errors.New("创建扩展记录失败")
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundle.BundleExtendRecordsListResponse, error) {
|
||||
data, total, err := dao.GetBundleExtendRecordList(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
logger.Error(err)
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
resp := &bundle.BundleExtendRecordsListResponse{}
|
||||
resp.Total = total
|
||||
resp.Data = lo.Map(data, func(m model.BundleExtendRecordItemPo, _ int) *bundle.BundleExtendRecordItem {
|
||||
result := &bundle.BundleExtendRecordItem{}
|
||||
copier.Copy(result, &m)
|
||||
result.CreatedAt = uint64(m.CreatedAt.UnixMilli())
|
||||
return result
|
||||
})
|
||||
return resp, nil
|
||||
@ -46,24 +55,48 @@ func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundl
|
||||
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) {
|
||||
data, total, err := dao.GetBundleBalanceList(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
logger.Error(err)
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
resp := &bundle.GetBundleBalanceListResp{}
|
||||
resp.Total = total
|
||||
resp.Data = lo.Map(data, func(m model.BundleBalancePo, _ int) *bundle.BundleBalanceItem {
|
||||
result := &bundle.BundleBalanceItem{}
|
||||
copier.Copy(result, &m)
|
||||
t, _ := time.Parse("2006-01-02", m.ExpirationTime)
|
||||
loc, _ := time.LoadLocation("Asia/Shanghai")
|
||||
t, _ := time.ParseInLocation(time.DateTime, m.ExpirationTime, loc)
|
||||
if m.OrderUUID != "" {
|
||||
result.Bought = 2
|
||||
} else {
|
||||
result.Bought = 1
|
||||
}
|
||||
result.ExpiredTime = t.UnixMilli()
|
||||
return result
|
||||
})
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func GetBundleBalanceByUserId(req *bundle.GetBundleBalanceByUserIdReq) (*bundle.GetBundleBalanceByUserIdResp, error) {
|
||||
data, err := dao.GetBundleBalanceByUserId(req)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
result := &bundle.GetBundleBalanceByUserIdResp{}
|
||||
copier.Copy(result, &data)
|
||||
loc, _ := time.LoadLocation("Asia/Shanghai")
|
||||
t, _ := time.ParseInLocation(time.DateTime, data.ExpiredTime, loc)
|
||||
result.ExpiredTime = t.UnixMilli()
|
||||
t, _ = time.ParseInLocation(time.DateTime, data.PayTime, loc)
|
||||
result.PayTime = t.UnixMilli()
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
|
||||
var data model.BundleBalance
|
||||
if err := copier.Copy(&data, req); err != nil {
|
||||
return nil, err
|
||||
logger.Error(err)
|
||||
return nil, errors.New("操作失败")
|
||||
}
|
||||
return nil, dao.AddBundleBalanceByUserId(data)
|
||||
}
|
||||
@ -71,15 +104,22 @@ 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 {
|
||||
return nil, err
|
||||
logger.Error(err)
|
||||
return nil, errors.New("操作失败")
|
||||
}
|
||||
return nil, dao.CreateBundleBalance(data)
|
||||
err := dao.CreateBundleBalance(data)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
return nil, errors.New("创建余量信息失败")
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListResp, error) {
|
||||
data, total, err := dao.GetUsedRecord(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
logger.Error(err)
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
resp := &bundle.GetUsedRecordListResp{}
|
||||
resp.Total = total
|
||||
@ -94,7 +134,8 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListR
|
||||
func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) {
|
||||
data, err := dao.GetImageWorkDetail(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
logger.Error(err)
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
result := &bundle.GetImageWorkDetailResp{}
|
||||
err = copier.Copy(result, &data)
|
||||
@ -104,7 +145,8 @@ func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWork
|
||||
func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) {
|
||||
data, err := dao.GetVedioWorkDetail(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
logger.Error(err)
|
||||
return nil, errors.New("查询失败")
|
||||
}
|
||||
result := &bundle.GetVedioeWorkDetailResp{}
|
||||
err = copier.Copy(result, &data)
|
||||
@ -112,6 +154,23 @@ func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWor
|
||||
}
|
||||
|
||||
func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) {
|
||||
// data, err := dao.ToBeComfirmedWorks(req)
|
||||
return nil, nil
|
||||
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)
|
||||
}
|
||||
|
@ -3,14 +3,13 @@ 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"
|
||||
@ -60,7 +59,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("排序参数需为正整数")
|
||||
@ -76,6 +75,7 @@ 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,50 +87,32 @@ 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, existErr
|
||||
}
|
||||
if valueService != nil && len(valueService) > 0 {
|
||||
for _, v := range valueService {
|
||||
existValueService[v] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
var cancelValueAddService = make(map[string]string)
|
||||
// var existValueService = make(map[string]string)
|
||||
// if req.Uuid != "" {
|
||||
// valueService, existErr := dao.GetValueAddServiceUuidsByBundleUuid(req.Uuid)
|
||||
// if existErr != nil {
|
||||
// return res, errors.New("查询增值服务失败")
|
||||
// }
|
||||
// if valueService != nil && len(valueService) > 0 {
|
||||
// for _, v := range valueService {
|
||||
// existValueService[v] = v
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
selectService := make([]*model.BundleToValueAddService, 0)
|
||||
var selectValueAddServiceCount = make(map[int]struct{})
|
||||
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(fmt.Sprintf("所选增值服务[%s]%s版不存在,请先创建对应增值套餐", v.ServiceName, req.Language))
|
||||
return res, errors.New("增值服务不存在")
|
||||
} else {
|
||||
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))
|
||||
|
||||
}
|
||||
return res, errors.New("查询增值服务失败")
|
||||
}
|
||||
}
|
||||
if _, exists := selectValueAddServiceCount[int(detail.ServiceType)]; exists {
|
||||
return res, errors.New(fmt.Sprintf("所选增值服务[%s]类型存在多个", detail.ServiceName))
|
||||
return res, errors.New("每种增值服务类型只可选择一个")
|
||||
}
|
||||
selectValueAddServiceCount[int(detail.ServiceType)] = struct{}{}
|
||||
selectService = append(selectService, &model.BundleToValueAddService{
|
||||
@ -150,9 +132,6 @@ 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 {
|
||||
@ -160,14 +139,14 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
||||
res.Msg = "请先创建中文版本套餐"
|
||||
return res, errors.New("请先创建中文版本套餐")
|
||||
} else {
|
||||
return res, err
|
||||
return res, errors.New("获取套餐信息失败")
|
||||
}
|
||||
}
|
||||
}
|
||||
if req.Language == msg.ZH_CN {
|
||||
bundleProfile.UUID = utils.GetUUID()
|
||||
if err = dao.TxCreateBundle(tx, bundleProfile); err != nil {
|
||||
return res, errors.New("保存中文语言套餐失败: " + err.Error())
|
||||
return res, errors.New("创建套餐信息失败")
|
||||
}
|
||||
bundleLang.UUID = bundleProfile.UUID
|
||||
res.Uuid = bundleProfile.UUID
|
||||
@ -177,39 +156,29 @@ 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("保存套餐与增值服务关联失败: " + err.Error())
|
||||
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
|
||||
if err = dao.TxCreateBundleLang(tx, bundleLang); err != nil {
|
||||
return res, errors.New("创建套餐信息失败")
|
||||
}
|
||||
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++
|
||||
}
|
||||
}
|
||||
}
|
||||
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JA_JP}
|
||||
for _, lang := range langList {
|
||||
otherLang := &model.BundleProfileLang{
|
||||
UUID: bundleLang.UUID,
|
||||
Name: bundleLang.Name,
|
||||
Content: bundleLang.Content,
|
||||
Price: bundleLang.Price,
|
||||
PriceType: bundleLang.PriceType,
|
||||
}
|
||||
otherLang.Language = lang
|
||||
if err = dao.TxCreateBundleLang(tx, otherLang); err != nil {
|
||||
return res, errors.New("创建套餐信息失败")
|
||||
}
|
||||
res.CancelNum = int64(count)
|
||||
}
|
||||
if err = dao.TxCreateBundleLang(tx, bundleLang); err != nil {
|
||||
return res, errors.New("保存语言套餐失败: " + err.Error())
|
||||
}
|
||||
res.Msg = "保存成功"
|
||||
return res, nil
|
||||
res.Msg = "创建套餐信息成功"
|
||||
return
|
||||
} else {
|
||||
return
|
||||
}
|
||||
@ -219,20 +188,7 @@ 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,
|
||||
@ -242,47 +198,15 @@ 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, err
|
||||
return res, errors.New("更新套餐信息失败")
|
||||
}
|
||||
// 更新中间表函数
|
||||
//更新中间表函数
|
||||
if err = diffUpdateBundleToValueAddService(tx, req.Uuid, selectService); err != nil {
|
||||
tx.Rollback()
|
||||
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))
|
||||
return res, errors.New("更新套餐与增值服务关联失败")
|
||||
}
|
||||
}
|
||||
updateBundleLang := map[string]interface{}{
|
||||
@ -292,13 +216,10 @@ 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, err
|
||||
return res, errors.New("更新套餐信息失败")
|
||||
}
|
||||
|
||||
res.Uuid = req.Uuid
|
||||
if res.Msg == "" {
|
||||
res.Msg = "保存成功"
|
||||
}
|
||||
res.Msg = "保存成功"
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
@ -306,7 +227,10 @@ 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)
|
||||
return
|
||||
if err != nil {
|
||||
return res, errors.New("获取套餐列表失败")
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
||||
res = new(bundle.BundleDetailResponseV2)
|
||||
@ -314,14 +238,11 @@ 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 {
|
||||
res.Msg = err.Error()
|
||||
return res, errors.New("获取套餐信息失败")
|
||||
}
|
||||
if detail != nil {
|
||||
bundleProfile.Uuid = detail.UUID
|
||||
@ -332,88 +253,171 @@ 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 detail.BundleToValueAddService != nil && len(detail.BundleToValueAddService) > 0 {
|
||||
if len(detail.BundleToValueAddService) > 0 {
|
||||
for _, valueAddService := range detail.BundleToValueAddService {
|
||||
valueAddDetail, err := dao.ValueAddServiceDetailByUuidAndLanguage(valueAddService.ValueUid, req.Language)
|
||||
if err != nil {
|
||||
return res, errors.New("查询增值服务失败")
|
||||
}
|
||||
selectValueAddService := &bundle.SelectValueAddService{
|
||||
ValueAddUuid: valueAddService.ValueUid,
|
||||
IsDisplay: valueAddService.IsDisplay,
|
||||
ServiceName: valueAddDetail.ServiceName,
|
||||
ServiceType: valueAddDetail.ServiceType,
|
||||
}
|
||||
selectValueAddServices = append(selectValueAddServices, selectValueAddService)
|
||||
}
|
||||
}
|
||||
if detail.BundleProfileLang != nil && len(detail.BundleProfileLang) > 0 {
|
||||
if len(detail.BundleProfileLang) > 0 {
|
||||
for _, lang := range detail.BundleProfileLang {
|
||||
bundleProfileLang := &bundle.BundleProfileLang{
|
||||
Uuid: lang.UUID,
|
||||
Name: lang.Name,
|
||||
Price: lang.Price,
|
||||
PriceType: lang.PriceType,
|
||||
Content: lang.Content,
|
||||
Language: lang.Language,
|
||||
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,
|
||||
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"),
|
||||
}
|
||||
// 通过中间表拼接增值服务数据
|
||||
// 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 selectValueAddServices != nil && len(selectValueAddServices) > 0 {
|
||||
if len(selectValueAddServices) > 0 {
|
||||
bundleProfile.SelectValueAddService = selectValueAddServices
|
||||
}
|
||||
bundleProfile.BundleProfileLang = bundleProfileLangs
|
||||
res.Bundle = bundleProfile
|
||||
return
|
||||
}
|
||||
func HandleShelf(req *bundle.HandShelfRequest) (res *bundle.CommonResponse, err error) {
|
||||
res = new(bundle.CommonResponse)
|
||||
func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProfileLang, err error) {
|
||||
res = new(bundle.BundleProfileLang)
|
||||
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("获取套餐信息失败")
|
||||
}
|
||||
lang, err := dao.BundleDetailByUuidAndLanguage(req.Uuid, req.Language)
|
||||
if err != nil {
|
||||
return res, errors.New("获取套餐信息失败")
|
||||
}
|
||||
if detail != nil {
|
||||
res.Uuid = detail.UUID
|
||||
res.ImgOption = int32(detail.ImgOption)
|
||||
res.BgImg1 = detail.BgImg1
|
||||
res.BgImg2 = detail.BgImg2
|
||||
res.FontColor = detail.FontColor
|
||||
res.Sort = detail.Sort
|
||||
res.ShelfStatus = detail.ShelfStatus
|
||||
res.Contract = detail.Contract
|
||||
}
|
||||
if lang != nil {
|
||||
res.Name = lang.Name
|
||||
res.Price = lang.Price
|
||||
res.PriceType = lang.PriceType
|
||||
res.Content = lang.Content
|
||||
res.Language = lang.Language
|
||||
res.CreatedAt = time.Unix(lang.CreatedAt, 0).Format("2006-01-02 15:04:05")
|
||||
res.UpdatedAt = time.Unix(int64(lang.UpdatedAt), 0).Format("2006-01-02 15:04:05")
|
||||
}
|
||||
return
|
||||
}
|
||||
func HandleShelf(req *bundle.HandShelfRequest) (*bundle.CommonResponse, error) {
|
||||
res := new(bundle.CommonResponse)
|
||||
if req.Uuid == "" {
|
||||
return res, errors.New("缺少套餐UUID")
|
||||
}
|
||||
if req.ShelfStatus != 1 && req.ShelfStatus != 2 {
|
||||
return res, errors.New("Invalid shelf status")
|
||||
return res, errors.New("状态值无效")
|
||||
}
|
||||
detail, err := dao.GetBundleDetailByUuid(req.Uuid)
|
||||
if err != nil {
|
||||
return res, errors.New("获取套餐信息失败")
|
||||
}
|
||||
if detail.ShelfStatus == req.ShelfStatus {
|
||||
switch detail.ShelfStatus {
|
||||
case 1:
|
||||
return res, errors.New("套餐已上架,请勿重复操作")
|
||||
case 2:
|
||||
return res, errors.New("套餐已下架,请勿重复操作")
|
||||
}
|
||||
}
|
||||
bundleDetailLangs, err := dao.GetBundleLangsByUuid(req.Uuid)
|
||||
if err != nil {
|
||||
return res, errors.New("获取套餐信息失败")
|
||||
}
|
||||
var langToPriceType = make(map[string]int64)
|
||||
for _, bundleLang := range bundleDetailLangs {
|
||||
langToPriceType[bundleLang.Language] = bundleLang.PriceType
|
||||
}
|
||||
tx := app.ModuleClients.BundleDB.Begin()
|
||||
defer func() {
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
} else {
|
||||
tx.Commit()
|
||||
}
|
||||
}()
|
||||
if req.ShelfStatus == 1 {
|
||||
valueAddUuids, err := dao.GetValueAddServiceUuidsByBundleUuid(req.Uuid)
|
||||
if err != nil {
|
||||
return res, errors.New("查询增值服务失败")
|
||||
}
|
||||
//判断时长类型是否存在
|
||||
isExist := false
|
||||
for _, valueUid := range valueAddUuids {
|
||||
detail, err := dao.ValueAddServiceDetail(valueUid)
|
||||
if err != nil {
|
||||
return res, errors.New("查询增值服务失败")
|
||||
}
|
||||
if detail.ServiceType == 5 {
|
||||
isExist = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !isExist {
|
||||
return res, errors.New("缺失可用时长服务类型")
|
||||
}
|
||||
//校验币种
|
||||
valueAddServices, er := dao.BatchValueAddServiceDetailTx(tx, valueAddUuids)
|
||||
if er != nil {
|
||||
return res, errors.New("查询增值服务详情失败")
|
||||
}
|
||||
for _, valueAddService := range valueAddServices {
|
||||
if len(valueAddService.ValueAddServiceLang) > 0 {
|
||||
for _, lang := range valueAddService.ValueAddServiceLang {
|
||||
if langToPriceType[lang.Language] != lang.PriceType {
|
||||
return res, errors.New("所选增值服务币种与套餐币种不一致")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
res, err = dao.HandShelf(req.Uuid, req.ShelfStatus)
|
||||
if err != nil {
|
||||
res.Msg = err.Error()
|
||||
return res, err
|
||||
return res, errors.New("更新套餐状态失败")
|
||||
}
|
||||
|
||||
res.Msg = "Operation success"
|
||||
res.Msg = "更新成功"
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@ -421,7 +425,7 @@ func HandleShelf(req *bundle.HandShelfRequest) (res *bundle.CommonResponse, err
|
||||
func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectService []*model.BundleToValueAddService) error {
|
||||
oldUuids, err := dao.GetValueAddServiceUuidsByBundleUuid(bundleUuid)
|
||||
if err != nil {
|
||||
return errors.New("查询旧套餐与增值服务关联失败: " + err.Error())
|
||||
return errors.New("查询套餐与增值服务关联失败")
|
||||
}
|
||||
newUuids := make(map[string]*model.BundleToValueAddService)
|
||||
for _, s := range selectService {
|
||||
@ -433,14 +437,18 @@ 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)
|
||||
@ -448,12 +456,23 @@ 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("删除套餐与增值服务关联失败: " + err.Error())
|
||||
return errors.New("删除套餐与增值服务关联失败")
|
||||
}
|
||||
}
|
||||
if len(toAdd) > 0 {
|
||||
if err = dao.CreateBundleToValueAddService(tx, toAdd); err != nil {
|
||||
return errors.New("保存套餐与增值服务关联失败: " + err.Error())
|
||||
return errors.New("保存套餐与增值服务关联失败")
|
||||
}
|
||||
}
|
||||
if len(toUpdate) > 0 {
|
||||
updates := make(map[string]interface{})
|
||||
var uids []string
|
||||
for _, record := range toUpdate {
|
||||
uids = append(uids, record.ValueUid)
|
||||
updates["is_display"] = record.IsDisplay
|
||||
}
|
||||
if err = dao.UpdateBundleToValueAddService(tx, toUpdate); err != nil {
|
||||
return errors.New("保存套餐与增值服务关联失败")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@ -462,27 +481,27 @@ func saveBundleHistory(tx *gorm.DB, bundleUuid string, operator string, operator
|
||||
// 保存历史记录
|
||||
data, err := dao.GetBundleDetailByUuid(bundleUuid)
|
||||
if err != nil {
|
||||
return errors.New("查询套餐详情失败: " + err.Error())
|
||||
return errors.New("获取套餐信息失败")
|
||||
}
|
||||
bundleToValueAddService := data.BundleToValueAddService
|
||||
data.BundleToValueAddService = nil
|
||||
var valueUuid []string
|
||||
if bundleToValueAddService != nil && len(bundleToValueAddService) > 0 {
|
||||
if len(bundleToValueAddService) > 0 {
|
||||
for _, v := range bundleToValueAddService {
|
||||
valueUuid = append(valueUuid, v.ValueUid)
|
||||
}
|
||||
}
|
||||
valueData, err := dao.BatchValueAddServiceDetailTx(tx, valueUuid)
|
||||
if err != nil {
|
||||
return errors.New("查询增值服务详情失败: " + err.Error())
|
||||
return errors.New("查询增值服务详情失败")
|
||||
}
|
||||
j, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return errors.New("套餐json转换失败: " + err.Error())
|
||||
return errors.New("序列化转换失败")
|
||||
}
|
||||
vJ, err := json.Marshal(valueData)
|
||||
if err != nil {
|
||||
return errors.New("增值服务json转换失败: " + err.Error())
|
||||
return errors.New("序列化转换失败")
|
||||
}
|
||||
history := &model.BundleProfileHistory{
|
||||
Uuid: bundleUuid,
|
||||
@ -492,7 +511,17 @@ func saveBundleHistory(tx *gorm.DB, bundleUuid string, operator string, operator
|
||||
OperatorId: operatorId,
|
||||
}
|
||||
if err := tx.Create(history).Error; err != nil {
|
||||
return errors.New("保存套餐历史记录失败: " + err.Error())
|
||||
return errors.New("保存套餐历史记录失败")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 增加h5套餐列表
|
||||
func BundleListH5V2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
|
||||
res = new(bundle.BundleListResponse)
|
||||
res, err = dao.BundleListH5V2(req)
|
||||
if err != nil {
|
||||
return res, errors.New("获取套餐列表失败")
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
@ -146,7 +146,16 @@ func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
|
||||
res, err = dao.UpdateReconciliation(req)
|
||||
return
|
||||
}
|
||||
|
||||
func OnlyAddValueListByOrderNo(req *bundle.OnlyAddValueListByOrderNoRequest) (res *bundle.OnlyAddValueListByOrderNoResp, err error) {
|
||||
res = new(bundle.OnlyAddValueListByOrderNoResp)
|
||||
res, err = dao.OnlyAddValueListByOrderNo(req)
|
||||
return
|
||||
}
|
||||
func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
|
||||
res = new(bundle.CommonResponse)
|
||||
res, err = dao.UpdateReconciliationStatusBySerialNumber(req)
|
||||
return
|
||||
}
|
||||
func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
|
||||
res = new(bundle.CommonResponse)
|
||||
res, err = dao.DeleteValueAddService(req)
|
||||
|
@ -147,14 +147,31 @@ 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, parseErr := strconv.ParseFloat(option.Price, 32)
|
||||
if parseErr != nil {
|
||||
return res, parseErr
|
||||
price, parseErr1 := strconv.ParseFloat(option.Price, 32)
|
||||
if parseErr1 != nil {
|
||||
fmt.Println("优惠单价转换失败: ", parseErr1)
|
||||
return res, errors.New("优惠单价转换失败")
|
||||
}
|
||||
if option.Num < 0 || option.Num > 99 {
|
||||
return res, errors.New("数量参数需为0-99")
|
||||
}
|
||||
if in.PriceMode == 1 && price > originalPrice {
|
||||
return res, errors.New("优惠单价需小于等于原价")
|
||||
}
|
||||
options = append(options, &model.PriceOption{
|
||||
Id: int32(index),
|
||||
@ -172,10 +189,6 @@ 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,
|
||||
@ -187,7 +200,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() {
|
||||
@ -205,7 +218,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 != "" {
|
||||
@ -225,15 +238,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("保存中文语言套餐失败: " + err.Error())
|
||||
return res, errors.New("保存增值服务失败")
|
||||
}
|
||||
valueAddServiceLang.UUID = valueAddService.UUID
|
||||
res.Uuid = valueAddService.UUID
|
||||
if err = dao.CreateValueAddServiceLang(tx, valueAddServiceLang); err != nil {
|
||||
return res, errors.New("保存语言套餐失败: " + err.Error())
|
||||
return res, errors.New("保存增值服务失败")
|
||||
}
|
||||
}
|
||||
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JS_JP}
|
||||
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JA_JP}
|
||||
for _, lang := range langList {
|
||||
otherLang := model.ValueAddServiceLang{
|
||||
UUID: valueAddServiceLang.UUID,
|
||||
@ -249,18 +262,18 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
||||
}
|
||||
otherLang.Language = lang
|
||||
if err = dao.CreateValueAddServiceLang(tx, &otherLang); err != nil {
|
||||
return res, errors.New(fmt.Sprintf("保存%s语言套餐失败: ", lang) + err.Error())
|
||||
return res, errors.New("保存增值服务失败")
|
||||
}
|
||||
}
|
||||
res.Msg = "保存成功"
|
||||
res.Msg = "新增增值服务成功"
|
||||
return
|
||||
} else {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// 已存在,进行更新
|
||||
if err := saveValueAddServiceHistory(tx, in.Uuid); err != nil {
|
||||
return res, err
|
||||
if err = saveValueAddServiceHistory(tx, in.Uuid); err != nil {
|
||||
return res, errors.New("保存增值服务历史记录失败")
|
||||
}
|
||||
//中文状态下,更新主表和语言表
|
||||
if in.Language == msg.ZH_CN {
|
||||
@ -270,17 +283,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
||||
"service_type": in.ServiceType,
|
||||
}
|
||||
if err = dao.UpdateValueAddService(tx, updateService); err != nil {
|
||||
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++
|
||||
return res, errors.New("更新增值服务失败")
|
||||
}
|
||||
}
|
||||
//更新语言表
|
||||
@ -296,11 +299,26 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
||||
"language": in.Language,
|
||||
}
|
||||
if err := dao.UpdateValueAddServiceLang(tx, updateLangService); err != nil {
|
||||
return res, err
|
||||
return res, errors.New("更新增值服务失败")
|
||||
}
|
||||
data, err := dao.GetBundleToValueAddServiceByValueUid(in.Uuid)
|
||||
if err != nil {
|
||||
return res, errors.New("获取套餐信息失败")
|
||||
}
|
||||
bundleUuids := []string{}
|
||||
if len(data) > 0 {
|
||||
for _, bundle := range data {
|
||||
bundleUuids = append(bundleUuids, bundle.BundleUuid)
|
||||
}
|
||||
}
|
||||
columns := map[string]interface{}{
|
||||
"updated_at": time.Now(),
|
||||
}
|
||||
if err = dao.TxUpdateBundles(tx, bundleUuids, columns); err != nil {
|
||||
return res, errors.New("更新套餐信息失败")
|
||||
}
|
||||
res.Uuid = in.Uuid
|
||||
res.Msg = "保存成功"
|
||||
res.CancelNum = cancelNum
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -310,8 +328,7 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
||||
res = &bundle.ValueAddServiceListResponse{}
|
||||
list, total, err := dao.ValueAddServiceList(req)
|
||||
if err != nil {
|
||||
res.Msg = msg.ErrorValueAddServiceList
|
||||
return res, err
|
||||
return res, errors.New("查询增值服务列表失败")
|
||||
}
|
||||
for _, valueAddService := range list {
|
||||
serviceInfo := &bundle.ValueAddService{
|
||||
@ -332,19 +349,22 @@ 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 serviceLang.Options != nil && len(serviceLang.Options) > 0 {
|
||||
if len(serviceLang.Options) > 0 {
|
||||
var options []*bundle.ValueAddPriceOptions
|
||||
for _, option := range serviceLang.Options {
|
||||
var saveAmount decimal.Decimal
|
||||
if serviceLang.PriceMode == 1 {
|
||||
switch serviceLang.PriceMode {
|
||||
case 1:
|
||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||
price := decimal.NewFromFloat(float64(option.Price))
|
||||
num := decimal.NewFromInt(int64(option.Num))
|
||||
saveAmount = original.Sub(price).Mul(num)
|
||||
} else if serviceLang.PriceMode == 2 {
|
||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||
price := decimal.NewFromFloat(float64(option.Price))
|
||||
saveAmount = original.Sub(price)
|
||||
case 2:
|
||||
//original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||
//price := decimal.NewFromFloat(float64(option.Price))
|
||||
saveAmount = decimal.NewFromInt(int64(0))
|
||||
default:
|
||||
return nil, errors.New("无效的价格模式")
|
||||
}
|
||||
options = append(options, &bundle.ValueAddPriceOptions{
|
||||
Id: int64(option.Id),
|
||||
@ -361,7 +381,6 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
||||
res.ValueAddServiceList = append(res.ValueAddServiceList, serviceInfo)
|
||||
}
|
||||
res.Total = int32(total)
|
||||
res.Msg = msg.SuccessValueAddServiceList
|
||||
return
|
||||
|
||||
}
|
||||
@ -373,7 +392,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
|
||||
@ -381,8 +400,7 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
|
||||
// }
|
||||
detail, err := dao.ValueAddServiceDetail(req.Uuid)
|
||||
if err != nil {
|
||||
res.Msg = msg.ErrorValueAddServiceInfo
|
||||
return res, err
|
||||
return res, errors.New("查询增值服务详情失败")
|
||||
}
|
||||
if detail != nil && len(detail.ValueAddServiceLang) > 0 {
|
||||
valueAddService.Uuid = detail.UUID
|
||||
@ -390,18 +408,21 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
|
||||
valueAddService.ServiceType = detail.ServiceType
|
||||
for _, serviceLang := range detail.ValueAddServiceLang {
|
||||
langOptions := []*bundle.ValueAddPriceOptions{}
|
||||
if serviceLang.Options != nil && len(serviceLang.Options) > 0 {
|
||||
if len(serviceLang.Options) > 0 {
|
||||
for _, opt := range serviceLang.Options {
|
||||
var saveAmount decimal.Decimal
|
||||
if serviceLang.PriceMode == 1 {
|
||||
switch serviceLang.PriceMode {
|
||||
case 1:
|
||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||
price := decimal.NewFromFloat(float64(opt.Price))
|
||||
num := decimal.NewFromInt(int64(opt.Num))
|
||||
saveAmount = original.Sub(price).Mul(num)
|
||||
} else if serviceLang.PriceMode == 2 {
|
||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||
price := decimal.NewFromFloat(float64(opt.Price))
|
||||
saveAmount = original.Sub(price)
|
||||
case 2:
|
||||
//original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||
//price := decimal.NewFromFloat(float64(opt.Price))
|
||||
saveAmount = decimal.NewFromInt(int64(0))
|
||||
default:
|
||||
return nil, errors.New("无效的价格模式")
|
||||
}
|
||||
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
|
||||
Id: int64(opt.Id),
|
||||
@ -429,9 +450,7 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
|
||||
}
|
||||
}
|
||||
valueAddService.ServiceLang = serviceLangs
|
||||
|
||||
res.ValueAddService = valueAddService
|
||||
res.Msg = msg.SuccessValueAddServiceInfo
|
||||
return
|
||||
}
|
||||
|
||||
@ -439,11 +458,11 @@ func saveValueAddServiceHistory(tx *gorm.DB, uuid string) (err error) {
|
||||
// 保存历史记录
|
||||
data, err := dao.GetValueAddServiceDetailByUuid(tx, uuid)
|
||||
if err != nil {
|
||||
return errors.New("查询增值服务详情失败: " + err.Error())
|
||||
return errors.New("查询增值服务详情失败")
|
||||
}
|
||||
j, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return errors.New("json转换失败: " + err.Error())
|
||||
return errors.New("序列化转换失败")
|
||||
}
|
||||
history := &model.ValueAddServiceHistory{
|
||||
Uuid: uuid,
|
||||
@ -452,33 +471,48 @@ func saveValueAddServiceHistory(tx *gorm.DB, uuid string) (err error) {
|
||||
//OperatorId: operatorId,
|
||||
}
|
||||
if err := tx.Create(history).Error; err != nil {
|
||||
return errors.New("保存增值服务历史记录失败: " + err.Error())
|
||||
return errors.New("保存增值服务历史记录失败")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func ValueAddServiceDetailByUuidAndLanguage(req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceLang, err error) {
|
||||
res = &bundle.ValueAddServiceLang{}
|
||||
if req.Uuid == "" {
|
||||
return res, errors.New("uuid不能为空")
|
||||
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, err
|
||||
return res, errors.New("查询增值服务详情失败")
|
||||
}
|
||||
if detail == nil {
|
||||
return res, errors.New("增值服务不存在")
|
||||
}
|
||||
langOptions := []*bundle.ValueAddPriceOptions{}
|
||||
if detail.Options != nil && len(detail.Options) > 0 {
|
||||
if len(detail.Options) > 0 {
|
||||
for _, opt := range detail.Options {
|
||||
var saveAmount decimal.Decimal
|
||||
switch detail.PriceMode {
|
||||
case 1:
|
||||
original := decimal.NewFromFloat(float64(detail.OriginalPrice))
|
||||
price := decimal.NewFromFloat(float64(opt.Price))
|
||||
num := decimal.NewFromInt(int64(opt.Num))
|
||||
saveAmount = original.Sub(price).Mul(num)
|
||||
case 2:
|
||||
//original := decimal.NewFromFloat(float64(detail.OriginalPrice))
|
||||
//price := decimal.NewFromFloat(float64(opt.Price))
|
||||
saveAmount = decimal.NewFromInt(int64(0))
|
||||
default:
|
||||
return nil, errors.New("无效的价格模式")
|
||||
}
|
||||
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
|
||||
Id: int64(opt.Id),
|
||||
Num: opt.Num,
|
||||
Symbol: opt.Symbol,
|
||||
Price: fmt.Sprintf("%.2f", opt.Price),
|
||||
Id: int64(opt.Id),
|
||||
Num: opt.Num,
|
||||
Symbol: opt.Symbol,
|
||||
Price: fmt.Sprintf("%.2f", opt.Price),
|
||||
SaveAmount: saveAmount.StringFixed(2),
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -492,20 +526,22 @@ 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, err
|
||||
return res, errors.New("查询增值服务详情失败")
|
||||
}
|
||||
if detail == nil {
|
||||
return res, errors.New("增值服务不存在")
|
||||
@ -523,8 +559,61 @@ func CalculatePrice(req *bundle.CalculatePriceRequest) (res *bundle.CalculatePri
|
||||
// }
|
||||
price, err := detail.Options.CalculatePrice(detail.PriceMode, req.Num)
|
||||
if err != nil {
|
||||
return res, err
|
||||
return res, errors.New("计算价格失败")
|
||||
}
|
||||
res.Price = price
|
||||
return
|
||||
}
|
||||
func BatchGetValueAddServiceLang(req *bundle.BatchGetValueAddServiceLangRequest) (res *bundle.BatchGetValueAddServiceLangResponse, err error) {
|
||||
res = &bundle.BatchGetValueAddServiceLangResponse{}
|
||||
if len(req.Uuids) == 0 {
|
||||
return res, errors.New("缺少套餐UUID")
|
||||
}
|
||||
if req.Language == "" {
|
||||
return res, errors.New("语言不能为空")
|
||||
}
|
||||
detail, err := dao.BatchGetValueAddServiceLang(req.Uuids, req.Language)
|
||||
if err != nil {
|
||||
return res, errors.New("查询增值服务详情失败")
|
||||
}
|
||||
for _, v := range detail {
|
||||
langOptions := []*bundle.ValueAddPriceOptions{}
|
||||
if len(v.Options) > 0 {
|
||||
for _, opt := range v.Options {
|
||||
var saveAmount decimal.Decimal
|
||||
switch v.PriceMode {
|
||||
case 1:
|
||||
original := decimal.NewFromFloat(float64(v.OriginalPrice))
|
||||
price := decimal.NewFromFloat(float64(opt.Price))
|
||||
num := decimal.NewFromInt(int64(opt.Num))
|
||||
saveAmount = original.Sub(price).Mul(num)
|
||||
case 2:
|
||||
//original := decimal.NewFromFloat(float64(v.OriginalPrice))
|
||||
//price := decimal.NewFromFloat(float64(opt.Price))
|
||||
saveAmount = decimal.NewFromInt(int64(0))
|
||||
default:
|
||||
return nil, errors.New("无效的价格模式")
|
||||
}
|
||||
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
|
||||
Id: int64(opt.Id),
|
||||
Num: opt.Num,
|
||||
Symbol: opt.Symbol,
|
||||
Price: fmt.Sprintf("%.2f", opt.Price),
|
||||
SaveAmount: saveAmount.StringFixed(2),
|
||||
})
|
||||
}
|
||||
}
|
||||
res.ValueAddServiceLangList = append(res.ValueAddServiceLangList, &bundle.ValueAddServiceLang{
|
||||
Uuid: v.UUID,
|
||||
ServiceName: v.ServiceName,
|
||||
ServiceType: v.ServiceType,
|
||||
Language: v.Language,
|
||||
PriceMode: v.PriceMode,
|
||||
OriginalPrice: fmt.Sprintf("%.2f", v.OriginalPrice),
|
||||
Unit: v.Unit,
|
||||
PriceType: int64(v.PriceType),
|
||||
Options: langOptions,
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -23,7 +23,8 @@ 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:1;comment:图片选择 1:背景图1 2 3"`
|
||||
ImgOption int8 `json:"imgOption" gorm:"column:img_option;type:int;default:0;comment:图片选择 1:背景图1 2 3"`
|
||||
FontColor string `json:"fontColor" gorm:"column:font_color;type:varchar(32);comment:字体颜色"`
|
||||
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"`
|
||||
BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;type:varchar(1024);comment:背景图-我的"`
|
||||
BundleToValueAddService []BundleToValueAddService `gorm:"foreignKey:BundleUuid;references:UUID" json:"bundleToValueAddService"`
|
||||
@ -36,7 +37,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 js-JP(中繁英德日)"`
|
||||
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
|
||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
||||
DeletedAt soft_delete.DeletedAt
|
||||
@ -88,12 +89,13 @@ 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"`
|
||||
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"`
|
||||
Type int `gorm:"column:type;type:tinyint(4);comment:类型 1:手动操作 2:自行购买" json:"type"`
|
||||
Remark string `gorm:"column:remark;type:text;comment:备注" json:"remark"`
|
||||
AssociatedorderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联订单号" json:"associatedOrderNumber"`
|
||||
OperatorId int `gorm:"column:operator_id;type:int(11);comment:操作人id" json:"operator_id"`
|
||||
OperatorName string `gorm:"column:operator_name;type:varchar(256)" json:"operatorName"`
|
||||
OperatorPhoneNumber string `gorm:"column:operator_phone_number;type:varchar(256)" json:"operatorPhoneNumber"`
|
||||
TimeUnit uint `gorm:"column:time_unit;type:int(11) unsigned;comment:时间单位" json:"timeUnit"`
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
@ -102,16 +104,20 @@ func (*BundleExtensionRecords) TableName() string {
|
||||
}
|
||||
|
||||
type BundleExtendRecordItemPo struct {
|
||||
UserName string
|
||||
UserPhoneNumber string
|
||||
AccountAdditional int
|
||||
ImagesAdditional int
|
||||
DataAdditional int
|
||||
VideoAdditional int
|
||||
OperatorName string
|
||||
OperatorPhoneNumber string
|
||||
OrderUUID string
|
||||
CreatedAt time.Time
|
||||
UserName string
|
||||
UserPhoneNumber string
|
||||
AccountAdditional int
|
||||
ImagesAdditional int
|
||||
DataAdditional int
|
||||
VideoAdditional int
|
||||
AvailableDurationAdditional uint `gorm:"column:available_duration_additional;type:int(11) unsigned;comment:可用时长增加" json:"available_duration_additional"`
|
||||
Type int
|
||||
Remark string
|
||||
OperatorName string
|
||||
OperatorPhoneNumber string
|
||||
AssociatedOrderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联订单号" json:"associatedOrderNumber"`
|
||||
OrderUUID string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type BundleExtendRecordItemDto struct {
|
||||
@ -138,10 +144,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_nmber"`
|
||||
UserPhoneNumber string `gorm:"column:user_phone_number"`
|
||||
BundleName string `gorm:"column:bundle_name"`
|
||||
ExpirationTime string `gorm:"column:expired_time"`
|
||||
BundleStatus int `gorm:"column:bundle_status"`
|
||||
Status int `gorm:"column:status"`
|
||||
OrderUUID string `gorm:"column:order_uuid"`
|
||||
AccountNumber int `gorm:"column:account_number;not null"`
|
||||
AccountConsumptionNumber int `gorm:"column:account_consumption_number;not null"`
|
||||
@ -154,6 +160,30 @@ 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"`
|
||||
|
@ -1,6 +1,8 @@
|
||||
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"`
|
||||
@ -11,7 +13,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"`
|
||||
@ -85,3 +87,26 @@ 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"
|
||||
}
|
||||
|
@ -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 js-JP(中繁英德日)"`
|
||||
Language string `json:"language" gorm:"column:language;type:varchar(32);comment:套餐语言 zh-CN zh-TW EN de-DE ja-JP(中繁英德日)"`
|
||||
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:币种 1:人民币 2:美元 3:日元 4:欧元"`
|
||||
Options PriceOptions `gorm:"column:options;type:json" json:"options"`
|
||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||
@ -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("数字范围错误")
|
||||
return false, errors.New("数量参数需为0-99")
|
||||
|
||||
}
|
||||
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 {
|
||||
switch priceMode { //1 单价模式
|
||||
case 1:
|
||||
return float32(target) * opt.Price, nil
|
||||
case 2:
|
||||
|
156
pb/bundle.proto
156
pb/bundle.proto
@ -17,6 +17,10 @@ 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) {}
|
||||
@ -32,6 +36,7 @@ service Bundle {
|
||||
rpc PackagePriceAndTime(OrderRecord) returns (PackagePriceAndTimeResponse) {}//计算套餐价格和有效时间
|
||||
rpc OrderRecordsListV2(OrderRecordsRequestV2) returns (OrderRecordsResponseV2) {}
|
||||
rpc OrderListByOrderNo(OrderInfoByOrderNoRequest) returns (OrderInfoByOrderNoResp) {}
|
||||
rpc OnlyAddValueListByOrderNo(OnlyAddValueListByOrderNoRequest) returns (OnlyAddValueListByOrderNoResp) {} // 根据orderNo只查增值服务
|
||||
|
||||
//增值套餐
|
||||
rpc CreateValueAddBundle(CreateValueAddBundleRequest) returns (CreateValueAddBundleResponse) {}
|
||||
@ -44,6 +49,7 @@ 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) {}
|
||||
|
||||
|
||||
@ -51,8 +57,9 @@ service Bundle {
|
||||
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) {} // 获取套餐使用记录列表
|
||||
@ -60,11 +67,13 @@ 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) {} // 更新对账单
|
||||
}
|
||||
message DeleteValueAddServiceRequest{
|
||||
string orderNo = 1;
|
||||
@ -237,6 +246,7 @@ 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"];
|
||||
@ -247,9 +257,15 @@ message BundleProfileLang {
|
||||
string language = 6 [json_name = "language"];
|
||||
string createdAt = 7 [json_name = "createdAt"];
|
||||
string updatedAt = 8 [json_name = "updatedAt"];
|
||||
//string bgImg1 = 9 [json_name = "bgImg1"];
|
||||
//string bgImg2 = 10 [json_name = "bgImg2"];
|
||||
// int64 sort = 11 [json_name = "sort"];
|
||||
string contract = 9 [json_name = "contract"];
|
||||
string companySign = 10 [json_name = "companySign"];
|
||||
int64 contractDuration = 11 [json_name = "contractDuration"];
|
||||
string fontColor = 12 [json_name = "fontColor"];
|
||||
int64 sort = 13 [json_name = "sort"];
|
||||
string bgImg1 = 14 [json_name = "bgImg1"];
|
||||
string bgImg2 = 15 [json_name = "bgImg2"];
|
||||
int64 shelfStatus = 16 [json_name = "shelfStatus"]; // 1 上架 2 下架
|
||||
int32 imgOption = 17 [json_name = "imgOption"];
|
||||
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
|
||||
}
|
||||
message SaveResponse {
|
||||
@ -261,6 +277,8 @@ 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"];
|
||||
@ -334,7 +352,14 @@ message OrderRecord {
|
||||
repeated PriceOptionsInfo priceOptionsInfo = 36 [json_name = "priceOptionsInfo"];
|
||||
string expirationTime = 37 [json_name = "expirationTime"];
|
||||
string snapshot = 38 [json_name = "snapshot"];
|
||||
repeated AddInfo addInfos = 39 [json_name = "addInfos"];
|
||||
}
|
||||
message AddInfo{
|
||||
string orderNo = 1 [json_name = "orderNo"];
|
||||
int32 num = 2 [json_name = "num"];
|
||||
string valueAddUUID = 3 [json_name = "valueAddUUID"];
|
||||
}
|
||||
|
||||
message OrderAddRecord{
|
||||
string bundleUuid = 1 [json_name = "bundleUuid"];
|
||||
repeated AddPriceOptionsInfo addPriceOptionsList = 2 [json_name = "addPriceOptionsList"];
|
||||
@ -521,6 +546,14 @@ 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{
|
||||
@ -533,8 +566,10 @@ message BundleExtendRequest{
|
||||
uint32 timeUnit = 7; // 1 日 2 月 3年
|
||||
string remark = 8;
|
||||
string associatedorderNumber = 9;
|
||||
string operatorName = 10;
|
||||
string operatorPhoneNumber = 11;
|
||||
uint64 operatorId = 10;
|
||||
string operatorName = 11;
|
||||
string operatorPhoneNumber = 12;
|
||||
int32 type = 13;
|
||||
}
|
||||
|
||||
message BundleExtendResponse{
|
||||
@ -576,10 +611,11 @@ message GetBundleBalanceListReq{
|
||||
string userName = 1;
|
||||
int32 status = 2;
|
||||
string bundleName = 3;
|
||||
int64 expiredTimeStart = 4;
|
||||
int64 expiredTimeEnd = 5;
|
||||
int32 page = 6;
|
||||
int32 pageSize = 7;
|
||||
int32 bought = 4;
|
||||
int64 expiredTimeStart = 5;
|
||||
int64 expiredTimeEnd = 6;
|
||||
int32 page = 7;
|
||||
int32 pageSize = 8;
|
||||
}
|
||||
|
||||
message GetBundleBalanceReq{
|
||||
@ -608,11 +644,9 @@ 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;
|
||||
@ -658,7 +692,7 @@ message AddBundleBalanceResp{
|
||||
message GetUsedRecordListReq{
|
||||
string user = 1;
|
||||
string operator = 2;
|
||||
int32 account = 3;
|
||||
string account = 3;
|
||||
int32 platform = 4;
|
||||
int32 type = 5;
|
||||
string title = 6;
|
||||
@ -681,7 +715,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; // 作品标题
|
||||
@ -718,16 +752,82 @@ message ToBeComfirmedWorksReq{
|
||||
int32 pageSize =3;
|
||||
}
|
||||
|
||||
message ToBeComfirmedWorksResp{
|
||||
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 workItem{
|
||||
string uuid = 1;
|
||||
string workUuid = 2;
|
||||
string title = 3;
|
||||
string content = 4;
|
||||
uint32 workCategory = 5;
|
||||
uint32 workStatus = 6;
|
||||
string platformIds = 7;
|
||||
string mediaNames = 8;
|
||||
string mediaAccUserIds = 9;
|
||||
int64 confirmedAt = 10;
|
||||
int64 createdAt = 11; // 提交时间
|
||||
string artistName = 12;
|
||||
string artistUuid = 13;
|
||||
}
|
||||
|
||||
message ToBeComfirmedWorksResp{
|
||||
int64 total = 1;
|
||||
int64 unconfirmed = 2;
|
||||
repeated workItem data = 3;
|
||||
}
|
||||
|
||||
message GetBundleBalanceByUserIdReq{
|
||||
int32 userId = 1;
|
||||
}
|
||||
|
||||
message GetBundleBalanceByUserIdResp{
|
||||
string orderUUID = 1;
|
||||
string bundleUuid = 2; // 套餐ID uuid
|
||||
string bundleName = 3; // 套餐名称
|
||||
string bundleStatus = 4; // 套餐名称
|
||||
int64 payTime = 5;
|
||||
int64 expiredTime = 6;
|
||||
string paymentAmount = 7;
|
||||
int32 paymentType = 8;
|
||||
int32 accountNumber = 9;
|
||||
int32 accountAdditional = 10;
|
||||
int32 accountConsumptionNumber = 11;
|
||||
int32 videoNumber = 12;
|
||||
int32 videoAdditional = 13;
|
||||
int32 videoConsumptionNumber = 14;
|
||||
int32 imageNumber = 15;
|
||||
int32 imageAdditional = 16;
|
||||
int32 imageConsumptionNumber = 17;
|
||||
int32 dataAnalysisNumber = 18;
|
||||
int32 dataAnalysisAdditional = 19;
|
||||
int32 dataAnalysisConsumptionNumber = 20;
|
||||
int32 expansionPacksNumber = 21;
|
||||
}
|
||||
|
||||
message OnlyAddValueListByOrderNoRequest{
|
||||
string orderNo = 1;
|
||||
}
|
||||
|
||||
message OnlyAddValueListByOrderNoResp{
|
||||
repeated AddBundleInfo AddBundleInfos = 1;
|
||||
}
|
||||
|
||||
message AddBundleInfo {
|
||||
string customerID = 1;
|
||||
float amount = 2;
|
||||
string checkOutSessionId = 3;
|
||||
string orderNo = 4;
|
||||
int32 paymentStatus = 5;
|
||||
}
|
||||
|
||||
message UpdateStatusAndPayTimeBySerialNumber {
|
||||
string serialNumber = 1;
|
||||
string payTime = 2;
|
||||
int32 paymentStatus = 3;
|
||||
}
|
||||
|
||||
message ConfirmWorkReq{
|
||||
string workUuid = 1;
|
||||
}
|
||||
|
||||
message ConfirmWorkResp{
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -159,6 +159,16 @@ func (this *OrderRecord) Validate() error {
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, item := range this.AddInfos {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("AddInfos", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *AddInfo) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *OrderAddRecord) Validate() error {
|
||||
@ -296,6 +306,19 @@ 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
|
||||
}
|
||||
@ -327,16 +350,6 @@ 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 {
|
||||
@ -390,6 +403,47 @@ func (this *GetVedioeWorkDetailResp) Validate() error {
|
||||
func (this *ToBeComfirmedWorksReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ToBeComfirmedWorksResp) Validate() error {
|
||||
func (this *WorkItem) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ToBeComfirmedWorksResp) Validate() error {
|
||||
for _, item := range this.Data {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Data", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *GetBundleBalanceByUserIdReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *GetBundleBalanceByUserIdResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *OnlyAddValueListByOrderNoRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *OnlyAddValueListByOrderNoResp) Validate() error {
|
||||
for _, item := range this.AddBundleInfos {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("AddBundleInfos", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *AddBundleInfo) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UpdateStatusAndPayTimeBySerialNumber) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ConfirmWorkReq) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ConfirmWorkResp) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ 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)
|
||||
@ -47,6 +49,7 @@ type BundleClient interface {
|
||||
PackagePriceAndTime(ctx context.Context, in *OrderRecord, opts ...grpc_go.CallOption) (*PackagePriceAndTimeResponse, common.ErrorWithAttachment)
|
||||
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)
|
||||
@ -57,11 +60,13 @@ type BundleClient interface {
|
||||
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)
|
||||
// 使用记录
|
||||
@ -69,10 +74,12 @@ 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)
|
||||
}
|
||||
|
||||
type bundleClient struct {
|
||||
@ -80,46 +87,53 @@ type bundleClient struct {
|
||||
}
|
||||
|
||||
type BundleClientImpl struct {
|
||||
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
|
||||
HandShelf func(ctx context.Context, in *HandShelfRequest) (*CommonResponse, error)
|
||||
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)
|
||||
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)
|
||||
UpdateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||
UpdateOrderRecordByOrderNo func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||
OrderRecordsList func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error)
|
||||
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
||||
UpdateFinancialConfirmationStatus func(ctx context.Context, in *FinancialConfirmationRequest) (*CommonResponse, error)
|
||||
CreateOrderAddRecord func(ctx context.Context, in *OrderAddRecord) (*CommonResponse, error)
|
||||
PackagePriceAndTime func(ctx context.Context, in *OrderRecord) (*PackagePriceAndTimeResponse, error)
|
||||
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||
SaveValueAddService func(ctx context.Context, in *ValueAddServiceLang) (*SaveResponse, error)
|
||||
ValueAddServiceList func(ctx context.Context, in *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
CreateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
UpdateBundle func(ctx context.Context, in *BundleProfile) (*CommonResponse, error)
|
||||
DeleteBundle func(ctx context.Context, in *DelBundleRequest) (*CommonResponse, error)
|
||||
HandShelf func(ctx context.Context, in *HandShelfRequest) (*CommonResponse, error)
|
||||
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)
|
||||
UpdateOrderRecord func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||
UpdateOrderRecordByOrderNo func(ctx context.Context, in *OrderRecord) (*CommonResponse, error)
|
||||
OrderRecordsList func(ctx context.Context, in *OrderRecordsRequest) (*OrderRecordsResponse, error)
|
||||
OrderRecordsDetail func(ctx context.Context, in *OrderRecordsDetailRequest) (*OrderRecordsDetailResponse, error)
|
||||
UpdateFinancialConfirmationStatus func(ctx context.Context, in *FinancialConfirmationRequest) (*CommonResponse, error)
|
||||
CreateOrderAddRecord func(ctx context.Context, in *OrderAddRecord) (*CommonResponse, error)
|
||||
PackagePriceAndTime func(ctx context.Context, in *OrderRecord) (*PackagePriceAndTimeResponse, error)
|
||||
OrderRecordsListV2 func(ctx context.Context, in *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||
OrderListByOrderNo func(ctx context.Context, in *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||
OnlyAddValueListByOrderNo func(ctx context.Context, in *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
||||
CreateValueAddBundle func(ctx context.Context, in *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||
ValueAddBundleList func(ctx context.Context, in *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||
ValueAddBundleDetail func(ctx context.Context, in *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||
SaveValueAddService func(ctx context.Context, in *ValueAddServiceLang) (*SaveResponse, error)
|
||||
ValueAddServiceList func(ctx context.Context, in *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
|
||||
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)
|
||||
}
|
||||
|
||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||
@ -176,6 +190,18 @@ 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)
|
||||
@ -248,6 +274,12 @@ func (c *bundleClient) OrderListByOrderNo(ctx context.Context, in *OrderInfoByOr
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OrderListByOrderNo", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) OnlyAddValueListByOrderNo(ctx context.Context, in *OnlyAddValueListByOrderNoRequest, opts ...grpc_go.CallOption) (*OnlyAddValueListByOrderNoResp, common.ErrorWithAttachment) {
|
||||
out := new(OnlyAddValueListByOrderNoResp)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/OnlyAddValueListByOrderNo", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) CreateValueAddBundle(ctx context.Context, in *CreateValueAddBundleRequest, opts ...grpc_go.CallOption) (*CreateValueAddBundleResponse, common.ErrorWithAttachment) {
|
||||
out := new(CreateValueAddBundleResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
@ -296,6 +328,12 @@ 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)
|
||||
@ -320,6 +358,12 @@ 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)
|
||||
@ -356,6 +400,12 @@ 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)
|
||||
@ -374,6 +424,12 @@ func (c *bundleClient) UpdateReconciliation(ctx context.Context, in *Reconciliat
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateReconciliation", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) UpdateReconciliationStatusBySerialNumber(ctx context.Context, in *UpdateStatusAndPayTimeBySerialNumber, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||
out := new(CommonResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateReconciliationStatusBySerialNumber", in, out)
|
||||
}
|
||||
|
||||
// BundleServer is the server API for Bundle service.
|
||||
// All implementations must embed UnimplementedBundleServer
|
||||
// for forward compatibility
|
||||
@ -385,6 +441,8 @@ 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)
|
||||
@ -397,6 +455,7 @@ type BundleServer interface {
|
||||
PackagePriceAndTime(context.Context, *OrderRecord) (*PackagePriceAndTimeResponse, error)
|
||||
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)
|
||||
@ -407,11 +466,13 @@ type BundleServer interface {
|
||||
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)
|
||||
// 使用记录
|
||||
@ -419,10 +480,12 @@ 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)
|
||||
mustEmbedUnimplementedBundleServer()
|
||||
}
|
||||
|
||||
@ -452,6 +515,12 @@ 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")
|
||||
}
|
||||
@ -488,6 +557,9 @@ func (UnimplementedBundleServer) OrderRecordsListV2(context.Context, *OrderRecor
|
||||
func (UnimplementedBundleServer) OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OrderListByOrderNo not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OnlyAddValueListByOrderNo not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateValueAddBundle not implemented")
|
||||
}
|
||||
@ -512,6 +584,9 @@ 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")
|
||||
}
|
||||
@ -524,6 +599,9 @@ 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")
|
||||
}
|
||||
@ -542,6 +620,9 @@ 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")
|
||||
}
|
||||
@ -551,6 +632,9 @@ func (UnimplementedBundleServer) CreateReconciliation(context.Context, *Reconcil
|
||||
func (UnimplementedBundleServer) UpdateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateReconciliation not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) UpdateReconciliationStatusBySerialNumber(context.Context, *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateReconciliationStatusBySerialNumber not implemented")
|
||||
}
|
||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
@ -782,6 +866,64 @@ 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 {
|
||||
@ -1130,6 +1272,35 @@ func _Bundle_OrderListByOrderNo_Handler(srv interface{}, ctx context.Context, de
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_OnlyAddValueListByOrderNo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(OnlyAddValueListByOrderNoRequest)
|
||||
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("OnlyAddValueListByOrderNo", 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_CreateValueAddBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateValueAddBundleRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@ -1362,6 +1533,35 @@ 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 {
|
||||
@ -1478,6 +1678,35 @@ 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 {
|
||||
@ -1652,6 +1881,35 @@ 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 {
|
||||
@ -1739,6 +1997,35 @@ func _Bundle_UpdateReconciliation_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_UpdateReconciliationStatusBySerialNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateStatusAndPayTimeBySerialNumber)
|
||||
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("UpdateReconciliationStatusBySerialNumber", 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)
|
||||
@ -1774,6 +2061,14 @@ 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,
|
||||
@ -1822,6 +2117,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "OrderListByOrderNo",
|
||||
Handler: _Bundle_OrderListByOrderNo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "OnlyAddValueListByOrderNo",
|
||||
Handler: _Bundle_OnlyAddValueListByOrderNo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateValueAddBundle",
|
||||
Handler: _Bundle_CreateValueAddBundle_Handler,
|
||||
@ -1854,6 +2153,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "CalculatePrice",
|
||||
Handler: _Bundle_CalculatePrice_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "BatchGetValueAddServiceLang",
|
||||
Handler: _Bundle_BatchGetValueAddServiceLang_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteValueAddService",
|
||||
Handler: _Bundle_DeleteValueAddService_Handler,
|
||||
@ -1870,6 +2173,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "GetBundleBalanceList",
|
||||
Handler: _Bundle_GetBundleBalanceList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBundleBalanceByUserId",
|
||||
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateBundleBalance",
|
||||
Handler: _Bundle_CreateBundleBalance_Handler,
|
||||
@ -1894,6 +2201,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "ToBeComfirmedWorks",
|
||||
Handler: _Bundle_ToBeComfirmedWorks_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ConfirmWork",
|
||||
Handler: _Bundle_ConfirmWork_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetReconciliationList",
|
||||
Handler: _Bundle_GetReconciliationList_Handler,
|
||||
@ -1906,6 +2217,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "UpdateReconciliation",
|
||||
Handler: _Bundle_UpdateReconciliation_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateReconciliationStatusBySerialNumber",
|
||||
Handler: _Bundle_UpdateReconciliationStatusBySerialNumber_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/bundle.proto",
|
||||
|
@ -15,7 +15,7 @@ const (
|
||||
ZH_TW = "zh-TW" //繁体中文
|
||||
EN = "EN" //英文
|
||||
DE_DE = "de-DE" //德语
|
||||
JS_JP = "js-JP" //日语
|
||||
JA_JP = "ja-JP" //日语
|
||||
)
|
||||
|
||||
const (
|
||||
|
Loading…
Reference in New Issue
Block a user