Compare commits
146 Commits
feat-zjy-i
...
main
Author | SHA1 | Date | |
---|---|---|---|
24102eccbd | |||
383a64077d | |||
68dd832b32 | |||
346dcb1d94 | |||
de204751ac | |||
744328055c | |||
234d86896a | |||
402a7644e6 | |||
841ec173c4 | |||
87b7805c42 | |||
d5e4c9590f | |||
e9f12cd0eb | |||
e7a5e19472 | |||
76e2b893a1 | |||
0f40072e22 | |||
57a3154634 | |||
a556777369 | |||
4ec5bb8915 | |||
335a61d6e7 | |||
b06d06c8e2 | |||
1f1fbed3a8 | |||
9c3c441eda | |||
8fe858aa03 | |||
f3e29cb7e8 | |||
ae4bbe29c0 | |||
bfc409ed70 | |||
a01be125e6 | |||
7c0027f624 | |||
397dd56761 | |||
0a4218757e | |||
26eb0df464 | |||
b9313b9ba2 | |||
4f9b72928b | |||
7468c2f442 | |||
9c9e9c0663 | |||
e4a9c3ac4d | |||
92c8e4d574 | |||
1b5b6037fd | |||
1885d2b8dc | |||
f55af5f719 | |||
668b7eb06e | |||
56c17a709f | |||
043274e61f | |||
0167e40f9e | |||
eca1a2329e | |||
3c1984be81 | |||
46a6c5723f | |||
f02601e5e8 | |||
bfa9fc4026 | |||
fb3b33a817 | |||
70c4eacce4 | |||
52d9baf2e6 | |||
ed0f0c9584 | |||
f82a96907c | |||
24c701d9a1 | |||
37bae4398d | |||
d3b82f4352 | |||
75a75e9480 | |||
8528412c33 | |||
d0dfb7ff96 | |||
4e2faf05cb | |||
c6a65f4589 | |||
5753c952f4 | |||
a6d315a283 | |||
9e36dfde6b | |||
9f5798c2be | |||
952caaaf91 | |||
e26829e19b | |||
089d8af480 | |||
bff2938313 | |||
0fae4587d8 | |||
2d9d620062 | |||
97c4bda203 | |||
14415f07f5 | |||
3bc6a5caa0 | |||
f933e4887f | |||
94e5c77f90 | |||
53a407cc1c | |||
d95dccf7c0 | |||
bcdb764522 | |||
99c4b85a62 | |||
16f5e1f7ec | |||
0429854814 | |||
9b6549f141 | |||
d85bfa4fa0 | |||
f612f8ad23 | |||
fbea508cfe | |||
33073667e8 | |||
02d0de5dad | |||
ac14519c91 | |||
bdc9706125 | |||
734c0b2c1f | |||
75aad32c7e | |||
51e3d24f23 | |||
fec7641edb | |||
0dce0b80a6 | |||
0057fa5856 | |||
e081b5f23b | |||
b151326427 | |||
e7727141d8 | |||
5086802f1b | |||
fdf2d5a09b | |||
c537e1e50c | |||
3d226f9c8d | |||
a6fddccda9 | |||
53fdc7c4b6 | |||
eac7c759f6 | |||
000de78286 | |||
df0b742168 | |||
a71942b0d4 | |||
370f0a08c1 | |||
90928cf5c8 | |||
3cce79adab | |||
6107e35aca | |||
4c027c4a08 | |||
2a137ad3fb | |||
3fae4f4ab7 | |||
32de65196b | |||
379cc1b1e7 | |||
0c5ffdcc90 | |||
412350cf8a | |||
8a14905343 | |||
8793f023c9 | |||
9bffde4a62 | |||
8b2e7c541e | |||
07b6296867 | |||
8c36da313e | |||
1d9b8bda3a | |||
2fe368cace | |||
7367bf1639 | |||
6c7a1f9d44 | |||
21504e78f2 | |||
e6eb835a01 | |||
74277a50ef | |||
3e6382481c | |||
459ae0d6fb | |||
edbe9f2c0a | |||
99f04c1de2 | |||
ed66051786 | |||
c4ef0b5f96 | |||
f042ca7891 | |||
497bdf894d | |||
c79569b421 | |||
abb53ac651 | |||
39a172f3dd | |||
15e313f053 |
@ -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[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.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[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."}
|
||||||
|
@ -112,3 +112,18 @@ func (b *BundleProvider) OnlyAddValueListByOrderNo(_ context.Context, req *bundl
|
|||||||
func (b *BundleProvider) UpdateReconciliationStatusBySerialNumber(_ context.Context, req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
|
func (b *BundleProvider) UpdateReconciliationStatusBySerialNumber(_ context.Context, req *bundle.UpdateStatusAndPayTimeBySerialNumber) (res *bundle.CommonResponse, err error) {
|
||||||
return logic.UpdateReconciliationStatusBySerialNumber(req)
|
return logic.UpdateReconciliationStatusBySerialNumber(req)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除订单
|
||||||
|
func (b *BundleProvider) DeleteValueAddService(_ context.Context, req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
return logic.DeleteValueAddService(req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自动创建用户且实名且下订单
|
||||||
|
func (b *BundleProvider) ListUnfinishedInfos(_ context.Context, req *bundle.AutoCreateUserAndOrderRequest) (res *bundle.UnfinishedInfos, err error) {
|
||||||
|
return logic.ListUnfinishedInfos(req)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自动创建用户且实名且下订单
|
||||||
|
func (b *BundleProvider) SoftDeleteUnfinishedInfo(_ context.Context, req *bundle.SoftDeleteUnfinishedInfoRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
return logic.SoftDeleteUnfinishedInfo(req)
|
||||||
|
}
|
||||||
|
@ -4,9 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"micro-bundle/internal/logic"
|
"micro-bundle/internal/logic"
|
||||||
"micro-bundle/pb/bundle"
|
"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) {
|
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)
|
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) {
|
func (b *BundleProvider) CreateBundleBalance(_ context.Context, req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) {
|
||||||
return logic.CreateBundleBalance(req)
|
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) {
|
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) {
|
func (b *BundleProvider) BundleDetailV2(_ context.Context, req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
||||||
return logic.BundleDetailV2(req)
|
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) {
|
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) {
|
func (b *BundleProvider) CalculatePrice(ctx context.Context, req *bundle.CalculatePriceRequest) (res *bundle.CalculatePriceResponse, err error) {
|
||||||
return logic.CalculatePrice(req)
|
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)
|
bundles := make([]*model.BundleProfile, 0)
|
||||||
|
|
||||||
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Preload("BundleProfileLang")
|
query := app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Preload("BundleProfileLang")
|
||||||
//query = query.Where("shelf_status = ?", 1) //上架的
|
|
||||||
|
|
||||||
if req.Name != "" {
|
if req.Name != "" {
|
||||||
query = query.Where("name like ?", "%"+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 {
|
if err = query.Preload("BundleToValueAddService").Find(&bundles).Error; err != nil {
|
||||||
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐列表失败: ")
|
return res, commonErr.ReturnError(err, msg.ErrorGetBundleList, "获取套餐列表失败: ")
|
||||||
}
|
}
|
||||||
if bundles != nil && len(bundles) > 0 {
|
if len(bundles) > 0 {
|
||||||
for _, bundleProfile := range bundles {
|
for _, bundleProfile := range bundles {
|
||||||
selectValueAddService := make([]*bundle.SelectValueAddService, 0)
|
selectValueAddService := make([]*bundle.SelectValueAddService, 0)
|
||||||
if bundleProfile.BundleToValueAddService != nil {
|
if bundleProfile.BundleToValueAddService != nil {
|
||||||
@ -173,7 +172,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
bundleProfileLang := []*bundle.BundleProfileLang{}
|
bundleProfileLang := []*bundle.BundleProfileLang{}
|
||||||
if bundleProfile.BundleProfileLang != nil && len(bundleProfile.BundleProfileLang) > 0 {
|
if len(bundleProfile.BundleProfileLang) > 0 {
|
||||||
for _, lang := range bundleProfile.BundleProfileLang {
|
for _, lang := range bundleProfile.BundleProfileLang {
|
||||||
bpl := &bundle.BundleProfileLang{
|
bpl := &bundle.BundleProfileLang{
|
||||||
Uuid: lang.UUID,
|
Uuid: lang.UUID,
|
||||||
@ -207,6 +206,7 @@ func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse
|
|||||||
SelectValueAddService: selectValueAddService,
|
SelectValueAddService: selectValueAddService,
|
||||||
BundleProfileLang: bundleProfileLang,
|
BundleProfileLang: bundleProfileLang,
|
||||||
ShelfStatus: int64(bundleProfile.ShelfStatus),
|
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) {
|
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *model.BundleProfile, err error) {
|
||||||
var data model.BundleProfile
|
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("BundleProfileLang").
|
||||||
Preload("BundleToValueAddService").
|
Preload("BundleToValueAddService").
|
||||||
First(&data).Error
|
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) {
|
func HandShelf(uuid string, shelfStatus int64) (res *bundle.CommonResponse, err error) {
|
||||||
res = new(bundle.CommonResponse)
|
res = new(bundle.CommonResponse)
|
||||||
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", uuid).Update("shelf_status", shelfStatus).Error
|
err = app.ModuleClients.BundleDB.Model(&model.BundleProfile{}).Where("uuid = ?", uuid).Update("shelf_status", shelfStatus).Error
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = "套餐上下架操作失败"
|
res.Msg = "套餐上下架操作失败"
|
||||||
return res, err
|
return res, err
|
||||||
@ -247,7 +248,8 @@ func HandShelf(uuid string, shelfStatus int64) (res *bundle.CommonResponse, err
|
|||||||
|
|
||||||
// 通过uuid和language查询套餐语言表
|
// 通过uuid和language查询套餐语言表
|
||||||
func BundleDetailByUuidAndLanguage(uuid string, language string) (bundleProfileLang *model.BundleProfileLang, err error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
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) {
|
func TxUpdateBundle(tx *gorm.DB, uuid string, columns map[string]interface{}) (err error) {
|
||||||
err = tx.Model(&model.BundleProfile{}).Where("uuid =?", uuid).Updates(columns).Error
|
err = tx.Model(&model.BundleProfile{}).Where("uuid =?", uuid).Updates(columns).Error
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
func TxUpdateBundleLang(tx *gorm.DB, uuid string, language string, columns map[string]interface{}) (err error) {
|
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 {
|
if err != nil {
|
||||||
return commonErr.ReturnError(err, msg.ErrorUpdateBundleInfo, "更新套餐信息失败: ")
|
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 {
|
func CreateBundleToValueAddService(tx *gorm.DB, records []*model.BundleToValueAddService) error {
|
||||||
return tx.Model(&model.BundleToValueAddService{}).Create(&records).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 {
|
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) {
|
func GetValueAddServiceUuidsByBundleUuid(bundleUuid string) ([]string, error) {
|
||||||
var uuids []string
|
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
|
return uuids, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,7 +326,7 @@ func GetValueAddServiceUuidsByBundleUuid(bundleUuid string) ([]string, error) {
|
|||||||
func GetBundleToValueAddServiceByBundleUuid(bundleUuid string) ([]*model.BundleToValueAddService, error) {
|
func GetBundleToValueAddServiceByBundleUuid(bundleUuid string) ([]*model.BundleToValueAddService, error) {
|
||||||
var result []*model.BundleToValueAddService
|
var result []*model.BundleToValueAddService
|
||||||
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).
|
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).
|
||||||
Where("bundle_uuid = ?", bundleUuid).
|
Where("bundle_uuid = ? and deleted_at = 0", bundleUuid).
|
||||||
Find(&result).Error
|
Find(&result).Error
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
@ -310,8 +334,11 @@ func GetBundleToValueAddServiceByBundleUuid(bundleUuid string) ([]*model.BundleT
|
|||||||
func GetBundleLangsByUuid(uuid string) ([]*model.BundleProfileLang, error) {
|
func GetBundleLangsByUuid(uuid string) ([]*model.BundleProfileLang, error) {
|
||||||
var result []*model.BundleProfileLang
|
var result []*model.BundleProfileLang
|
||||||
err := app.ModuleClients.BundleDB.Model(&model.BundleProfileLang{}).
|
err := app.ModuleClients.BundleDB.Model(&model.BundleProfileLang{}).
|
||||||
Where("uuid =?", uuid).
|
Where("uuid =? and deleted_at = 0", uuid).
|
||||||
Find(&result).Error
|
Find(&result).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return result, err
|
return result, err
|
||||||
}
|
}
|
||||||
func GetBundleDetailByUuid(uuid string) (*model.BundleProfile, error) {
|
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 {
|
func CreateBunldeHistory(tx *gorm.DB, req *model.BundleProfileHistory) error {
|
||||||
return tx.Model(&model.BundleProfileHistory{}).Create(req).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 (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
@ -9,6 +10,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||||
"github.com/duke-git/lancet/v2/datetime"
|
"github.com/duke-git/lancet/v2/datetime"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
@ -21,14 +23,20 @@ func AddBundleExtendRecord(data model.BundleExtensionRecords) error {
|
|||||||
}
|
}
|
||||||
if data.AvailableDurationAdditional != 0 && data.TimeUnit != 0 {
|
if data.AvailableDurationAdditional != 0 && data.TimeUnit != 0 {
|
||||||
record := model.BundleOrderRecords{}
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
var expireTime time.Time
|
||||||
|
if record.ExpirationTime != "" {
|
||||||
|
loc, _ := time.LoadLocation("Asia/Shanghai")
|
||||||
|
et, _ := time.ParseInLocation(time.DateTime, record.ExpirationTime, loc)
|
||||||
|
expireTime = et
|
||||||
|
} else {
|
||||||
|
t, _ := time.Parse("2006-01-02 15:04:05", record.PayTime)
|
||||||
|
expireTime = t
|
||||||
|
logger.Infof("过期时间为空,使用默认过期时间" + expireTime.Format(time.DateTime))
|
||||||
|
}
|
||||||
|
|
||||||
expireTime, err := time.Parse(time.DateOnly, record.ExpirationTime)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
switch data.TimeUnit {
|
switch data.TimeUnit {
|
||||||
case 1:
|
case 1:
|
||||||
expireTime = datetime.AddDay(expireTime, int64(data.AvailableDurationAdditional))
|
expireTime = datetime.AddDay(expireTime, int64(data.AvailableDurationAdditional))
|
||||||
@ -39,45 +47,51 @@ func AddBundleExtendRecord(data model.BundleExtensionRecords) error {
|
|||||||
default:
|
default:
|
||||||
return errors.New("时间单位有误")
|
return errors.New("时间单位有误")
|
||||||
}
|
}
|
||||||
record.ExpirationTime = expireTime.Format(time.DateOnly)
|
record.ExpirationTime = expireTime.Format(time.DateTime)
|
||||||
err = tx.Model(&model.BundleOrderRecords{}).Save(&record).Error
|
return tx.Model(&model.BundleOrderRecords{}).Where(&model.BundleOrderRecords{UUID: record.UUID}).Updates(&record).Error
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data []model.BundleExtendRecordItemPo, total int64, err error) {
|
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(`
|
Select(`
|
||||||
ber.*,
|
ber.*,
|
||||||
u.nickname as user_name,
|
rn.name as user_name,
|
||||||
u.tel_num as user_phone_number
|
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 req.User != "" {
|
||||||
if utils.IsPhoneNumber(req.User) {
|
if utils.IsPhoneNumber(req.User) {
|
||||||
session = session.Where("u.tel_num = ?", req.User)
|
session = session.Where("u.tel_num = ?", req.User)
|
||||||
} else {
|
} else {
|
||||||
session = session.Where("u.nickname like ?", req.User)
|
session = session.Where("rn.name like ?", "%"+req.User+"%")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if req.Operator != "" {
|
if req.Operator != "" {
|
||||||
if utils.IsPhoneNumber(req.Operator) {
|
if utils.IsPhoneNumber(req.Operator) {
|
||||||
session = session.Where("ber.operator_phone_number = ?", req.Operator)
|
session = session.Where("ber.operator_phone_number = ?", req.Operator)
|
||||||
} else {
|
} else {
|
||||||
session = session.Where("ber.operator_name like ?", req.Operator)
|
session = session.Where("ber.operator_name like ?", "%"+req.Operator+"%")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if req.Type != 0 {
|
if req.Type != 0 {
|
||||||
session = session.Where("ber.`type` = ?", req.Type)
|
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 != "" {
|
if req.AssociatedOrderNumber != "" {
|
||||||
session = session.Where("ber.associated_order_number like ?", "%"+req.AssociatedOrderNumber+"%")
|
session = session.Where("ber.associated_order_number like ?", "%"+req.AssociatedOrderNumber+"%")
|
||||||
}
|
}
|
||||||
if err = session.Count(&total).Error; err != nil {
|
if err = session.Count(&total).Error; err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Page != 0 && req.PageSize != 0 {
|
if req.Page != 0 && req.PageSize != 0 {
|
||||||
session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
|
session = session.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
|
||||||
}
|
}
|
||||||
@ -86,30 +100,48 @@ func GetBundleExtendRecordList(req *bundle.BundleExtendRecordsListRequest) (data
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.BundleBalancePo, total int64, err error) {
|
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.BundleBalancePo, total int64, err error) {
|
||||||
session := app.ModuleClients.BundleDB.Table("fiee_bundle.bundle_balance AS bb").
|
subQuery := app.ModuleClients.BundleDB.Table("bundle_order_records as bor1").
|
||||||
Select(`
|
Select("bor1.*").
|
||||||
bb .*,
|
Joins(`INNER JOIN (
|
||||||
bor.expiration_time as expired_time,
|
SELECT customer_id, MAX(created_at) AS max_created_time
|
||||||
bor.bundle_name,
|
FROM bundle_order_records
|
||||||
bor.status,
|
GROUP BY customer_id
|
||||||
bor.uuid as order_uuid,
|
) bor2 ON bor1.customer_id = bor2.customer_id AND bor1.created_at = bor2.max_created_time`)
|
||||||
u.nickname as user_name,
|
session := app.ModuleClients.BundleDB.Table("`micro-account`.`user` AS u").
|
||||||
u.tel_num as user_phone_number
|
Select(`bb.*, bor.expiration_time as expired_time, bor.bundle_name, bor.status,
|
||||||
`).
|
bor.uuid as order_uuid, rn.name as user_name,
|
||||||
Joins("LEFT JOIN bundle_order_records bor on bor.customer_id = bb .user_id").
|
u.tel_num as user_phone_number, u.id as user_id`).
|
||||||
Joins("LEFT JOIN `micro-account`.`user` u on u.id = bb.user_id")
|
Joins("LEFT JOIN `micro-account`.real_name rn ON u.real_name_id = rn.id").
|
||||||
|
Joins("LEFT JOIN (?) as bor ON bor.customer_id = u.id", subQuery).
|
||||||
|
Joins("LEFT JOIN micro_bundle.bundle_balance bb ON u.id = bb.user_id AND bb.order_uuid = bor.uuid").
|
||||||
|
Where("rn.name IS NOT NULL").
|
||||||
|
Where("u.deleted_at = 0").
|
||||||
|
Order("bor.expiration_time desc")
|
||||||
if req.UserName != "" {
|
if 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 {
|
if req.Status != 0 {
|
||||||
session = session.Where("bor.status = ?", req.Status)
|
session = session.Where("bor.status = ?", req.Status)
|
||||||
}
|
}
|
||||||
|
if req.BundleName != "" {
|
||||||
|
session = session.Where("bor.bundle_name like ?", "%"+req.BundleName+"%")
|
||||||
|
}
|
||||||
if req.ExpiredTimeEnd != 0 {
|
if req.ExpiredTimeEnd != 0 {
|
||||||
session = session.Where("bor.expiration_time <= ?", time.UnixMilli(req.ExpiredTimeEnd))
|
session = session.Where("bor.expiration_time <= ?", time.UnixMilli(req.ExpiredTimeEnd))
|
||||||
}
|
}
|
||||||
if req.ExpiredTimeStart != 0 {
|
if req.ExpiredTimeStart != 0 {
|
||||||
session = session.Where("bor.expiration_time >= ?", time.UnixMilli(req.ExpiredTimeStart))
|
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
|
err = session.Count(&total).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
@ -121,6 +153,36 @@ func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (data []model.Bun
|
|||||||
return
|
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 {
|
func AddBundleBalanceByUserId(data model.BundleBalance) error {
|
||||||
return app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error {
|
return app.ModuleClients.BundleDB.Transaction(func(tx *gorm.DB) error {
|
||||||
oldData := model.BundleBalance{}
|
oldData := model.BundleBalance{}
|
||||||
@ -128,9 +190,7 @@ func AddBundleBalanceByUserId(data model.BundleBalance) error {
|
|||||||
return errors.New("用户还没有套餐信息")
|
return errors.New("用户还没有套餐信息")
|
||||||
}
|
}
|
||||||
newData := model.BundleBalance{
|
newData := model.BundleBalance{
|
||||||
Model: gorm.Model{
|
Model: oldData.Model,
|
||||||
ID: data.Model.ID,
|
|
||||||
},
|
|
||||||
UserId: oldData.UserId,
|
UserId: oldData.UserId,
|
||||||
OrderUUID: oldData.OrderUUID,
|
OrderUUID: oldData.OrderUUID,
|
||||||
AccountNumber: oldData.AccountNumber + data.AccountNumber,
|
AccountNumber: oldData.AccountNumber + data.AccountNumber,
|
||||||
@ -150,7 +210,7 @@ func AddBundleBalanceByUserId(data model.BundleBalance) error {
|
|||||||
newData.DataAnalysisConsumptionNumber > newData.DataAnalysisNumber {
|
newData.DataAnalysisConsumptionNumber > newData.DataAnalysisNumber {
|
||||||
return errors.New("套餐余量不足")
|
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 +224,10 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, tota
|
|||||||
session = session.Where("title = ?", req.Title)
|
session = session.Where("title = ?", req.Title)
|
||||||
}
|
}
|
||||||
if req.Platform != 0 {
|
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 {
|
if req.Account != "" {
|
||||||
session = session.Where("JSON_CONTAINS(media_names,?)", req.Account)
|
session = session.Where(fmt.Sprintf(`JSON_CONTAINS(media_names,'"%s"')`, req.Account))
|
||||||
}
|
}
|
||||||
if req.SubmitTimeEnd != 0 {
|
if req.SubmitTimeEnd != 0 {
|
||||||
session = session.Where("submit_time <= ?", time.UnixMilli(req.SubmitTimeEnd))
|
session = session.Where("submit_time <= ?", time.UnixMilli(req.SubmitTimeEnd))
|
||||||
@ -198,7 +258,7 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (data []model.CostLog, tota
|
|||||||
if req.Page != 0 && req.PageSize != 0 {
|
if req.Page != 0 && req.PageSize != 0 {
|
||||||
session = session.Offset(int(req.Page-1) * int(req.PageSize)).Limit(int(req.PageSize))
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,8 +272,38 @@ func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (data model.CastWorkV
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWork, err error) {
|
func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (data []model.CastWorkLog, total int64, unconfirmed int64, err error) {
|
||||||
// // app.ModuleClients.BundleDB.Where(&model.CastWork{
|
unConfirmSubQuery := app.ModuleClients.BundleDB.
|
||||||
// // ArtistUuid: req.ArtistUuid,
|
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.CheckoutSessionId = orderRecord.CheckoutSessionId
|
||||||
valueAdd.CheckoutSessionUrl = orderRecord.CheckoutSessionUrl
|
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{}).
|
err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||||
Where("order_no = ?", orderRecord.OrderNo).
|
Where("order_no = ?", orderRecord.OrderNo).
|
||||||
Updates(valueAdd).Error
|
Updates(valueAdd).Error
|
||||||
@ -273,7 +289,10 @@ func OrderRecordDetail(req *bundle.OrderRecordsDetailRequest) (res *bundle.Order
|
|||||||
if req.BundleUUID != "" {
|
if req.BundleUUID != "" {
|
||||||
query = query.Where("bundle_uuid = ?", req.BundleUUID)
|
query = query.Where("bundle_uuid = ?", req.BundleUUID)
|
||||||
}
|
}
|
||||||
err = query.Order("expiration_time desc").First(&orderRecord).Error
|
if req.Status != 0 {
|
||||||
|
query = query.Where("status = ?", req.Status)
|
||||||
|
}
|
||||||
|
err = query.Order("created_at desc").First(&orderRecord).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, commonErr.ReturnError(err, msg.ErrorGetOrderInfo, "获取订单信息失败: ")
|
return res, commonErr.ReturnError(err, msg.ErrorGetOrderInfo, "获取订单信息失败: ")
|
||||||
}
|
}
|
||||||
@ -449,6 +468,9 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
|
|||||||
if req.OrderAddCreateAtStart != "" && req.OrderAddCreateAtEnd != "" {
|
if req.OrderAddCreateAtStart != "" && req.OrderAddCreateAtEnd != "" {
|
||||||
modelObj = modelObj.Where("bundle_order_records.created_at between ? and ?", req.OrderAddCreateAtStart, req.OrderAddCreateAtEnd)
|
modelObj = modelObj.Where("bundle_order_records.created_at between ? and ?", req.OrderAddCreateAtStart, req.OrderAddCreateAtEnd)
|
||||||
}
|
}
|
||||||
|
if req.BundlePayStart != "" && req.BundlePayEnd != "" {
|
||||||
|
modelObj = modelObj.Where("bundle_order_records.pay_time between ? and ?", req.BundlePayStart, req.BundlePayEnd)
|
||||||
|
}
|
||||||
err = modelObj.Count(&count).Error
|
err = modelObj.Count(&count).Error
|
||||||
if req.PageSize != 0 && req.Page != 0 {
|
if req.PageSize != 0 && req.Page != 0 {
|
||||||
modelObj = modelObj.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
|
modelObj = modelObj.Limit(int(req.PageSize)).Offset(int(req.Page-1) * int(req.PageSize))
|
||||||
@ -464,6 +486,7 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
|
|||||||
}
|
}
|
||||||
for _, record := range records {
|
for _, record := range records {
|
||||||
customerID, _ := strconv.ParseInt(record.CustomerID, 10, 64)
|
customerID, _ := strconv.ParseInt(record.CustomerID, 10, 64)
|
||||||
|
|
||||||
orderItem := &bundle.OrderBundleRecordInfo{
|
orderItem := &bundle.OrderBundleRecordInfo{
|
||||||
OrderNo: record.OrderNo,
|
OrderNo: record.OrderNo,
|
||||||
BundleName: record.BundleName,
|
BundleName: record.BundleName,
|
||||||
@ -473,30 +496,24 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
|
|||||||
BundleCreateAt: record.CreatedAt.Format("2006-01-02 15:04:05"),
|
BundleCreateAt: record.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||||
Amount: record.Amount,
|
Amount: record.Amount,
|
||||||
CustomerId: customerID,
|
CustomerId: customerID,
|
||||||
|
PayTime: record.PayTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建子订单 map,按 orderAddNo 聚合
|
// 聚合子订单
|
||||||
addMap := make(map[string]*bundle.OrderAddBundleRecordInfo)
|
addMap := make(map[string]*bundle.OrderAddBundleRecordInfo)
|
||||||
|
|
||||||
for _, sub := range record.BundleOrderValueAdd {
|
for _, sub := range record.BundleOrderValueAdd {
|
||||||
orderAddNo := sub.OrderNo
|
orderAddNo := sub.OrderNo
|
||||||
|
amount := float32(sub.Amount)
|
||||||
// SettlementAmount 规则
|
|
||||||
settlementAmount := float32(sub.Amount)
|
|
||||||
if sub.OrderNo == record.OrderNo {
|
|
||||||
settlementAmount = record.TotalAmount
|
|
||||||
}
|
|
||||||
|
|
||||||
if existing, ok := addMap[orderAddNo]; ok {
|
if existing, ok := addMap[orderAddNo]; ok {
|
||||||
existing.Amount += float32(sub.Amount)
|
existing.Amount += amount
|
||||||
existing.SettlementAmount += settlementAmount
|
|
||||||
} else {
|
} else {
|
||||||
addMap[orderAddNo] = &bundle.OrderAddBundleRecordInfo{
|
addMap[orderAddNo] = &bundle.OrderAddBundleRecordInfo{
|
||||||
OrderAddNo: orderAddNo,
|
OrderAddNo: orderAddNo,
|
||||||
Amount: float32(sub.Amount),
|
Amount: amount,
|
||||||
SettlementAmount: settlementAmount,
|
|
||||||
CurrencyType: int32(sub.CurrencyType),
|
CurrencyType: int32(sub.CurrencyType),
|
||||||
//HandlingFee: float32(sub.HandlingFee),
|
HandlingFee: sub.HandlingFee, //手续费
|
||||||
//ExchangeRate: float32(sub.ExchangeRate),
|
|
||||||
OrderAddCreateAt: sub.CreatedAt.Format("2006-01-02 15:04:05"),
|
OrderAddCreateAt: sub.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||||
AddPayStatus: int32(sub.PaymentStatus),
|
AddPayStatus: int32(sub.PaymentStatus),
|
||||||
Contract: sub.SignContract,
|
Contract: sub.SignContract,
|
||||||
@ -507,10 +524,16 @@ func OrderRecordsListV2(req *bundle.OrderRecordsRequestV2) (res *bundle.OrderRec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将聚合后的子订单添加到主订单返回结构中
|
// 设置 SettlementAmount 并追加到主订单中
|
||||||
for _, v := range addMap {
|
for orderAddNo, addInfo := range addMap {
|
||||||
orderItem.AddBundleInfo = append(orderItem.AddBundleInfo, v)
|
if orderAddNo == record.OrderNo {
|
||||||
|
addInfo.SettlementAmount = record.TotalAmount
|
||||||
|
} else {
|
||||||
|
addInfo.SettlementAmount = addInfo.Amount
|
||||||
}
|
}
|
||||||
|
orderItem.AddBundleInfo = append(orderItem.AddBundleInfo, addInfo)
|
||||||
|
}
|
||||||
|
|
||||||
res.BundleInfo = append(res.BundleInfo, orderItem)
|
res.BundleInfo = append(res.BundleInfo, orderItem)
|
||||||
}
|
}
|
||||||
res.Total = int32(count)
|
res.Total = int32(count)
|
||||||
@ -540,6 +563,7 @@ func OrderListByOrderNo(req *bundle.OrderInfoByOrderNoRequest) (*bundle.OrderInf
|
|||||||
Type: int32(addOrder[0].Source),
|
Type: int32(addOrder[0].Source),
|
||||||
UserId: uint64(userID),
|
UserId: uint64(userID),
|
||||||
OrderUUID: addOrder[0].OrderUUID,
|
OrderUUID: addOrder[0].OrderUUID,
|
||||||
|
UserName: addOrder[0].CustomerName,
|
||||||
}
|
}
|
||||||
for _, item := range addOrder {
|
for _, item := range addOrder {
|
||||||
switch item.ServiceType {
|
switch item.ServiceType {
|
||||||
@ -582,8 +606,11 @@ func GetReconciliationList(req *bundle.GetReconciliationListReq) (*bundle.GetRec
|
|||||||
if req.PayChannel != 0 {
|
if req.PayChannel != 0 {
|
||||||
modelObj = modelObj.Where("pay_channel = ?", req.PayChannel)
|
modelObj = modelObj.Where("pay_channel = ?", req.PayChannel)
|
||||||
}
|
}
|
||||||
if req.OrderNo != "" {
|
if req.BundleOrderOn != "" {
|
||||||
modelObj = modelObj.Where("order_no like ?", "%"+req.OrderNo+"%")
|
modelObj = modelObj.Where("bundle_order_on like ?", "%"+req.BundleOrderOn+"%")
|
||||||
|
}
|
||||||
|
if req.BundleAddOrderOn != "" {
|
||||||
|
modelObj = modelObj.Where("bundle_add_order_on like ?", "%"+req.BundleAddOrderOn+"%")
|
||||||
}
|
}
|
||||||
if req.CreatedStart != "" && req.CreatedEnd != "" {
|
if req.CreatedStart != "" && req.CreatedEnd != "" {
|
||||||
modelObj = modelObj.Where("created_at between ? and ?", req.CreatedStart, req.CreatedEnd)
|
modelObj = modelObj.Where("created_at between ? and ?", req.CreatedStart, req.CreatedEnd)
|
||||||
@ -602,7 +629,7 @@ func GetReconciliationList(req *bundle.GetReconciliationListReq) (*bundle.GetRec
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
offset := (req.Page - 1) * req.PageSize
|
offset := (req.Page - 1) * req.PageSize
|
||||||
if err := modelObj.Offset(int(offset)).Limit(int(req.PageSize)).Find(&records).Error; err != nil {
|
if err := modelObj.Offset(int(offset)).Limit(int(req.PageSize)).Order("created_at desc").Find(&records).Error; err != nil {
|
||||||
return nil, fmt.Errorf("查询记录失败: %v", err)
|
return nil, fmt.Errorf("查询记录失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -636,6 +663,7 @@ func CreateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
|
|||||||
PayStatus: int(req.PayStatus),
|
PayStatus: int(req.PayStatus),
|
||||||
SerialNumber: req.SerialNumber,
|
SerialNumber: req.SerialNumber,
|
||||||
CreationTime: time.Now().Format("2006-01-02 15:04:05"),
|
CreationTime: time.Now().Format("2006-01-02 15:04:05"),
|
||||||
|
HandlingFee: req.HandlingFee,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建记录
|
// 创建记录
|
||||||
@ -666,6 +694,7 @@ func UpdateReconciliation(req *bundle.ReconciliationInfo) (res *bundle.CommonRes
|
|||||||
PayTime: req.PayTime,
|
PayTime: req.PayTime,
|
||||||
PayStatus: int(req.PayStatus),
|
PayStatus: int(req.PayStatus),
|
||||||
SerialNumber: req.SerialNumber,
|
SerialNumber: req.SerialNumber,
|
||||||
|
HandlingFee: req.HandlingFee,
|
||||||
}
|
}
|
||||||
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
|
if err := app.ModuleClients.BundleDB.Model(&existing).Updates(updates).Error; err != nil {
|
||||||
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
return nil, fmt.Errorf("更新对账单失败: %v", err)
|
||||||
@ -714,3 +743,105 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
|
|||||||
// 返回成功响应
|
// 返回成功响应
|
||||||
return &bundle.CommonResponse{Msg: "更新成功"}, nil
|
return &bundle.CommonResponse{Msg: "更新成功"}, nil
|
||||||
}
|
}
|
||||||
|
func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
res = new(bundle.CommonResponse)
|
||||||
|
var paidServices []*model.BundleOrderValueAdd
|
||||||
|
if err = app.ModuleClients.BundleDB.Model(&model.BundleOrderValueAdd{}).
|
||||||
|
Where("order_no = ? AND payment_status = 2 and customer_id = ?", req.OrderNo, req.UserID).
|
||||||
|
Find(&paidServices).Error; err != nil {
|
||||||
|
res.Msg = msg.ErrorUpdateOrderInfo
|
||||||
|
return res, commonErr.ReturnError(err, msg.ErrorUpdateOrderInfo, "查询增值服务支付状态失败: ")
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(paidServices) > 0 {
|
||||||
|
res.Msg = "订单已支付,无法删除"
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = app.ModuleClients.BundleDB.Where("order_no = ?", req.OrderNo).
|
||||||
|
Delete(&model.BundleOrderValueAdd{}).Error; err != nil {
|
||||||
|
res.Msg = msg.ErrorDeleteOrderInfo
|
||||||
|
return res, commonErr.ReturnError(err, msg.ErrorDeleteOrderInfo, "删除增值服务失败: ")
|
||||||
|
}
|
||||||
|
|
||||||
|
var order model.BundleOrderRecords
|
||||||
|
if err = app.ModuleClients.BundleDB.Model(&model.BundleOrderRecords{}).
|
||||||
|
Where("order_no = ? and customer_id = ?", req.OrderNo, req.UserID).
|
||||||
|
First(&order).Error; err != nil {
|
||||||
|
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
} else if order.PayType == 2 {
|
||||||
|
res.Msg = "订单已支付,无法删除"
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
if err = app.ModuleClients.BundleDB.Where("order_no = ?", order.OrderNo).
|
||||||
|
Delete(&model.BundleOrderRecords{}).Error; err != nil {
|
||||||
|
res.Msg = msg.ErrorDeleteOrderInfo
|
||||||
|
return res, commonErr.ReturnError(err, msg.ErrorDeleteOrderInfo, "删除套餐订单服务失败: ")
|
||||||
|
}
|
||||||
|
res.Msg = msg.SuccessDeletedOrderInfo
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func ListUnfinishedInfos(req *bundle.AutoCreateUserAndOrderRequest) (res *bundle.UnfinishedInfos, err error) {
|
||||||
|
res = new(bundle.UnfinishedInfos)
|
||||||
|
res.UnfinishedInfos = make([]*bundle.UnfinishedInfo, 0)
|
||||||
|
|
||||||
|
// TODO 0.捞出指定数量的数据
|
||||||
|
infos := make([]*model.FieePaymentAuto, 0)
|
||||||
|
query := app.ModuleClients.BundleDB.Where("deleted_at is null")
|
||||||
|
if req.Num != 0 {
|
||||||
|
query.Limit(int(req.Num))
|
||||||
|
}
|
||||||
|
err = query.Find(&infos).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, info := range infos {
|
||||||
|
unfinishedInfo := new(bundle.UnfinishedInfo)
|
||||||
|
unfinishedInfo.ID = uint32(info.ID)
|
||||||
|
unfinishedInfo.UserNum = info.UserNum
|
||||||
|
unfinishedInfo.UserName = info.UserName
|
||||||
|
unfinishedInfo.UserTelArea = info.UserTelArea
|
||||||
|
unfinishedInfo.UserTel = info.UserTel
|
||||||
|
unfinishedInfo.UserSex = info.UserSex
|
||||||
|
unfinishedInfo.Nationality = info.Nationality
|
||||||
|
unfinishedInfo.PlaceOfResidence = info.PlaceOfResidence
|
||||||
|
unfinishedInfo.DocumentType = int32(info.DocumentType)
|
||||||
|
unfinishedInfo.UserIdCardFrontUrl = info.UserIdCardFrontUrl
|
||||||
|
unfinishedInfo.UserIdCardReverseUrl = info.UserIdCardReverseUrl
|
||||||
|
unfinishedInfo.UserIdCardValidity = info.UserIdCardValidity
|
||||||
|
unfinishedInfo.OrderNo = info.OrderNo
|
||||||
|
unfinishedInfo.OrderPayAmount = info.OrderPayAmount
|
||||||
|
unfinishedInfo.OrderSettlementAmount = info.OrderSettlementAmount
|
||||||
|
unfinishedInfo.OrderFeeAmount = info.OrderFeeAmount
|
||||||
|
unfinishedInfo.OrderPayCurrency = info.OrderPayCurrency
|
||||||
|
unfinishedInfo.OrderAccountCurrency = info.OrderAccountCurrency
|
||||||
|
unfinishedInfo.PayTime = info.PayTime.Format("2006-01-02 15:04:05")
|
||||||
|
res.UnfinishedInfos = append(res.UnfinishedInfos, unfinishedInfo)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SoftDeleteUnfinishedInfo(req *bundle.SoftDeleteUnfinishedInfoRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
res = new(bundle.CommonResponse)
|
||||||
|
|
||||||
|
exist := new(model.FieePaymentAuto)
|
||||||
|
// 查询未处理的数据
|
||||||
|
err = app.ModuleClients.BundleDB.Model(&model.FieePaymentAuto{}).
|
||||||
|
Where("id = ?", req.ID).
|
||||||
|
First(&exist).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("数据不存在")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err = app.ModuleClients.BundleDB.Where("id = ?", req.ID).
|
||||||
|
Delete(&model.FieePaymentAuto{}).Error; err != nil {
|
||||||
|
return res, errors.New("删除自动导入表数据失败")
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
@ -97,15 +97,15 @@ func CreateValueAddServiceLang(tx *gorm.DB, req *model.ValueAddServiceLang) (err
|
|||||||
|
|
||||||
// 增值套餐主表更新
|
// 增值套餐主表更新
|
||||||
func UpdateValueAddService(tx *gorm.DB, columns map[string]interface{}) (err error) {
|
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 {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func UpdateValueAddServiceLang(tx *gorm.DB, columns map[string]interface{}) (err error) {
|
func UpdateValueAddServiceLang(tx *gorm.DB, columns map[string]interface{}) (err error) {
|
||||||
err = tx.Model(&model.ValueAddServiceLang{}).Where("uuid =?", columns["uuid"]).
|
err = tx.Model(&model.ValueAddServiceLang{}).Where("uuid =? and deleted_at = 0", columns["uuid"]).
|
||||||
Where("language", columns["language"]).Updates(columns).Error
|
Where("language = ?", columns["language"]).Updates(columns).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
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) {
|
func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res []*model.ValueAddService, total int64, err error) {
|
||||||
query := app.ModuleClients.BundleDB.Model(&model.ValueAddService{}).
|
query := app.ModuleClients.BundleDB.Model(&model.ValueAddService{}).
|
||||||
|
Where("deleted_at = 0").
|
||||||
Preload("ValueAddServiceLang", func(db *gorm.DB) *gorm.DB {
|
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")
|
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) {
|
func ValueAddServiceDetail(uuid string) (valueAddServiceDetail *model.ValueAddService, err error) {
|
||||||
var data model.ValueAddService
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -143,7 +144,8 @@ func ValueAddServiceDetail(uuid string) (valueAddServiceDetail *model.ValueAddSe
|
|||||||
|
|
||||||
// 通过uuid和language查询增值套餐
|
// 通过uuid和language查询增值套餐
|
||||||
func ValueAddServiceDetailByUuidAndLanguage(uuid string, language string) (valueAddServiceLang *model.ValueAddServiceLang, err error) {
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -154,7 +156,7 @@ func ValueAddServiceDetailByUuidAndLanguage(uuid string, language string) (value
|
|||||||
func GetBundleToValueAddServiceByValueUid(valueUid string) ([]model.BundleToValueAddService, error) {
|
func GetBundleToValueAddServiceByValueUid(valueUid string) ([]model.BundleToValueAddService, error) {
|
||||||
var rels []model.BundleToValueAddService
|
var rels []model.BundleToValueAddService
|
||||||
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).
|
err := app.ModuleClients.BundleDB.Model(&model.BundleToValueAddService{}).
|
||||||
Where("value_uid = ?", valueUid).
|
Where("value_uid = ? and deleted_at = 0", valueUid).
|
||||||
Find(&rels).Error
|
Find(&rels).Error
|
||||||
return rels, err
|
return rels, err
|
||||||
}
|
}
|
||||||
@ -187,3 +189,17 @@ func BatchValueAddServiceDetailTx(tx *gorm.DB, uids []string) (map[string]*model
|
|||||||
}
|
}
|
||||||
return resultMap, nil
|
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
|
package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"micro-bundle/internal/dao"
|
"micro-bundle/internal/dao"
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
"micro-bundle/pb/bundle"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"dubbo.apache.org/dubbo-go/v3/common/logger"
|
||||||
"github.com/jinzhu/copier"
|
"github.com/jinzhu/copier"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
)
|
)
|
||||||
@ -23,21 +25,28 @@ func BundleExtend(req *bundle.BundleExtendRequest) (*bundle.BundleExtendResponse
|
|||||||
AccountNumber: int(req.AccountAdditional),
|
AccountNumber: int(req.AccountAdditional),
|
||||||
ExpansionPacksNumber: 1,
|
ExpansionPacksNumber: 1,
|
||||||
}); err != nil {
|
}); 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) {
|
func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundle.BundleExtendRecordsListResponse, error) {
|
||||||
data, total, err := dao.GetBundleExtendRecordList(req)
|
data, total, err := dao.GetBundleExtendRecordList(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
logger.Error(err)
|
||||||
|
return nil, errors.New("查询失败")
|
||||||
}
|
}
|
||||||
resp := &bundle.BundleExtendRecordsListResponse{}
|
resp := &bundle.BundleExtendRecordsListResponse{}
|
||||||
resp.Total = total
|
resp.Total = total
|
||||||
resp.Data = lo.Map(data, func(m model.BundleExtendRecordItemPo, _ int) *bundle.BundleExtendRecordItem {
|
resp.Data = lo.Map(data, func(m model.BundleExtendRecordItemPo, _ int) *bundle.BundleExtendRecordItem {
|
||||||
result := &bundle.BundleExtendRecordItem{}
|
result := &bundle.BundleExtendRecordItem{}
|
||||||
copier.Copy(result, &m)
|
copier.Copy(result, &m)
|
||||||
|
result.CreatedAt = uint64(m.CreatedAt.UnixMilli())
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
return resp, nil
|
return resp, nil
|
||||||
@ -46,24 +55,48 @@ func BundleExtendRecordsList(req *bundle.BundleExtendRecordsListRequest) (*bundl
|
|||||||
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) {
|
func GetBundleBalanceList(req *bundle.GetBundleBalanceListReq) (*bundle.GetBundleBalanceListResp, error) {
|
||||||
data, total, err := dao.GetBundleBalanceList(req)
|
data, total, err := dao.GetBundleBalanceList(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
logger.Error(err)
|
||||||
|
return nil, errors.New("查询失败")
|
||||||
}
|
}
|
||||||
resp := &bundle.GetBundleBalanceListResp{}
|
resp := &bundle.GetBundleBalanceListResp{}
|
||||||
resp.Total = total
|
resp.Total = total
|
||||||
resp.Data = lo.Map(data, func(m model.BundleBalancePo, _ int) *bundle.BundleBalanceItem {
|
resp.Data = lo.Map(data, func(m model.BundleBalancePo, _ int) *bundle.BundleBalanceItem {
|
||||||
result := &bundle.BundleBalanceItem{}
|
result := &bundle.BundleBalanceItem{}
|
||||||
copier.Copy(result, &m)
|
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()
|
result.ExpiredTime = t.UnixMilli()
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
return resp, nil
|
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) {
|
func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalanceResp, error) {
|
||||||
var data model.BundleBalance
|
var data model.BundleBalance
|
||||||
if err := copier.Copy(&data, req); err != nil {
|
if err := copier.Copy(&data, req); err != nil {
|
||||||
return nil, err
|
logger.Error(err)
|
||||||
|
return nil, errors.New("操作失败")
|
||||||
}
|
}
|
||||||
return nil, dao.AddBundleBalanceByUserId(data)
|
return nil, dao.AddBundleBalanceByUserId(data)
|
||||||
}
|
}
|
||||||
@ -71,15 +104,22 @@ func AddBundleBalance(req *bundle.AddBundleBalanceReq) (*bundle.AddBundleBalance
|
|||||||
func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) {
|
func CreateBundleBalance(req *bundle.CreateBundleBalanceReq) (*bundle.CreateBundleBalanceResp, error) {
|
||||||
var data model.BundleBalance
|
var data model.BundleBalance
|
||||||
if err := copier.Copy(&data, req); err != nil {
|
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) {
|
func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListResp, error) {
|
||||||
data, total, err := dao.GetUsedRecord(req)
|
data, total, err := dao.GetUsedRecord(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
logger.Error(err)
|
||||||
|
return nil, errors.New("查询失败")
|
||||||
}
|
}
|
||||||
resp := &bundle.GetUsedRecordListResp{}
|
resp := &bundle.GetUsedRecordListResp{}
|
||||||
resp.Total = total
|
resp.Total = total
|
||||||
@ -94,7 +134,8 @@ func GetUsedRecord(req *bundle.GetUsedRecordListReq) (*bundle.GetUsedRecordListR
|
|||||||
func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) {
|
func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWorkDetailResp, error) {
|
||||||
data, err := dao.GetImageWorkDetail(req)
|
data, err := dao.GetImageWorkDetail(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
logger.Error(err)
|
||||||
|
return nil, errors.New("查询失败")
|
||||||
}
|
}
|
||||||
result := &bundle.GetImageWorkDetailResp{}
|
result := &bundle.GetImageWorkDetailResp{}
|
||||||
err = copier.Copy(result, &data)
|
err = copier.Copy(result, &data)
|
||||||
@ -104,7 +145,8 @@ func GetImageWorkDetail(req *bundle.GetImageWorkDetailReq) (*bundle.GetImageWork
|
|||||||
func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) {
|
func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWorkDetailResp, error) {
|
||||||
data, err := dao.GetVedioWorkDetail(req)
|
data, err := dao.GetVedioWorkDetail(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
logger.Error(err)
|
||||||
|
return nil, errors.New("查询失败")
|
||||||
}
|
}
|
||||||
result := &bundle.GetVedioeWorkDetailResp{}
|
result := &bundle.GetVedioeWorkDetailResp{}
|
||||||
err = copier.Copy(result, &data)
|
err = copier.Copy(result, &data)
|
||||||
@ -112,6 +154,23 @@ func GetVedioWorkDetail(req *bundle.GetVedioWorkDetailReq) (*bundle.GetVedioeWor
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) {
|
func ToBeComfirmedWorks(req *bundle.ToBeComfirmedWorksReq) (*bundle.ToBeComfirmedWorksResp, error) {
|
||||||
// data, err := dao.ToBeComfirmedWorks(req)
|
data, total, unconfirmed, err := dao.ToBeComfirmedWorks(req)
|
||||||
return nil, nil
|
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 (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"micro-bundle/internal/dao"
|
"micro-bundle/internal/dao"
|
||||||
|
"micro-bundle/pb/bundle"
|
||||||
"micro-bundle/pkg/app"
|
"micro-bundle/pkg/app"
|
||||||
"micro-bundle/pkg/msg"
|
"micro-bundle/pkg/msg"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"micro-bundle/internal/model"
|
"micro-bundle/internal/model"
|
||||||
"micro-bundle/pb/bundle"
|
|
||||||
|
|
||||||
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
|
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
|
||||||
"github.com/jinzhu/copier"
|
"github.com/jinzhu/copier"
|
||||||
@ -60,7 +59,7 @@ func BundleDetail(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResp
|
|||||||
func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error) {
|
func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error) {
|
||||||
res = &bundle.SaveResponse{}
|
res = &bundle.SaveResponse{}
|
||||||
if req.Language == "" {
|
if req.Language == "" {
|
||||||
return res, errors.New("语言参数不能为空")
|
return res, errors.New("语言不能为空")
|
||||||
}
|
}
|
||||||
if req.Sort <= 0 {
|
if req.Sort <= 0 {
|
||||||
return res, errors.New("排序参数需为正整数")
|
return res, errors.New("排序参数需为正整数")
|
||||||
@ -76,6 +75,7 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
BgImg1: req.BgImg1,
|
BgImg1: req.BgImg1,
|
||||||
BgImg2: req.BgImg2,
|
BgImg2: req.BgImg2,
|
||||||
ShelfStatus: 2, //默认初始状态为2-下架
|
ShelfStatus: 2, //默认初始状态为2-下架
|
||||||
|
FontColor: req.FontColor,
|
||||||
}
|
}
|
||||||
bundleLang := &model.BundleProfileLang{
|
bundleLang := &model.BundleProfileLang{
|
||||||
Name: req.Name,
|
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 {
|
if req.Uuid == "" && req.Language != msg.ZH_CN {
|
||||||
return res, errors.New("请先创建中文版本套餐")
|
return res, errors.New("请先创建中文版本套餐")
|
||||||
}
|
}
|
||||||
var existValueService = make(map[string]string)
|
// var existValueService = make(map[string]string)
|
||||||
if req.Uuid != "" {
|
// if req.Uuid != "" {
|
||||||
valueService, existErr := dao.GetValueAddServiceUuidsByBundleUuid(req.Uuid)
|
// valueService, existErr := dao.GetValueAddServiceUuidsByBundleUuid(req.Uuid)
|
||||||
if existErr != nil {
|
// if existErr != nil {
|
||||||
return res, existErr
|
// return res, errors.New("查询增值服务失败")
|
||||||
}
|
// }
|
||||||
if valueService != nil && len(valueService) > 0 {
|
// if valueService != nil && len(valueService) > 0 {
|
||||||
for _, v := range valueService {
|
// for _, v := range valueService {
|
||||||
existValueService[v] = v
|
// existValueService[v] = v
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
var cancelValueAddService = make(map[string]string)
|
|
||||||
selectService := make([]*model.BundleToValueAddService, 0)
|
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 {
|
if req.Language == msg.ZH_CN && req.SelectValueAddService != nil && len(req.SelectValueAddService) > 0 {
|
||||||
for _, v := range req.SelectValueAddService {
|
for _, v := range req.SelectValueAddService {
|
||||||
detail, checkErr := dao.ValueAddServiceDetailByUuidAndLanguage(v.ValueAddUuid, req.Language)
|
detail, checkErr := dao.ValueAddServiceDetailByUuidAndLanguage(v.ValueAddUuid, req.Language)
|
||||||
if checkErr != nil {
|
if checkErr != nil {
|
||||||
if checkErr == gorm.ErrRecordNotFound {
|
if checkErr == gorm.ErrRecordNotFound {
|
||||||
return res, errors.New(fmt.Sprintf("所选增值服务[%s]%s版不存在,请先创建对应增值套餐", v.ServiceName, req.Language))
|
return res, errors.New("增值服务不存在")
|
||||||
} else {
|
} else {
|
||||||
return res, checkErr
|
return res, errors.New("查询增值服务失败")
|
||||||
}
|
|
||||||
}
|
|
||||||
if detail.PriceType != req.PriceType {
|
|
||||||
if req.Uuid == "" {
|
|
||||||
//中文套餐创建时,币种不一致直接返回错误
|
|
||||||
return res, errors.New(fmt.Sprintf("所选增值服务[%s]%s币种与套餐币种不一致", detail.ServiceName, req.Language))
|
|
||||||
} else {
|
|
||||||
//更新时,判断是否已存在,存在则取消关联
|
|
||||||
_, ok := existValueService[v.ValueAddUuid]
|
|
||||||
if ok {
|
|
||||||
cancelValueAddService[v.ValueAddUuid] = detail.ServiceName
|
|
||||||
continue
|
|
||||||
} else {
|
|
||||||
//币种不一致,新加币种时返回错误
|
|
||||||
return res, errors.New(fmt.Sprintf("所选增值服务[%s]%s币种与套餐币种不一致", detail.ServiceName, req.Language))
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, exists := selectValueAddServiceCount[int(detail.ServiceType)]; exists {
|
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{}{}
|
selectValueAddServiceCount[int(detail.ServiceType)] = struct{}{}
|
||||||
selectService = append(selectService, &model.BundleToValueAddService{
|
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)
|
_, err = dao.BundleDetailByUuidAndLanguage(req.Uuid, req.Language)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == gorm.ErrRecordNotFound {
|
if err == gorm.ErrRecordNotFound {
|
||||||
// if req.Uuid != "" {
|
|
||||||
// return res, errors.New("套餐不存在")
|
|
||||||
// }
|
|
||||||
if req.Language != msg.ZH_CN {
|
if req.Language != msg.ZH_CN {
|
||||||
_, err = dao.BundleDetailByUuidAndLanguage(req.Uuid, msg.ZH_CN)
|
_, err = dao.BundleDetailByUuidAndLanguage(req.Uuid, msg.ZH_CN)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -160,14 +139,14 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
res.Msg = "请先创建中文版本套餐"
|
res.Msg = "请先创建中文版本套餐"
|
||||||
return res, errors.New("请先创建中文版本套餐")
|
return res, errors.New("请先创建中文版本套餐")
|
||||||
} else {
|
} else {
|
||||||
return res, err
|
return res, errors.New("获取套餐信息失败")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if req.Language == msg.ZH_CN {
|
if req.Language == msg.ZH_CN {
|
||||||
bundleProfile.UUID = utils.GetUUID()
|
bundleProfile.UUID = utils.GetUUID()
|
||||||
if err = dao.TxCreateBundle(tx, bundleProfile); err != nil {
|
if err = dao.TxCreateBundle(tx, bundleProfile); err != nil {
|
||||||
return res, errors.New("保存中文语言套餐失败: " + err.Error())
|
return res, errors.New("创建套餐信息失败")
|
||||||
}
|
}
|
||||||
bundleLang.UUID = bundleProfile.UUID
|
bundleLang.UUID = bundleProfile.UUID
|
||||||
res.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 len(selectService) > 0 {
|
||||||
if err = dao.CreateBundleToValueAddService(tx, selectService); err != nil {
|
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
|
|
||||||
}
|
|
||||||
count := 0
|
|
||||||
if valueUuid != nil && len(valueUuid) > 0 {
|
|
||||||
for _, v := range valueUuid {
|
|
||||||
//可以改成批量获取
|
|
||||||
valueDetail, err2 := dao.ValueAddServiceDetailByUuidAndLanguage(v, req.Language)
|
|
||||||
if err2 != nil {
|
|
||||||
return res, err2
|
|
||||||
}
|
|
||||||
if valueDetail.PriceType != req.PriceType {
|
|
||||||
if err = tx.Where("bundle_uuid =? AND value_uid =?", bundleLang.UUID, v).Delete(&model.BundleToValueAddService{}).Error; err != nil {
|
|
||||||
return res, errors.New("删除套餐与增值服务关联失败: " + err.Error())
|
|
||||||
}
|
|
||||||
count++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.CancelNum = int64(count)
|
|
||||||
}
|
|
||||||
if err = dao.TxCreateBundleLang(tx, bundleLang); err != nil {
|
if err = dao.TxCreateBundleLang(tx, bundleLang); err != nil {
|
||||||
return res, errors.New("保存语言套餐失败: " + err.Error())
|
return res, errors.New("创建套餐信息失败")
|
||||||
}
|
}
|
||||||
res.Msg = "保存成功"
|
}
|
||||||
return res, nil
|
langList := []string{msg.ZH_TW, msg.EN, msg.DE_DE, msg.JA_JP}
|
||||||
|
for _, lang := range langList {
|
||||||
|
otherLang := &model.BundleProfileLang{
|
||||||
|
UUID: bundleLang.UUID,
|
||||||
|
Name: bundleLang.Name,
|
||||||
|
Content: bundleLang.Content,
|
||||||
|
Price: bundleLang.Price,
|
||||||
|
PriceType: bundleLang.PriceType,
|
||||||
|
}
|
||||||
|
otherLang.Language = lang
|
||||||
|
if err = dao.TxCreateBundleLang(tx, otherLang); err != nil {
|
||||||
|
return res, errors.New("创建套餐信息失败")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.Msg = "创建套餐信息成功"
|
||||||
|
return
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -219,20 +188,7 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
if saveErr := saveBundleHistory(tx, req.Uuid, "", 0); saveErr != nil {
|
if saveErr := saveBundleHistory(tx, req.Uuid, "", 0); saveErr != nil {
|
||||||
return res, saveErr
|
return res, saveErr
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.Language == msg.ZH_CN {
|
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{}{
|
updateBundle := map[string]interface{}{
|
||||||
"name": req.Name,
|
"name": req.Name,
|
||||||
"sort": req.Sort,
|
"sort": req.Sort,
|
||||||
@ -242,47 +198,15 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
"img_option": req.ImgOption,
|
"img_option": req.ImgOption,
|
||||||
"bg_img1": req.BgImg1,
|
"bg_img1": req.BgImg1,
|
||||||
"bg_img2": req.BgImg2,
|
"bg_img2": req.BgImg2,
|
||||||
|
"font_color": req.FontColor,
|
||||||
}
|
}
|
||||||
if err = dao.TxUpdateBundle(tx, req.Uuid, updateBundle); err != nil {
|
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 {
|
if err = diffUpdateBundleToValueAddService(tx, req.Uuid, selectService); err != nil {
|
||||||
tx.Rollback()
|
tx.Rollback()
|
||||||
return res, err
|
return res, errors.New("更新套餐与增值服务关联失败")
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//更新其他语言时 先获取所有关联增值服务,判断币种是否一致,不一致则取消关联
|
|
||||||
valueAddService, err := dao.GetBundleToValueAddServiceByBundleUuid(req.Uuid)
|
|
||||||
if err != nil {
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
cancelValueService := make(map[string]string)
|
|
||||||
for _, v := range valueAddService {
|
|
||||||
detail, checkErr := dao.ValueAddServiceDetailByUuidAndLanguage(v.ValueUid, req.Language)
|
|
||||||
if checkErr != nil {
|
|
||||||
if checkErr == gorm.ErrRecordNotFound {
|
|
||||||
continue
|
|
||||||
} else {
|
|
||||||
return res, checkErr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if detail.PriceType != req.PriceType {
|
|
||||||
cancelValueService[v.ValueUid] = detail.ServiceName
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if int64(len(cancelValueService)) > 0 {
|
|
||||||
cancel := "以下增值服务:"
|
|
||||||
for k, v := range cancelValueService {
|
|
||||||
cancel += fmt.Sprintf("[%s]%s", v, req.Language)
|
|
||||||
if err = tx.Where("bundle_uuid = ? AND value_uid = ?", req.Uuid, k).Delete(&model.BundleToValueAddService{}).Error; err != nil {
|
|
||||||
return res, errors.New("删除套餐与增值服务关联失败: " + err.Error())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cancel += "版币种与套餐币种不一致,已取消相关关联"
|
|
||||||
res.Msg = "保存成功 " + cancel
|
|
||||||
res.CancelNum = int64(len(cancelValueService))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateBundleLang := map[string]interface{}{
|
updateBundleLang := map[string]interface{}{
|
||||||
@ -292,21 +216,21 @@ func SaveBundle(req *bundle.BundleProfile) (res *bundle.SaveResponse, err error)
|
|||||||
"price_type": req.PriceType,
|
"price_type": req.PriceType,
|
||||||
}
|
}
|
||||||
if err = dao.TxUpdateBundleLang(tx, req.Uuid, req.Language, updateBundleLang); err != nil {
|
if err = dao.TxUpdateBundleLang(tx, req.Uuid, req.Language, updateBundleLang); err != nil {
|
||||||
return res, err
|
return res, errors.New("更新套餐信息失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
res.Uuid = req.Uuid
|
res.Uuid = req.Uuid
|
||||||
if res.Msg == "" {
|
|
||||||
res.Msg = "保存成功"
|
res.Msg = "保存成功"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
|
func BundleListV2(req *bundle.BundleListRequest) (res *bundle.BundleListResponse, err error) {
|
||||||
res = new(bundle.BundleListResponse)
|
res = new(bundle.BundleListResponse)
|
||||||
res, err = dao.BundleListV2(req)
|
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) {
|
func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailResponseV2, err error) {
|
||||||
res = new(bundle.BundleDetailResponseV2)
|
res = new(bundle.BundleDetailResponseV2)
|
||||||
@ -314,14 +238,11 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0)
|
bundleProfileLangs := make([]*bundle.BundleProfileLang, 0)
|
||||||
selectValueAddServices := make([]*bundle.SelectValueAddService, 0) //已选增值服务
|
selectValueAddServices := make([]*bundle.SelectValueAddService, 0) //已选增值服务
|
||||||
if req.Uuid == "" {
|
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)
|
detail, err := dao.BundleDetailV2(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
return res, errors.New("获取套餐信息失败")
|
||||||
}
|
}
|
||||||
if detail != nil {
|
if detail != nil {
|
||||||
bundleProfile.Uuid = detail.UUID
|
bundleProfile.Uuid = detail.UUID
|
||||||
@ -332,21 +253,28 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
bundleProfile.ImgOption = int32(detail.ImgOption)
|
bundleProfile.ImgOption = int32(detail.ImgOption)
|
||||||
bundleProfile.BgImg1 = detail.BgImg1
|
bundleProfile.BgImg1 = detail.BgImg1
|
||||||
bundleProfile.BgImg2 = detail.BgImg2
|
bundleProfile.BgImg2 = detail.BgImg2
|
||||||
|
bundleProfile.FontColor = detail.FontColor
|
||||||
bundleProfile.Sort = detail.Sort
|
bundleProfile.Sort = detail.Sort
|
||||||
bundleProfile.ShelfStatus = detail.ShelfStatus
|
bundleProfile.ShelfStatus = detail.ShelfStatus
|
||||||
bundleProfile.CreatedAt = detail.CreatedAt.Format("2006-01-02 15:04:05")
|
bundleProfile.CreatedAt = detail.CreatedAt.Format("2006-01-02 15:04:05")
|
||||||
bundleProfile.UpdatedAt = detail.UpdatedAt.Format("2006-01-02 15:04:05")
|
bundleProfile.UpdatedAt = detail.UpdatedAt.Format("2006-01-02 15:04:05")
|
||||||
bundleProfile.Contract = detail.Contract
|
bundleProfile.Contract = detail.Contract
|
||||||
if detail.BundleToValueAddService != nil && len(detail.BundleToValueAddService) > 0 {
|
if len(detail.BundleToValueAddService) > 0 {
|
||||||
for _, valueAddService := range detail.BundleToValueAddService {
|
for _, valueAddService := range detail.BundleToValueAddService {
|
||||||
|
valueAddDetail, err := dao.ValueAddServiceDetailByUuidAndLanguage(valueAddService.ValueUid, req.Language)
|
||||||
|
if err != nil {
|
||||||
|
return res, errors.New("查询增值服务失败")
|
||||||
|
}
|
||||||
selectValueAddService := &bundle.SelectValueAddService{
|
selectValueAddService := &bundle.SelectValueAddService{
|
||||||
ValueAddUuid: valueAddService.ValueUid,
|
ValueAddUuid: valueAddService.ValueUid,
|
||||||
IsDisplay: valueAddService.IsDisplay,
|
IsDisplay: valueAddService.IsDisplay,
|
||||||
|
ServiceName: valueAddDetail.ServiceName,
|
||||||
|
ServiceType: valueAddDetail.ServiceType,
|
||||||
}
|
}
|
||||||
selectValueAddServices = append(selectValueAddServices, selectValueAddService)
|
selectValueAddServices = append(selectValueAddServices, selectValueAddService)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if detail.BundleProfileLang != nil && len(detail.BundleProfileLang) > 0 {
|
if len(detail.BundleProfileLang) > 0 {
|
||||||
for _, lang := range detail.BundleProfileLang {
|
for _, lang := range detail.BundleProfileLang {
|
||||||
bundleProfileLang := &bundle.BundleProfileLang{
|
bundleProfileLang := &bundle.BundleProfileLang{
|
||||||
Uuid: lang.UUID,
|
Uuid: lang.UUID,
|
||||||
@ -355,65 +283,141 @@ func BundleDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleDetailRe
|
|||||||
PriceType: lang.PriceType,
|
PriceType: lang.PriceType,
|
||||||
Content: lang.Content,
|
Content: lang.Content,
|
||||||
Language: lang.Language,
|
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"),
|
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"),
|
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)
|
bundleProfileLangs = append(bundleProfileLangs, bundleProfileLang)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if selectValueAddServices != nil && len(selectValueAddServices) > 0 {
|
if len(selectValueAddServices) > 0 {
|
||||||
bundleProfile.SelectValueAddService = selectValueAddServices
|
bundleProfile.SelectValueAddService = selectValueAddServices
|
||||||
}
|
}
|
||||||
bundleProfile.BundleProfileLang = bundleProfileLangs
|
bundleProfile.BundleProfileLang = bundleProfileLangs
|
||||||
res.Bundle = bundleProfile
|
res.Bundle = bundleProfile
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func HandleShelf(req *bundle.HandShelfRequest) (res *bundle.CommonResponse, err error) {
|
func BundleLangDetailV2(req *bundle.BundleDetailRequest) (res *bundle.BundleProfileLang, err error) {
|
||||||
res = new(bundle.CommonResponse)
|
res = new(bundle.BundleProfileLang)
|
||||||
if req.Uuid == "" {
|
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 {
|
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)
|
res, err = dao.HandShelf(req.Uuid, req.ShelfStatus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = err.Error()
|
return res, errors.New("更新套餐状态失败")
|
||||||
return res, err
|
|
||||||
}
|
}
|
||||||
|
res.Msg = "更新成功"
|
||||||
res.Msg = "Operation success"
|
|
||||||
return res, nil
|
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 {
|
func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectService []*model.BundleToValueAddService) error {
|
||||||
oldUuids, err := dao.GetValueAddServiceUuidsByBundleUuid(bundleUuid)
|
oldUuids, err := dao.GetValueAddServiceUuidsByBundleUuid(bundleUuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("查询旧套餐与增值服务关联失败: " + err.Error())
|
return errors.New("查询套餐与增值服务关联失败")
|
||||||
}
|
}
|
||||||
newUuids := make(map[string]*model.BundleToValueAddService)
|
newUuids := make(map[string]*model.BundleToValueAddService)
|
||||||
for _, s := range selectService {
|
for _, s := range selectService {
|
||||||
@ -433,14 +437,18 @@ func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectSer
|
|||||||
}
|
}
|
||||||
// 需要新增的
|
// 需要新增的
|
||||||
toAdd := make([]*model.BundleToValueAddService, 0)
|
toAdd := make([]*model.BundleToValueAddService, 0)
|
||||||
|
toDel := make([]string, 0)
|
||||||
|
toUpdate := make([]*model.BundleToValueAddService, 0)
|
||||||
for uid, s := range newUuids {
|
for uid, s := range newUuids {
|
||||||
if _, exist := oldSet[uid]; !exist {
|
if _, exist := oldSet[uid]; !exist {
|
||||||
s.BundleUuid = bundleUuid
|
s.BundleUuid = bundleUuid
|
||||||
toAdd = append(toAdd, s)
|
toAdd = append(toAdd, s)
|
||||||
|
} else {
|
||||||
|
s.BundleUuid = bundleUuid
|
||||||
|
toUpdate = append(toUpdate, s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 需要删除的
|
// 需要删除的
|
||||||
toDel := make([]string, 0)
|
|
||||||
for _, uid := range oldUuids {
|
for _, uid := range oldUuids {
|
||||||
if _, exist := newUuids[uid]; !exist {
|
if _, exist := newUuids[uid]; !exist {
|
||||||
toDel = append(toDel, uid)
|
toDel = append(toDel, uid)
|
||||||
@ -448,12 +456,23 @@ func diffUpdateBundleToValueAddService(tx *gorm.DB, bundleUuid string, selectSer
|
|||||||
}
|
}
|
||||||
if len(toDel) > 0 {
|
if len(toDel) > 0 {
|
||||||
if err = tx.Where("bundle_uuid = ? AND value_uid IN ?", bundleUuid, toDel).Delete(&model.BundleToValueAddService{}).Error; err != nil {
|
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 len(toAdd) > 0 {
|
||||||
if err = dao.CreateBundleToValueAddService(tx, toAdd); err != nil {
|
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
|
return nil
|
||||||
@ -462,27 +481,27 @@ func saveBundleHistory(tx *gorm.DB, bundleUuid string, operator string, operator
|
|||||||
// 保存历史记录
|
// 保存历史记录
|
||||||
data, err := dao.GetBundleDetailByUuid(bundleUuid)
|
data, err := dao.GetBundleDetailByUuid(bundleUuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("查询套餐详情失败: " + err.Error())
|
return errors.New("获取套餐信息失败")
|
||||||
}
|
}
|
||||||
bundleToValueAddService := data.BundleToValueAddService
|
bundleToValueAddService := data.BundleToValueAddService
|
||||||
data.BundleToValueAddService = nil
|
data.BundleToValueAddService = nil
|
||||||
var valueUuid []string
|
var valueUuid []string
|
||||||
if bundleToValueAddService != nil && len(bundleToValueAddService) > 0 {
|
if len(bundleToValueAddService) > 0 {
|
||||||
for _, v := range bundleToValueAddService {
|
for _, v := range bundleToValueAddService {
|
||||||
valueUuid = append(valueUuid, v.ValueUid)
|
valueUuid = append(valueUuid, v.ValueUid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
valueData, err := dao.BatchValueAddServiceDetailTx(tx, valueUuid)
|
valueData, err := dao.BatchValueAddServiceDetailTx(tx, valueUuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("查询增值服务详情失败: " + err.Error())
|
return errors.New("查询增值服务详情失败")
|
||||||
}
|
}
|
||||||
j, err := json.Marshal(data)
|
j, err := json.Marshal(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("套餐json转换失败: " + err.Error())
|
return errors.New("序列化转换失败")
|
||||||
}
|
}
|
||||||
vJ, err := json.Marshal(valueData)
|
vJ, err := json.Marshal(valueData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("增值服务json转换失败: " + err.Error())
|
return errors.New("序列化转换失败")
|
||||||
}
|
}
|
||||||
history := &model.BundleProfileHistory{
|
history := &model.BundleProfileHistory{
|
||||||
Uuid: bundleUuid,
|
Uuid: bundleUuid,
|
||||||
@ -492,7 +511,17 @@ func saveBundleHistory(tx *gorm.DB, bundleUuid string, operator string, operator
|
|||||||
OperatorId: operatorId,
|
OperatorId: operatorId,
|
||||||
}
|
}
|
||||||
if err := tx.Create(history).Error; err != nil {
|
if err := tx.Create(history).Error; err != nil {
|
||||||
return errors.New("保存套餐历史记录失败: " + err.Error())
|
return errors.New("保存套餐历史记录失败")
|
||||||
}
|
}
|
||||||
return nil
|
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
|
||||||
|
}
|
||||||
|
@ -13,6 +13,9 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
|
|||||||
res = new(bundle.CommonResponse)
|
res = new(bundle.CommonResponse)
|
||||||
orderUUID := app.ModuleClients.SfNode.Generate().Base64()
|
orderUUID := app.ModuleClients.SfNode.Generate().Base64()
|
||||||
orderNo := utils.GetOrderNo()
|
orderNo := utils.GetOrderNo()
|
||||||
|
if req.OrderNo != "" {
|
||||||
|
orderNo = req.OrderNo
|
||||||
|
}
|
||||||
var addRecords []model.BundleOrderValueAdd
|
var addRecords []model.BundleOrderValueAdd
|
||||||
for _, i := range req.AddRecords {
|
for _, i := range req.AddRecords {
|
||||||
addRecords = append(addRecords, model.BundleOrderValueAdd{
|
addRecords = append(addRecords, model.BundleOrderValueAdd{
|
||||||
@ -34,6 +37,7 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons
|
|||||||
Signature: req.Signature,
|
Signature: req.Signature,
|
||||||
SignedTime: req.SignedTime,
|
SignedTime: req.SignedTime,
|
||||||
Snapshot: req.Snapshot,
|
Snapshot: req.Snapshot,
|
||||||
|
HandlingFee: i.HandlingFee,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
orderRecord := &model.BundleOrderRecords{
|
orderRecord := &model.BundleOrderRecords{
|
||||||
@ -156,3 +160,20 @@ func UpdateReconciliationStatusBySerialNumber(req *bundle.UpdateStatusAndPayTime
|
|||||||
res, err = dao.UpdateReconciliationStatusBySerialNumber(req)
|
res, err = dao.UpdateReconciliationStatusBySerialNumber(req)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
func DeleteValueAddService(req *bundle.DeleteValueAddServiceRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
res = new(bundle.CommonResponse)
|
||||||
|
res, err = dao.DeleteValueAddService(req)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func ListUnfinishedInfos(req *bundle.AutoCreateUserAndOrderRequest) (res *bundle.UnfinishedInfos, err error) {
|
||||||
|
res = new(bundle.UnfinishedInfos)
|
||||||
|
res, err = dao.ListUnfinishedInfos(req)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func SoftDeleteUnfinishedInfo(req *bundle.SoftDeleteUnfinishedInfoRequest) (res *bundle.CommonResponse, err error) {
|
||||||
|
res = new(bundle.CommonResponse)
|
||||||
|
res, err = dao.SoftDeleteUnfinishedInfo(req)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
@ -147,14 +147,31 @@ func ValueAddBundleDetail(req *bundle.ValueAddBundleDetailRequest) (res *bundle.
|
|||||||
func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveResponse, err error) {
|
func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveResponse, err error) {
|
||||||
res = &bundle.SaveResponse{}
|
res = &bundle.SaveResponse{}
|
||||||
if in.Language == "" {
|
if in.Language == "" {
|
||||||
return res, errors.New("语言参数不能为空")
|
return res, errors.New("语言不能为空")
|
||||||
}
|
}
|
||||||
var options model.PriceOptions
|
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
|
index := 1
|
||||||
for _, option := range in.Options {
|
for _, option := range in.Options {
|
||||||
price, parseErr := strconv.ParseFloat(option.Price, 32)
|
price, parseErr1 := strconv.ParseFloat(option.Price, 32)
|
||||||
if parseErr != nil {
|
if parseErr1 != nil {
|
||||||
return res, parseErr
|
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{
|
options = append(options, &model.PriceOption{
|
||||||
Id: int32(index),
|
Id: int32(index),
|
||||||
@ -172,10 +189,6 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
ServiceName: in.ServiceName,
|
ServiceName: in.ServiceName,
|
||||||
ServiceType: in.ServiceType,
|
ServiceType: in.ServiceType,
|
||||||
}
|
}
|
||||||
originalPrice, err := strconv.ParseFloat(in.OriginalPrice, 32)
|
|
||||||
if err != nil {
|
|
||||||
return res, err
|
|
||||||
}
|
|
||||||
valueAddServiceLang := &model.ValueAddServiceLang{
|
valueAddServiceLang := &model.ValueAddServiceLang{
|
||||||
ServiceName: in.ServiceName,
|
ServiceName: in.ServiceName,
|
||||||
ServiceType: in.ServiceType,
|
ServiceType: in.ServiceType,
|
||||||
@ -187,7 +200,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
Options: options,
|
Options: options,
|
||||||
}
|
}
|
||||||
if in.Uuid == "" && in.Language != msg.ZH_CN {
|
if in.Uuid == "" && in.Language != msg.ZH_CN {
|
||||||
return res, errors.New("请先新增简体中文套餐,再添加其他语言版本")
|
return res, errors.New("请先创建中文版本增值服务")
|
||||||
}
|
}
|
||||||
tx := app.ModuleClients.BundleDB.Begin()
|
tx := app.ModuleClients.BundleDB.Begin()
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -205,7 +218,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
_, err = dao.ValueAddServiceDetailByUuidAndLanguage(in.Uuid, msg.ZH_CN)
|
_, err = dao.ValueAddServiceDetailByUuidAndLanguage(in.Uuid, msg.ZH_CN)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != gorm.ErrRecordNotFound {
|
if err != gorm.ErrRecordNotFound {
|
||||||
return res, errors.New("请先创建中文套餐")
|
return res, errors.New("请先创建中文版本增值服务")
|
||||||
} else {
|
} else {
|
||||||
// // 新语言补充:只要UUID存在即可直接插入新语言
|
// // 新语言补充:只要UUID存在即可直接插入新语言
|
||||||
// if in.Uuid != "" {
|
// if in.Uuid != "" {
|
||||||
@ -225,15 +238,15 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
valueAddService.UUID = utils.GetUUID()
|
valueAddService.UUID = utils.GetUUID()
|
||||||
err = dao.CreateValueAddService(tx, valueAddService)
|
err = dao.CreateValueAddService(tx, valueAddService)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, errors.New("保存中文语言套餐失败: " + err.Error())
|
return res, errors.New("保存增值服务失败")
|
||||||
}
|
}
|
||||||
valueAddServiceLang.UUID = valueAddService.UUID
|
valueAddServiceLang.UUID = valueAddService.UUID
|
||||||
res.Uuid = valueAddService.UUID
|
res.Uuid = valueAddService.UUID
|
||||||
if err = dao.CreateValueAddServiceLang(tx, valueAddServiceLang); err != nil {
|
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 {
|
for _, lang := range langList {
|
||||||
otherLang := model.ValueAddServiceLang{
|
otherLang := model.ValueAddServiceLang{
|
||||||
UUID: valueAddServiceLang.UUID,
|
UUID: valueAddServiceLang.UUID,
|
||||||
@ -249,18 +262,18 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
}
|
}
|
||||||
otherLang.Language = lang
|
otherLang.Language = lang
|
||||||
if err = dao.CreateValueAddServiceLang(tx, &otherLang); err != nil {
|
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
|
return
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 已存在,进行更新
|
// 已存在,进行更新
|
||||||
if err := saveValueAddServiceHistory(tx, in.Uuid); err != nil {
|
if err = saveValueAddServiceHistory(tx, in.Uuid); err != nil {
|
||||||
return res, err
|
return res, errors.New("保存增值服务历史记录失败")
|
||||||
}
|
}
|
||||||
//中文状态下,更新主表和语言表
|
//中文状态下,更新主表和语言表
|
||||||
if in.Language == msg.ZH_CN {
|
if in.Language == msg.ZH_CN {
|
||||||
@ -270,17 +283,7 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
"service_type": in.ServiceType,
|
"service_type": in.ServiceType,
|
||||||
}
|
}
|
||||||
if err = dao.UpdateValueAddService(tx, updateService); err != nil {
|
if err = dao.UpdateValueAddService(tx, updateService); err != nil {
|
||||||
return res, err
|
return res, errors.New("更新增值服务失败")
|
||||||
}
|
|
||||||
}
|
|
||||||
// 查找所有与该增值服务关联的套餐,若币种不一致则取消关联并统计
|
|
||||||
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++
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//更新语言表
|
//更新语言表
|
||||||
@ -296,11 +299,26 @@ func SaveValueAddService(in *bundle.ValueAddServiceLang) (res *bundle.SaveRespon
|
|||||||
"language": in.Language,
|
"language": in.Language,
|
||||||
}
|
}
|
||||||
if err := dao.UpdateValueAddServiceLang(tx, updateLangService); err != nil {
|
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.Uuid = in.Uuid
|
||||||
res.Msg = "保存成功"
|
res.Msg = "保存成功"
|
||||||
res.CancelNum = cancelNum
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -310,8 +328,7 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
|||||||
res = &bundle.ValueAddServiceListResponse{}
|
res = &bundle.ValueAddServiceListResponse{}
|
||||||
list, total, err := dao.ValueAddServiceList(req)
|
list, total, err := dao.ValueAddServiceList(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = msg.ErrorValueAddServiceList
|
return res, errors.New("查询增值服务列表失败")
|
||||||
return res, err
|
|
||||||
}
|
}
|
||||||
for _, valueAddService := range list {
|
for _, valueAddService := range list {
|
||||||
serviceInfo := &bundle.ValueAddService{
|
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"),
|
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"),
|
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
|
var options []*bundle.ValueAddPriceOptions
|
||||||
for _, option := range serviceLang.Options {
|
for _, option := range serviceLang.Options {
|
||||||
var saveAmount decimal.Decimal
|
var saveAmount decimal.Decimal
|
||||||
if serviceLang.PriceMode == 1 {
|
switch serviceLang.PriceMode {
|
||||||
|
case 1:
|
||||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||||
price := decimal.NewFromFloat(float64(option.Price))
|
price := decimal.NewFromFloat(float64(option.Price))
|
||||||
num := decimal.NewFromInt(int64(option.Num))
|
num := decimal.NewFromInt(int64(option.Num))
|
||||||
saveAmount = original.Sub(price).Mul(num)
|
saveAmount = original.Sub(price).Mul(num)
|
||||||
} else if serviceLang.PriceMode == 2 {
|
case 2:
|
||||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
//original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||||
price := decimal.NewFromFloat(float64(option.Price))
|
//price := decimal.NewFromFloat(float64(option.Price))
|
||||||
saveAmount = original.Sub(price)
|
saveAmount = decimal.NewFromInt(int64(0))
|
||||||
|
default:
|
||||||
|
return nil, errors.New("无效的价格模式")
|
||||||
}
|
}
|
||||||
options = append(options, &bundle.ValueAddPriceOptions{
|
options = append(options, &bundle.ValueAddPriceOptions{
|
||||||
Id: int64(option.Id),
|
Id: int64(option.Id),
|
||||||
@ -361,7 +381,6 @@ func ValueAddServiceList(req *bundle.ValueAddServiceListRequest) (res *bundle.Va
|
|||||||
res.ValueAddServiceList = append(res.ValueAddServiceList, serviceInfo)
|
res.ValueAddServiceList = append(res.ValueAddServiceList, serviceInfo)
|
||||||
}
|
}
|
||||||
res.Total = int32(total)
|
res.Total = int32(total)
|
||||||
res.Msg = msg.SuccessValueAddServiceList
|
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -373,7 +392,7 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
|
|||||||
serviceLangs := []*bundle.ValueAddServiceLang{}
|
serviceLangs := []*bundle.ValueAddServiceLang{}
|
||||||
if req.Uuid == "" {
|
if req.Uuid == "" {
|
||||||
res.Msg = msg.ErrorValueAddServiceInfo
|
res.Msg = msg.ErrorValueAddServiceInfo
|
||||||
return res, errors.New("uuid不能为空")
|
return res, errors.New("缺少套餐UUID")
|
||||||
}
|
}
|
||||||
// if req.Language == "" {
|
// if req.Language == "" {
|
||||||
// res.Msg = msg.ErrorValueAddServiceInfo
|
// res.Msg = msg.ErrorValueAddServiceInfo
|
||||||
@ -381,8 +400,7 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
|
|||||||
// }
|
// }
|
||||||
detail, err := dao.ValueAddServiceDetail(req.Uuid)
|
detail, err := dao.ValueAddServiceDetail(req.Uuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.Msg = msg.ErrorValueAddServiceInfo
|
return res, errors.New("查询增值服务详情失败")
|
||||||
return res, err
|
|
||||||
}
|
}
|
||||||
if detail != nil && len(detail.ValueAddServiceLang) > 0 {
|
if detail != nil && len(detail.ValueAddServiceLang) > 0 {
|
||||||
valueAddService.Uuid = detail.UUID
|
valueAddService.Uuid = detail.UUID
|
||||||
@ -390,18 +408,21 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
|
|||||||
valueAddService.ServiceType = detail.ServiceType
|
valueAddService.ServiceType = detail.ServiceType
|
||||||
for _, serviceLang := range detail.ValueAddServiceLang {
|
for _, serviceLang := range detail.ValueAddServiceLang {
|
||||||
langOptions := []*bundle.ValueAddPriceOptions{}
|
langOptions := []*bundle.ValueAddPriceOptions{}
|
||||||
if serviceLang.Options != nil && len(serviceLang.Options) > 0 {
|
if len(serviceLang.Options) > 0 {
|
||||||
for _, opt := range serviceLang.Options {
|
for _, opt := range serviceLang.Options {
|
||||||
var saveAmount decimal.Decimal
|
var saveAmount decimal.Decimal
|
||||||
if serviceLang.PriceMode == 1 {
|
switch serviceLang.PriceMode {
|
||||||
|
case 1:
|
||||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||||
price := decimal.NewFromFloat(float64(opt.Price))
|
price := decimal.NewFromFloat(float64(opt.Price))
|
||||||
num := decimal.NewFromInt(int64(opt.Num))
|
num := decimal.NewFromInt(int64(opt.Num))
|
||||||
saveAmount = original.Sub(price).Mul(num)
|
saveAmount = original.Sub(price).Mul(num)
|
||||||
} else if serviceLang.PriceMode == 2 {
|
case 2:
|
||||||
original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
//original := decimal.NewFromFloat(float64(serviceLang.OriginalPrice))
|
||||||
price := decimal.NewFromFloat(float64(opt.Price))
|
//price := decimal.NewFromFloat(float64(opt.Price))
|
||||||
saveAmount = original.Sub(price)
|
saveAmount = decimal.NewFromInt(int64(0))
|
||||||
|
default:
|
||||||
|
return nil, errors.New("无效的价格模式")
|
||||||
}
|
}
|
||||||
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
|
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
|
||||||
Id: int64(opt.Id),
|
Id: int64(opt.Id),
|
||||||
@ -429,9 +450,7 @@ func ValueAddServiceDetail(req *bundle.ValueAddServiceDetailRequest) (res *bundl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
valueAddService.ServiceLang = serviceLangs
|
valueAddService.ServiceLang = serviceLangs
|
||||||
|
|
||||||
res.ValueAddService = valueAddService
|
res.ValueAddService = valueAddService
|
||||||
res.Msg = msg.SuccessValueAddServiceInfo
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,11 +458,11 @@ func saveValueAddServiceHistory(tx *gorm.DB, uuid string) (err error) {
|
|||||||
// 保存历史记录
|
// 保存历史记录
|
||||||
data, err := dao.GetValueAddServiceDetailByUuid(tx, uuid)
|
data, err := dao.GetValueAddServiceDetailByUuid(tx, uuid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("查询增值服务详情失败: " + err.Error())
|
return errors.New("查询增值服务详情失败")
|
||||||
}
|
}
|
||||||
j, err := json.Marshal(data)
|
j, err := json.Marshal(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("json转换失败: " + err.Error())
|
return errors.New("序列化转换失败")
|
||||||
}
|
}
|
||||||
history := &model.ValueAddServiceHistory{
|
history := &model.ValueAddServiceHistory{
|
||||||
Uuid: uuid,
|
Uuid: uuid,
|
||||||
@ -452,33 +471,48 @@ func saveValueAddServiceHistory(tx *gorm.DB, uuid string) (err error) {
|
|||||||
//OperatorId: operatorId,
|
//OperatorId: operatorId,
|
||||||
}
|
}
|
||||||
if err := tx.Create(history).Error; err != nil {
|
if err := tx.Create(history).Error; err != nil {
|
||||||
return errors.New("保存增值服务历史记录失败: " + err.Error())
|
return errors.New("保存增值服务历史记录失败")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func ValueAddServiceDetailByUuidAndLanguage(req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceLang, err error) {
|
func ValueAddServiceDetailByUuidAndLanguage(req *bundle.ValueAddServiceDetailRequest) (res *bundle.ValueAddServiceLang, err error) {
|
||||||
res = &bundle.ValueAddServiceLang{}
|
res = &bundle.ValueAddServiceLang{}
|
||||||
if req.Uuid == "" {
|
if req.Uuid == "" {
|
||||||
return res, errors.New("uuid不能为空")
|
return res, errors.New("缺少套餐UUID")
|
||||||
}
|
}
|
||||||
if req.Language == "" {
|
if req.Language == "" {
|
||||||
return res, errors.New("语言选项不能为空")
|
return res, errors.New("语言不能为空")
|
||||||
}
|
}
|
||||||
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
|
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, errors.New("查询增值服务详情失败")
|
||||||
}
|
}
|
||||||
if detail == nil {
|
if detail == nil {
|
||||||
return res, errors.New("增值服务不存在")
|
return res, errors.New("增值服务不存在")
|
||||||
}
|
}
|
||||||
langOptions := []*bundle.ValueAddPriceOptions{}
|
langOptions := []*bundle.ValueAddPriceOptions{}
|
||||||
if detail.Options != nil && len(detail.Options) > 0 {
|
if len(detail.Options) > 0 {
|
||||||
for _, opt := range detail.Options {
|
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{
|
langOptions = append(langOptions, &bundle.ValueAddPriceOptions{
|
||||||
Id: int64(opt.Id),
|
Id: int64(opt.Id),
|
||||||
Num: opt.Num,
|
Num: opt.Num,
|
||||||
Symbol: opt.Symbol,
|
Symbol: opt.Symbol,
|
||||||
Price: fmt.Sprintf("%.2f", opt.Price),
|
Price: fmt.Sprintf("%.2f", opt.Price),
|
||||||
|
SaveAmount: saveAmount.StringFixed(2),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -492,20 +526,22 @@ func ValueAddServiceDetailByUuidAndLanguage(req *bundle.ValueAddServiceDetailReq
|
|||||||
Unit: detail.Unit,
|
Unit: detail.Unit,
|
||||||
PriceType: int64(detail.PriceType),
|
PriceType: int64(detail.PriceType),
|
||||||
Options: langOptions,
|
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
|
return
|
||||||
}
|
}
|
||||||
func CalculatePrice(req *bundle.CalculatePriceRequest) (res *bundle.CalculatePriceResponse, err error) {
|
func CalculatePrice(req *bundle.CalculatePriceRequest) (res *bundle.CalculatePriceResponse, err error) {
|
||||||
res = &bundle.CalculatePriceResponse{}
|
res = &bundle.CalculatePriceResponse{}
|
||||||
if req.Uuid == "" {
|
if req.Uuid == "" {
|
||||||
return res, errors.New("uuid不能为空")
|
return res, errors.New("缺少套餐UUID")
|
||||||
}
|
}
|
||||||
if req.Language == "" {
|
if req.Language == "" {
|
||||||
return res, errors.New("语言选项不能为空")
|
return res, errors.New("语言不能为空")
|
||||||
}
|
}
|
||||||
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
|
detail, err := dao.ValueAddServiceDetailByUuidAndLanguage(req.Uuid, req.Language)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, errors.New("查询增值服务详情失败")
|
||||||
}
|
}
|
||||||
if detail == nil {
|
if detail == nil {
|
||||||
return res, errors.New("增值服务不存在")
|
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)
|
price, err := detail.Options.CalculatePrice(detail.PriceMode, req.Num)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, errors.New("计算价格失败")
|
||||||
}
|
}
|
||||||
res.Price = price
|
res.Price = price
|
||||||
return
|
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:套餐排序"` //数字越小越靠前,同大小后创建优先
|
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:下架"`
|
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:背景图-首页"`
|
BgImg1 string `json:"bgImg1" gorm:"column:bg_img1;type:varchar(1024);comment:背景图-首页"`
|
||||||
BgImg2 string `json:"bgImg2" gorm:"column:bg_img2;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"`
|
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:套餐价格"`
|
Price float32 `json:"price" gorm:"column:price;type:decimal(12,2);comment:套餐价格"`
|
||||||
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
|
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:套餐类型 1:人民币 2:美元"`
|
||||||
Content string `json:"content" gorm:"column:content;type:text;comment:套餐内容"`
|
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"`
|
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||||
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
UpdatedAt int64 `gorm:"column:updated_at;autoCreateTime"`
|
||||||
DeletedAt soft_delete.DeletedAt
|
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"`
|
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"`
|
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"`
|
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:类型 1:手动操作 2:自行购买" json:"type"`
|
||||||
Type int `gorm:"column:type;type:tinyint(4);comment:类型 0:手动操作" json:"type"`
|
|
||||||
Remark string `gorm:"column:remark;type:text;comment:备注" json:"remark"`
|
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"`
|
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"`
|
OperatorName string `gorm:"column:operator_name;type:varchar(256)" json:"operatorName"`
|
||||||
OperatorPhoneNumber string `gorm:"column:operator_phone_number;type:varchar(256)" json:"operatorPhoneNumber"`
|
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 表名称
|
// TableName 表名称
|
||||||
@ -108,8 +110,13 @@ type BundleExtendRecordItemPo struct {
|
|||||||
ImagesAdditional int
|
ImagesAdditional int
|
||||||
DataAdditional int
|
DataAdditional int
|
||||||
VideoAdditional 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
|
OperatorName string
|
||||||
OperatorPhoneNumber string
|
OperatorPhoneNumber string
|
||||||
|
AssociatedOrderNumber string `gorm:"column:associated_order_number;type:varchar(256);comment:关联订单号" json:"associatedOrderNumber"`
|
||||||
|
TimeUnit uint `gorm:"column:time_unit;type:int(11) unsigned;comment:时间单位" json:"timeUnit"`
|
||||||
OrderUUID string
|
OrderUUID string
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
}
|
}
|
||||||
@ -138,10 +145,10 @@ type BundleExtendRecordItemDto struct {
|
|||||||
type BundleBalancePo struct {
|
type BundleBalancePo struct {
|
||||||
UserId int `gorm:"column:user_id"`
|
UserId int `gorm:"column:user_id"`
|
||||||
UserName string `gorm:"column:user_name"`
|
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"`
|
BundleName string `gorm:"column:bundle_name"`
|
||||||
ExpirationTime string `gorm:"column:expired_time"`
|
ExpirationTime string `gorm:"column:expired_time"`
|
||||||
BundleStatus int `gorm:"column:bundle_status"`
|
Status int `gorm:"column:status"`
|
||||||
OrderUUID string `gorm:"column:order_uuid"`
|
OrderUUID string `gorm:"column:order_uuid"`
|
||||||
AccountNumber int `gorm:"column:account_number;not null"`
|
AccountNumber int `gorm:"column:account_number;not null"`
|
||||||
AccountConsumptionNumber int `gorm:"column:account_consumption_number;not null"`
|
AccountConsumptionNumber int `gorm:"column:account_consumption_number;not null"`
|
||||||
@ -154,6 +161,30 @@ type BundleBalancePo struct {
|
|||||||
ExpansionPacksNumber int `gorm:"column:expansion_packs_number;not null"`
|
ExpansionPacksNumber int `gorm:"column:expansion_packs_number;not null"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type UserBundleBalancePo struct {
|
||||||
|
OrderUUID string `json:"orderUUID" gorm:"column:order_uuid"`
|
||||||
|
BundleUuid string `json:"bundleUuid" gorm:"column:bundle_uuid"`
|
||||||
|
BundleName string `json:"bundleName" gorm:"column:bundle_name"`
|
||||||
|
BundleStatus string `json:"bundleStatus" gorm:"column:bundle_status"`
|
||||||
|
PayTime string `json:"payTime" gorm:"column:pay_time"`
|
||||||
|
ExpiredTime string `json:"expiredTime" gorm:"column:expired_time"`
|
||||||
|
PaymentAmount string `json:"paymentAmount" gorm:"column:payment_amount"`
|
||||||
|
PaymentType int32 `json:"paymentType" gorm:"column:payment_type"`
|
||||||
|
AccountNumber int32 `json:"accountNumber" gorm:"column:account_number"`
|
||||||
|
AccountAdditional int32 `json:"accountAdditional" gorm:"column:account_additional"`
|
||||||
|
AccountConsumptionNumber int32 `json:"accountConsumptionNumber" gorm:"column:account_consumption_number"`
|
||||||
|
VideoNumber int32 `json:"videoNumber" gorm:"column:video_number"`
|
||||||
|
VideoAdditional int32 `json:"videoAdditional" gorm:"column:video_additional"`
|
||||||
|
VideoConsumptionNumber int32 `json:"videoConsumptionNumber" gorm:"column:video_consumption_number"`
|
||||||
|
ImageNumber int32 `json:"imageNumber" gorm:"column:image_number"`
|
||||||
|
ImageAdditional int32 `json:"imageAdditional" gorm:"column:image_additional"`
|
||||||
|
ImageConsumptionNumber int32 `json:"imageConsumptionNumber" gorm:"column:image_consumption_number"`
|
||||||
|
DataAnalysisNumber int32 `json:"dataAnalysisNumber" gorm:"column:data_analysis_number"`
|
||||||
|
DataAnalysisAdditional int32 `json:"dataAnalysisAdditional" gorm:"column:data_analysis_additional"`
|
||||||
|
DataAnalysisConsumptionNumber int32 `json:"dataAnalysisConsumptionNumber" gorm:"column:data_analysis_consumption_number"`
|
||||||
|
ExpansionPacksNumber int32 `json:"expansionPacksNumber" gorm:"column:expansion_packs_number"`
|
||||||
|
}
|
||||||
|
|
||||||
type BundleBalance struct {
|
type BundleBalance struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
UserId int `gorm:"column:user_id;not null"`
|
UserId int `gorm:"column:user_id;not null"`
|
||||||
|
@ -65,6 +65,7 @@ type BundleOrderValueAdd struct {
|
|||||||
Snapshot string `gorm:"column:snapshot;comment:快照" json:"snapshot"` //订单快照
|
Snapshot string `gorm:"column:snapshot;comment:快照" json:"snapshot"` //订单快照
|
||||||
CheckoutSessionId string `json:"checkoutSessionId" gorm:"column:checkout_session_id;type:varchar(1024);default:null;comment:checkoutSessionId"`
|
CheckoutSessionId string `json:"checkoutSessionId" gorm:"column:checkout_session_id;type:varchar(1024);default:null;comment:checkoutSessionId"`
|
||||||
CheckoutSessionUrl string `json:"checkoutSessionUrl" gorm:"column:checkout_session_url;type:varchar(1024);default:null;comment:checkoutSessionUrl"`
|
CheckoutSessionUrl string `json:"checkoutSessionUrl" gorm:"column:checkout_session_url;type:varchar(1024);default:null;comment:checkoutSessionUrl"`
|
||||||
|
HandlingFee string `gorm:"column:handling_fee;comment:手续费" json:"handlingFee"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// 财务确认状态
|
// 财务确认状态
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import "gorm.io/plugin/soft_delete"
|
import (
|
||||||
|
"gorm.io/plugin/soft_delete"
|
||||||
|
)
|
||||||
|
|
||||||
type CostLog struct {
|
type CostLog struct {
|
||||||
Uuid string `gorm:"column:uuid;type:varchar(50);NOT NULL;primary_key;" json:"id"`
|
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"`
|
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"`
|
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"`
|
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"`
|
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"`
|
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"`
|
WorkTitle string `gorm:"column:work_title;type:varchar(50);NOT NULL;" json:"workTitle"`
|
||||||
@ -85,3 +87,26 @@ type CastWork struct {
|
|||||||
func (*CastWork) TableName() string {
|
func (*CastWork) TableName() string {
|
||||||
return "cast_work"
|
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"
|
||||||
|
}
|
||||||
|
29
internal/model/fiee_payment_auto.go
Normal file
29
internal/model/fiee_payment_auto.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package model
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 用来自动导入 来创建用户和订单的 数据
|
||||||
|
type FieePaymentAuto struct {
|
||||||
|
gorm.Model
|
||||||
|
UserNum string `json:"userNum" gorm:"column:user_num;type:varchar(64);comment:用户编号"`
|
||||||
|
UserName string `json:"userName" gorm:"column:user_name;type:varchar(128);comment:用户姓名"`
|
||||||
|
UserTelArea string `json:"userTelArea" gorm:"column:user_tel_area;type:varchar(32);comment:用户手机号区号"`
|
||||||
|
UserTel string `json:"userTel" gorm:"column:user_tel;type:varchar(32);comment:用户手机号"`
|
||||||
|
UserSex string `json:"userSex" gorm:"column:user_sex;type:varchar(16);comment:用户性别"`
|
||||||
|
Nationality string `json:"nationality" gorm:"column:nationality;type:varchar(128);comment:国籍"`
|
||||||
|
PlaceOfResidence string `json:"placeOfResidence" gorm:"column:place_of_residence;type:varchar(512);comment:用户居住地"`
|
||||||
|
DocumentType int `json:"documentType" gorm:"column:document_type;type:varchar(512);comment:证件类型:1护照 2身份证 3驾驶证 4居住证 5自拍照 6社保卡"`
|
||||||
|
UserIdCardFrontUrl string `json:"userIdCardFrontUrl" gorm:"column:user_id_card_front_url;type:varchar(1024);comment:用户身份证正面"`
|
||||||
|
UserIdCardReverseUrl string `json:"userIdCardReverseUrl" gorm:"column:user_id_card_reverse_url;type:varchar(1024);comment:用户身份证反面"`
|
||||||
|
UserIdCardValidity string `json:"userIdCardValidity" gorm:"column:user_id_card_validity;type:varchar(64);comment:证件有效期"`
|
||||||
|
OrderNo string `json:"orderNo" gorm:"column:order_no;type:varchar(128);comment:订单编号"`
|
||||||
|
OrderPayAmount string `gorm:"column:order_pay_amount;type:decimal(20,2);comment:订单支付金额" json:"orderPayAmount"`
|
||||||
|
OrderSettlementAmount string `gorm:"column:order_settlement_amount;type:decimal(20,2);comment:订单结算金额" json:"orderSettlementAmount"`
|
||||||
|
OrderFeeAmount string `gorm:"column:order_fee_amount;type:decimal(20,2);comment:订单手续费金额" json:"orderFeeAmount"`
|
||||||
|
OrderPayCurrency string `json:"orderPayCurrency" gorm:"column:order_pay_currency;type:varchar(16);comment:支付时的币种:cny人民币,usd美元"`
|
||||||
|
OrderAccountCurrency string `json:"orderAccountCurrency" gorm:"column:order_account_currency;type:varchar(16);comment:账户上的币种: 暂时固定usd美元"`
|
||||||
|
PayTime time.Time `gorm:"column:pay_time;type:datetime;default:null;comment:支付成功时间" json:"payTime"`
|
||||||
|
}
|
@ -17,4 +17,5 @@ type Reconciliation struct {
|
|||||||
PayStatus int `gorm:"column:pay_status;comment:支付状态" json:"payStatus"`
|
PayStatus int `gorm:"column:pay_status;comment:支付状态" json:"payStatus"`
|
||||||
SerialNumber string `gorm:"column:serial_number;comment:流水号" json:"serialNumber"`
|
SerialNumber string `gorm:"column:serial_number;comment:流水号" json:"serialNumber"`
|
||||||
CreationTime string `gorm:"column:creation_time;comment:创建时间" json:"creationTime"`
|
CreationTime string `gorm:"column:creation_time;comment:创建时间" json:"creationTime"`
|
||||||
|
HandlingFee string `gorm:"column:handling_fee;comment:手续费" json:"handlingFee"`
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ type ValueAddServiceLang struct {
|
|||||||
OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"`
|
OriginalPrice float32 `json:"originalPrice" gorm:"column:original_price;type:decimal(12,2);comment:原单价"`
|
||||||
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"`
|
TotalPrice float32 `json:"totalPrice" gorm:"column:total_price;type:decimal(12,2);comment:增值服务总价"`
|
||||||
Unit string `json:"unit" gorm:"column:unit;type:varchar(50);comment:单位 1:个 2:条 3:天 4:月 5:年"`
|
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:欧元"`
|
PriceType int64 `json:"priceType" gorm:"column:price_type;type:int;comment:币种 1:人民币 2:美元 3:日元 4:欧元"`
|
||||||
Options PriceOptions `gorm:"column:options;type:json" json:"options"`
|
Options PriceOptions `gorm:"column:options;type:json" json:"options"`
|
||||||
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
CreatedAt int64 `gorm:"column:created_at;autoCreateTime"`
|
||||||
@ -76,7 +76,7 @@ type PriceOptions []*PriceOption
|
|||||||
type PriceOption struct {
|
type PriceOption struct {
|
||||||
Id int32 `json:"id"`
|
Id int32 `json:"id"`
|
||||||
Num int32 `json:"num"`
|
Num int32 `json:"num"`
|
||||||
Symbol string `json:"symbol"` // 符号> < = <= =>
|
Symbol string `json:"symbol"` // 符号> < = >= <=
|
||||||
Price float32 `json:"price"` // 价格(根据priceMode决定是单价还是总价)
|
Price float32 `json:"price"` // 价格(根据priceMode决定是单价还是总价)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ func ValidateOptions(options PriceOptions) (bool, error) {
|
|||||||
cover := make(map[int]struct{})
|
cover := make(map[int]struct{})
|
||||||
for _, opt := range options {
|
for _, opt := range options {
|
||||||
if opt.Num < 0 || opt.Num > 100 {
|
if opt.Num < 0 || opt.Num > 100 {
|
||||||
return false, errors.New("数字范围错误")
|
return false, errors.New("数量参数需为0-99")
|
||||||
|
|
||||||
}
|
}
|
||||||
if _, ok := symbolSet[opt.Symbol]; !ok {
|
if _, ok := symbolSet[opt.Symbol]; !ok {
|
||||||
@ -130,7 +130,7 @@ func ValidateOptions(options PriceOptions) (bool, error) {
|
|||||||
}
|
}
|
||||||
for _, n := range nums {
|
for _, n := range nums {
|
||||||
if _, exist := cover[n]; exist {
|
if _, exist := cover[n]; exist {
|
||||||
return false, errors.New("逻辑存在冲突,请重新设置")
|
return false, errors.New("条件存在冲突,请重新设置")
|
||||||
|
|
||||||
}
|
}
|
||||||
cover[n] = struct{}{}
|
cover[n] = struct{}{}
|
||||||
@ -166,7 +166,7 @@ func (options PriceOptions) CalculatePrice(priceMode, target int32) (float32, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
if match {
|
if match {
|
||||||
switch priceMode {
|
switch priceMode { //1 单价模式
|
||||||
case 1:
|
case 1:
|
||||||
return float32(target) * opt.Price, nil
|
return float32(target) * opt.Price, nil
|
||||||
case 2:
|
case 2:
|
||||||
|
186
pb/bundle.proto
186
pb/bundle.proto
@ -17,6 +17,10 @@ service Bundle {
|
|||||||
|
|
||||||
rpc BundleListV2(BundleListRequest) returns(BundleListResponse) {}
|
rpc BundleListV2(BundleListRequest) returns(BundleListResponse) {}
|
||||||
rpc BundleDetailV2(BundleDetailRequest) returns(BundleDetailResponseV2) {}
|
rpc BundleDetailV2(BundleDetailRequest) returns(BundleDetailResponseV2) {}
|
||||||
|
rpc BundleListH5V2(BundleListRequest) returns(BundleListResponse) {}
|
||||||
|
rpc BundleLangDetailV2(BundleDetailRequest) returns(BundleProfileLang) {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
rpc BundleList(BundleListRequest) returns (BundleListResponse) {}
|
rpc BundleList(BundleListRequest) returns (BundleListResponse) {}
|
||||||
@ -45,15 +49,17 @@ service Bundle {
|
|||||||
rpc ValueAddServiceDetail(ValueAddServiceDetailRequest) returns (ValueAddServiceDetailResponse) {}
|
rpc ValueAddServiceDetail(ValueAddServiceDetailRequest) returns (ValueAddServiceDetailResponse) {}
|
||||||
rpc ValueAddServiceLangByUuidAndLanguage(ValueAddServiceDetailRequest)returns (ValueAddServiceLang) {}
|
rpc ValueAddServiceLangByUuidAndLanguage(ValueAddServiceDetailRequest)returns (ValueAddServiceLang) {}
|
||||||
rpc CalculatePrice(CalculatePriceRequest) returns (CalculatePriceResponse) {}
|
rpc CalculatePrice(CalculatePriceRequest) returns (CalculatePriceResponse) {}
|
||||||
|
rpc BatchGetValueAddServiceLang(BatchGetValueAddServiceLangRequest) returns (BatchGetValueAddServiceLangResponse) {}
|
||||||
|
rpc DeleteValueAddService(DeleteValueAddServiceRequest) returns (CommonResponse) {}
|
||||||
|
|
||||||
|
|
||||||
// 余量管理
|
// 余量管理
|
||||||
rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} // 套餐扩展
|
rpc BundleExtend(BundleExtendRequest) returns (BundleExtendResponse) {} // 套餐扩展
|
||||||
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} // 套餐扩展记录查询
|
rpc BundleExtendRecordsList(BundleExtendRecordsListRequest) returns (BundleExtendRecordsListResponse) {} // 套餐扩展记录查询
|
||||||
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} // 余量信息
|
rpc GetBundleBalanceList(GetBundleBalanceListReq) returns (GetBundleBalanceListResp) {} // 余量信息
|
||||||
|
rpc GetBundleBalanceByUserId(GetBundleBalanceByUserIdReq) returns (GetBundleBalanceByUserIdResp) {} // 余量信息
|
||||||
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} // 创建新的余量信息
|
rpc CreateBundleBalance(CreateBundleBalanceReq) returns (CreateBundleBalanceResp) {} // 创建新的余量信息
|
||||||
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} // 创建新的余量信息
|
rpc AddBundleBalance(AddBundleBalanceReq) returns (AddBundleBalanceResp) {} // 修改余量信息
|
||||||
|
|
||||||
// 使用记录
|
// 使用记录
|
||||||
rpc GetUsedRecordList(GetUsedRecordListReq) returns (GetUsedRecordListResp) {} // 获取套餐使用记录列表
|
rpc GetUsedRecordList(GetUsedRecordListReq) returns (GetUsedRecordListResp) {} // 获取套餐使用记录列表
|
||||||
@ -61,20 +67,28 @@ service Bundle {
|
|||||||
rpc GetVedioWorkDetail(GetVedioWorkDetailReq) returns (GetVedioeWorkDetailResp) {} // 获取视频作品详情
|
rpc GetVedioWorkDetail(GetVedioWorkDetailReq) returns (GetVedioeWorkDetailResp) {} // 获取视频作品详情
|
||||||
|
|
||||||
rpc ToBeComfirmedWorks(ToBeComfirmedWorksReq) returns (ToBeComfirmedWorksResp) {} // 待确认作品列表
|
rpc ToBeComfirmedWorks(ToBeComfirmedWorksReq) returns (ToBeComfirmedWorksResp) {} // 待确认作品列表
|
||||||
|
rpc ConfirmWork(ConfirmWorkReq) returns (ConfirmWorkResp) {} // 确认作品
|
||||||
|
|
||||||
//对账单
|
//对账单
|
||||||
rpc GetReconciliationList(GetReconciliationListReq) returns (GetReconciliationListResp) {} // 获取对账单列表
|
rpc GetReconciliationList(GetReconciliationListReq) returns (GetReconciliationListResp) {} // 获取对账单列表
|
||||||
rpc CreateReconciliation(ReconciliationInfo) returns (CommonResponse) {} // 创建对账单
|
rpc CreateReconciliation(ReconciliationInfo) returns (CommonResponse) {} // 创建对账单
|
||||||
rpc UpdateReconciliation(ReconciliationInfo) returns (CommonResponse) {} // 更新对账单
|
rpc UpdateReconciliation(ReconciliationInfo) returns (CommonResponse) {} // 更新对账单
|
||||||
rpc UpdateReconciliationStatusBySerialNumber(UpdateStatusAndPayTimeBySerialNumber) returns (CommonResponse) {} // 更新对账单
|
rpc UpdateReconciliationStatusBySerialNumber(UpdateStatusAndPayTimeBySerialNumber) returns (CommonResponse) {} // 更新对账单
|
||||||
}
|
|
||||||
|
|
||||||
|
// 查出没处理的数据
|
||||||
|
rpc ListUnfinishedInfos(AutoCreateUserAndOrderRequest) returns (UnfinishedInfos) {} // 查出没处理的数据
|
||||||
|
rpc SoftDeleteUnfinishedInfo(SoftDeleteUnfinishedInfoRequest) returns (CommonResponse) {} // 软删除
|
||||||
|
}
|
||||||
|
message DeleteValueAddServiceRequest{
|
||||||
|
string orderNo = 1;
|
||||||
|
uint64 userID = 2;
|
||||||
|
}
|
||||||
message GetReconciliationListReq{
|
message GetReconciliationListReq{
|
||||||
string userName = 1;
|
string userName = 1;
|
||||||
string bundleName = 2;
|
string bundleName = 2;
|
||||||
int32 payStatus = 3;
|
int32 payStatus = 3;
|
||||||
int32 payChannel = 4;
|
int32 payChannel = 4;
|
||||||
string orderNo = 5;
|
string bundleOrderOn = 5;
|
||||||
string createdStart = 6;
|
string createdStart = 6;
|
||||||
string createdEnd = 7;
|
string createdEnd = 7;
|
||||||
string payTimeStart = 8;
|
string payTimeStart = 8;
|
||||||
@ -83,6 +97,7 @@ message GetReconciliationListReq{
|
|||||||
int32 page = 11;
|
int32 page = 11;
|
||||||
int32 pageSize = 12;
|
int32 pageSize = 12;
|
||||||
repeated uint64 userIDS = 13;
|
repeated uint64 userIDS = 13;
|
||||||
|
string bundleAddOrderOn = 14;
|
||||||
}
|
}
|
||||||
message GetReconciliationListResp{
|
message GetReconciliationListResp{
|
||||||
repeated ReconciliationInfo list = 1;
|
repeated ReconciliationInfo list = 1;
|
||||||
@ -105,6 +120,7 @@ message ReconciliationInfo{
|
|||||||
int32 payStatus = 12;
|
int32 payStatus = 12;
|
||||||
string serialNumber = 13;
|
string serialNumber = 13;
|
||||||
uint64 userID = 14;
|
uint64 userID = 14;
|
||||||
|
string handlingFee = 15;
|
||||||
}
|
}
|
||||||
message OrderInfoByOrderNoRequest{
|
message OrderInfoByOrderNoRequest{
|
||||||
string orderNo = 1;
|
string orderNo = 1;
|
||||||
@ -119,6 +135,7 @@ message OrderInfoByOrderNoResp{
|
|||||||
int32 dataNumber = 7;
|
int32 dataNumber = 7;
|
||||||
int32 duration = 8;
|
int32 duration = 8;
|
||||||
string unit = 9;
|
string unit = 9;
|
||||||
|
string userName = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
message OrderCreateRecord{
|
message OrderCreateRecord{
|
||||||
@ -142,6 +159,7 @@ message OrderCreateRecord{
|
|||||||
string snapshot = 18 [json_name = "snapshot"];
|
string snapshot = 18 [json_name = "snapshot"];
|
||||||
int32 payType = 19 [json_name = "payType"];
|
int32 payType = 19 [json_name = "payType"];
|
||||||
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //增值服务
|
repeated OrderCreateAddRecord addRecords = 20 [json_name = "addRecords"]; //增值服务
|
||||||
|
string orderNo = 21 [json_name = "orderNo"];
|
||||||
}
|
}
|
||||||
message OrderCreateAddRecord{
|
message OrderCreateAddRecord{
|
||||||
int32 serviceType = 1 [json_name = "serviceType"];
|
int32 serviceType = 1 [json_name = "serviceType"];
|
||||||
@ -152,6 +170,7 @@ message OrderCreateAddRecord{
|
|||||||
string unit = 6 [json_name = "unit"];
|
string unit = 6 [json_name = "unit"];
|
||||||
int32 source = 7 [json_name = "source"];
|
int32 source = 7 [json_name = "source"];
|
||||||
int32 paymentStatus = 8 [json_name = "paymentStatus"];
|
int32 paymentStatus = 8 [json_name = "paymentStatus"];
|
||||||
|
string handlingFee = 9 [json_name = "handlingFee"];
|
||||||
}
|
}
|
||||||
message OrderRecordsRequestV2{
|
message OrderRecordsRequestV2{
|
||||||
string customerName = 1;
|
string customerName = 1;
|
||||||
@ -168,6 +187,8 @@ message OrderRecordsRequestV2{
|
|||||||
int32 page = 12;
|
int32 page = 12;
|
||||||
int32 pageSize = 13;
|
int32 pageSize = 13;
|
||||||
repeated int64 userIds = 14;
|
repeated int64 userIds = 14;
|
||||||
|
string bundlePayStart = 15;
|
||||||
|
string bundlePayEnd = 16;
|
||||||
}
|
}
|
||||||
message OrderRecordsResponseV2{
|
message OrderRecordsResponseV2{
|
||||||
repeated OrderBundleRecordInfo bundleInfo = 1;
|
repeated OrderBundleRecordInfo bundleInfo = 1;
|
||||||
@ -185,13 +206,14 @@ message OrderBundleRecordInfo{
|
|||||||
float amount = 7;
|
float amount = 7;
|
||||||
repeated OrderAddBundleRecordInfo addBundleInfo = 8;
|
repeated OrderAddBundleRecordInfo addBundleInfo = 8;
|
||||||
int64 customerId = 9;
|
int64 customerId = 9;
|
||||||
|
string payTime = 10;
|
||||||
}
|
}
|
||||||
message OrderAddBundleRecordInfo{
|
message OrderAddBundleRecordInfo{
|
||||||
string orderAddNo = 1;
|
string orderAddNo = 1;
|
||||||
float amount = 2;
|
float amount = 2;
|
||||||
float settlementAmount = 3;
|
float settlementAmount = 3;
|
||||||
int32 currencyType = 4;
|
int32 currencyType = 4;
|
||||||
float handlingFee = 5;
|
string handlingFee = 5;
|
||||||
float exchangeRate = 6;
|
float exchangeRate = 6;
|
||||||
string orderAddCreateAt = 7;
|
string orderAddCreateAt = 7;
|
||||||
int32 addPayStatus = 8;
|
int32 addPayStatus = 8;
|
||||||
@ -231,6 +253,7 @@ message BundleProfile {
|
|||||||
repeated SelectValueAddService selectValueAddService = 17 [json_name = "SelectValueAddService"];
|
repeated SelectValueAddService selectValueAddService = 17 [json_name = "SelectValueAddService"];
|
||||||
repeated BundleProfileLang bundleProfileLang = 18 [json_name = "bundleProfileLang"];
|
repeated BundleProfileLang bundleProfileLang = 18 [json_name = "bundleProfileLang"];
|
||||||
int32 imgOption = 19 [json_name = "imgOption"];
|
int32 imgOption = 19 [json_name = "imgOption"];
|
||||||
|
string fontColor = 20 [json_name = "fontColor"];
|
||||||
}
|
}
|
||||||
message BundleProfileLang {
|
message BundleProfileLang {
|
||||||
string uuid = 1 [json_name = "uuid"];
|
string uuid = 1 [json_name = "uuid"];
|
||||||
@ -241,9 +264,15 @@ message BundleProfileLang {
|
|||||||
string language = 6 [json_name = "language"];
|
string language = 6 [json_name = "language"];
|
||||||
string createdAt = 7 [json_name = "createdAt"];
|
string createdAt = 7 [json_name = "createdAt"];
|
||||||
string updatedAt = 8 [json_name = "updatedAt"];
|
string updatedAt = 8 [json_name = "updatedAt"];
|
||||||
//string bgImg1 = 9 [json_name = "bgImg1"];
|
string contract = 9 [json_name = "contract"];
|
||||||
//string bgImg2 = 10 [json_name = "bgImg2"];
|
string companySign = 10 [json_name = "companySign"];
|
||||||
// int64 sort = 11 [json_name = "sort"];
|
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"];
|
//repeated ValueAddServiceLang valueAddServiceLang = 12 [json_name = "ValueAddServiceLang"];
|
||||||
}
|
}
|
||||||
message SaveResponse {
|
message SaveResponse {
|
||||||
@ -255,6 +284,8 @@ message SelectValueAddService {
|
|||||||
string valueAddUuid = 1 [json_name = "valueAddUuid"];
|
string valueAddUuid = 1 [json_name = "valueAddUuid"];
|
||||||
string serviceName= 2 [json_name = "serviceName"];
|
string serviceName= 2 [json_name = "serviceName"];
|
||||||
bool isDisplay = 3 [json_name = "isDisplay"];
|
bool isDisplay = 3 [json_name = "isDisplay"];
|
||||||
|
int32 serviceType = 4 [json_name = "serviceType"];
|
||||||
|
|
||||||
}
|
}
|
||||||
message DelBundleRequest {
|
message DelBundleRequest {
|
||||||
string uuid = 1 [json_name = "uuid"];
|
string uuid = 1 [json_name = "uuid"];
|
||||||
@ -395,6 +426,7 @@ message OrderRecordsDetailRequest {
|
|||||||
string orderNo = 2 [json_name = "orderNo"];
|
string orderNo = 2 [json_name = "orderNo"];
|
||||||
string customerID = 3 [json_name = "customerID"];
|
string customerID = 3 [json_name = "customerID"];
|
||||||
string bundleUUID = 4 [json_name = "bundleUUID"];
|
string bundleUUID = 4 [json_name = "bundleUUID"];
|
||||||
|
uint64 status = 5 [json_name = "status"];
|
||||||
}
|
}
|
||||||
|
|
||||||
message OrderRecordsDetailResponse {
|
message OrderRecordsDetailResponse {
|
||||||
@ -521,6 +553,14 @@ message CalculatePriceResponse{
|
|||||||
string msg = 1;
|
string msg = 1;
|
||||||
float price = 2;
|
float price = 2;
|
||||||
}
|
}
|
||||||
|
message BatchGetValueAddServiceLangRequest{
|
||||||
|
repeated string uuids = 1;
|
||||||
|
string language = 2;
|
||||||
|
}
|
||||||
|
message BatchGetValueAddServiceLangResponse{
|
||||||
|
string msg = 1;
|
||||||
|
repeated ValueAddServiceLang valueAddServiceLangList = 2;
|
||||||
|
}
|
||||||
//*********************************新增值服务-over******************************************
|
//*********************************新增值服务-over******************************************
|
||||||
|
|
||||||
message BundleExtendRequest{
|
message BundleExtendRequest{
|
||||||
@ -533,8 +573,10 @@ message BundleExtendRequest{
|
|||||||
uint32 timeUnit = 7; // 1 日 2 月 3年
|
uint32 timeUnit = 7; // 1 日 2 月 3年
|
||||||
string remark = 8;
|
string remark = 8;
|
||||||
string associatedorderNumber = 9;
|
string associatedorderNumber = 9;
|
||||||
string operatorName = 10;
|
uint64 operatorId = 10;
|
||||||
string operatorPhoneNumber = 11;
|
string operatorName = 11;
|
||||||
|
string operatorPhoneNumber = 12;
|
||||||
|
int32 type = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BundleExtendResponse{
|
message BundleExtendResponse{
|
||||||
@ -568,18 +610,20 @@ message BundleExtendRecordItem{
|
|||||||
uint64 createdAt = 9;
|
uint64 createdAt = 9;
|
||||||
string remark = 10;
|
string remark = 10;
|
||||||
string associatedOrderNumber = 11;
|
string associatedOrderNumber = 11;
|
||||||
string operatorName = 12;
|
uint32 timeUnit = 12;
|
||||||
string operatorPhoneNumber = 13;
|
string operatorName = 13;
|
||||||
|
string operatorPhoneNumber = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBundleBalanceListReq{
|
message GetBundleBalanceListReq{
|
||||||
string userName = 1;
|
string userName = 1;
|
||||||
int32 status = 2;
|
int32 status = 2;
|
||||||
string bundleName = 3;
|
string bundleName = 3;
|
||||||
int64 expiredTimeStart = 4;
|
int32 bought = 4;
|
||||||
int64 expiredTimeEnd = 5;
|
int64 expiredTimeStart = 5;
|
||||||
int32 page = 6;
|
int64 expiredTimeEnd = 6;
|
||||||
int32 pageSize = 7;
|
int32 page = 7;
|
||||||
|
int32 pageSize = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBundleBalanceReq{
|
message GetBundleBalanceReq{
|
||||||
@ -608,11 +652,9 @@ message BundleBalanceItem{
|
|||||||
int32 dataAnalysisNumber = 13;
|
int32 dataAnalysisNumber = 13;
|
||||||
int32 dataAnalysisConsumptionNumber = 14;
|
int32 dataAnalysisConsumptionNumber = 14;
|
||||||
int32 expansionPacksNumber = 15;
|
int32 expansionPacksNumber = 15;
|
||||||
|
int32 bought = 16;
|
||||||
}
|
}
|
||||||
message GetBundleBalanceResp{
|
|
||||||
int64 total = 1;
|
|
||||||
repeated BundleBalanceItem data = 2;
|
|
||||||
}
|
|
||||||
message GetBundleBalanceListResp{
|
message GetBundleBalanceListResp{
|
||||||
int64 total = 1;
|
int64 total = 1;
|
||||||
repeated BundleBalanceItem data = 2;
|
repeated BundleBalanceItem data = 2;
|
||||||
@ -658,7 +700,7 @@ message AddBundleBalanceResp{
|
|||||||
message GetUsedRecordListReq{
|
message GetUsedRecordListReq{
|
||||||
string user = 1;
|
string user = 1;
|
||||||
string operator = 2;
|
string operator = 2;
|
||||||
int32 account = 3;
|
string account = 3;
|
||||||
int32 platform = 4;
|
int32 platform = 4;
|
||||||
int32 type = 5;
|
int32 type = 5;
|
||||||
string title = 6;
|
string title = 6;
|
||||||
@ -681,7 +723,7 @@ message WorkCastItem{
|
|||||||
uint32 workCategory = 5; // 1 图文 2 视频
|
uint32 workCategory = 5; // 1 图文 2 视频
|
||||||
string bundleUuid = 6; // 套餐ID uuid
|
string bundleUuid = 6; // 套餐ID uuid
|
||||||
string bundleName = 7; // 套餐名称
|
string bundleName = 7; // 套餐名称
|
||||||
string platformIDs = 8; // 发布平台ID集合 (json 格式字符串)
|
string platformIds = 8; // 发布平台ID集合 (json 格式字符串)
|
||||||
string mediaNames = 9; // 自媒体账号名称集合
|
string mediaNames = 9; // 自媒体账号名称集合
|
||||||
string mediaAccIDs = 10; // 自媒体账号ID集合
|
string mediaAccIDs = 10; // 自媒体账号ID集合
|
||||||
string workTitle = 11; // 作品标题
|
string workTitle = 11; // 作品标题
|
||||||
@ -718,18 +760,54 @@ message ToBeComfirmedWorksReq{
|
|||||||
int32 pageSize =3;
|
int32 pageSize =3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message workItem{
|
||||||
|
string uuid = 1;
|
||||||
|
string workUuid = 2;
|
||||||
|
string title = 3;
|
||||||
|
string content = 4;
|
||||||
|
uint32 workCategory = 5;
|
||||||
|
uint32 workStatus = 6;
|
||||||
|
string platformIds = 7;
|
||||||
|
string mediaNames = 8;
|
||||||
|
string mediaAccUserIds = 9;
|
||||||
|
int64 confirmedAt = 10;
|
||||||
|
int64 createdAt = 11; // 提交时间
|
||||||
|
string artistName = 12;
|
||||||
|
string artistUuid = 13;
|
||||||
|
}
|
||||||
|
|
||||||
message ToBeComfirmedWorksResp{
|
message ToBeComfirmedWorksResp{
|
||||||
string uuid = 1; // 作品uuid
|
int64 total = 1;
|
||||||
uint32 workCategory = 2; // 1 图文 2 视频
|
int64 unconfirmed = 2;
|
||||||
string platformIDs = 3; // 发布平台ID集合 (json 格式字符串)
|
repeated workItem data = 3;
|
||||||
string mediaNames = 4; // 自媒体账号名称集合
|
}
|
||||||
string mediaAccIDs = 5; // 自媒体账号ID集合
|
|
||||||
string title = 6; // 作品标题
|
message GetBundleBalanceByUserIdReq{
|
||||||
string content = 7; // 作品标题
|
int32 userId = 1;
|
||||||
string submitTime = 8; // 提交时间
|
}
|
||||||
string operatorName = 9; // 操作人名称
|
|
||||||
string operatorPhone = 10; // 操作人手机号
|
message GetBundleBalanceByUserIdResp{
|
||||||
uint32 status = 11; // 1 待提交 2 审核中 3 审核失败 4 待艺人确认 5 艺人驳回 6 发布成功 7 发布失败
|
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{
|
message OnlyAddValueListByOrderNoRequest{
|
||||||
@ -753,3 +831,45 @@ message UpdateStatusAndPayTimeBySerialNumber {
|
|||||||
string payTime = 2;
|
string payTime = 2;
|
||||||
int32 paymentStatus = 3;
|
int32 paymentStatus = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message ConfirmWorkReq{
|
||||||
|
string workUuid = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ConfirmWorkResp{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
message AutoCreateUserAndOrderRequest {
|
||||||
|
int32 num = 1; // 处理数量
|
||||||
|
}
|
||||||
|
|
||||||
|
message UnfinishedInfos {
|
||||||
|
repeated UnfinishedInfo unfinishedInfos = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message UnfinishedInfo {
|
||||||
|
uint32 ID = 1;
|
||||||
|
string userNum = 2;
|
||||||
|
string userName = 3;
|
||||||
|
string userTelArea = 4;
|
||||||
|
string userTel = 5;
|
||||||
|
string userSex = 6;
|
||||||
|
string nationality = 7;
|
||||||
|
string placeOfResidence = 8;
|
||||||
|
int32 documentType = 9;
|
||||||
|
string userIdCardFrontUrl = 10;
|
||||||
|
string userIdCardReverseUrl = 11;
|
||||||
|
string userIdCardValidity = 12;
|
||||||
|
string orderNo = 13;
|
||||||
|
string orderPayAmount = 14;
|
||||||
|
string orderSettlementAmount = 15;
|
||||||
|
string orderFeeAmount = 16;
|
||||||
|
string orderPayCurrency = 17;
|
||||||
|
string orderAccountCurrency = 18;
|
||||||
|
string payTime = 19;
|
||||||
|
}
|
||||||
|
|
||||||
|
message SoftDeleteUnfinishedInfoRequest {
|
||||||
|
uint32 ID = 1;
|
||||||
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -5,11 +5,11 @@ package bundle
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
fmt "fmt"
|
fmt "fmt"
|
||||||
|
math "math"
|
||||||
proto "github.com/golang/protobuf/proto"
|
proto "github.com/golang/protobuf/proto"
|
||||||
_ "github.com/mwitkow/go-proto-validators"
|
_ "github.com/mwitkow/go-proto-validators"
|
||||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
|
||||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||||
math "math"
|
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
@ -17,6 +17,9 @@ var _ = proto.Marshal
|
|||||||
var _ = fmt.Errorf
|
var _ = fmt.Errorf
|
||||||
var _ = math.Inf
|
var _ = math.Inf
|
||||||
|
|
||||||
|
func (this *DeleteValueAddServiceRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *GetReconciliationListReq) Validate() error {
|
func (this *GetReconciliationListReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -303,6 +306,19 @@ func (this *CalculatePriceRequest) Validate() error {
|
|||||||
func (this *CalculatePriceResponse) Validate() error {
|
func (this *CalculatePriceResponse) Validate() error {
|
||||||
return nil
|
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 {
|
func (this *BundleExtendRequest) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -334,16 +350,6 @@ func (this *GetBundleBalanceReq) Validate() error {
|
|||||||
func (this *BundleBalanceItem) Validate() error {
|
func (this *BundleBalanceItem) Validate() error {
|
||||||
return nil
|
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 {
|
func (this *GetBundleBalanceListResp) Validate() error {
|
||||||
for _, item := range this.Data {
|
for _, item := range this.Data {
|
||||||
if item != nil {
|
if item != nil {
|
||||||
@ -397,7 +403,23 @@ func (this *GetVedioeWorkDetailResp) Validate() error {
|
|||||||
func (this *ToBeComfirmedWorksReq) Validate() error {
|
func (this *ToBeComfirmedWorksReq) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *WorkItem) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (this *ToBeComfirmedWorksResp) Validate() error {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
func (this *OnlyAddValueListByOrderNoRequest) Validate() error {
|
func (this *OnlyAddValueListByOrderNoRequest) Validate() error {
|
||||||
@ -419,3 +441,28 @@ func (this *AddBundleInfo) Validate() error {
|
|||||||
func (this *UpdateStatusAndPayTimeBySerialNumber) Validate() error {
|
func (this *UpdateStatusAndPayTimeBySerialNumber) Validate() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
func (this *ConfirmWorkReq) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *ConfirmWorkResp) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *AutoCreateUserAndOrderRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UnfinishedInfos) Validate() error {
|
||||||
|
for _, item := range this.UnfinishedInfos {
|
||||||
|
if item != nil {
|
||||||
|
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||||
|
return github_com_mwitkow_go_proto_validators.FieldError("UnfinishedInfos", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *UnfinishedInfo) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (this *SoftDeleteUnfinishedInfoRequest) Validate() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-triple v1.0.8
|
// - protoc-gen-go-triple v1.0.8
|
||||||
// - protoc v5.26.1
|
// - protoc v4.24.0--rc1
|
||||||
// source: pb/bundle.proto
|
// source: pb/bundle.proto
|
||||||
|
|
||||||
package bundle
|
package bundle
|
||||||
@ -35,6 +35,8 @@ type BundleClient interface {
|
|||||||
SaveBundle(ctx context.Context, in *BundleProfile, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
|
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)
|
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)
|
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)
|
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)
|
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)
|
CreateOrderRecord(ctx context.Context, in *OrderCreateRecord, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
@ -48,20 +50,23 @@ type BundleClient interface {
|
|||||||
OrderRecordsListV2(ctx context.Context, in *OrderRecordsRequestV2, opts ...grpc_go.CallOption) (*OrderRecordsResponseV2, 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)
|
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)
|
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)
|
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)
|
ValueAddBundleList(ctx context.Context, in *ValueAddBundleListRequest, opts ...grpc_go.CallOption) (*ValueAddBundleListResponse, common.ErrorWithAttachment)
|
||||||
ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment)
|
ValueAddBundleDetail(ctx context.Context, in *ValueAddBundleDetailRequest, opts ...grpc_go.CallOption) (*ValueAddBundleDetailResponse, common.ErrorWithAttachment)
|
||||||
// 新增值服务
|
//新增值服务
|
||||||
SaveValueAddService(ctx context.Context, in *ValueAddServiceLang, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
|
SaveValueAddService(ctx context.Context, in *ValueAddServiceLang, opts ...grpc_go.CallOption) (*SaveResponse, common.ErrorWithAttachment)
|
||||||
ValueAddServiceList(ctx context.Context, in *ValueAddServiceListRequest, opts ...grpc_go.CallOption) (*ValueAddServiceListResponse, common.ErrorWithAttachment)
|
ValueAddServiceList(ctx context.Context, in *ValueAddServiceListRequest, opts ...grpc_go.CallOption) (*ValueAddServiceListResponse, common.ErrorWithAttachment)
|
||||||
ValueAddServiceDetail(ctx context.Context, in *ValueAddServiceDetailRequest, opts ...grpc_go.CallOption) (*ValueAddServiceDetailResponse, common.ErrorWithAttachment)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
AddBundleBalance(ctx context.Context, in *AddBundleBalanceReq, opts ...grpc_go.CallOption) (*AddBundleBalanceResp, common.ErrorWithAttachment)
|
||||||
// 使用记录
|
// 使用记录
|
||||||
@ -69,11 +74,15 @@ type BundleClient interface {
|
|||||||
GetImageWorkDetail(ctx context.Context, in *GetImageWorkDetailReq, opts ...grpc_go.CallOption) (*GetImageWorkDetailResp, common.ErrorWithAttachment)
|
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)
|
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)
|
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)
|
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)
|
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)
|
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)
|
UpdateReconciliationStatusBySerialNumber(ctx context.Context, in *UpdateStatusAndPayTimeBySerialNumber, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
|
// 查出没处理的数据
|
||||||
|
ListUnfinishedInfos(ctx context.Context, in *AutoCreateUserAndOrderRequest, opts ...grpc_go.CallOption) (*UnfinishedInfos, common.ErrorWithAttachment)
|
||||||
|
SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||||
}
|
}
|
||||||
|
|
||||||
type bundleClient struct {
|
type bundleClient struct {
|
||||||
@ -88,6 +97,8 @@ type BundleClientImpl struct {
|
|||||||
SaveBundle func(ctx context.Context, in *BundleProfile) (*SaveResponse, error)
|
SaveBundle func(ctx context.Context, in *BundleProfile) (*SaveResponse, error)
|
||||||
BundleListV2 func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
|
BundleListV2 func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
|
||||||
BundleDetailV2 func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponseV2, 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)
|
BundleList func(ctx context.Context, in *BundleListRequest) (*BundleListResponse, error)
|
||||||
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
|
BundleDetail func(ctx context.Context, in *BundleDetailRequest) (*BundleDetailResponse, error)
|
||||||
CreateOrderRecord func(ctx context.Context, in *OrderCreateRecord) (*CommonResponse, error)
|
CreateOrderRecord func(ctx context.Context, in *OrderCreateRecord) (*CommonResponse, error)
|
||||||
@ -109,19 +120,25 @@ type BundleClientImpl struct {
|
|||||||
ValueAddServiceDetail func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
|
ValueAddServiceDetail func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
|
||||||
ValueAddServiceLangByUuidAndLanguage func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error)
|
ValueAddServiceLangByUuidAndLanguage func(ctx context.Context, in *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error)
|
||||||
CalculatePrice func(ctx context.Context, in *CalculatePriceRequest) (*CalculatePriceResponse, 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)
|
BundleExtend func(ctx context.Context, in *BundleExtendRequest) (*BundleExtendResponse, error)
|
||||||
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
BundleExtendRecordsList func(ctx context.Context, in *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||||
GetBundleBalanceList func(ctx context.Context, in *GetBundleBalanceListReq) (*GetBundleBalanceListResp, 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)
|
CreateBundleBalance func(ctx context.Context, in *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
||||||
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
AddBundleBalance func(ctx context.Context, in *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
||||||
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
|
GetUsedRecordList func(ctx context.Context, in *GetUsedRecordListReq) (*GetUsedRecordListResp, error)
|
||||||
GetImageWorkDetail func(ctx context.Context, in *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
|
GetImageWorkDetail func(ctx context.Context, in *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
|
||||||
GetVedioWorkDetail func(ctx context.Context, in *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
|
GetVedioWorkDetail func(ctx context.Context, in *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
|
||||||
ToBeComfirmedWorks func(ctx context.Context, in *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, 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)
|
GetReconciliationList func(ctx context.Context, in *GetReconciliationListReq) (*GetReconciliationListResp, error)
|
||||||
CreateReconciliation func(ctx context.Context, in *ReconciliationInfo) (*CommonResponse, error)
|
CreateReconciliation func(ctx context.Context, in *ReconciliationInfo) (*CommonResponse, error)
|
||||||
UpdateReconciliation 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)
|
UpdateReconciliationStatusBySerialNumber func(ctx context.Context, in *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error)
|
||||||
|
ListUnfinishedInfos func(ctx context.Context, in *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
|
||||||
|
SoftDeleteUnfinishedInfo func(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||||
@ -178,6 +195,18 @@ func (c *bundleClient) BundleDetailV2(ctx context.Context, in *BundleDetailReque
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BundleDetailV2", in, out)
|
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) {
|
func (c *bundleClient) BundleList(ctx context.Context, in *BundleListRequest, opts ...grpc_go.CallOption) (*BundleListResponse, common.ErrorWithAttachment) {
|
||||||
out := new(BundleListResponse)
|
out := new(BundleListResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -304,6 +333,18 @@ func (c *bundleClient) CalculatePrice(ctx context.Context, in *CalculatePriceReq
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CalculatePrice", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CalculatePrice", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) BatchGetValueAddServiceLang(ctx context.Context, in *BatchGetValueAddServiceLangRequest, opts ...grpc_go.CallOption) (*BatchGetValueAddServiceLangResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(BatchGetValueAddServiceLangResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/BatchGetValueAddServiceLang", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) DeleteValueAddService(ctx context.Context, in *DeleteValueAddServiceRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteValueAddService", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *bundleClient) BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) {
|
func (c *bundleClient) BundleExtend(ctx context.Context, in *BundleExtendRequest, opts ...grpc_go.CallOption) (*BundleExtendResponse, common.ErrorWithAttachment) {
|
||||||
out := new(BundleExtendResponse)
|
out := new(BundleExtendResponse)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -322,6 +363,12 @@ func (c *bundleClient) GetBundleBalanceList(ctx context.Context, in *GetBundleBa
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetBundleBalanceList", in, out)
|
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) {
|
func (c *bundleClient) CreateBundleBalance(ctx context.Context, in *CreateBundleBalanceReq, opts ...grpc_go.CallOption) (*CreateBundleBalanceResp, common.ErrorWithAttachment) {
|
||||||
out := new(CreateBundleBalanceResp)
|
out := new(CreateBundleBalanceResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -358,6 +405,12 @@ func (c *bundleClient) ToBeComfirmedWorks(ctx context.Context, in *ToBeComfirmed
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ToBeComfirmedWorks", in, out)
|
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) {
|
func (c *bundleClient) GetReconciliationList(ctx context.Context, in *GetReconciliationListReq, opts ...grpc_go.CallOption) (*GetReconciliationListResp, common.ErrorWithAttachment) {
|
||||||
out := new(GetReconciliationListResp)
|
out := new(GetReconciliationListResp)
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
@ -382,6 +435,18 @@ func (c *bundleClient) UpdateReconciliationStatusBySerialNumber(ctx context.Cont
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateReconciliationStatusBySerialNumber", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateReconciliationStatusBySerialNumber", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) ListUnfinishedInfos(ctx context.Context, in *AutoCreateUserAndOrderRequest, opts ...grpc_go.CallOption) (*UnfinishedInfos, common.ErrorWithAttachment) {
|
||||||
|
out := new(UnfinishedInfos)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListUnfinishedInfos", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *bundleClient) SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||||
|
out := new(CommonResponse)
|
||||||
|
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||||
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SoftDeleteUnfinishedInfo", in, out)
|
||||||
|
}
|
||||||
|
|
||||||
// BundleServer is the server API for Bundle service.
|
// BundleServer is the server API for Bundle service.
|
||||||
// All implementations must embed UnimplementedBundleServer
|
// All implementations must embed UnimplementedBundleServer
|
||||||
// for forward compatibility
|
// for forward compatibility
|
||||||
@ -393,6 +458,8 @@ type BundleServer interface {
|
|||||||
SaveBundle(context.Context, *BundleProfile) (*SaveResponse, error)
|
SaveBundle(context.Context, *BundleProfile) (*SaveResponse, error)
|
||||||
BundleListV2(context.Context, *BundleListRequest) (*BundleListResponse, error)
|
BundleListV2(context.Context, *BundleListRequest) (*BundleListResponse, error)
|
||||||
BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, 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)
|
BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error)
|
||||||
BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error)
|
BundleDetail(context.Context, *BundleDetailRequest) (*BundleDetailResponse, error)
|
||||||
CreateOrderRecord(context.Context, *OrderCreateRecord) (*CommonResponse, error)
|
CreateOrderRecord(context.Context, *OrderCreateRecord) (*CommonResponse, error)
|
||||||
@ -406,20 +473,23 @@ type BundleServer interface {
|
|||||||
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
OrderRecordsListV2(context.Context, *OrderRecordsRequestV2) (*OrderRecordsResponseV2, error)
|
||||||
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
OrderListByOrderNo(context.Context, *OrderInfoByOrderNoRequest) (*OrderInfoByOrderNoResp, error)
|
||||||
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
OnlyAddValueListByOrderNo(context.Context, *OnlyAddValueListByOrderNoRequest) (*OnlyAddValueListByOrderNoResp, error)
|
||||||
// 增值套餐
|
//增值套餐
|
||||||
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
CreateValueAddBundle(context.Context, *CreateValueAddBundleRequest) (*CreateValueAddBundleResponse, error)
|
||||||
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
ValueAddBundleList(context.Context, *ValueAddBundleListRequest) (*ValueAddBundleListResponse, error)
|
||||||
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
ValueAddBundleDetail(context.Context, *ValueAddBundleDetailRequest) (*ValueAddBundleDetailResponse, error)
|
||||||
// 新增值服务
|
//新增值服务
|
||||||
SaveValueAddService(context.Context, *ValueAddServiceLang) (*SaveResponse, error)
|
SaveValueAddService(context.Context, *ValueAddServiceLang) (*SaveResponse, error)
|
||||||
ValueAddServiceList(context.Context, *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
|
ValueAddServiceList(context.Context, *ValueAddServiceListRequest) (*ValueAddServiceListResponse, error)
|
||||||
ValueAddServiceDetail(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
|
ValueAddServiceDetail(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceDetailResponse, error)
|
||||||
ValueAddServiceLangByUuidAndLanguage(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error)
|
ValueAddServiceLangByUuidAndLanguage(context.Context, *ValueAddServiceDetailRequest) (*ValueAddServiceLang, error)
|
||||||
CalculatePrice(context.Context, *CalculatePriceRequest) (*CalculatePriceResponse, 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)
|
BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error)
|
||||||
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
BundleExtendRecordsList(context.Context, *BundleExtendRecordsListRequest) (*BundleExtendRecordsListResponse, error)
|
||||||
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error)
|
||||||
|
GetBundleBalanceByUserId(context.Context, *GetBundleBalanceByUserIdReq) (*GetBundleBalanceByUserIdResp, error)
|
||||||
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error)
|
||||||
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
AddBundleBalance(context.Context, *AddBundleBalanceReq) (*AddBundleBalanceResp, error)
|
||||||
// 使用记录
|
// 使用记录
|
||||||
@ -427,11 +497,15 @@ type BundleServer interface {
|
|||||||
GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
|
GetImageWorkDetail(context.Context, *GetImageWorkDetailReq) (*GetImageWorkDetailResp, error)
|
||||||
GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
|
GetVedioWorkDetail(context.Context, *GetVedioWorkDetailReq) (*GetVedioeWorkDetailResp, error)
|
||||||
ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
|
ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error)
|
||||||
// 对账单
|
ConfirmWork(context.Context, *ConfirmWorkReq) (*ConfirmWorkResp, error)
|
||||||
|
//对账单
|
||||||
GetReconciliationList(context.Context, *GetReconciliationListReq) (*GetReconciliationListResp, error)
|
GetReconciliationList(context.Context, *GetReconciliationListReq) (*GetReconciliationListResp, error)
|
||||||
CreateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)
|
CreateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)
|
||||||
UpdateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)
|
UpdateReconciliation(context.Context, *ReconciliationInfo) (*CommonResponse, error)
|
||||||
UpdateReconciliationStatusBySerialNumber(context.Context, *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error)
|
UpdateReconciliationStatusBySerialNumber(context.Context, *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error)
|
||||||
|
// 查出没处理的数据
|
||||||
|
ListUnfinishedInfos(context.Context, *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
|
||||||
|
SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
|
||||||
mustEmbedUnimplementedBundleServer()
|
mustEmbedUnimplementedBundleServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,6 +535,12 @@ func (UnimplementedBundleServer) BundleListV2(context.Context, *BundleListReques
|
|||||||
func (UnimplementedBundleServer) BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error) {
|
func (UnimplementedBundleServer) BundleDetailV2(context.Context, *BundleDetailRequest) (*BundleDetailResponseV2, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method BundleDetailV2 not implemented")
|
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) {
|
func (UnimplementedBundleServer) BundleList(context.Context, *BundleListRequest) (*BundleListResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method BundleList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method BundleList not implemented")
|
||||||
}
|
}
|
||||||
@ -524,6 +604,12 @@ func (UnimplementedBundleServer) ValueAddServiceLangByUuidAndLanguage(context.Co
|
|||||||
func (UnimplementedBundleServer) CalculatePrice(context.Context, *CalculatePriceRequest) (*CalculatePriceResponse, error) {
|
func (UnimplementedBundleServer) CalculatePrice(context.Context, *CalculatePriceRequest) (*CalculatePriceResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CalculatePrice not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method CalculatePrice not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) BatchGetValueAddServiceLang(context.Context, *BatchGetValueAddServiceLangRequest) (*BatchGetValueAddServiceLangResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method BatchGetValueAddServiceLang not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) DeleteValueAddService(context.Context, *DeleteValueAddServiceRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteValueAddService not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) {
|
func (UnimplementedBundleServer) BundleExtend(context.Context, *BundleExtendRequest) (*BundleExtendResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method BundleExtend not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method BundleExtend not implemented")
|
||||||
}
|
}
|
||||||
@ -533,6 +619,9 @@ func (UnimplementedBundleServer) BundleExtendRecordsList(context.Context, *Bundl
|
|||||||
func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
|
func (UnimplementedBundleServer) GetBundleBalanceList(context.Context, *GetBundleBalanceListReq) (*GetBundleBalanceListResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBundleBalanceList not implemented")
|
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) {
|
func (UnimplementedBundleServer) CreateBundleBalance(context.Context, *CreateBundleBalanceReq) (*CreateBundleBalanceResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method CreateBundleBalance not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method CreateBundleBalance not implemented")
|
||||||
}
|
}
|
||||||
@ -551,6 +640,9 @@ func (UnimplementedBundleServer) GetVedioWorkDetail(context.Context, *GetVedioWo
|
|||||||
func (UnimplementedBundleServer) ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) {
|
func (UnimplementedBundleServer) ToBeComfirmedWorks(context.Context, *ToBeComfirmedWorksReq) (*ToBeComfirmedWorksResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ToBeComfirmedWorks not implemented")
|
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) {
|
func (UnimplementedBundleServer) GetReconciliationList(context.Context, *GetReconciliationListReq) (*GetReconciliationListResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetReconciliationList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetReconciliationList not implemented")
|
||||||
}
|
}
|
||||||
@ -563,6 +655,12 @@ func (UnimplementedBundleServer) UpdateReconciliation(context.Context, *Reconcil
|
|||||||
func (UnimplementedBundleServer) UpdateReconciliationStatusBySerialNumber(context.Context, *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error) {
|
func (UnimplementedBundleServer) UpdateReconciliationStatusBySerialNumber(context.Context, *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateReconciliationStatusBySerialNumber not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateReconciliationStatusBySerialNumber not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedBundleServer) ListUnfinishedInfos(context.Context, *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method ListUnfinishedInfos not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedBundleServer) SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method SoftDeleteUnfinishedInfo not implemented")
|
||||||
|
}
|
||||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -794,6 +892,64 @@ func _Bundle_BundleDetailV2_Handler(srv interface{}, ctx context.Context, dec fu
|
|||||||
return interceptor(ctx, in, info, handler)
|
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) {
|
func _Bundle_BundleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(BundleListRequest)
|
in := new(BundleListRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -1403,6 +1559,64 @@ func _Bundle_CalculatePrice_Handler(srv interface{}, ctx context.Context, dec fu
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_BatchGetValueAddServiceLang_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(BatchGetValueAddServiceLangRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("BatchGetValueAddServiceLang", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_DeleteValueAddService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(DeleteValueAddServiceRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("DeleteValueAddService", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _Bundle_BundleExtend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
func _Bundle_BundleExtend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(BundleExtendRequest)
|
in := new(BundleExtendRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -1490,6 +1704,35 @@ func _Bundle_GetBundleBalanceList_Handler(srv interface{}, ctx context.Context,
|
|||||||
return interceptor(ctx, in, info, handler)
|
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) {
|
func _Bundle_CreateBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(CreateBundleBalanceReq)
|
in := new(CreateBundleBalanceReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -1664,6 +1907,35 @@ func _Bundle_ToBeComfirmedWorks_Handler(srv interface{}, ctx context.Context, de
|
|||||||
return interceptor(ctx, in, info, handler)
|
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) {
|
func _Bundle_GetReconciliationList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetReconciliationListReq)
|
in := new(GetReconciliationListReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
@ -1780,6 +2052,64 @@ func _Bundle_UpdateReconciliationStatusBySerialNumber_Handler(srv interface{}, c
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Bundle_ListUnfinishedInfos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(AutoCreateUserAndOrderRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("ListUnfinishedInfos", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Bundle_SoftDeleteUnfinishedInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(SoftDeleteUnfinishedInfoRequest)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||||
|
args := []interface{}{}
|
||||||
|
args = append(args, in)
|
||||||
|
md, _ := metadata.FromIncomingContext(ctx)
|
||||||
|
invAttachment := make(map[string]interface{}, len(md))
|
||||||
|
for k, v := range md {
|
||||||
|
invAttachment[k] = v
|
||||||
|
}
|
||||||
|
invo := invocation.NewRPCInvocation("SoftDeleteUnfinishedInfo", args, invAttachment)
|
||||||
|
if interceptor == nil {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
info := &grpc_go.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||||
|
return result, result.Error()
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
||||||
// It's only intended for direct use with grpc_go.RegisterService,
|
// It's only intended for direct use with grpc_go.RegisterService,
|
||||||
// and not to be introspected or modified (even as a copy)
|
// and not to be introspected or modified (even as a copy)
|
||||||
@ -1815,6 +2145,14 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "BundleDetailV2",
|
MethodName: "BundleDetailV2",
|
||||||
Handler: _Bundle_BundleDetailV2_Handler,
|
Handler: _Bundle_BundleDetailV2_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "BundleListH5V2",
|
||||||
|
Handler: _Bundle_BundleListH5V2_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "BundleLangDetailV2",
|
||||||
|
Handler: _Bundle_BundleLangDetailV2_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "BundleList",
|
MethodName: "BundleList",
|
||||||
Handler: _Bundle_BundleList_Handler,
|
Handler: _Bundle_BundleList_Handler,
|
||||||
@ -1899,6 +2237,14 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "CalculatePrice",
|
MethodName: "CalculatePrice",
|
||||||
Handler: _Bundle_CalculatePrice_Handler,
|
Handler: _Bundle_CalculatePrice_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "BatchGetValueAddServiceLang",
|
||||||
|
Handler: _Bundle_BatchGetValueAddServiceLang_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "DeleteValueAddService",
|
||||||
|
Handler: _Bundle_DeleteValueAddService_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "BundleExtend",
|
MethodName: "BundleExtend",
|
||||||
Handler: _Bundle_BundleExtend_Handler,
|
Handler: _Bundle_BundleExtend_Handler,
|
||||||
@ -1911,6 +2257,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "GetBundleBalanceList",
|
MethodName: "GetBundleBalanceList",
|
||||||
Handler: _Bundle_GetBundleBalanceList_Handler,
|
Handler: _Bundle_GetBundleBalanceList_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetBundleBalanceByUserId",
|
||||||
|
Handler: _Bundle_GetBundleBalanceByUserId_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "CreateBundleBalance",
|
MethodName: "CreateBundleBalance",
|
||||||
Handler: _Bundle_CreateBundleBalance_Handler,
|
Handler: _Bundle_CreateBundleBalance_Handler,
|
||||||
@ -1935,6 +2285,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "ToBeComfirmedWorks",
|
MethodName: "ToBeComfirmedWorks",
|
||||||
Handler: _Bundle_ToBeComfirmedWorks_Handler,
|
Handler: _Bundle_ToBeComfirmedWorks_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ConfirmWork",
|
||||||
|
Handler: _Bundle_ConfirmWork_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetReconciliationList",
|
MethodName: "GetReconciliationList",
|
||||||
Handler: _Bundle_GetReconciliationList_Handler,
|
Handler: _Bundle_GetReconciliationList_Handler,
|
||||||
@ -1951,6 +2305,14 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "UpdateReconciliationStatusBySerialNumber",
|
MethodName: "UpdateReconciliationStatusBySerialNumber",
|
||||||
Handler: _Bundle_UpdateReconciliationStatusBySerialNumber_Handler,
|
Handler: _Bundle_UpdateReconciliationStatusBySerialNumber_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "ListUnfinishedInfos",
|
||||||
|
Handler: _Bundle_ListUnfinishedInfos_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "SoftDeleteUnfinishedInfo",
|
||||||
|
Handler: _Bundle_SoftDeleteUnfinishedInfo_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/bundle.proto",
|
Metadata: "pb/bundle.proto",
|
||||||
|
@ -15,7 +15,7 @@ const (
|
|||||||
ZH_TW = "zh-TW" //繁体中文
|
ZH_TW = "zh-TW" //繁体中文
|
||||||
EN = "EN" //英文
|
EN = "EN" //英文
|
||||||
DE_DE = "de-DE" //德语
|
DE_DE = "de-DE" //德语
|
||||||
JS_JP = "js-JP" //日语
|
JA_JP = "ja-JP" //日语
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -52,7 +52,9 @@ const (
|
|||||||
SuccessCreateOrderInfo = "创建订单信息成功"
|
SuccessCreateOrderInfo = "创建订单信息成功"
|
||||||
|
|
||||||
ErrorUpdateOrderInfo = "更新订单信息失败"
|
ErrorUpdateOrderInfo = "更新订单信息失败"
|
||||||
|
ErrorDeleteOrderInfo = "删除增值服务失败"
|
||||||
SuccessUpdateOrderInfo = "更新订单信息成功"
|
SuccessUpdateOrderInfo = "更新订单信息成功"
|
||||||
|
SuccessDeletedOrderInfo = "删除订单信息成功"
|
||||||
|
|
||||||
ErrorGetOrderInfo = "获取订单信息失败"
|
ErrorGetOrderInfo = "获取订单信息失败"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user