From cdc0c3f2fb5020f74e012e43f7715bb24edea630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=87=E6=AD=A6?= <875892894@qq.com> Date: Thu, 1 Aug 2024 12:54:03 +0800 Subject: [PATCH] init --- .gitignore | 24 + .idea/.gitignore | 5 + .idea/admin-api.iml | 9 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + README.md | 3 +- api/admin/application.go | 131 + api/admin/banner.go | 186 + api/admin/bill.go | 549 + api/admin/business.go | 162 + api/admin/category.go | 153 + api/admin/chain.go | 36 + api/admin/dict.go | 40 + api/admin/goods.go | 61 + api/admin/mission.go | 575 + api/admin/order.go | 80 + api/admin/organization.go | 131 + api/admin/provider.go | 131 + api/admin/tags.go | 181 + api/admin/user.go | 219 + api/admin/wallet.go | 48 + api/sys/exa_breakpoint_continue.go | 130 + api/sys/sys_api.go | 175 + api/sys/sys_authority.go | 140 + api/sys/sys_auto_code.go | 99 + api/sys/sys_captcha.go | 37 + api/sys/sys_casbin.go | 54 + api/sys/sys_dictionary.go | 77 + api/sys/sys_dictionary_detail.go | 77 + api/sys/sys_email.go | 19 + api/sys/sys_jwt_blacklist.go | 22 + api/sys/sys_menu.go | 237 + api/sys/sys_operation_record.go | 117 + api/sys/sys_system.go | 65 + api/sys/sys_user.go | 395 + config-prod.yaml | 78 + config.yaml | 78 + config/auto_code.go | 18 + config/captcha.go | 7 + config/casbin.go | 5 + config/config.go | 26 + config/email.go | 11 + config/excel.go | 5 + config/gorm.go | 21 + config/gorm_settings.go | 10 + config/jpush.go | 8 + config/jwt.go | 7 + config/minio.go | 8 + config/oss.go | 31 + config/paypal.go | 10 + config/redis.go | 7 + config/system.go | 9 + config/timer.go | 13 + config/zap.go | 13 + core/server.go | 38 + core/server_other.go | 17 + core/server_win.go | 19 + core/viper.go | 57 + core/zap.go | 103 + deploy/.gitkeep | 0 deploy/admin-api-deployment.yaml | 24 + deploy/admin-api-service.yaml | 13 + docs/docs.go | 11770 ++++++++++++++++ docs/swagger.json | 11745 +++++++++++++++ docs/swagger.yaml | 7674 ++++++++++ dto/customer.pb.go | 1006 ++ dto/customer.proto | 73 + global/global.go | 24 + global/model.go | 56 + go.mod | 159 + go.sum | 1046 ++ initialize/api/greeter.pb.go | 2205 +++ initialize/api/greeter.proto | 203 + initialize/api/greeter_grpc.pb.go | 482 + initialize/gorm.go | 100 + initialize/grpc.go | 54 + initialize/internal/gorm.go | 52 + initialize/internal/logger.go | 33 + initialize/minio.go | 22 + initialize/redis.go | 24 + initialize/router.go | 75 + initialize/timer.go | 27 + initialize/validator.go | 22 + main.go | 33 + middleware/casbin_rbac.go | 36 + middleware/cors.go | 26 + middleware/error.go | 61 + middleware/jwt.go | 144 + middleware/loadtls.go | 26 + middleware/need_init.go | 23 + middleware/operation.go | 87 + model/account.go | 30 + model/address.go | 22 + model/application.go | 23 + model/banner.go | 28 + model/bill.go | 42 + model/bill_fund.go | 47 + model/brochure.go | 28 + model/business.go | 18 + model/category.go | 39 + model/customer_user.go | 27 + model/dict.go | 50 + model/dt_statistic_order.go | 41 + model/exa_breakpoint_continue.go | 24 + model/goods_visit.go | 13 + model/influencer_user.go | 63 + model/mission.go | 83 + model/mission_claim.go | 85 + model/mission_claim_address.go | 12 + model/mission_claim_order.go | 52 + model/mission_claim_order_goods.go | 17 + model/mission_claim_video.go | 30 + model/mission_claim_works.go | 16 + model/mission_recommend.go | 27 + model/mission_stop.go | 25 + model/notify.go | 16 + model/order.go | 69 + model/order_address.go | 12 + model/order_deliver.go | 26 + model/order_goods.go | 25 + model/order_goods_specs.go | 14 + model/order_post_sale.go | 31 + model/organization.go | 18 + model/platform_auth.go | 39 + model/provider.go | 26 + model/request/application.go | 8 + model/request/banner.go | 34 + model/request/bill.go | 52 + model/request/business.go | 17 + model/request/category.go | 26 + model/request/chain.go | 5 + model/request/common.go | 77 + model/request/dict.go | 5 + model/request/jwt.go | 19 + model/request/mission.go | 109 + model/request/notify.go | 8 + model/request/order.go | 31 + model/request/organization.go | 8 + model/request/provider.go | 8 + model/request/statistic.go | 8 + model/request/sys_api.go | 11 + model/request/sys_autocode.go | 16 + model/request/sys_casbin.go | 13 + model/request/sys_dictionary.go | 8 + model/request/sys_dictionary_detail.go | 8 + model/request/sys_init.go | 9 + model/request/sys_menu.go | 9 + model/request/sys_operation_record.go | 11 + model/request/sys_user.go | 47 + model/request/tags.go | 23 + model/request/user.go | 53 + model/request/wallet.go | 6 + model/response/banner.go | 18 + model/response/bill.go | 44 + model/response/chain.go | 10 + model/response/common.go | 31 + model/response/exa_breakpoint_continue.go | 11 + model/response/mission.go | 140 + model/response/order.go | 33 + model/response/response.go | 64 + model/response/setting.go | 7 + model/response/store.go | 15 + model/response/sys_api.go | 11 + model/response/sys_authority.go | 13 + model/response/sys_captcha.go | 6 + model/response/sys_casbin.go | 7 + model/response/sys_menu.go | 15 + model/response/sys_system.go | 7 + model/response/sys_user.go | 15 + model/response/wallet.go | 8 + model/seller_store.go | 82 + model/seller_user.go | 18 + model/statistic_mission_daily.go | 16 + model/sys_api.go | 14 + model/sys_authority.go | 28 + model/sys_authority_menu.go | 18 + model/sys_auto_code.go | 31 + model/sys_base_menu.go | 52 + model/sys_casbin.go | 8 + model/sys_config.go | 25 + model/sys_dictionary.go | 14 + model/sys_dictionary_detail.go | 14 + model/sys_initdb.go | 5 + model/sys_jwt_blacklist.go | 8 + model/sys_mission_reward.go | 21 + model/sys_operation_record.go | 25 + model/sys_system.go | 10 + model/sys_user.go | 37 + model/tag_relation.go | 26 + model/tags.go | 27 + model/tb_goods.go | 87 + model/tb_goods_specs.go | 42 + model/user.go | 81 + model/wallet.go | 20 + model/withdrawal.go | 28 + packfile/notUsePackFile.go | 3 + packfile/usePackFile.go | 45 + resource/excel/ExcelExport.xlsx | Bin 0 -> 6555 bytes resource/excel/ExcelImport.xlsx | Bin 0 -> 9005 bytes resource/excel/ExcelTemplate.xlsx | Bin 0 -> 8906 bytes resource/gorm_settings.yaml | 25 + resource/rbac_model.conf | 14 + resource/template/readme.txt.tpl | 9 + resource/template/server/api.go.tpl | 130 + resource/template/server/model.go.tpl | 22 + resource/template/server/request.go.tpl | 8 + resource/template/server/router.go.tpl | 19 + resource/template/server/service.go.tpl | 105 + resource/template/web/api.js.tpl | 97 + resource/template/web/form.vue.tpl | 122 + resource/template/web/table.vue.tpl | 316 + router/application.go | 59 + router/banner.go | 20 + router/bill.go | 45 + router/business.go | 29 + router/dict.go | 13 + router/mission.go | 51 + router/order.go | 15 + router/organization.go | 20 + router/provider.go | 20 + router/sys_api.go | 21 + router/sys_authority.go | 19 + router/sys_auto_code.go | 18 + router/sys_base.go | 19 + router/sys_casbin.go | 16 + router/sys_dictionary.go | 19 + router/sys_dictionary_detail.go | 19 + router/sys_email.go | 15 + router/sys_jwt.go | 15 + router/sys_menu.go | 25 + router/sys_operation_record.go | 23 + router/sys_system.go | 17 + router/sys_user.go | 21 + router/tags.go | 20 + router/user.go | 27 + router/wallet.go | 13 + service/application.go | 80 + service/banner.go | 244 + service/bill.go | 564 + service/business.go | 144 + service/category.go | 233 + service/chain.go | 28 + service/dict.go | 40 + service/exa_breakpoint_continue.go | 57 + service/exa_excel_parse.go | 92 + service/goods.go | 111 + service/influencer_user.go | 41 + service/jwt_black_list.go | 53 + service/mission.go | 1309 ++ service/notify.go | 34 + service/order.go | 451 + service/organization.go | 80 + service/provider.go | 80 + service/redis_tools.go | 255 + service/seller.go | 22 + service/statistic.go | 181 + service/sys_api.go | 148 + service/sys_authority.go | 152 + service/sys_auto_code.go | 373 + service/sys_base_menu.go | 90 + service/sys_casbin.go | 137 + service/sys_dictionary.go | 98 + service/sys_dictionary_detail.go | 76 + service/sys_email.go | 16 + service/sys_menu.go | 168 + service/sys_mission_reward.go | 107 + service/sys_operation_record.go | 91 + service/sys_system.go | 30 + service/sys_user.go | 284 + service/tags.go | 171 + service/task.go | 61 + service/ueditor.go | 132 + service/user.go | 519 + service/wallet.go | 158 + source/admin.go | 36 + source/api.go | 104 + source/authorities_menus.go | 77 + source/authority.go | 35 + source/authority_menu.go | 25 + source/casbin.go | 130 + source/data_authorities.go | 40 + source/dictionary.go | 41 + source/dictionary_details.go | 55 + source/file.go | 1 + source/menu.go | 56 + third_party/google/api/annotations.proto | 31 + third_party/google/api/client.proto | 101 + third_party/google/api/field_behavior.proto | 80 + third_party/google/api/http.proto | 375 + third_party/google/api/httpbody.proto | 77 + third_party/google/protobuf/any.proto | 158 + third_party/google/protobuf/api.proto | 208 + .../google/protobuf/compiler/plugin.proto | 183 + third_party/google/protobuf/descriptor.proto | 921 ++ third_party/google/protobuf/duration.proto | 116 + third_party/google/protobuf/empty.proto | 52 + third_party/google/protobuf/field_mask.proto | 245 + .../google/protobuf/source_context.proto | 48 + third_party/google/protobuf/struct.proto | 95 + third_party/google/protobuf/timestamp.proto | 147 + third_party/google/protobuf/type.proto | 187 + third_party/google/protobuf/wrappers.proto | 123 + ueditor-config.json | 234 + utils/array.go | 19 + utils/breakpoint_continue.go | 102 + utils/constant.go | 6 + utils/cors.go | 17 + utils/db_automation.go | 28 + utils/directory.go | 46 + utils/email.go | 78 + utils/file_operations.go | 63 + utils/float.go | 28 + utils/fmt_plus.go | 36 + utils/injectionCode.go | 142 + utils/jpush/model.go | 23 + utils/jpush/push.go | 202 + utils/md5.go | 17 + utils/qiniu/model.go | 83 + utils/qiniu/video.go | 84 + utils/redis.go | 319 + utils/redis_store.go | 45 + utils/reload.go | 18 + utils/rotatelogs_unix.go | 30 + utils/rotatelogs_windows.go | 26 + utils/sendSms.go | 172 + utils/string.go | 110 + utils/time.go | 14 + utils/timer/timed_task.go | 109 + utils/upload/aliyun_oss.go | 75 + utils/upload/local.go | 79 + utils/upload/minio.go | 123 + utils/upload/qiniu.go | 114 + utils/upload/tencent_cos.go | 60 + utils/upload/upload.go | 34 + utils/validator.go | 368 + utils/verify.go | 79 + utils/zipfiles.go | 71 + 337 files changed, 60448 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/admin-api.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100755 api/admin/application.go create mode 100644 api/admin/banner.go create mode 100644 api/admin/bill.go create mode 100755 api/admin/business.go create mode 100644 api/admin/category.go create mode 100644 api/admin/chain.go create mode 100644 api/admin/dict.go create mode 100644 api/admin/goods.go create mode 100644 api/admin/mission.go create mode 100644 api/admin/order.go create mode 100755 api/admin/organization.go create mode 100755 api/admin/provider.go create mode 100644 api/admin/tags.go create mode 100755 api/admin/user.go create mode 100644 api/admin/wallet.go create mode 100644 api/sys/exa_breakpoint_continue.go create mode 100644 api/sys/sys_api.go create mode 100644 api/sys/sys_authority.go create mode 100644 api/sys/sys_auto_code.go create mode 100644 api/sys/sys_captcha.go create mode 100644 api/sys/sys_casbin.go create mode 100644 api/sys/sys_dictionary.go create mode 100644 api/sys/sys_dictionary_detail.go create mode 100644 api/sys/sys_email.go create mode 100644 api/sys/sys_jwt_blacklist.go create mode 100644 api/sys/sys_menu.go create mode 100644 api/sys/sys_operation_record.go create mode 100644 api/sys/sys_system.go create mode 100644 api/sys/sys_user.go create mode 100644 config-prod.yaml create mode 100644 config.yaml create mode 100644 config/auto_code.go create mode 100644 config/captcha.go create mode 100644 config/casbin.go create mode 100644 config/config.go create mode 100644 config/email.go create mode 100644 config/excel.go create mode 100644 config/gorm.go create mode 100644 config/gorm_settings.go create mode 100644 config/jpush.go create mode 100644 config/jwt.go create mode 100644 config/minio.go create mode 100644 config/oss.go create mode 100644 config/paypal.go create mode 100644 config/redis.go create mode 100644 config/system.go create mode 100644 config/timer.go create mode 100644 config/zap.go create mode 100644 core/server.go create mode 100644 core/server_other.go create mode 100644 core/server_win.go create mode 100644 core/viper.go create mode 100644 core/zap.go create mode 100644 deploy/.gitkeep create mode 100644 deploy/admin-api-deployment.yaml create mode 100644 deploy/admin-api-service.yaml create mode 100644 docs/docs.go create mode 100644 docs/swagger.json create mode 100644 docs/swagger.yaml create mode 100644 dto/customer.pb.go create mode 100644 dto/customer.proto create mode 100644 global/global.go create mode 100644 global/model.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 initialize/api/greeter.pb.go create mode 100644 initialize/api/greeter.proto create mode 100644 initialize/api/greeter_grpc.pb.go create mode 100644 initialize/gorm.go create mode 100644 initialize/grpc.go create mode 100644 initialize/internal/gorm.go create mode 100644 initialize/internal/logger.go create mode 100644 initialize/minio.go create mode 100644 initialize/redis.go create mode 100644 initialize/router.go create mode 100644 initialize/timer.go create mode 100644 initialize/validator.go create mode 100644 main.go create mode 100644 middleware/casbin_rbac.go create mode 100644 middleware/cors.go create mode 100644 middleware/error.go create mode 100644 middleware/jwt.go create mode 100644 middleware/loadtls.go create mode 100644 middleware/need_init.go create mode 100644 middleware/operation.go create mode 100644 model/account.go create mode 100644 model/address.go create mode 100755 model/application.go create mode 100644 model/banner.go create mode 100644 model/bill.go create mode 100644 model/bill_fund.go create mode 100644 model/brochure.go create mode 100755 model/business.go create mode 100644 model/category.go create mode 100644 model/customer_user.go create mode 100644 model/dict.go create mode 100644 model/dt_statistic_order.go create mode 100644 model/exa_breakpoint_continue.go create mode 100644 model/goods_visit.go create mode 100644 model/influencer_user.go create mode 100644 model/mission.go create mode 100644 model/mission_claim.go create mode 100644 model/mission_claim_address.go create mode 100644 model/mission_claim_order.go create mode 100644 model/mission_claim_order_goods.go create mode 100644 model/mission_claim_video.go create mode 100644 model/mission_claim_works.go create mode 100644 model/mission_recommend.go create mode 100644 model/mission_stop.go create mode 100644 model/notify.go create mode 100644 model/order.go create mode 100644 model/order_address.go create mode 100644 model/order_deliver.go create mode 100644 model/order_goods.go create mode 100644 model/order_goods_specs.go create mode 100644 model/order_post_sale.go create mode 100755 model/organization.go create mode 100644 model/platform_auth.go create mode 100755 model/provider.go create mode 100755 model/request/application.go create mode 100644 model/request/banner.go create mode 100644 model/request/bill.go create mode 100755 model/request/business.go create mode 100644 model/request/category.go create mode 100644 model/request/chain.go create mode 100644 model/request/common.go create mode 100644 model/request/dict.go create mode 100644 model/request/jwt.go create mode 100644 model/request/mission.go create mode 100644 model/request/notify.go create mode 100644 model/request/order.go create mode 100755 model/request/organization.go create mode 100755 model/request/provider.go create mode 100644 model/request/statistic.go create mode 100644 model/request/sys_api.go create mode 100644 model/request/sys_autocode.go create mode 100644 model/request/sys_casbin.go create mode 100644 model/request/sys_dictionary.go create mode 100644 model/request/sys_dictionary_detail.go create mode 100644 model/request/sys_init.go create mode 100644 model/request/sys_menu.go create mode 100644 model/request/sys_operation_record.go create mode 100644 model/request/sys_user.go create mode 100644 model/request/tags.go create mode 100755 model/request/user.go create mode 100644 model/request/wallet.go create mode 100644 model/response/banner.go create mode 100644 model/response/bill.go create mode 100644 model/response/chain.go create mode 100644 model/response/common.go create mode 100644 model/response/exa_breakpoint_continue.go create mode 100644 model/response/mission.go create mode 100644 model/response/order.go create mode 100644 model/response/response.go create mode 100644 model/response/setting.go create mode 100644 model/response/store.go create mode 100644 model/response/sys_api.go create mode 100644 model/response/sys_authority.go create mode 100644 model/response/sys_captcha.go create mode 100644 model/response/sys_casbin.go create mode 100644 model/response/sys_menu.go create mode 100644 model/response/sys_system.go create mode 100644 model/response/sys_user.go create mode 100644 model/response/wallet.go create mode 100644 model/seller_store.go create mode 100644 model/seller_user.go create mode 100644 model/statistic_mission_daily.go create mode 100644 model/sys_api.go create mode 100644 model/sys_authority.go create mode 100644 model/sys_authority_menu.go create mode 100644 model/sys_auto_code.go create mode 100644 model/sys_base_menu.go create mode 100644 model/sys_casbin.go create mode 100644 model/sys_config.go create mode 100644 model/sys_dictionary.go create mode 100644 model/sys_dictionary_detail.go create mode 100644 model/sys_initdb.go create mode 100644 model/sys_jwt_blacklist.go create mode 100644 model/sys_mission_reward.go create mode 100644 model/sys_operation_record.go create mode 100644 model/sys_system.go create mode 100644 model/sys_user.go create mode 100644 model/tag_relation.go create mode 100644 model/tags.go create mode 100644 model/tb_goods.go create mode 100644 model/tb_goods_specs.go create mode 100755 model/user.go create mode 100644 model/wallet.go create mode 100644 model/withdrawal.go create mode 100644 packfile/notUsePackFile.go create mode 100644 packfile/usePackFile.go create mode 100644 resource/excel/ExcelExport.xlsx create mode 100644 resource/excel/ExcelImport.xlsx create mode 100644 resource/excel/ExcelTemplate.xlsx create mode 100644 resource/gorm_settings.yaml create mode 100644 resource/rbac_model.conf create mode 100644 resource/template/readme.txt.tpl create mode 100644 resource/template/server/api.go.tpl create mode 100644 resource/template/server/model.go.tpl create mode 100644 resource/template/server/request.go.tpl create mode 100644 resource/template/server/router.go.tpl create mode 100644 resource/template/server/service.go.tpl create mode 100644 resource/template/web/api.js.tpl create mode 100644 resource/template/web/form.vue.tpl create mode 100644 resource/template/web/table.vue.tpl create mode 100755 router/application.go create mode 100644 router/banner.go create mode 100644 router/bill.go create mode 100755 router/business.go create mode 100644 router/dict.go create mode 100644 router/mission.go create mode 100644 router/order.go create mode 100755 router/organization.go create mode 100755 router/provider.go create mode 100644 router/sys_api.go create mode 100644 router/sys_authority.go create mode 100644 router/sys_auto_code.go create mode 100644 router/sys_base.go create mode 100644 router/sys_casbin.go create mode 100644 router/sys_dictionary.go create mode 100644 router/sys_dictionary_detail.go create mode 100644 router/sys_email.go create mode 100644 router/sys_jwt.go create mode 100644 router/sys_menu.go create mode 100644 router/sys_operation_record.go create mode 100644 router/sys_system.go create mode 100644 router/sys_user.go create mode 100644 router/tags.go create mode 100755 router/user.go create mode 100644 router/wallet.go create mode 100755 service/application.go create mode 100644 service/banner.go create mode 100644 service/bill.go create mode 100755 service/business.go create mode 100644 service/category.go create mode 100644 service/chain.go create mode 100644 service/dict.go create mode 100644 service/exa_breakpoint_continue.go create mode 100644 service/exa_excel_parse.go create mode 100644 service/goods.go create mode 100644 service/influencer_user.go create mode 100644 service/jwt_black_list.go create mode 100644 service/mission.go create mode 100644 service/notify.go create mode 100644 service/order.go create mode 100755 service/organization.go create mode 100755 service/provider.go create mode 100644 service/redis_tools.go create mode 100644 service/seller.go create mode 100644 service/statistic.go create mode 100644 service/sys_api.go create mode 100644 service/sys_authority.go create mode 100644 service/sys_auto_code.go create mode 100644 service/sys_base_menu.go create mode 100644 service/sys_casbin.go create mode 100644 service/sys_dictionary.go create mode 100644 service/sys_dictionary_detail.go create mode 100644 service/sys_email.go create mode 100644 service/sys_menu.go create mode 100644 service/sys_mission_reward.go create mode 100644 service/sys_operation_record.go create mode 100644 service/sys_system.go create mode 100644 service/sys_user.go create mode 100644 service/tags.go create mode 100644 service/task.go create mode 100644 service/ueditor.go create mode 100755 service/user.go create mode 100644 service/wallet.go create mode 100644 source/admin.go create mode 100644 source/api.go create mode 100644 source/authorities_menus.go create mode 100644 source/authority.go create mode 100644 source/authority_menu.go create mode 100644 source/casbin.go create mode 100644 source/data_authorities.go create mode 100644 source/dictionary.go create mode 100644 source/dictionary_details.go create mode 100644 source/file.go create mode 100644 source/menu.go create mode 100644 third_party/google/api/annotations.proto create mode 100644 third_party/google/api/client.proto create mode 100644 third_party/google/api/field_behavior.proto create mode 100644 third_party/google/api/http.proto create mode 100644 third_party/google/api/httpbody.proto create mode 100644 third_party/google/protobuf/any.proto create mode 100644 third_party/google/protobuf/api.proto create mode 100644 third_party/google/protobuf/compiler/plugin.proto create mode 100644 third_party/google/protobuf/descriptor.proto create mode 100644 third_party/google/protobuf/duration.proto create mode 100644 third_party/google/protobuf/empty.proto create mode 100644 third_party/google/protobuf/field_mask.proto create mode 100644 third_party/google/protobuf/source_context.proto create mode 100644 third_party/google/protobuf/struct.proto create mode 100644 third_party/google/protobuf/timestamp.proto create mode 100644 third_party/google/protobuf/type.proto create mode 100644 third_party/google/protobuf/wrappers.proto create mode 100644 ueditor-config.json create mode 100644 utils/array.go create mode 100644 utils/breakpoint_continue.go create mode 100644 utils/constant.go create mode 100644 utils/cors.go create mode 100644 utils/db_automation.go create mode 100644 utils/directory.go create mode 100644 utils/email.go create mode 100644 utils/file_operations.go create mode 100644 utils/float.go create mode 100644 utils/fmt_plus.go create mode 100644 utils/injectionCode.go create mode 100644 utils/jpush/model.go create mode 100644 utils/jpush/push.go create mode 100644 utils/md5.go create mode 100644 utils/qiniu/model.go create mode 100644 utils/qiniu/video.go create mode 100644 utils/redis.go create mode 100644 utils/redis_store.go create mode 100644 utils/reload.go create mode 100644 utils/rotatelogs_unix.go create mode 100644 utils/rotatelogs_windows.go create mode 100644 utils/sendSms.go create mode 100644 utils/string.go create mode 100644 utils/time.go create mode 100644 utils/timer/timed_task.go create mode 100644 utils/upload/aliyun_oss.go create mode 100644 utils/upload/local.go create mode 100644 utils/upload/minio.go create mode 100644 utils/upload/qiniu.go create mode 100644 utils/upload/tencent_cos.go create mode 100644 utils/upload/upload.go create mode 100644 utils/validator.go create mode 100644 utils/verify.go create mode 100644 utils/zipfiles.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..19f0afe --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# ---> Go +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test +*.log +log + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out +*.baiduyun.* + +# Dependency directories (remove the comment below to include it) +# vendor/ + +*.history +*_debug* +*.vscode +*cache \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/admin-api.iml b/.idea/admin-api.iml new file mode 100644 index 0000000..5e764c4 --- /dev/null +++ b/.idea/admin-api.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..f9da820 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index e9f4c89..9214127 100644 --- a/README.md +++ b/README.md @@ -1,2 +1 @@ -# admin-api - +# admin-api \ No newline at end of file diff --git a/api/admin/application.go b/api/admin/application.go new file mode 100755 index 0000000..c93cfc9 --- /dev/null +++ b/api/admin/application.go @@ -0,0 +1,131 @@ +package v1 + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags Applicationv0.0.0 +// @Summary 创建Application +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Application true "创建Application" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /application/createApplication [post] +func CreateApplication(c *gin.Context) { + var application model.Application + _ = c.ShouldBindJSON(&application) + if err := service.CreateApplication(application); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags Applicationv0.0.0 +// @Summary 删除Application +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Application true "删除Application" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /application/deleteApplication [delete] +func DeleteApplication(c *gin.Context) { + var application model.Application + _ = c.ShouldBindJSON(&application) + if err := service.DeleteApplication(application); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags Applicationv0.0.0 +// @Summary 批量删除Application +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除Application" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}" +// @Router /application/deleteApplicationByIds [delete] +func DeleteApplicationByIds(c *gin.Context) { + var IDS request.IdsReq + _ = c.ShouldBindJSON(&IDS) + if err := service.DeleteApplicationByIds(IDS); err != nil { + global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// @Tags Applicationv0.0.0 +// @Summary 更新Application +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Application true "更新Application" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /application/updateApplication [put] +func UpdateApplication(c *gin.Context) { + var application model.Application + _ = c.ShouldBindJSON(&application) + if err := service.UpdateApplication(application); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags Applicationv0.0.0 +// @Summary 用id查询Application +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Application true "用id查询Application" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /application/findApplication [get] +func FindApplication(c *gin.Context) { + var application model.Application + _ = c.ShouldBindQuery(&application) + if err, reapplication := service.GetApplication(application.ID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithData(gin.H{"reapplication": reapplication}, c) + } +} + +// @Tags Applicationv0.0.0 +// @Summary 分页获取Application列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.ApplicationSearch true "分页获取Application列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /application/getApplicationList [get] +func GetApplicationList(c *gin.Context) { + var pageInfo request.ApplicationSearch + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.GetApplicationInfoList(pageInfo); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/admin/banner.go b/api/admin/banner.go new file mode 100644 index 0000000..584cae2 --- /dev/null +++ b/api/admin/banner.go @@ -0,0 +1,186 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + "pure-admin/api/sys" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" +) + +// GetBannerList +// @Tags banner +// @Summary 分页获取banner列表【v1.1.0新增】 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.SearchBanner true "data" +// @Success 200 {array} response.BannerListResponse "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /banner/list [get] +func GetBannerList(c *gin.Context) { + var ( + err error + list interface{} + total int64 + pageInfo request.SearchBanner + ) + _ = c.ShouldBindQuery(&pageInfo) + if err = utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list, total = service.GetBannerList(pageInfo); err != nil { + ////global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} + +// CreateBanner +// @Tags banner +// @Summary 创建banner【v1.1.0新增】 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.CreateBanner true "data" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /banner [post] +func CreateBanner(c *gin.Context) { + var ( + err error + params request.CreateBanner + ) + _ = c.ShouldBindJSON(¶ms) + //去除空格 + if err = utils.Verify(params, utils.BannerVerity); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + uuid := sys.GetUserUuid(c) + err = service.AddBanner(params, uuid) + if err != nil { + //global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage(err.Error(), c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// UpdateBanner +// @Tags banner +// @Summary 编辑banner【v1.1.0新增】 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.UpdateBanner true "id,data" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /banner [put] +func UpdateBanner(c *gin.Context) { + var ( + err error + params request.UpdateBanner + ) + _ = c.ShouldBindJSON(¶ms) + if err = utils.Verify(params, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + + //编辑参数验证 + if err = utils.Verify(params, utils.BannerVerity); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + + uuid := sys.GetUserUuid(c) + if err = service.UpdateBanner(params, uuid); err != nil { + //global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败,"+err.Error(), c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// DelBannerByIds +// @Tags banner +// @Summary 批量删除banner【v1.1.0新增】 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "ids" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /banner/batchDelBanner [delete] +func DelBannerByIds(c *gin.Context) { + var ( + err error + param request.IdsReq + ) + _ = c.ShouldBindJSON(¶m) + if err = service.DeleteBannerByIds(param); err != nil { + //global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// BannerUpData +// @Tags banner +// @Summary 上移banner排序【v1.1.0新增】 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdReq true "id,page,pageSize..." +// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}" +// @Router /banner/up-data [put] +func BannerUpData(c *gin.Context) { + var ( + err error + param request.IdReq + ) + _ = c.ShouldBindJSON(¶m) + if err = utils.Verify(param, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err = service.BannerUpData(param, c); err != nil { + //global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败", c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// BannerDownData +// @Tags banner +// @Summary 下移banner排序【v1.1.0新增】 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdReq true "id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}" +// @Router /banner/down-data [put] +func BannerDownData(c *gin.Context) { + var ( + err error + param request.IdReq + ) + _ = c.ShouldBindJSON(¶m) + if err = utils.Verify(param, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err = service.BannerDownData(param, c); err != nil { + //global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败", c) + } else { + response.OkWithMessage("操作成功", c) + } +} diff --git a/api/admin/bill.go b/api/admin/bill.go new file mode 100644 index 0000000..05d9220 --- /dev/null +++ b/api/admin/bill.go @@ -0,0 +1,549 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" +) + +// @Summary 用户账单数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} response.BillData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/customer-data [get] +func GetUserBillData(c *gin.Context) { + var ( + err error + params request.BillSearch + result response.BillData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetBillData("customer", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 用户账单列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} []model.BillList "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/customer-list [get] +func GetUserBillList(c *gin.Context) { + var ( + err error + total int64 + params request.BillSearch + result []model.BillList + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetBillList("customer", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +// @Summary 网红提现数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.WithdrawalSearch false "data..." +// @Success 200 {object} response.InfluenceWithdrawalData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/influence-data [get] +func GetInfluenceWithdrawalData(c *gin.Context) { + var ( + err error + params request.WithdrawalSearch + result response.InfluenceWithdrawalData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetInfluenceWithdrawalData(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 网红提现列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.WithdrawalSearch false "data..." +// @Success 200 {object} []model.Withdrawal "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/influence-list [get] +func GetInfluenceWithdrawalList(c *gin.Context) { + var ( + err error + total int64 + params request.WithdrawalSearch + result []model.Withdrawal + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetWithdrawalList("1", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +func ExamineInfluenceWithdrawal(c *gin.Context) { + //var ( + // err error + // params request.ExamineWithdrawal + //) + //_ = c.ShouldBindJSON(¶ms) + //err = service.ExamineWithdrawal("1", ¶ms) + //if err != nil { + // response.FailWithMessage(err.Error(), c) + // return + //} + response.OkWithMessage("提交成功", c) +} + +// @Summary 手动提现打款状态 +// @Security Bearer +// @Description +// @Tags bill +// @Param data body request.TransferResult false "data..." +// @Success 200 {string} string "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/status [put] +func UpdateWithdrawalStatus(c *gin.Context) { + var ( + err error + params request.TransferResult + ) + _ = c.ShouldBindJSON(¶ms) + err = service.UpdateWithdrawalStatus(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithMessage("操作成功", c) +} + +func TransferWithdrawalRetry(c *gin.Context) { + var ( + //err error + //params request.RetryWithdrawal + ) + //_ = c.ShouldBindJSON(¶ms) + //err = service.TransferWithdrawalRetry("1", ¶ms) + //if err != nil { + // response.FailWithMessage(err.Error(), c) + // return + //} + response.OkWithMessage("操作成功", c) +} + +// @Summary 网红账单数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} response.BillData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/influence-data [get] +func GetInfluenceBillData(c *gin.Context) { + var ( + err error + params request.BillSearch + result response.BillData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetBillData("influencer", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 网红账单列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} []model.BillList "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/influence-list [get] +func GetInfluenceBillList(c *gin.Context) { + var ( + err error + total int64 + params request.BillSearch + result []model.BillList + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetBillList("influencer", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +// @Summary 商家提现数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.WithdrawalSearch false "data..." +// @Success 200 {object} response.SellerWithdrawalData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/seller-data [get] +func GetSellerWithdrawalData(c *gin.Context) { + var ( + err error + params request.WithdrawalSearch + result response.SellerWithdrawalData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetSellerWithdrawalData(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 商家提现列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.WithdrawalSearch false "data..." +// @Success 200 {object} []model.Withdrawal "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/seller-list [get] +func GetSellerWithdrawalList(c *gin.Context) { + var ( + err error + total int64 + params request.WithdrawalSearch + result []model.Withdrawal + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetWithdrawalList("2", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +// @Summary 商家提现审核 +// @Security Bearer +// @Description +// @Tags bill +// @Param data body request.ExamineWithdrawal false "data..." +// @Success 200 {string} string "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/seller-examine [post] +func ExamineSellerWithdrawal(c *gin.Context) { + //var ( + // err error + // params request.ExamineWithdrawal + //) + //_ = c.ShouldBindJSON(¶ms) + //err = service.ExamineWithdrawal("2", ¶ms) + //if err != nil { + // response.FailWithMessage(err.Error(), c) + // return + //} + response.OkWithMessage("操作成功", c) +} + +// @Summary 商家账单数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} response.BillData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/seller-data [get] +func GetSellerBillData(c *gin.Context) { + var ( + err error + params request.BillSearch + result response.BillData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetBillData("seller", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 商家账单列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} []model.BillList "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/seller-list [get] +func GetSellerBillList(c *gin.Context) { + var ( + err error + total int64 + params request.BillSearch + result []model.BillList + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetBillList("seller", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +// @Summary 商家营销账户数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillFundSearch false "data..." +// @Success 200 {object} response.SellerFundData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/seller-fund-data [get] +func GetSellerFundData(c *gin.Context) { + var ( + err error + params request.BillFundSearch + result response.SellerFundData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetSellerFundData(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 商家营销账户记录列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillFundSearch false "data..." +// @Success 200 {array} model.SellerBillFund "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/seller-fund-list [get] +func GetSellerFundList(c *gin.Context) { + var ( + err error + total int64 + params request.BillFundSearch + result []model.SellerBillFund + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetSellerFundList("seller", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +// @Summary 平台提现数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.WithdrawalSearch false "data..." +// @Success 200 {object} response.BkbData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/admin-data [get] +func GetAdminWithdrawalData(c *gin.Context) { + var ( + err error + params request.WithdrawalSearch + result response.BkbData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetBkbWithdrawalData(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 平台提现列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.WithdrawalSearch false "data..." +// @Success 200 {object} []model.Withdrawal "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /withdrawal/admin-list [get] +func GetAdminWithdrawalList(c *gin.Context) { + var ( + err error + total int64 + params request.WithdrawalSearch + result []model.Withdrawal + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetWithdrawalList("", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +// @Summary 平台账单数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} response.BillData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/admin-data [get] +func GetAdminBillData(c *gin.Context) { + var ( + err error + params request.BillSearch + result response.BillData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetBillData("", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 平台账单列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillSearch false "data..." +// @Success 200 {object} []model.BillList "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/admin-list [get] +func GetAdminBillList(c *gin.Context) { + var ( + err error + total int64 + params request.BillSearch + result []model.BillList + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetBillList("", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} + +// @Summary 平台奖励账户数据 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillFundSearch false "data..." +// @Success 200 {object} response.AdminFundData "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/admin-fund-data [get] +func GetAdminFundData(c *gin.Context) { + var ( + err error + params request.BillFundSearch + result response.AdminFundData + ) + _ = c.ShouldBindQuery(¶ms) + err, result = service.GetBkbFundData(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} + +// @Summary 平台奖励账户列表 +// @Security Bearer +// @Description +// @Tags bill +// @Param data query request.BillFundSearch false "data..." +// @Success 200 {array} model.AdminBillFund "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /bill/admin-fund-list [get] +func GetAdminFundList(c *gin.Context) { + var ( + err error + total int64 + params request.BillFundSearch + result []model.AdminBillFund + ) + _ = c.ShouldBindQuery(¶ms) + err, result, total = service.GetBkbFundList("bkb", ¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: result, + Total: total, + Page: params.Page, + PageSize: params.PageSize, + }, "获取成功", c) +} diff --git a/api/admin/business.go b/api/admin/business.go new file mode 100755 index 0000000..fdbd91b --- /dev/null +++ b/api/admin/business.go @@ -0,0 +1,162 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + "go.uber.org/zap" + + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" +) + +// @Tags Businessv0.0.0 +// @Summary 创建Business +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SellerStore true "创建Business" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /business [post] +func CreateBusiness(c *gin.Context) { + var business model.SellerStore + _ = c.ShouldBindJSON(&business) + if err := service.CreateBusiness(business); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags Businessv0.0.0 +// @Summary 删除Business +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SellerStore true "删除Business" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /business [delete] +func DeleteBusiness(c *gin.Context) { + var business model.SellerStore + _ = c.ShouldBindJSON(&business) + if err := service.DeleteBusiness(business); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags Businessv0.0.0 +// @Summary 批量删除商家 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除Business" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}" +// @Router /business/deleteBusinessByIds [delete] +func DeleteBusinessByIds(c *gin.Context) { + var IDS request.IdsReq + _ = c.ShouldBindJSON(&IDS) + if err := service.DeleteBusinessByIds(IDS); err != nil { + global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// @Tags Business +// @Summary 更新商家 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SellerStore true "更新Business" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /business [put] +func UpdateBusiness(c *gin.Context) { + var business model.SellerStore + _ = c.ShouldBindJSON(&business) + if err := service.UpdateBusiness(business); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags Business +// @Summary 用id查询商家 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body response.StoreInfoItem true "用id查询Business" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /business [get] +func GetBusiness(c *gin.Context) { + var info request.IdReq + _ = c.ShouldBindQuery(&info) + rebusiness, err := service.GetBusiness(info.ID) + if err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithData(rebusiness, c) + } +} + +// @Tags Business +// @Summary 商家列表 +// @Security ApiKeyAuth +// @accept application/json +// @Param data body request.PageInfo true "分页获取商家列表" +// @Success 200 {object} model.SellerStoreInfo "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /business/list [get] +func ListBusiness(c *gin.Context) { + var info request.PageInfo + _ = c.ShouldBindQuery(&info) + if info.Page == 0 { + info.Page = 1 + } + list, total, err := service.GetBusinessInfoList(info) + if err != nil { + global.MG_LOG.Error("获取失败!" + err.Error()) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// @Tags Business +// @Summary 商家搜索 +// @Security ApiKeyAuth +// @accept application/json +// @Param data body request.SearchStore true "分页获取商家列表" +// @Success 200 {object} model.SellerStoreInfo "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /business/search [get] +func SearchBusiness(c *gin.Context) { + var info request.SearchStore + _ = c.ShouldBindQuery(&info) + if info.Page == 0 { + info.Page = 1 + } + list, total, err := service.SearchBusiness(info) + if err != nil { + global.MG_LOG.Error("获取失败!" + err.Error()) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} diff --git a/api/admin/category.go b/api/admin/category.go new file mode 100644 index 0000000..fadd423 --- /dev/null +++ b/api/admin/category.go @@ -0,0 +1,153 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + + "pure-admin/global" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" +) + +// UpdateCategory +// @Summary 更新分类 +// @Description +// @Tags category +// @Security ApiKeyAuth +// @Param data body request.UpdateCategory false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /category [put] +func UpdateCategory(c *gin.Context) { + var info request.UpdateCategory + err := c.ShouldBindJSON(&info) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + err = service.UpdateCategory(info.Id, info.Name) + if err != nil { + global.MG_LOG.Error("获取失败! " + err.Error()) + response.FailWithMessage("操作失败", c) + return + } + response.OkWithMessage("操作成功", c) +} + +// CreateCategory +// @Summary 创建分类 +// @Description +// @Tags category +// @Security ApiKeyAuth +// @Param data body request.CreateCategory false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /category [post] +func CreateCategory(c *gin.Context) { + var info request.CreateCategory + err := c.ShouldBindJSON(&info) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + err = service.CreateCategory(info.Name, info.Pid, info.Layer) + if err != nil { + global.MG_LOG.Error("获取失败! " + err.Error()) + response.FailWithMessage("操作失败", c) + } + response.OkWithMessage("操作成功", c) +} + +// DeleteCategory +// @Summary 删除分类 +// @Description +// @Tags category +// @Security ApiKeyAuth +// @Param data body request.IdsReq false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /category [delete] +func DeleteCategory(c *gin.Context) { + var info request.IdsReq + err := c.ShouldBindJSON(&info) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + + if err := service.DeleteCategory(info.Ids); err != nil { + global.MG_LOG.Error("获取失败! " + err.Error()) + response.FailWithMessage("操作失败", c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// ListCategoryPage +// @Summary 商品分类分页 +// @Description +// @Tags category +// @Security ApiKeyAuth +// @Param data query request.ListCategoryPage false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /category/list [get] +func ListCategoryPage(c *gin.Context) { + var info request.ListCategoryPage + _ = c.ShouldBindQuery(&info) + if info.Page <= 0 { + info.Page = 1 + } + list, total, err := service.ListCategoryTree(info) + if err != nil { + global.MG_LOG.Error("获取失败! " + err.Error()) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// ListCategoryChildren +// @Summary 查询分类下级 +// @Description +// @Tags category +// @Security ApiKeyAuth +// @Param data query request.ListCategoryChildren false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /category/children [get] +func ListCategoryChildren(c *gin.Context) { + var info request.ListCategoryChildren + err := c.ShouldBindQuery(&info) + if err != nil { + global.MG_LOG.Error(err.Error()) + response.FailWithMessage(err.Error(), c) + return + } + list, err := service.ListCategoryChildren(info.Pid) + if err != nil { + global.MG_LOG.Error("获取失败! " + err.Error()) + response.FailWithMessage("获取失败", c) + return + } + response.OkWithDetailed(list, "获取成功", c) +} +// GetCategoryItem +// @Summary 查询单个商品分类 +// @Description +// @Tags category +// @Security ApiKeyAuth +// @Param data body request.IdReq false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /category [get] +func GetCategoryItem(c *gin.Context) { + var info request.IdReq + _ = c.ShouldBindQuery(&info) + item, err := service.GetCategoryTree(int64(info.ID)) + if err != nil { + global.MG_LOG.Error("获取失败! " + err.Error()) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(item, "获取成功", c) + } +} \ No newline at end of file diff --git a/api/admin/chain.go b/api/admin/chain.go new file mode 100644 index 0000000..f8d20e5 --- /dev/null +++ b/api/admin/chain.go @@ -0,0 +1,36 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" +) + +// GetChainInfo +// @Summary 获取区块链数据 +// @Description +// @Tags Chain +// @Param data query request.ChainParams false "data..." +// @Success 200 {object} []response.ChainResp "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /base/chain [get] +func GetChainInfo(c *gin.Context) { + var ( + err error + params request.ChainParams + result []response.ChainResp + ) + _ = c.ShouldBindQuery(¶ms) + if err := utils.Verify(params, utils.ChainVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + err, result = service.GetChainInfo(params.Hash) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithData(result, c) +} diff --git a/api/admin/dict.go b/api/admin/dict.go new file mode 100644 index 0000000..68c19cc --- /dev/null +++ b/api/admin/dict.go @@ -0,0 +1,40 @@ +package v1 + +import ( + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" +) + +// GetSysDictDataList +// @Tags dict +// @Summary 获取数据字典取值列表【v1.0】 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.SearchDictDataParams true "data" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /dict/getDictDataList [get] +func GetSysDictDataList(c *gin.Context) { + var ( + err error + list interface{} + params request.SearchDictDataParams + ) + _ = c.ShouldBindQuery(¶ms) + if err = utils.Verify(params, utils.DictDataVerity); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list = service.GetSysDictDataList(params); err != nil { + ////global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.SelectListResult{ + List: list, + }, "获取成功", c) + } +} diff --git a/api/admin/goods.go b/api/admin/goods.go new file mode 100644 index 0000000..957e81f --- /dev/null +++ b/api/admin/goods.go @@ -0,0 +1,61 @@ +package v1 + +import ( + "pure-admin/global" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" +) + +// @Tags Goods +// @Summary 商品列表 +// @Security ApiKeyAuth +// @accept application/json +// @Param data body request.PageInfo true "分页获取商品列表" +// @Success 200 {object} model.TbGoods4List "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /goods/list [get] +func ListGoods(c *gin.Context) { + var info request.PageInfo + _ = c.ShouldBindQuery(&info) + if info.Page == 0 { + info.Page = 1 + } + if list, total, err := service.ListGoods(info); err != nil { + global.MG_LOG.Error("获取失败!" + err.Error()) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} +// @Tags Goods +// @Summary 商品搜索 +// @Security ApiKeyAuth +// @accept application/json +// @Param data body request.PageInfo true "分页获取商品列表" +// @Success 200 {object} model.TbGoods4List "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /goods/search [get] +func SearchGoods(c *gin.Context) { + var info request.SearchGoods + _ = c.ShouldBindQuery(&info) + if info.Page == 0 { + info.Page = 1 + } + if list, total, err := service.SearchGoods(info); err != nil { + global.MG_LOG.Error("获取失败!" + err.Error()) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} \ No newline at end of file diff --git a/api/admin/mission.go b/api/admin/mission.go new file mode 100644 index 0000000..a713b31 --- /dev/null +++ b/api/admin/mission.go @@ -0,0 +1,575 @@ +package v1 + +import ( + "pure-admin/api/sys" + "pure-admin/global" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// GetMissionDetail +// @Summary 获取任务详情 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.IdReq false "params" +// @Success 200 {object} model.MissionDetail "{"code": 200, "data": {}}" +// @Router /mission/mission [get] +func GetMissionDetail(c *gin.Context) { + var info request.IdReq + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, data := service.GetMissionDetail(info.ID); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithData(data, c) + } +} + +// GetMissionList +// @Summary 获取任务列表 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.SearchMission false "params" +// @Success 200 {object} response.PageResult "{"code": 200, "data": {}}" +// @Router /mission/mission-list [get] +func GetMissionList(c *gin.Context) { + var info request.SearchMission + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + //if timeZone := c.GetHeader("Time-Zone"); timeZone != "" { + // info.TimeZone, _ = time.LoadLocation(timeZone) + //} else { + // info.TimeZone = time.Local + //} + if err, list, total := service.GetMissionList(info); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// GetMissionVideoList +// @Summary 获取任务视频列表 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.SearchMissionVideo false "params" +// @Success 200 {array} response.MissionVideoResponse "{"code": 200, "data": {}}" +// @Router /mission/video-list [get] +func GetMissionVideoList(c *gin.Context) { + var info request.SearchMissionVideo + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + //info.VideoStatus = 2 //仅查询审核通过状态的视频列表 + if err, list, total := service.GetMissionVideoList(info); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// AddMissionVideo +// @Summary 创建任务视频 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data body request.AddMissionVideo false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /mission/add-video [post] +func AddMissionVideo(c *gin.Context) { + var info request.AddMissionVideo + _ = c.ShouldBindJSON(&info) + if err := service.AddMissionVideo(sys.GetUserUuid(c), info); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// EditMissionVideo +// @Summary 编辑任务视频 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data body request.EditMissionVideo false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"编辑成功"}" +// @Router /mission/edit-video [put] +func EditMissionVideo(c *gin.Context) { + var info request.EditMissionVideo + _ = c.ShouldBindJSON(&info) + if err := service.EditMissionVideo(sys.GetUserUuid(c), info); err != nil { + global.MG_LOG.Error("编辑失败!", zap.Any("err", err)) + response.FailWithMessage("编辑失败", c) + } else { + response.OkWithMessage("编辑成功", c) + } +} + +// AddMissionRecommend +// @Summary 创建任务推荐关联 +// @Description +// @Tags mission/recommend +// @Security ApiKeyAuth +// @Param data body request.AddMissionRecommend false "params" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /mission/recommend/add-data [post] +func AddMissionRecommend(c *gin.Context) { + var p request.AddMissionRecommend + var err error + err = c.ShouldBindJSON(&p) + if err != nil { + response.OkWithMessage("创建失败,参数错误", c) + return + } + + if err = service.AddMissionRecommend(&p, sys.GetUserUuid(c)); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败,"+err.Error(), c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// BatchDelMissionRecommendByIds +// @Tags mission/recommend +// @Summary 批量删除任务推荐关联 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsUReq true "ids" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /mission/recommend/batch-del-data [delete] +func BatchDelMissionRecommendByIds(c *gin.Context) { + var ( + err error + param request.IdsUReq + ) + _ = c.ShouldBindJSON(¶m) + if err = service.DeleteMissionRecommendByIds(param); err != nil { + //global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// MissionRecommendUpData +// @Tags mission/recommend +// @Summary 上移任务推荐排序 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdReq true "id,page,pageSize..." +// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}" +// @Router /mission/recommend/up-data [put] +func MissionRecommendUpData(c *gin.Context) { + var ( + err error + param request.IdReq + ) + _ = c.ShouldBindJSON(¶m) + if err = utils.Verify(param, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err = service.MissionRecommendUpData(param, c); err != nil { + //global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败", c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// MissionRecommendDownData +// @Tags mission/recommend +// @Summary 上移任务推荐排序 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdReq true "id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}" +// @Router /mission/recommend/down-data [put] +func MissionRecommendDownData(c *gin.Context) { + var ( + err error + param request.IdReq + ) + _ = c.ShouldBindJSON(¶m) + if err = utils.Verify(param, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err = service.MissionRecommendDownData(param, c); err != nil { + //global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败", c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// MissionRecommendDownData +// @Tags mission/recommend +// @Summary 修改任务推荐排序 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body global.BASE_ID_SORT true "id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}" +// @Router /mission/recommend/update-sort [put] +func UpdateMissionRecommendSort(c *gin.Context) { + var ( + err error + param global.BASE_ID_SORT + ) + _ = c.ShouldBindJSON(¶m) + if err = utils.Verify(param, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err = service.UpdateMissionRecommendSort(param); err != nil { + //global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败", c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// GetMissionRecommendList +// @Tags mission/recommend +// @Summary 分页获取任务推荐列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.SearchMission true "data" +// @Success 200 {object} []response.MissionRecommendResponse "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /mission/recommend/list [get] +func GetMissionRecommendList(c *gin.Context) { + var ( + err error + list interface{} + total int64 + params request.SearchMission + ) + _ = c.ShouldBindQuery(¶ms) + if err, list, total = service.GetMissionRecommendList(params); err != nil { + ////global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + }, "获取成功", c) + } +} + +// GetMissionClaimVideoDetail +// @Summary 任务视频审核详情【v1.0】 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.IdReq false "params" +// @Success 200 {array} response.MissionClaimVideoDetail "{"code": 200, "data": {}}" +// @Router /mission/claim-video-detail [get] +func GetMissionClaimVideoDetail(c *gin.Context) { + var info request.IdReq + _ = c.ShouldBindQuery(&info) + + if err := utils.Verify(info, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, res := service.GetMissionClaimVideoDetail(info.ID); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(res, "获取成功", c) + } +} + +// GetMissionStopList +// @Tags mission +// @Summary 分页获取任务结束申请列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.SearchStopMission true "data" +// @Success 200 {array} response.MissionStopData "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /mission/stop-list [get] +func GetMissionStopList(c *gin.Context) { + var ( + err error + list []response.MissionStopData + total int64 + params request.SearchStopMission + ) + _ = c.ShouldBindQuery(¶ms) + if err, list, total = service.GetMissionStopList(params); err != nil { + ////global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + }, "获取成功", c) + } +} + +// GetMissionStopDetail +// @Tags mission +// @Summary 获取任务结束详情 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.IdReq true "data" +// @Success 200 {object} response.MissionStopData "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /mission/stop-detail [get] +func GetMissionStopDetail(c *gin.Context) { + var ( + err error + data response.MissionStopData + params request.IdReq + ) + _ = c.ShouldBindQuery(¶ms) + if err, data = service.GetMissionStopDetail(params); err != nil { + ////global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(data, "获取成功", c) + } +} + +// StopMission +// @Summary 结束任务 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data body request.IdReq false "params" +// @Success 200 {string} string "{"code": 200, "data": {}}" +// @Router /mission/stop [put] +func StopMission(c *gin.Context) { + var info request.IdReq + _ = c.ShouldBindJSON(&info) + if err := utils.Verify(info, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.StopMission(sys.GetUserUuid(c), info); err != nil { + global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败,"+err.Error(), c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// GetMissionClaimList +// @Summary 获取任务领取列表 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.SearchMissionClaim false "params" +// @Success 200 {array} response.MissionClaimSimpleData "{"code": 200, "data": {}}" +// @Router /mission/claim-list [get] +func GetMissionClaimList(c *gin.Context) { + var info request.SearchMissionClaim + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list, total := service.GetMissionClaimList(info); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// GetSysRewardList +// @Summary 获取平台奖励列表【v1.0】 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.SearchSysReward false "params" +// @Success 200 {array} model.SysMissionReward "{"code": 200, "data": {}}" +// @Router /mission/sys-reward-list [get] +func GetSysRewardList(c *gin.Context) { + var info request.SearchSysReward + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + //uuid := sys.GetUserUuid(c) + if err, list, total := service.GetSysMissionRewardList(info); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// SendSysReward +// @Summary 发送系统任务奖励 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data body request.IdReq false "params" +// @Success 200 {string} string "{"code": 200, "data": {}}" +// @Router /mission/send-sys-reward [post] +func SendSysReward(c *gin.Context) { + var info request.IdReq + _ = c.ShouldBindJSON(&info) + if err := utils.Verify(info, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.SendSysMissionReward(sys.GetUserUuid(c), info); err != nil { + global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败,"+err.Error(), c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// MissionTagRelation +// @Summary 打标签 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data body request.CreateMissionTagRelation false "params" +// @Success 200 {string} string "{"code": 200, "data": {}}" +// @Router /mission/tag-relation [post] +func MissionTagRelation(c *gin.Context) { + var info request.CreateMissionTagRelation + _ = c.ShouldBindJSON(&info) + if err := utils.Verify(info, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.CreateMissionTagRelation(info, sys.GetUserUuid(c)); err != nil { + global.MG_LOG.Error("操作失败!", zap.Any("err", err)) + response.FailWithMessage("操作失败,"+err.Error(), c) + } else { + response.OkWithMessage("操作成功", c) + } +} + +// GetInfluencerMissionSummaryList +// @Summary 获取网红任务统计列表 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.InfluencerSummaryListParam false "params" +// @Success 200 {array} model.MissionClaimSummary "{"code": 200, "data": {}}" +// @Router /mission/influencer-summary-list [get] +func GetInfluencerMissionSummaryList(c *gin.Context) { + var info request.InfluencerSummaryListParam + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + //info.VideoStatus = 2 //仅查询审核通过状态的视频列表 + if err, list, total := service.GetInfluencerSummaryList(info); err != nil { + //global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage(err.Error(), c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// GetMissionClaimOrder +// @Summary 获取任务订单详情【v1.0】 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.OrderId false "params" +// @Success 200 {object} response.MissionClaimOrderResponse "{"code": 200, "data": {}}" +// @Router /mission/claim-order [get] +func GetMissionClaimOrder(c *gin.Context) { + var info request.OrderId + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info, utils.OrderIDVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, data := service.GetMissionClaimOrder(info.OrderID); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithData(response.MissionClaimOrderResponse{Order: data}, c) + } +} + +// GetMissionClaimOrderList +// @Summary 获取任务订单列表【v1.0】 +// @Description +// @Tags mission +// @Security ApiKeyAuth +// @Param data query request.SearchMissionClaimOrder false "params" +// @Success 200 {array} model.MissionClaimOrderDetail "{"code": 200, "data": {}}" +// @Router /mission/claim-order-list [get] +func GetMissionClaimOrderList(c *gin.Context) { + var info request.SearchMissionClaimOrder + _ = c.ShouldBindQuery(&info) + if err := utils.Verify(info.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list, total := service.GetMissionClaimOrderList(info); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} diff --git a/api/admin/order.go b/api/admin/order.go new file mode 100644 index 0000000..ac6e2b3 --- /dev/null +++ b/api/admin/order.go @@ -0,0 +1,80 @@ +package v1 + +import ( + "github.com/gin-gonic/gin" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" +) + +// @Summary 获取订单列表 +// @Security Bearer +// @Description +// @Tags order +// @Param data query request.SearchOrderList false "data..." +// @Success 200 {object} []model.OrderList "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /order/list [get] +func GetOrderList(c *gin.Context) { + var ( + err error + list interface{} + total int64 + data request.SearchOrderList + ) + _ = c.ShouldBindQuery(&data) + err, list, total = service.GetOrderList(&data) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: data.Page, + PageSize: data.PageSize, + }, "获取成功", c) +} + +// @Summary 获取订单详情 +// @Security Bearer +// @Description +// @Tags order +// @Param data query request.SearchOrderDetail false "data..." +// @Success 200 {object} model.OrderDetail "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /order/detail [get] +func GetOrderDetail(c *gin.Context) { + var ( + err error + list interface{} + data request.SearchOrderDetail + ) + _ = c.ShouldBindQuery(&data) + err, list = service.GetOrderDetail(&data) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(list, "获取成功", c) +} + +// @Summary 获取数据统计 +// @Security Bearer +// @Description +// @Tags order +// @Success 200 {object} response.DataStatistics "{"code": 0, "data": [...]}" +// @Success 201 {string} string "{"code": 1, "message": ""}" +// @Router /order/statistic [get] +func GetStatisticData(c *gin.Context) { + var ( + err error + result response.DataStatistics + ) + result, err = service.GetStatisticData() + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDetailed(result, "获取成功", c) +} diff --git a/api/admin/organization.go b/api/admin/organization.go new file mode 100755 index 0000000..a13a82e --- /dev/null +++ b/api/admin/organization.go @@ -0,0 +1,131 @@ +package v1 + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags Organizationv0.0.0 +// @Summary 创建Organization +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Organization true "创建Organization" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /organization/createOrganization [post] +func CreateOrganization(c *gin.Context) { + var organization model.Organization + _ = c.ShouldBindJSON(&organization) + if err := service.CreateOrganization(organization); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags Organizationv0.0.0 +// @Summary 删除Organization +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Organization true "删除Organization" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /organization/deleteOrganization [delete] +func DeleteOrganization(c *gin.Context) { + var organization model.Organization + _ = c.ShouldBindJSON(&organization) + if err := service.DeleteOrganization(organization); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags Organizationv0.0.0 +// @Summary 批量删除Organization +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除Organization" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}" +// @Router /organization/deleteOrganizationByIds [delete] +func DeleteOrganizationByIds(c *gin.Context) { + var IDS request.IdsReq + _ = c.ShouldBindJSON(&IDS) + if err := service.DeleteOrganizationByIds(IDS); err != nil { + global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// @Tags Organizationv0.0.0 +// @Summary 更新Organization +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Organization true "更新Organization" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /organization/updateOrganization [put] +func UpdateOrganization(c *gin.Context) { + var organization model.Organization + _ = c.ShouldBindJSON(&organization) + if err := service.UpdateOrganization(organization); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags Organizationv0.0.0 +// @Summary 用id查询Organization +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Organization true "用id查询Organization" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /organization/findOrganization [get] +func FindOrganization(c *gin.Context) { + var organization model.Organization + _ = c.ShouldBindQuery(&organization) + if err, reorganization := service.GetOrganization(organization.ID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithData(gin.H{"reorganization": reorganization}, c) + } +} + +// @Tags Organizationv0.0.0 +// @Summary 分页获取Organization列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.OrganizationSearch true "分页获取Organization列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /organization/getOrganizationList [get] +func GetOrganizationList(c *gin.Context) { + var pageInfo request.OrganizationSearch + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.GetOrganizationInfoList(pageInfo); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/admin/provider.go b/api/admin/provider.go new file mode 100755 index 0000000..72a45dc --- /dev/null +++ b/api/admin/provider.go @@ -0,0 +1,131 @@ +package v1 + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags Providerv0.0.0 +// @Summary 创建Provider +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Provider true "创建Provider" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /provider/createProvider [post] +func CreateProvider(c *gin.Context) { + var provider model.Provider + _ = c.ShouldBindJSON(&provider) + if err := service.CreateProvider(provider); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags Providerv0.0.0 +// @Summary 删除Provider +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Provider true "删除Provider" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /provider/deleteProvider [delete] +func DeleteProvider(c *gin.Context) { + var provider model.Provider + _ = c.ShouldBindJSON(&provider) + if err := service.DeleteProvider(provider); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags Providerv0.0.0 +// @Summary 批量删除Provider +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除Provider" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}" +// @Router /provider/deleteProviderByIds [delete] +func DeleteProviderByIds(c *gin.Context) { + var IDS request.IdsReq + _ = c.ShouldBindJSON(&IDS) + if err := service.DeleteProviderByIds(IDS); err != nil { + global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// @Tags Providerv0.0.0 +// @Summary 更新Provider +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Provider true "更新Provider" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /provider/updateProvider [put] +func UpdateProvider(c *gin.Context) { + var provider model.Provider + _ = c.ShouldBindJSON(&provider) + if err := service.UpdateProvider(provider); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags Providerv0.0.0 +// @Summary 用id查询Provider +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Provider true "用id查询Provider" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /provider/findProvider [get] +func FindProvider(c *gin.Context) { + var provider model.Provider + _ = c.ShouldBindQuery(&provider) + if err, reprovider := service.GetProvider(provider.ID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithData(gin.H{"reprovider": reprovider}, c) + } +} + +// @Tags Providerv0.0.0 +// @Summary 分页获取Provider列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.ProviderSearch true "分页获取Provider列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /provider/getProviderList [get] +func GetProviderList(c *gin.Context) { + var pageInfo request.ProviderSearch + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.GetProviderInfoList(pageInfo); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/admin/tags.go b/api/admin/tags.go new file mode 100644 index 0000000..37e174a --- /dev/null +++ b/api/admin/tags.go @@ -0,0 +1,181 @@ +package v1 + +import ( + "pure-admin/api/sys" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + "strings" + + "github.com/gin-gonic/gin" +) + +// GetTagsList +// @Tags tags +// @Summary 分页获取标签列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.SearchTags true "data" +// @Success 200 {object} [][]model.Tags "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /tags/list [get] +func GetTagsList(c *gin.Context) { + var ( + err error + list interface{} + total int64 + pageInfo request.SearchTags + ) + _ = c.ShouldBindQuery(&pageInfo) + if err = utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list, total = service.GetTagsList(pageInfo); err != nil { + ////global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} + +// CreateTags +// @Tags tags +// @Summary 创建标签 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.TagsCommon true "data" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /tags [post] +func CreateTags(c *gin.Context) { + var ( + err error + params request.TagsCommon + outData model.Tags + ) + _ = c.ShouldBindJSON(¶ms) + //去除空格 + params.Value = strings.Replace(params.Value, " ", "", -1) + if err = utils.Verify(params, utils.ValueVerity); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + uuid := sys.GetUserUuid(c) + outData, err = service.CreateTags(params, uuid) + if err != nil { + //global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage(err.Error(), c) + } else { + response.OkWithDataMessage(outData.ID, "创建成功", c) + } +} + +// UpdateTags +// @Tags tags +// @Summary 编辑标签 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.TagsCommon true "id,data" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /tags [put] +func UpdateTags(c *gin.Context) { + var ( + err error + params request.TagsCommon + ) + _ = c.ShouldBindJSON(¶ms) + params.Value = strings.Replace(params.Value, " ", "", -1) + if err = utils.Verify(params, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + + //编辑参数验证 + if err = utils.Verify(params, utils.ValueVerity); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + + uuid := sys.GetUserUuid(c) + if err = service.UpdateTags(params, uuid); err != nil { + //global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败,"+err.Error(), c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// DelTagsByIds +// @Tags tags +// @Summary 批量删除标签 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "ids" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /tags/batchDelTags [delete] +func DelTagsByIds(c *gin.Context) { + var ( + err error + param request.IdsReq + ) + _ = c.ShouldBindJSON(¶m) + if err = service.DeleteTagsByIds(param); err != nil { + //global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// GetTagsList +// @Tags tags +// @Summary 获取关联标签列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.RaletionTags true "data" +// @Success 200 {object} []model.TagsDesc "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /tags/relationTags [get] +func GetRelationTags(c *gin.Context) { + var ( + param request.RaletionTags + ) + _ = c.ShouldBindJSON(¶m) + tags, err := service.GetTagsByRelation(¶m) + if err != nil { + response.FailWithMessage("获取失败", c) + return + } + response.OkWithData(tags, c) +} + +// @Summary 打标签 +// @Description +// @Tags tags +// @Security ApiKeyAuth +// @Param data body request.CreateTagRelation false "params" +// @Success 200 {string} string "{"code": 200, "data": {}}" +// @Router /tags/relationTags [post] +func TagRelation(c *gin.Context) { + var info request.CreateTagRelation + _ = c.ShouldBindJSON(&info) + if err := utils.Verify(info, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.CreateTagRelation(info, sys.GetUserUuid(c)); err != nil { + response.FailWithMessage("操作失败,"+err.Error(), c) + } else { + response.OkWithMessage("操作成功", c) + } +} diff --git a/api/admin/user.go b/api/admin/user.go new file mode 100755 index 0000000..097dfc7 --- /dev/null +++ b/api/admin/user.go @@ -0,0 +1,219 @@ +package v1 + +import ( + "pure-admin/api/sys" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags User +// @Summary 创建User +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.User true "创建User" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/createUser [post] +func CreateUser(c *gin.Context) { + var user model.User + _ = c.ShouldBindJSON(&user) + if err := service.CreateUser(user); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags User +// @Summary 删除User +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.User true "删除User" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /user/deleteUser [delete] +func DeleteUser(c *gin.Context) { + var user model.User + _ = c.ShouldBindJSON(&user) + if err := service.DeleteUser(user); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags User +// @Summary 批量删除User +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除User" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}" +// @Router /user/deleteUserByIds [delete] +func DeleteUserByIds(c *gin.Context) { + var IDS request.IdsReq + _ = c.ShouldBindJSON(&IDS) + if err := service.DeleteUserByIds(IDS); err != nil { + global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// @Tags User +// @Summary 更新User +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.User true "更新User" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /user/updateUser [put] +func UpdateUser(c *gin.Context) { + var user model.User + _ = c.ShouldBindJSON(&user) + if err := service.UpdateUser(user); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags User +// @Summary 用id查询User +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.UserSearchByID true "用id查询User" +// @Success 200 {object} model.UserSimple "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /user/findUser [get] +func FindUser(c *gin.Context) { + var user request.UserSearchByID + _ = c.ShouldBindQuery(&user) + if err, reuser := service.GetUser(user.UserID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithData(gin.H{"reuser": reuser}, c) + } +} + +// @Tags User +// @Summary 分页获取User列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.UserSimpleSearch true "分页获取User列表" +// @Success 200 {object} model.UserSimple "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/getUserList [get] +func GetUserList(c *gin.Context) { + var pageInfo request.UserSimpleSearch + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.GetUserInfoList(pageInfo, sys.GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} + +// @Tags User +// @Summary 分页获取系统User列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.UserSimpleSearch true "分页获取User列表" +// @Success 200 {object} model.UserSimple "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/getUserList [post] +func GetSysUserList(c *gin.Context) { + var pageInfo request.UserSimpleSearch + _ = c.ShouldBind(&pageInfo) + if err, list, total := service.GetSysUserInfoList(pageInfo, sys.GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} + +// @Tags User +// @Summary 获取网红认证审核记录 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PlatformAuthSearch true "分页获取User列表" +// @Success 200 {object} model.PlatformAuthSimple "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/platformAuth [get] +func PlatformAuth(c *gin.Context) { + var pageInfo request.PlatformAuthSearch + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.GetPlatformAuthList(pageInfo); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} + +// @Tags User +// @Summary 网红认证审核 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.PlatformAuthCheck true "分页获取User列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/platformAuth [put] +func CheckPlatformAuth(c *gin.Context) { + var auth request.PlatformAuthCheck + _ = c.ShouldBindJSON(&auth) + userID := sys.GetUserUuid(c) + if err := service.CheckPlatformAuth(&auth, userID); err != nil { + global.MG_LOG.Error("审核失败!", zap.Any("err", err)) + response.FailWithMessage("审核失败", c) + } else { + response.OkWithMessage("审核成功", c) + } +} + +// @Tags User +// @Summary 用户禁用启用 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.UserStatus true "分页获取User列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/userStatus [put] +func UpdateUserStatus(c *gin.Context) { + var auth request.UserStatus + _ = c.ShouldBind(&auth) + if err := service.UpdateUserStatus(&auth, sys.GetUserAppid(c), sys.GetUserUuid(c)); err != nil { + global.MG_LOG.Error("审核失败!", zap.Any("err", err)) + response.FailWithMessage("审核失败,"+err.Error(), c) + } else { + response.OkWithMessage("审核成功", c) + } +} diff --git a/api/admin/wallet.go b/api/admin/wallet.go new file mode 100644 index 0000000..80e873b --- /dev/null +++ b/api/admin/wallet.go @@ -0,0 +1,48 @@ +package v1 + +import ( + "fmt" + "github.com/gin-gonic/gin" + "pure-admin/dto" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" +) + +// @Summary 奖励账户充值 +// @Security Bearer +// @Description +// @Tags wallet +// @Param data body request.FundRecharge false "data..." +// @Success 200 {object} response.PayResult "{"code": 0, "data": [...]}" +// @Success 200 {string} string "{"code": 1, "message": ""}" +// @Router /wallet/fund/recharge [post] +func FundRecharge(c *gin.Context) { + var ( + err error + params request.FundRecharge + result response.PayResult + ) + _ = c.ShouldBindJSON(¶ms) + err, result = service.FundRecharge(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithDataMessage(result, "ok", c) +} + +func PaymentPayback(c *gin.Context) { + var ( + err error + params dto.PaybackBody + ) + _ = c.ShouldBind(¶ms) + fmt.Println(params) + err = service.PaypalCallback(¶ms) + if err != nil { + response.FailWithMessage(err.Error(), c) + return + } + response.OkWithMessage("回调成功", c) +} diff --git a/api/sys/exa_breakpoint_continue.go b/api/sys/exa_breakpoint_continue.go new file mode 100644 index 0000000..ee62ec4 --- /dev/null +++ b/api/sys/exa_breakpoint_continue.go @@ -0,0 +1,130 @@ +package sys + +import ( + "io/ioutil" + "pure-admin/global" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + "strconv" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags ExaFileUploadAndDownload +// @Summary 断点续传到服务器 +// @Security ApiKeyAuth +// @accept multipart/form-data +// @Produce application/json +// @Param file formData file true "an example for breakpoint resume, 断点续传示例" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"切片创建成功"}" +// @Router /fileUploadAndDownload/breakpointContinue [post] +func BreakpointContinue(c *gin.Context) { + fileMd5 := c.Request.FormValue("fileMd5") + fileName := c.Request.FormValue("fileName") + chunkMd5 := c.Request.FormValue("chunkMd5") + chunkNumber, _ := strconv.Atoi(c.Request.FormValue("chunkNumber")) + chunkTotal, _ := strconv.Atoi(c.Request.FormValue("chunkTotal")) + _, FileHeader, err := c.Request.FormFile("file") + if err != nil { + global.MG_LOG.Error("接收文件失败!", zap.Any("err", err)) + response.FailWithMessage("接收文件失败", c) + return + } + f, err := FileHeader.Open() + if err != nil { + global.MG_LOG.Error("文件读取失败!", zap.Any("err", err)) + response.FailWithMessage("文件读取失败", c) + return + } + defer f.Close() + cen, _ := ioutil.ReadAll(f) + if !utils.CheckMd5(cen, chunkMd5) { + global.MG_LOG.Error("检查md5失败!", zap.Any("err", err)) + response.FailWithMessage("检查md5失败", c) + return + } + err, file := service.FindOrCreateFile(fileMd5, fileName, chunkTotal) + if err != nil { + global.MG_LOG.Error("查找或创建记录失败!", zap.Any("err", err)) + response.FailWithMessage("查找或创建记录失败", c) + return + } + err, pathc := utils.BreakPointContinue(cen, fileName, chunkNumber, chunkTotal, fileMd5) + if err != nil { + global.MG_LOG.Error("断点续传失败!", zap.Any("err", err)) + response.FailWithMessage("断点续传失败", c) + return + } + + if err = service.CreateFileChunk(file.ID, pathc, chunkNumber); err != nil { + global.MG_LOG.Error("创建文件记录失败!", zap.Any("err", err)) + response.FailWithMessage("创建文件记录失败", c) + return + } + response.OkWithMessage("切片创建成功", c) +} + +// @Tags ExaFileUploadAndDownload +// @Summary 查找文件 +// @Security ApiKeyAuth +// @accept multipart/form-data +// @Produce application/json +// @Param file formData file true "Find the file, 查找文件" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}" +// @Router /fileUploadAndDownload/findFile [post] +func FindFile(c *gin.Context) { + fileMd5 := c.Query("fileMd5") + fileName := c.Query("fileName") + chunkTotal, _ := strconv.Atoi(c.Query("chunkTotal")) + err, file := service.FindOrCreateFile(fileMd5, fileName, chunkTotal) + if err != nil { + global.MG_LOG.Error("查找失败!", zap.Any("err", err)) + response.FailWithMessage("查找失败", c) + } else { + response.OkWithDetailed(response.FileResponse{File: file}, "查找成功", c) + } +} + +// @Tags ExaFileUploadAndDownload +// @Summary 创建文件 +// @Security ApiKeyAuth +// @accept multipart/form-data +// @Produce application/json +// @Param file formData file true "上传文件完成" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"file uploaded, 文件创建成功"}" +// @Router /fileUploadAndDownload/findFile [post] +func BreakpointContinueFinish(c *gin.Context) { + fileMd5 := c.Query("fileMd5") + fileName := c.Query("fileName") + err, filePath := utils.MakeFile(fileName, fileMd5) + if err != nil { + global.MG_LOG.Error("文件创建失败!", zap.Any("err", err)) + response.FailWithMessage("文件创建失败", c) + } else { + response.OkWithDetailed(response.FilePathResponse{FilePath: filePath}, "文件创建成功", c) + } +} + +// @Tags ExaFileUploadAndDownload +// @Summary 删除切片 +// @Security ApiKeyAuth +// @accept multipart/form-data +// @Produce application/json +// @Param file formData file true "删除缓存切片" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"缓存切片删除成功"}" +// @Router /fileUploadAndDownload/removeChunk [post] +func RemoveChunk(c *gin.Context) { + fileMd5 := c.Query("fileMd5") + fileName := c.Query("fileName") + filePath := c.Query("filePath") + err := utils.RemoveChunk(fileMd5) + err = service.DeleteFileChunk(fileMd5, fileName, filePath) + if err != nil { + global.MG_LOG.Error("缓存切片删除失败!", zap.Any("err", err)) + response.FailWithMessage("缓存切片删除失败", c) + } else { + response.OkWithDetailed(response.FilePathResponse{FilePath: filePath}, "缓存切片删除成功", c) + } +} diff --git a/api/sys/sys_api.go b/api/sys/sys_api.go new file mode 100644 index 0000000..a51ce0f --- /dev/null +++ b/api/sys/sys_api.go @@ -0,0 +1,175 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags SysApi +// @Summary 创建基础api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysApi true "api路径, api中文描述, api组, 方法" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /api/createApi [post] +func CreateApi(c *gin.Context) { + var api model.SysApi + _ = c.ShouldBindJSON(&api) + if err := utils.Verify(api, utils.ApiVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + api.Appid = GetUserAppid(c) + api.Type = "admin" + if err := service.CreateApi(api); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败,"+err.Error(), c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags SysApi +// @Summary 删除api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysApi true "ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /api/deleteApi [post] +func DeleteApi(c *gin.Context) { + var api model.SysApi + _ = c.ShouldBindJSON(&api) + if err := utils.Verify(api.MG_MODEL, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + api.Appid = GetUserAppid(c) + if err := service.DeleteApi(api, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags SysApi +// @Summary 分页获取API列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.SearchApiParams true "分页获取API列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/getApiList [post] +func GetApiList(c *gin.Context) { + var pageInfo request.SearchApiParams + _ = c.ShouldBindJSON(&pageInfo) + if err := utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + pageInfo.SysApi.Appid = GetUserAppid(c) + if err, list, total := service.GetAPIInfoList(pageInfo.SysApi, pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} + +// @Tags SysApi +// @Summary 根据id获取api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.GetById true "根据id获取api" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/getApiById [post] +func GetApiById(c *gin.Context) { + var idInfo request.GetById + _ = c.ShouldBindJSON(&idInfo) + if err := utils.Verify(idInfo, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + err, api := service.GetApiById(idInfo.ID) + if err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithData(response.SysAPIResponse{Api: api}, c) + } +} + +// @Tags SysApi +// @Summary 更新基础api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysApi true "api路径, api中文描述, api组, 方法" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /api/updateApi [post] +func UpdateApi(c *gin.Context) { + var api model.SysApi + _ = c.ShouldBindJSON(&api) + if err := utils.Verify(api, utils.ApiVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + api.Appid = GetUserAppid(c) + api.Type = "admin" + if err := service.UpdateApi(api); err != nil { + global.MG_LOG.Error("修改失败!", zap.Any("err", err)) + response.FailWithMessage("修改失败"+err.Error(), c) + } else { + response.OkWithMessage("修改成功", c) + } +} + +// @Tags SysApi +// @Summary 获取所有的Api 不分页 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/getAllApis [post] +func GetAllApis(c *gin.Context) { + if err, apis := service.GetAllApis(GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.SysAPIListResponse{Apis: apis}, "获取成功", c) + } +} + +// @Tags SysApi +// @Summary 删除选中Api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /api/deleteApisByIds [delete] +func DeleteApisByIds(c *gin.Context) { + var ids request.IdsReq + _ = c.ShouldBindJSON(&ids) + if err := service.DeleteApisByIds(ids, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} diff --git a/api/sys/sys_authority.go b/api/sys/sys_authority.go new file mode 100644 index 0000000..a92ac34 --- /dev/null +++ b/api/sys/sys_authority.go @@ -0,0 +1,140 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags Authority +// @Summary 创建角色 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysAuthority true "权限id, 权限名, 父角色id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /authority/createAuthority [post] +func CreateAuthority(c *gin.Context) { + var authority model.SysAuthority + _ = c.ShouldBindJSON(&authority) + if err := utils.Verify(authority, utils.AuthorityVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + authority.Appid = GetUserAppid(c) + authority.Type = "admin" + if err, authBack := service.CreateAuthority(authority); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败"+err.Error(), c) + } else { + response.OkWithDetailed(response.SysAuthorityResponse{Authority: authBack}, "创建成功", c) + } +} + +// @Tags Authority +// @Summary 拷贝角色 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body response.SysAuthorityCopyResponse true "旧角色id, 新权限id, 新权限名, 新父角色id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"拷贝成功"}" +// @Router /authority/copyAuthority [post] +func CopyAuthority(c *gin.Context) { + var copyInfo response.SysAuthorityCopyResponse + _ = c.ShouldBindJSON(©Info) + if err := utils.Verify(copyInfo, utils.OldAuthorityVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := utils.Verify(copyInfo.Authority, utils.AuthorityVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + copyInfo.Authority.Appid = GetUserAppid(c) + if err, authBack := service.CopyAuthority(copyInfo); err != nil { + global.MG_LOG.Error("拷贝失败!", zap.Any("err", err)) + response.FailWithMessage("拷贝失败"+err.Error(), c) + } else { + response.OkWithDetailed(response.SysAuthorityResponse{Authority: authBack}, "拷贝成功", c) + } +} + +// @Tags Authority +// @Summary 删除角色 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysAuthority true "删除角色" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /authority/deleteAuthority [post] +func DeleteAuthority(c *gin.Context) { + var authority model.SysAuthority + _ = c.ShouldBindJSON(&authority) + if err := utils.Verify(authority, utils.AuthorityIdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.DeleteAuthority(&authority); err != nil { // 删除角色之前需要判断是否有用户正在使用此角色 + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败"+err.Error(), c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags Authority +// @Summary 更新角色信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysAuthority true "权限id, 权限名, 父角色id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /authority/updateAuthority [put] +func UpdateAuthority(c *gin.Context) { + var auth model.SysAuthority + _ = c.ShouldBindJSON(&auth) + if err := utils.Verify(auth, utils.AuthorityVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, authority := service.UpdateAuthority(auth); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败"+err.Error(), c) + } else { + response.OkWithDetailed(response.SysAuthorityResponse{Authority: authority}, "更新成功", c) + } +} + +// @Tags Authority +// @Summary 分页获取角色列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.PageInfo true "页码, 每页大小" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /authority/getAuthorityList [post] +func GetAuthorityList(c *gin.Context) { + var pageInfo request.PageInfo + _ = c.ShouldBindJSON(&pageInfo) + if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list, total := service.GetAuthorityInfoList(pageInfo, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败"+err.Error(), c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/sys/sys_auto_code.go b/api/sys/sys_auto_code.go new file mode 100644 index 0000000..261dc08 --- /dev/null +++ b/api/sys/sys_auto_code.go @@ -0,0 +1,99 @@ +package sys + +import ( + "errors" + "fmt" + "net/url" + "os" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +func PreviewTemp(c *gin.Context) { + var a model.AutoCodeStruct + _ = c.ShouldBindJSON(&a) + if err := utils.Verify(a, utils.AutoCodeVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + autoCode, err := service.PreviewTemp(a) + if err != nil { + global.MG_LOG.Error("预览失败!", zap.Any("err", err)) + response.FailWithMessage("预览失败", c) + } else { + response.OkWithDetailed(gin.H{"autoCode": autoCode}, "预览成功", c) + } +} + +func CreateTemp(c *gin.Context) { + var a model.AutoCodeStruct + _ = c.ShouldBindJSON(&a) + if err := utils.Verify(a, utils.AutoCodeVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if a.AutoCreateApiToSql { + if err := service.AutoCreateApi(&a); err != nil { + global.MG_LOG.Error("自动化创建失败!请自行清空垃圾数据!", zap.Any("err", err)) + c.Writer.Header().Add("success", "false") + c.Writer.Header().Add("msg", url.QueryEscape("自动化创建失败!请自行清空垃圾数据!")) + return + } + } + err := service.CreateTemp(a) + if err != nil { + fmt.Println(err) + if errors.Is(err, model.AutoMoveErr) { + c.Writer.Header().Add("success", "false") + c.Writer.Header().Add("msgtype", "success") + c.Writer.Header().Add("msg", url.QueryEscape(err.Error())) + } else { + c.Writer.Header().Add("success", "false") + c.Writer.Header().Add("msg", url.QueryEscape(err.Error())) + _ = os.Remove("./ginvueadmin.zip") + } + } else { + c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "ginvueadmin.zip")) // fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名 + c.Writer.Header().Add("Content-Type", "application/json") + c.Writer.Header().Add("success", "true") + c.File("./ginvueadmin.zip") + _ = os.Remove("./ginvueadmin.zip") + } +} + +func GetTables(c *gin.Context) { + dbName := c.DefaultQuery("dbName", "") + err, tables := service.GetTables(dbName) + if err != nil { + global.MG_LOG.Error("查询table失败!", zap.Any("err", err)) + response.FailWithMessage("查询table失败", c) + } else { + response.OkWithDetailed(gin.H{"tables": tables}, "获取成功", c) + } +} + +func GetDB(c *gin.Context) { + if err, dbs := service.GetDB(); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(gin.H{"dbs": dbs}, "获取成功", c) + } +} + +func GetColumn(c *gin.Context) { + dbName := c.DefaultQuery("dbName", "") + tableName := c.Query("tableName") + if err, columns := service.GetColumn(tableName, dbName); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(gin.H{"columns": columns}, "获取成功", c) + } +} diff --git a/api/sys/sys_captcha.go b/api/sys/sys_captcha.go new file mode 100644 index 0000000..9580d4b --- /dev/null +++ b/api/sys/sys_captcha.go @@ -0,0 +1,37 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model/response" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "github.com/mojocn/base64Captcha" + "go.uber.org/zap" +) + +//var store = base64Captcha.DefaultMemStore +var store = utils.RedisStore{} + +// @Tags Base +// @Summary 生成验证码 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"验证码获取成功"}" +// @Router /base/captcha [post] +func Captcha(c *gin.Context) { + // 字符,公式,验证码配置 + // 生成默认数字的driver + driver := base64Captcha.NewDriverDigit(global.MG_CONFIG.Captcha.ImgHeight, global.MG_CONFIG.Captcha.ImgWidth, global.MG_CONFIG.Captcha.KeyLong, 0.7, 80) + cp := base64Captcha.NewCaptcha(driver, store) + if id, b64s, err := cp.Generate(); err != nil { + global.MG_LOG.Error("验证码获取失败!", zap.Any("err", err)) + response.FailWithMessage("验证码获取失败", c) + } else { + response.OkWithDetailed(response.SysCaptchaResponse{ + CaptchaId: id, + PicPath: b64s, + }, "验证码获取成功", c) + } +} diff --git a/api/sys/sys_casbin.go b/api/sys/sys_casbin.go new file mode 100644 index 0000000..40e5d5c --- /dev/null +++ b/api/sys/sys_casbin.go @@ -0,0 +1,54 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags Casbin +// @Summary 更新角色api权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.CasbinInReceive true "权限id, 权限模型列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /casbin/UpdateCasbin [post] +func UpdateCasbin(c *gin.Context) { + var cmr request.CasbinInReceive + _ = c.ShouldBindJSON(&cmr) + if err := utils.Verify(cmr, utils.AuthorityIdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.UpdateCasbin(cmr.AuthorityId, GetUserAppid(c), cmr.CasbinInfos); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags Casbin +// @Summary 获取权限列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.CasbinInReceive true "权限id, 权限模型列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /casbin/getPolicyPathByAuthorityId [post] +func GetPolicyPathByAuthorityId(c *gin.Context) { + var casbin request.CasbinInReceive + _ = c.ShouldBindJSON(&casbin) + if err := utils.Verify(casbin, utils.AuthorityIdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + paths := service.GetPolicyPathByAuthorityId(casbin.AuthorityId, GetUserAppid(c)) + response.OkWithDetailed(response.PolicyPathResponse{Paths: paths}, "获取成功", c) +} diff --git a/api/sys/sys_dictionary.go b/api/sys/sys_dictionary.go new file mode 100644 index 0000000..a2720da --- /dev/null +++ b/api/sys/sys_dictionary.go @@ -0,0 +1,77 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +func CreateSysDictionary(c *gin.Context) { + var dictionary model.SysDictionary + _ = c.ShouldBindJSON(&dictionary) + if err := service.CreateSysDictionary(dictionary); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +func DeleteSysDictionary(c *gin.Context) { + var dictionary model.SysDictionary + _ = c.ShouldBindJSON(&dictionary) + if err := service.DeleteSysDictionary(dictionary); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +func UpdateSysDictionary(c *gin.Context) { + var dictionary model.SysDictionary + _ = c.ShouldBindJSON(&dictionary) + if err := service.UpdateSysDictionary(&dictionary); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +func FindSysDictionary(c *gin.Context) { + var dictionary model.SysDictionary + _ = c.ShouldBindQuery(&dictionary) + if err, sysDictionary := service.GetSysDictionary(dictionary.Type, dictionary.ID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithDetailed(gin.H{"resysDictionary": sysDictionary}, "查询成功", c) + } +} + +func GetSysDictionaryList(c *gin.Context) { + var pageInfo request.SysDictionarySearch + _ = c.ShouldBindQuery(&pageInfo) + if err := utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list, total := service.GetSysDictionaryInfoList(pageInfo); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/sys/sys_dictionary_detail.go b/api/sys/sys_dictionary_detail.go new file mode 100644 index 0000000..1cff181 --- /dev/null +++ b/api/sys/sys_dictionary_detail.go @@ -0,0 +1,77 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +func CreateSysDictionaryDetail(c *gin.Context) { + var detail model.SysDictionaryDetail + _ = c.ShouldBindJSON(&detail) + if err := service.CreateSysDictionaryDetail(detail); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +func DeleteSysDictionaryDetail(c *gin.Context) { + var detail model.SysDictionaryDetail + _ = c.ShouldBindJSON(&detail) + if err := service.DeleteSysDictionaryDetail(detail); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +func UpdateSysDictionaryDetail(c *gin.Context) { + var detail model.SysDictionaryDetail + _ = c.ShouldBindJSON(&detail) + if err := service.UpdateSysDictionaryDetail(&detail); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +func FindSysDictionaryDetail(c *gin.Context) { + var detail model.SysDictionaryDetail + _ = c.ShouldBindQuery(&detail) + if err := utils.Verify(detail, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, resysDictionaryDetail := service.GetSysDictionaryDetail(detail.ID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithDetailed(gin.H{"resysDictionaryDetail": resysDictionaryDetail}, "查询成功", c) + } +} + +func GetSysDictionaryDetailList(c *gin.Context) { + var pageInfo request.SysDictionaryDetailSearch + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.GetSysDictionaryDetailInfoList(pageInfo); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/sys/sys_email.go b/api/sys/sys_email.go new file mode 100644 index 0000000..85199e0 --- /dev/null +++ b/api/sys/sys_email.go @@ -0,0 +1,19 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +func EmailTest(c *gin.Context) { + if err := service.EmailTest(); err != nil { + global.MG_LOG.Error("发送失败!", zap.Any("err", err)) + response.FailWithMessage("发送失败", c) + } else { + response.OkWithData("发送成功", c) + } +} diff --git a/api/sys/sys_jwt_blacklist.go b/api/sys/sys_jwt_blacklist.go new file mode 100644 index 0000000..75d3e64 --- /dev/null +++ b/api/sys/sys_jwt_blacklist.go @@ -0,0 +1,22 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +func JsonInBlacklist(c *gin.Context) { + token := c.Request.Header.Get("x-token") + jwt := model.JwtBlacklist{Jwt: token} + if err := service.JsonInBlacklist(jwt); err != nil { + global.MG_LOG.Error("jwt作废失败!", zap.Any("err", err)) + response.FailWithMessage("jwt作废失败", c) + } else { + response.OkWithMessage("jwt作废成功", c) + } +} diff --git a/api/sys/sys_menu.go b/api/sys/sys_menu.go new file mode 100644 index 0000000..393399a --- /dev/null +++ b/api/sys/sys_menu.go @@ -0,0 +1,237 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags AuthorityMenu +// @Summary 获取用户动态路由 +// @Security ApiKeyAuth +// @Produce application/json +// @Param data body request.Empty true "空" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getMenu [post] +func GetMenu(c *gin.Context) { + if err, menus := service.GetMenuTree(GetUserAuthorityId(c), GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.SysMenusResponse{Menus: menus}, "获取成功", c) + } +} + +// @Tags AuthorityMenu +// @Summary 获取用户动态路由List +// @Security ApiKeyAuth +// @Produce application/json +// @Param data body request.Empty true "空" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getMenuForList [post] +func GetMenuForList(c *gin.Context) { + if err, menus := service.GetMenuAuthority(GetUserAuthorityId(c), GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + paths := service.GetPolicyPathByAuthorityId(GetUserAuthorityId(c), GetUserAppid(c)) + response.OkWithDetailed(gin.H{"menus": menus, "apis": paths}, "获取成功", c) + } +} + +// @Tags AuthorityMenu +// @Summary 获取用户动态路由 +// @Security ApiKeyAuth +// @Produce application/json +// @Param data body request.Empty true "空" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getBaseMenuTree [post] +func GetBaseMenuTree(c *gin.Context) { + if err, menus := service.GetBaseMenuTree(); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.SysBaseMenusResponse{Menus: menus}, "获取成功", c) + } +} + +// @Tags AuthorityMenu +// @Summary 增加menu和角色关联关系 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.AddMenuAuthorityInfo true "角色ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"添加成功"}" +// @Router /menu/addMenuAuthority [post] +func AddMenuAuthority(c *gin.Context) { + var authorityMenu request.AddMenuAuthorityInfo + _ = c.ShouldBindJSON(&authorityMenu) + if err := utils.Verify(authorityMenu, utils.AuthorityIdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.AddMenuAuthority(authorityMenu.Menus, authorityMenu.AuthorityId, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("添加失败!", zap.Any("err", err)) + response.FailWithMessage("添加失败", c) + } else { + response.OkWithMessage("添加成功", c) + } +} + +// @Tags AuthorityMenu +// @Summary 获取指定角色menu +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.GetAuthorityId true "角色ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getMenuAuthority [post] +func GetMenuAuthority(c *gin.Context) { + var param request.GetAuthorityId + _ = c.ShouldBindJSON(¶m) + if err := utils.Verify(param, utils.AuthorityIdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, menus := service.GetMenuAuthority(param.AuthorityId, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(gin.H{"menus": menus}, "获取成功", c) + } +} + +// @Tags Menu +// @Summary 新增菜单 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"添加成功"}" +// @Router /menu/addBaseMenu [post] +func AddBaseMenu(c *gin.Context) { + var menu model.SysBaseMenu + _ = c.ShouldBindJSON(&menu) + if err := utils.Verify(menu, utils.MenuVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := utils.Verify(menu.Meta, utils.MenuMetaVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.AddBaseMenu(menu, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("添加失败!", zap.Any("err", err)) + + response.FailWithMessage("添加失败,"+err.Error(), c) + } else { + response.OkWithMessage("添加成功", c) + } +} + +// @Tags Menu +// @Summary 删除菜单 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.GetById true "菜单id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /menu/deleteBaseMenu [post] +func DeleteBaseMenu(c *gin.Context) { + var menu request.GetById + _ = c.ShouldBindJSON(&menu) + if err := utils.Verify(menu, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.DeleteBaseMenu(menu.ID, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags Menu +// @Summary 更新菜单 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /menu/updateBaseMenu [post] +func UpdateBaseMenu(c *gin.Context) { + var menu model.SysBaseMenu + _ = c.ShouldBindJSON(&menu) + if err := utils.Verify(menu, utils.MenuVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := utils.Verify(menu.Meta, utils.MenuMetaVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err := service.UpdateBaseMenu(menu); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags Menu +// @Summary 根据id获取菜单 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.GetById true "菜单id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getBaseMenuById [post] +func GetBaseMenuById(c *gin.Context) { + var idInfo request.GetById + _ = c.ShouldBindJSON(&idInfo) + if err := utils.Verify(idInfo, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, menu := service.GetBaseMenuById(idInfo.ID); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.SysBaseMenuResponse{Menu: menu}, "获取成功", c) + } +} + +// @Tags Menu +// @Summary 分页获取基础menu列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.PageInfo true "页码, 每页大小" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getMenuList [post] +func GetMenuList(c *gin.Context) { + var pageInfo request.PageInfo + _ = c.ShouldBindJSON(&pageInfo) + if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, menuList, total := service.GetInfoList(); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: menuList, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/sys/sys_operation_record.go b/api/sys/sys_operation_record.go new file mode 100644 index 0000000..d571494 --- /dev/null +++ b/api/sys/sys_operation_record.go @@ -0,0 +1,117 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags SysOperationRecord +// @Summary 创建SysOperationRecord +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysOperationRecord true "创建SysOperationRecord" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysOperationRecord/createSysOperationRecord [post] +func CreateSysOperationRecord(c *gin.Context) { + var sysOperationRecord model.SysOperationRecord + _ = c.ShouldBindJSON(&sysOperationRecord) + if err := service.CreateSysOperationRecord(sysOperationRecord); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags SysOperationRecord +// @Summary 删除SysOperationRecord +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysOperationRecord true "SysOperationRecord模型" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sysOperationRecord/deleteSysOperationRecord [delete] +func DeleteSysOperationRecord(c *gin.Context) { + var sysOperationRecord model.SysOperationRecord + _ = c.ShouldBindJSON(&sysOperationRecord) + if err := service.DeleteSysOperationRecord(sysOperationRecord); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags SysOperationRecord +// @Summary 批量删除SysOperationRecord +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除SysOperationRecord" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}" +// @Router /sysOperationRecord/deleteSysOperationRecordByIds [delete] +func DeleteSysOperationRecordByIds(c *gin.Context) { + var IDS request.IdsReq + _ = c.ShouldBindJSON(&IDS) + if err := service.DeleteSysOperationRecordByIds(IDS); err != nil { + global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// @Tags SysOperationRecord +// @Summary 用id查询SysOperationRecord +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysOperationRecord true "Id" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /sysOperationRecord/findSysOperationRecord [get] +func FindSysOperationRecord(c *gin.Context) { + var sysOperationRecord model.SysOperationRecord + _ = c.ShouldBindQuery(&sysOperationRecord) + if err := utils.Verify(sysOperationRecord, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, resysOperationRecord := service.GetSysOperationRecord(sysOperationRecord.ID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithDetailed(gin.H{"resysOperationRecord": resysOperationRecord}, "查询成功", c) + } +} + +// @Tags SysOperationRecord +// @Summary 分页获取SysOperationRecord列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysOperationRecord/getSysOperationRecordList [get] +func GetSysOperationRecordList(c *gin.Context) { + var pageInfo request.SysOperationRecordSearch + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.GetSysOperationRecordInfoList(pageInfo, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/api/sys/sys_system.go b/api/sys/sys_system.go new file mode 100644 index 0000000..e366d79 --- /dev/null +++ b/api/sys/sys_system.go @@ -0,0 +1,65 @@ +package sys + +import ( + "github.com/gin-gonic/gin" + "go.uber.org/zap" + + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" +) + +// @Tags System +// @Summary 获取配置文件内容 +// @Security ApiKeyAuth +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /system/getSystemConfig [post] +func GetSystemConfig(c *gin.Context) { + if err, config := service.GetSystemConfig(); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.SysConfigResponse{Config: config}, "获取成功", c) + } +} + +// @Tags System +// @Summary 设置配置文件内容 +// @Security ApiKeyAuth +// @Produce application/json +// @Param data body model.System true "设置配置文件内容" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}" +// @Router /system/setSystemConfig [post] +func SetSystemConfig(c *gin.Context) { + var sys model.System + _ = c.ShouldBindJSON(&sys) + if err := service.SetSystemConfig(sys); err != nil { + global.MG_LOG.Error("设置失败!", zap.Any("err", err)) + response.FailWithMessage("设置失败", c) + } else { + response.OkWithData("设置成功", c) + } +} + +// @Tags System +// @Summary 重启系统 +// @Security ApiKeyAuth +// @Produce application/json +// @Success 200 {string} string "{"code":0,"data":{},"msg":"重启系统成功"}" +// @Router /system/reloadSystem [post] +func ReloadSystem(c *gin.Context) { + err := utils.Reload() + if err != nil { + global.MG_LOG.Error("重启系统失败!", zap.Any("err", err)) + response.FailWithMessage("重启系统失败", c) + } else { + response.OkWithMessage("重启系统成功", c) + } +} + +func MonitorTest(c *gin.Context) { + response.OkWithMessage("ok", c) +} diff --git a/api/sys/sys_user.go b/api/sys/sys_user.go new file mode 100644 index 0000000..73191d5 --- /dev/null +++ b/api/sys/sys_user.go @@ -0,0 +1,395 @@ +package sys + +import ( + "pure-admin/global" + "pure-admin/middleware" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "pure-admin/utils" + "time" + + "github.com/dgrijalva/jwt-go" + "github.com/gin-gonic/gin" + "github.com/go-redis/redis" + "go.uber.org/zap" +) + +// @Tags Base +// @Summary 用户登录 +// @Produce application/json +// @Param data body request.Login true "用户名, 密码, 验证码" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}" +// @Router /base/login [post] +func Login(c *gin.Context) { + var l request.Login + _ = c.ShouldBindJSON(&l) + if err := utils.Verify(l, utils.LoginVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if store.Verify(l.CaptchaId, l.Captcha, true) { + u := &model.User{Username: l.Username, Password: l.Password, Appid: l.Appid} + if err, user := service.Login(u); err != nil { + global.MG_LOG.Error("登陆失败! 用户名不存在或者密码错误!", zap.Any("err", err)) + response.FailWithMessage(err.Error(), c) + } else { + tokenNext(c, *user) + } + } else { + response.FailWithMessage("验证码错误", c) + } +} + +// 登录以后签发jwt +func tokenNext(c *gin.Context, user model.User) { + j := &middleware.JWT{SigningKey: []byte(global.MG_CONFIG.JWT.SigningKey)} // 唯一签名 + claims := request.CustomClaims{ + UUID: user.UUID, + ID: user.ID, + NickName: user.NickName, + AuthorityId: user.AuthorityID, + Organization: user.Organization, + Appid: user.Appid, + Type: user.Type, + BufferTime: global.MG_CONFIG.JWT.BufferTime, // 缓冲时间1天 缓冲时间内会获得新的token刷新令牌 此时一个用户会存在两个有效令牌 但是前端只留一个 另一个会丢失 + StandardClaims: jwt.StandardClaims{ + NotBefore: time.Now().Unix() - 1000, // 签名生效时间 + ExpiresAt: time.Now().Unix() + global.MG_CONFIG.JWT.ExpiresTime, // 过期时间 7天 配置文件 + Issuer: "qmPlus", // 签名的发行者 + }, + } + token, err := j.CreateToken(claims) + if err != nil { + global.MG_LOG.Error("获取token失败!", zap.Any("err", err)) + response.FailWithMessage("获取token失败", c) + return + } + if !global.MG_CONFIG.System.UseMultipoint { + response.OkWithDetailed(response.LoginResponse{ + User: user, + Token: token, + ExpiresAt: claims.StandardClaims.ExpiresAt * 1000, + }, "登录成功", c) + return + } + + if err, jwtStr := service.GetRedisJWT(user.UUID.String()); err == redis.Nil { + if err := service.SetRedisJWT(token, user.UUID.String()); err != nil { + global.MG_LOG.Error("设置登录状态失败!", zap.Any("err", err)) + response.FailWithMessage("设置登录状态失败", c) + return + } + response.OkWithDetailed(response.LoginResponse{ + User: user, + Token: token, + ExpiresAt: claims.StandardClaims.ExpiresAt * 1000, + }, "登录成功", c) + } else if err != nil { + global.MG_LOG.Error("设置登录状态失败!", zap.Any("err", err)) + response.FailWithMessage("设置登录状态失败", c) + } else { + var blackJWT model.JwtBlacklist + blackJWT.Jwt = jwtStr + if err := service.JsonInBlacklist(blackJWT); err != nil { + response.FailWithMessage("jwt作废失败", c) + return + } + if err := service.SetRedisJWT(token, user.UUID.String()); err != nil { + response.FailWithMessage("设置登录状态失败", c) + return + } + response.OkWithDetailed(response.LoginResponse{ + User: user, + Token: token, + ExpiresAt: claims.StandardClaims.ExpiresAt * 1000, + }, "登录成功", c) + } +} + +// @Tags SysUser +// @Summary 用户注册账号 +// @Produce application/json +// @Param data body model.SysUser true "用户名, 昵称, 密码, 角色ID,姓名,手机" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}" +// @Router /user/register [post] +func Register(c *gin.Context) { + var r request.Register + _ = c.ShouldBindJSON(&r) + if err := utils.Verify(r, utils.RegisterVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + var authorities []model.SysAuthority + for _, v := range r.AuthorityIds { + authorities = append(authorities, model.SysAuthority{ + AuthorityId: v, + }) + } + user := &model.User{Username: r.Username, NickName: r.NickName, Phone: r.Phone, Password: r.Password, AuthorityID: r.AuthorityId, Authorities: authorities} + err, userReturn := service.Register(*user) + if err != nil { + global.MG_LOG.Error("注册失败!", zap.Any("err", err)) + response.FailWithMessage(err.Error(), c) + } else { + response.OkWithDetailed(response.SysUserResponse{User: userReturn}, "注册成功", c) + } +} + +// @Tags SysUser +// @Summary 用户修改密码 +// @Security ApiKeyAuth +// @Produce application/json +// @Param data body request.ChangePasswordStruct true "用户名, 原密码, 新密码" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/changePassword [put] +func ChangePassword(c *gin.Context) { + var user request.ChangePasswordStruct + _ = c.ShouldBindJSON(&user) + if err := utils.Verify(user, utils.ChangePasswordVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + u := &model.SysUser{Username: user.Username, Password: user.Password} + if err, _ := service.ChangePassword(u, user.NewPassword); err != nil { + global.MG_LOG.Error("修改失败!", zap.Any("err", err)) + response.FailWithMessage("修改失败,原密码与当前账户不符", c) + } else { + response.OkWithMessage("修改成功", c) + } +} + +// @Tags SysUser +// @Summary 分页获取用户列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.SearchSysUserParams true "页码, 每页大小" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /suser/getUserList [post] +func GetUserList(c *gin.Context) { + var info request.SearchSysUserParams + _ = c.ShouldBindJSON(&info) + if err := utils.Verify(info.PageInfo, utils.PageInfoVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, list, total := service.GetUserInfoList1(info, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: info.Page, + PageSize: info.PageSize, + }, "获取成功", c) + } +} + +// @Tags SysUser +// @Summary 设置用户权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.SetUserAuth true "用户UUID, 角色ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/setUserAuthority [post] +func SetUserAuthority(c *gin.Context) { + var sua request.SetUserAuth + _ = c.ShouldBindJSON(&sua) + if UserVerifyErr := utils.Verify(sua, utils.SetUserAuthorityVerify); UserVerifyErr != nil { + response.FailWithMessage(UserVerifyErr.Error(), c) + return + } + if err := service.SetUserAuthority(GetUserUuid(c), sua.AuthorityId); err != nil { + global.MG_LOG.Error("修改失败!", zap.Any("err", err)) + response.FailWithMessage("修改失败", c) + } else { + if err, user := service.GetUserInfo(GetUserUuid(c), GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取用户信息失败!", zap.Any("err", err)) + response.FailWithMessage("获取用户信息失败", c) + } else { + tokenNext(c, user) + } + //claims := getUserInfo(c) + //j := &middleware.JWT{SigningKey: []byte(global.MG_CONFIG.JWT.SigningKey)} // 唯一签名 + //claims.AuthorityId = sua.AuthorityId + //if token, err := j.CreateToken(*claims); err != nil { + // global.MG_LOG.Error("修改失败!", zap.Any("err", err)) + // response.FailWithMessage(err.Error(), c) + //} else { + // response.OkWithDataMessage(token, "修改成功", c) + //} + } +} + +// @Tags SysUser +// @Summary 删除用户 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.GetById true "用户ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /suser/deleteUser [delete] +func DeleteUser(c *gin.Context) { + var reqId request.GetById + _ = c.ShouldBindJSON(&reqId) + if err := utils.Verify(reqId, utils.IdVerify); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + jwtId := getUserID(c) + if jwtId == uint(reqId.ID) { + response.FailWithMessage("删除失败, 自杀失败", c) + return + } + if err := service.DeleteUser1(reqId.ID); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags SysUser +// @Summary 设置用户信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysUser true "ID, 用户名, 昵称, 头像链接" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}" +// @Router /user/setUserInfo [put] +func SetUserInfo(c *gin.Context) { + var user model.SysUser + _ = c.ShouldBindJSON(&user) + if err := utils.Verify(user.MG_MODEL, utils.UUIDVerity); err != nil { + response.FailWithMessage(err.Error(), c) + return + } + if err, ReqUser := service.SetUserInfo(user); err != nil { + global.MG_LOG.Error("设置失败!", zap.Any("err", err)) + response.FailWithMessage("设置失败", c) + } else { + response.OkWithDetailed(gin.H{"userInfo": ReqUser}, "设置成功", c) + } +} + +// @Tags SysUser +// @Summary 获取用户信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/getUserInfo [get] +func GetUserInfo(c *gin.Context) { + if err, ReqUser := service.GetUserInfo(GetUserUuid(c), GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(gin.H{"userInfo": ReqUser}, "获取成功", c) + } +} + +// @Tags SysUser +// @Summary 获取用户选择器列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param nickName query string true "nickName" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/getUserSelectList [get] +func GetUserSelectList(c *gin.Context) { + nickName := c.Query("nickName") + if list, err := service.GetUserSelectList(nickName, GetUserAppid(c)); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(list, "获取成功", c) + } +} + +// 从Gin的Context中获取从jwt解析出来的用户ID +func getUserID(c *gin.Context) uint { + if claims, exists := c.Get("claims"); !exists { + global.MG_LOG.Error("从Gin的Context中获取从jwt解析出来的用户ID失败, 请检查路由是否使用jwt中间件!") + return 0 + } else { + waitUse := claims.(*request.CustomClaims) + return waitUse.ID + } +} + +// 从Gin的Context中获取从jwt解析出来的用户UUID +func GetUserUuid(c *gin.Context) string { + if claims, exists := c.Get("claims"); !exists { + global.MG_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件!") + return "" + } else { + waitUse := claims.(*request.CustomClaims) + return waitUse.UUID.String() + } +} + +// 从Gin的Context中获取从jwt解析出来的用户UUID +func GetUserAppid(c *gin.Context) string { + if claims, exists := c.Get("claims"); !exists { + global.MG_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件!") + return "" + } else { + waitUse := claims.(*request.CustomClaims) + return waitUse.Appid + } +} + +// 从Gin的Context中获取从jwt解析出来的用户昵称 +func GetUserNickName(c *gin.Context) string { + if claims, exists := c.Get("claims"); !exists { + global.MG_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件!") + return "" + } else { + waitUse := claims.(*request.CustomClaims) + return waitUse.NickName + } +} + +// 从Gin的Context中获取从jwt解析出来的用户角色id +func GetUserAuthorityId(c *gin.Context) uint { + if claims, exists := c.Get("claims"); !exists { + global.MG_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件!") + return 0 + } else { + waitUse := claims.(*request.CustomClaims) + return waitUse.AuthorityId + } +} + +func getUserInfo(c *gin.Context) *request.CustomClaims { + if claims, exists := c.Get("claims"); !exists { + global.MG_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件!") + return nil + } else { + waitUse := claims.(*request.CustomClaims) + return waitUse + } +} + +// @Tags SysUser +// @Summary 设置用户权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.SetUserAuthorities true "用户UUID, 角色ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/setUserAuthorities [post] +func SetUserAuthorities(c *gin.Context) { + var sua request.SetUserAuthorities + _ = c.ShouldBindJSON(&sua) + if err := service.SetUserAuthorities(sua.UUID, sua.AuthorityIds); err != nil { + global.MG_LOG.Error("修改失败!", zap.Any("err", err)) + response.FailWithMessage("修改失败", c) + } else { + response.OkWithMessage("修改成功", c) + } +} diff --git a/config-prod.yaml b/config-prod.yaml new file mode 100644 index 0000000..497ef46 --- /dev/null +++ b/config-prod.yaml @@ -0,0 +1,78 @@ +autocode: + transfer-restart: true + root: /Users/wenwu/Desktop/project/BKB-N + server: /admin-api + server-api: /api/admin + server-initialize: /initialize + server-model: /model + server-request: /model/request/ + server-router: /router + server-service: /service + web: /web/src + web-api: /api + web-form: /view + web-table: /view + web-flow: /view +captcha: + key-long: 6 + img-width: 240 + img-height: 80 +casbin: + model-path: ./resource/rbac_model.conf +email: + to: xxx@qq.com + port: 465 + from: xxx@163.com + host: smtp.163.com + is-ssl: true + secret: xxx + nickname: test +jwt: + signing-key: qmPlus + expires-time: 604800 + buffer-time: 86400 +local: + path: uploads/file +mysql: + path: 172.16.0.26:3306 + config: charset=utf8mb4&parseTime=True&loc=Local + db-name: bkb_prod + username: bkbrd + password: yJGQ3hlV#*4nTJrn + max-idle-conns: 10 + max-open-conns: 100 + log-mode: info + log-zap: "" + +redis: + db: 1 +# addr: 172.16.0.239:6379 +# password: bkbrd:!Fgcye*HGs*Z&q0p + addr: redis-6715eafa-8e3f-4014-9659-ac647bd1ef46.cn-north-4.dcs.myhuaweicloud.com:6379 + password: rMof*kkr!mfO7MHW + +system: + env: develop + addr: 8001 + db-type: mysql + oss-type: local + use-multipoint: false + +zap: + level: warn + format: console + prefix: '[NFT-ADMIN]' + director: log + link-name: nft.log + showLine: true + encode-level: LowercaseColorLevelEncoder + stacktrace-key: stacktrace + log-in-console: true + +paypal: + env: SandBox + client-id: Af7cbDvcc0qBEZDWgGU3ATZFJePJnFl-UH6foaGzmOu6w_8l1ewZRv88CO39HA0X_ATSR-TP_ZvM_t55 + secret: EFsM94NOvKscr6J-U18rtVp0AIZXlrqWwjXP-vqnNXQ8s2c9TpLQo2hFuf0gYUJg4pjPonqCD4T7nrdW + return-url: https://admin-dev.bkbackground.com + cancel-url: https://admin-dev.bkbackground.com + notify-url: https://admin-api-dev.bkbackground.com \ No newline at end of file diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..6c83e0f --- /dev/null +++ b/config.yaml @@ -0,0 +1,78 @@ +autocode: + transfer-restart: true + root: /Users/wenwu/Desktop/project/BKB-N + server: /admin-api + server-api: /api/admin + server-initialize: /initialize + server-model: /model + server-request: /model/request/ + server-router: /router + server-service: /service + web: /web/src + web-api: /api + web-form: /view + web-table: /view + web-flow: /view +captcha: + key-long: 6 + img-width: 240 + img-height: 80 +casbin: + model-path: ./resource/rbac_model.conf +email: + to: xxx@qq.com + port: 465 + from: xxx@163.com + host: smtp.163.com + is-ssl: true + secret: xxx + nickname: test +jwt: + signing-key: qmPlus + expires-time: 604800 + buffer-time: 86400 +local: + path: uploads/file +mysql: + path: 172.16.0.26:3306 + config: charset=utf8mb4&parseTime=True&loc=Local + db-name: bkb + username: bkbrd + password: yJGQ3hlV#*4nTJrn + max-idle-conns: 10 + max-open-conns: 100 + log-mode: info + log-zap: "" + +redis: + db: 1 +# addr: 172.16.0.239:6379 +# password: bkbrd:!Fgcye*HGs*Z&q0p + addr: redis-6715eafa-8e3f-4014-9659-ac647bd1ef46.cn-north-4.dcs.myhuaweicloud.com:6379 + password: rMof*kkr!mfO7MHW + +system: + env: develop + addr: 8001 + db-type: mysql + oss-type: local + use-multipoint: false + +zap: + level: warn + format: console + prefix: '[NFT-ADMIN]' + director: log + link-name: nft.log + showLine: true + encode-level: LowercaseColorLevelEncoder + stacktrace-key: stacktrace + log-in-console: true + +paypal: + env: SandBox + client-id: Af7cbDvcc0qBEZDWgGU3ATZFJePJnFl-UH6foaGzmOu6w_8l1ewZRv88CO39HA0X_ATSR-TP_ZvM_t55 + secret: EFsM94NOvKscr6J-U18rtVp0AIZXlrqWwjXP-vqnNXQ8s2c9TpLQo2hFuf0gYUJg4pjPonqCD4T7nrdW + return-url: https://admin-dev.bkbackground.com + cancel-url: https://admin-dev.bkbackground.com + notify-url: https://admin-api-dev.bkbackground.com \ No newline at end of file diff --git a/config/auto_code.go b/config/auto_code.go new file mode 100644 index 0000000..f941e39 --- /dev/null +++ b/config/auto_code.go @@ -0,0 +1,18 @@ +package config + +type Autocode struct { + TransferRestart bool `mapstructure:"transfer-restart" json:"transferRestart" yaml:"transfer-restart"` + Root string `mapstructure:"root" json:"root" yaml:"root"` + Server string `mapstructure:"server" json:"server" yaml:"server"` + SApi string `mapstructure:"server-api" json:"serverApi" yaml:"server-api"` + SInitialize string `mapstructure:"server-initialize" json:"serverInitialize" yaml:"server-initialize"` + SModel string `mapstructure:"server-model" json:"serverModel" yaml:"server-model"` + SRequest string `mapstructure:"server-request" json:"serverRequest" yaml:"server-request"` + SRouter string `mapstructure:"server-router" json:"serverRouter" yaml:"server-router"` + SService string `mapstructure:"server-service" json:"serverService" yaml:"server-service"` + Web string `mapstructure:"web" json:"web" yaml:"web"` + WApi string `mapstructure:"web-api" json:"webApi" yaml:"web-api"` + WForm string `mapstructure:"web-form" json:"webForm" yaml:"web-form"` + WTable string `mapstructure:"web-table" json:"webTable" yaml:"web-table"` + WFlow string `mapstructure:"web-flow" json:"webFlow" yaml:"web-flow"` +} diff --git a/config/captcha.go b/config/captcha.go new file mode 100644 index 0000000..af329bf --- /dev/null +++ b/config/captcha.go @@ -0,0 +1,7 @@ +package config + +type Captcha struct { + KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"` // 验证码长度 + ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"` // 验证码宽度 + ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"` // 验证码高度 +} diff --git a/config/casbin.go b/config/casbin.go new file mode 100644 index 0000000..1b32f2b --- /dev/null +++ b/config/casbin.go @@ -0,0 +1,5 @@ +package config + +type Casbin struct { + ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"` // 存放casbin模型的相对路径 +} diff --git a/config/config.go b/config/config.go new file mode 100644 index 0000000..de1b523 --- /dev/null +++ b/config/config.go @@ -0,0 +1,26 @@ +package config + +type Server struct { + JWT JWT `mapstructure:"jwt" json:"jwt" yaml:"jwt"` + Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"` + Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"` + Email Email `mapstructure:"email" json:"email" yaml:"email"` + Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"` + System System `mapstructure:"system" json:"system" yaml:"system"` + Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"` + // auto + AutoCode Autocode `mapstructure:"autoCode" json:"autoCode" yaml:"autoCode"` + // gorm + Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"` + GormSettings GormSettings `mapstructure:"gorm-settings" json:"gormSettings" yaml:"gorm-settings"` + // oss + Minio Minio `mapstructure:"minio" json:"minio" yaml:"minio"` + Local Local `mapstructure:"local" json:"local" yaml:"local"` + Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"` + AliyunOSS AliyunOSS `mapstructure:"aliyun-oss" json:"aliyunOSS" yaml:"aliyun-oss"` + TencentCOS TencentCOS `mapstructure:"tencent-cos" json:"tencentCOS" yaml:"tencent-cos"` + Excel Excel `mapstructure:"excel" json:"excel" yaml:"excel"` + Timer Timer `mapstructure:"timer" json:"timer" yaml:"timer"` + JPush JPush `mapstructure:"jpush" json:"jpush" yaml:"jpush"` + Paypal Paypal `mapstructure:"paypal" json:"paypal" yaml:"paypal"` +} diff --git a/config/email.go b/config/email.go new file mode 100644 index 0000000..7a8676d --- /dev/null +++ b/config/email.go @@ -0,0 +1,11 @@ +package config + +type Email struct { + To string `mapstructure:"to" json:"to" yaml:"to"` // 收件人:多个以英文逗号分隔 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 + From string `mapstructure:"from" json:"from" yaml:"from"` // 收件人 + Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址 + IsSSL bool `mapstructure:"is-ssl" json:"isSSL" yaml:"is-ssl"` // 是否SSL + Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // 密钥 + Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称 +} diff --git a/config/excel.go b/config/excel.go new file mode 100644 index 0000000..13caab7 --- /dev/null +++ b/config/excel.go @@ -0,0 +1,5 @@ +package config + +type Excel struct { + Dir string `mapstructure:"dir" json:"dir" yaml:"dir"` +} diff --git a/config/gorm.go b/config/gorm.go new file mode 100644 index 0000000..9466414 --- /dev/null +++ b/config/gorm.go @@ -0,0 +1,21 @@ +package config + +type Mysql struct { + Path string `mapstructure:"path" json:"path" yaml:"path"` // 服务器地址:端口 + Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置 + Dbname string `mapstructure:"db-name" json:"dbname" yaml:"db-name"` // 数据库名 + Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库用户名 + Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码 + MaxIdleConns int `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"` // 空闲中的最大连接数 + MaxOpenConns int `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"` // 打开到数据库的最大连接数 + LogMode string `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"` // 是否开启Gorm全局日志 + LogZap bool `mapstructure:"log-zap" json:"logZap" yaml:"log-zap"` // 是否通过zap写入日志文件 +} + +func (m *Mysql) Dsn() string { + return m.Username + ":" + m.Password + "@tcp(" + m.Path + ")/" + m.Dbname + "?" + m.Config +} + +func (m *Mysql) GetLogMode() string { + return m.LogMode +} diff --git a/config/gorm_settings.go b/config/gorm_settings.go new file mode 100644 index 0000000..c01a311 --- /dev/null +++ b/config/gorm_settings.go @@ -0,0 +1,10 @@ +package config + +type GormSettings struct { + Settings []Settings `mapstructure:"settings" json:"settings" yaml:"settings"` +} + +type Settings struct { + DsnName string `mapstructure:"dsn-name" json:"dsnName" yaml:"dsn-name"` + BindTables []interface{} `mapstructure:"bind-tables" json:"bindTables" yaml:"bind-tables"` +} diff --git a/config/jpush.go b/config/jpush.go new file mode 100644 index 0000000..54c4366 --- /dev/null +++ b/config/jpush.go @@ -0,0 +1,8 @@ +package config + +type JPush struct { + Appkey string `mapstructure:"appkey" json:"appkey" yaml:"appkey"` //appkey + Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` //密钥 + AllUserSign string `mapstructure:"all-user-sign" json:"allUserSign" yaml:"all-user-sign"` //所有用户标签 + AndroidIntent string `mapstructure:"android-intent" json:"androidIntent" yaml:"android-intent"` //安卓厂商通道包名 +} diff --git a/config/jwt.go b/config/jwt.go new file mode 100644 index 0000000..0ac7168 --- /dev/null +++ b/config/jwt.go @@ -0,0 +1,7 @@ +package config + +type JWT struct { + SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"` // jwt签名 + ExpiresTime int64 `mapstructure:"expires-time" json:"expiresTime" yaml:"expires-time"` // 过期时间 + BufferTime int64 `mapstructure:"buffer-time" json:"bufferTime" yaml:"buffer-time"` // 缓冲时间 +} diff --git a/config/minio.go b/config/minio.go new file mode 100644 index 0000000..2943b84 --- /dev/null +++ b/config/minio.go @@ -0,0 +1,8 @@ +package config + +type Minio struct { + Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"` //端点 + AccessKeyID string `mapstructure:"accessKeyID" json:"accessKeyID" yaml:"access-key-id"` //用户ID + SecretAccessKey string `mapstructure:"secretAccessKey" json:"secretAccessKey" yaml:"secret-access-key"` //密钥 + UseSSL bool `mapstructure:"useSSL" json:"useSSL" yaml:"use-ssl"` //是否使用ssl +} diff --git a/config/oss.go b/config/oss.go new file mode 100644 index 0000000..a78420a --- /dev/null +++ b/config/oss.go @@ -0,0 +1,31 @@ +package config + +type Local struct { + Path string `mapstructure:"path" json:"path" yaml:"path"` // 本地文件路径 +} + +type Qiniu struct { + Zone string `mapstructure:"zone" json:"zone" yaml:"zone"` // 存储区域 + Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` // 空间名称 + ImgPath string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"` // CDN加速域名 + UseHTTPS bool `mapstructure:"use-https" json:"useHttps" yaml:"use-https"` // 是否使用https + AccessKey string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"` // 秘钥AK + SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"` // 秘钥SK + UseCdnDomains bool `mapstructure:"use-cdn-domains" json:"useCdnDomains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速 +} + +type AliyunOSS struct { + Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"` + AccessKeyId string `mapstructure:"access-key-id" json:"accessKeyId" yaml:"access-key-id"` + AccessKeySecret string `mapstructure:"access-key-secret" json:"accessKeySecret" yaml:"access-key-secret"` + BucketName string `mapstructure:"bucket-name" json:"bucketName" yaml:"bucket-name"` + BucketUrl string `mapstructure:"bucket-url" json:"bucketUrl" yaml:"bucket-url"` +} +type TencentCOS struct { + Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` + Region string `mapstructure:"region" json:"region" yaml:"region"` + SecretID string `mapstructure:"secret-id" json:"secretID" yaml:"secret-id"` + SecretKey string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"` + BaseURL string `mapstructure:"base-url" json:"baseURL" yaml:"base-url"` + PathPrefix string `mapstructure:"path-prefix" json:"pathPrefix" yaml:"path-prefix"` +} diff --git a/config/paypal.go b/config/paypal.go new file mode 100644 index 0000000..bf019be --- /dev/null +++ b/config/paypal.go @@ -0,0 +1,10 @@ +package config + +type Paypal struct { + Env string `mapstructure:"env" json:"env" yaml:"env"` //端点 + ClientID string `mapstructure:"client-id" json:"client-id" yaml:"client-id"` //用户ID + Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` //密钥 + ReturnUrl string `mapstructure:"return-url" json:"return-url" yaml:"return-url"` //支付完成跳转 + CancelUrl string `mapstructure:"cancel-url" json:"cancel-url" yaml:"cancel-url"` //取消支付跳转 + NotifyUrl string `mapstructure:"notify-url" json:"notify-url" yaml:"notify-url"` // 支付结果通知 +} diff --git a/config/redis.go b/config/redis.go new file mode 100644 index 0000000..1a25178 --- /dev/null +++ b/config/redis.go @@ -0,0 +1,7 @@ +package config + +type Redis struct { + DB int `mapstructure:"db" json:"db" yaml:"db"` // redis的哪个数据库 + Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // 服务器地址:端口 + Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码 +} diff --git a/config/system.go b/config/system.go new file mode 100644 index 0000000..768788a --- /dev/null +++ b/config/system.go @@ -0,0 +1,9 @@ +package config + +type System struct { + Env string `mapstructure:"env" json:"env" yaml:"env"` // 环境值 + Addr int `mapstructure:"addr" json:"addr" yaml:"addr"` // 端口值 + DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"` // 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql + OssType string `mapstructure:"oss-type" json:"ossType" yaml:"oss-type"` // Oss类型 + UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"` // 多点登录拦截 +} diff --git a/config/timer.go b/config/timer.go new file mode 100644 index 0000000..1ece2bc --- /dev/null +++ b/config/timer.go @@ -0,0 +1,13 @@ +package config + +type Timer struct { + Start bool `mapstructure:"start" json:"start" yaml:"start"` // 是否启用 + Spec string `mapstructure:"spec" json:"spec" yaml:"spec"` // CRON表达式 + Detail []Detail `mapstructure:"detail" json:"detail" yaml:"detail"` +} + +type Detail struct { + TableName string `mapstructure:"tableName" json:"tableName" yaml:"tableName"` // 需要清理的表名 + CompareField string `mapstructure:"compareField" json:"compareField" yaml:"compareField"` // 需要比较时间的字段 + Interval string `mapstructure:"interval" json:"interval" yaml:"interval"` // 时间间隔 +} diff --git a/config/zap.go b/config/zap.go new file mode 100644 index 0000000..f681ca8 --- /dev/null +++ b/config/zap.go @@ -0,0 +1,13 @@ +package config + +type Zap struct { + Level string `mapstructure:"level" json:"level" yaml:"level"` // 级别 + Format string `mapstructure:"format" json:"format" yaml:"format"` // 输出 + Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // 日志前缀 + Director string `mapstructure:"director" json:"director" yaml:"director"` // 日志文件夹 + LinkName string `mapstructure:"link-name" json:"linkName" yaml:"link-name"` // 软链接名称 + ShowLine bool `mapstructure:"show-line" json:"showLine" yaml:"showLine"` // 显示行 + EncodeLevel string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"` // 编码级 + StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"` // 栈名 + LogInConsole bool `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"` // 输出控制台 +} diff --git a/core/server.go b/core/server.go new file mode 100644 index 0000000..3b50f07 --- /dev/null +++ b/core/server.go @@ -0,0 +1,38 @@ +package core + +import ( + "fmt" + "pure-admin/global" + "pure-admin/initialize" + "time" + + "go.uber.org/zap" +) + +type server interface { + ListenAndServe() error +} + +func RunWindowsServer() { + // 初始化redis服务 + initialize.Redis() + //NewRedisEventSink(global.MG_CONFIG.Redis.DB, "expired") + + Router := initialize.Routers() + Router.Static("/form-generator", "./resource/page") + + address := fmt.Sprintf(":%d", global.MG_CONFIG.System.Addr) + s := initServer(address, Router) + // 保证文本顺序输出 + // In order to ensure that the text order output can be deleted + time.Sleep(10 * time.Microsecond) + global.MG_LOG.Info("server run success on ", zap.String("address", address)) + + fmt.Printf(` + 欢迎使用 MangGuoNews-Admin + 当前版本:V2.4.2 + 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html + 默认前端文件运行地址:http://127.0.0.1%s +`, address, address) + global.MG_LOG.Error(s.ListenAndServe().Error()) +} diff --git a/core/server_other.go b/core/server_other.go new file mode 100644 index 0000000..baa7222 --- /dev/null +++ b/core/server_other.go @@ -0,0 +1,17 @@ +// +build !windows + +package core + +import ( + "github.com/fvbock/endless" + "github.com/gin-gonic/gin" + "time" +) + +func initServer(address string, router *gin.Engine) server { + s := endless.NewServer(address, router) + s.ReadHeaderTimeout = 10 * time.Millisecond + s.WriteTimeout = 10 * time.Second + s.MaxHeaderBytes = 1 << 20 + return s +} diff --git a/core/server_win.go b/core/server_win.go new file mode 100644 index 0000000..ada3c4b --- /dev/null +++ b/core/server_win.go @@ -0,0 +1,19 @@ +// +build windows + +package core + +import ( + "github.com/gin-gonic/gin" + "net/http" + "time" +) + +func initServer(address string, router *gin.Engine) server { + return &http.Server{ + Addr: address, + Handler: router, + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + MaxHeaderBytes: 1 << 20, + } +} diff --git a/core/viper.go b/core/viper.go new file mode 100644 index 0000000..5bba66e --- /dev/null +++ b/core/viper.go @@ -0,0 +1,57 @@ +package core + +import ( + "flag" + "fmt" + "os" + "path/filepath" + "pure-admin/global" + _ "pure-admin/packfile" + "pure-admin/utils" + + "github.com/fsnotify/fsnotify" + "github.com/spf13/viper" +) + +func Viper(path ...string) *viper.Viper { + var config string + if len(path) == 0 { + flag.StringVar(&config, "c", "", "choose config file.") + flag.Parse() + if config == "" { // 优先级: 命令行 > 环境变量 > 默认值 + if configEnv := os.Getenv(utils.ConfigEnv); configEnv == "" { + config = utils.ConfigFile + fmt.Printf("您正在使用config的默认值,config的路径为%v\n", utils.ConfigFile) + } else { + config = configEnv + fmt.Printf("您正在使用MG_CONFIG环境变量,config的路径为%v\n", config) + } + } else { + fmt.Printf("您正在使用命令行的-c参数传递的值,config的路径为%v\n", config) + } + } else { + config = path[0] + fmt.Printf("您正在使用func Viper()传递的值,config的路径为%v\n", config) + } + + v := viper.New() + v.SetConfigFile(config) + v.SetConfigType("yaml") + err := v.ReadInConfig() + if err != nil { + panic(fmt.Errorf("Fatal error config file: %s \n", err)) + } + v.WatchConfig() + + v.OnConfigChange(func(e fsnotify.Event) { + fmt.Println("config file changed:", e.Name) + if err := v.Unmarshal(&global.MG_CONFIG); err != nil { + fmt.Println(err) + } + }) + if err := v.Unmarshal(&global.MG_CONFIG); err != nil { + fmt.Println(err) + } + global.MG_CONFIG.AutoCode.Root, _ = filepath.Abs("..") + return v +} diff --git a/core/zap.go b/core/zap.go new file mode 100644 index 0000000..1716188 --- /dev/null +++ b/core/zap.go @@ -0,0 +1,103 @@ +package core + +import ( + "fmt" + "os" + "pure-admin/global" + "pure-admin/utils" + "time" + + "go.uber.org/zap" + "go.uber.org/zap/zapcore" +) + +var level zapcore.Level + +func Zap() (logger *zap.Logger) { + if ok, _ := utils.PathExists(global.MG_CONFIG.Zap.Director); !ok { // 判断是否有Director文件夹 + fmt.Printf("create %v directory\n", global.MG_CONFIG.Zap.Director) + _ = os.Mkdir(global.MG_CONFIG.Zap.Director, os.ModePerm) + } + + switch global.MG_CONFIG.Zap.Level { // 初始化配置文件的Level + case "debug": + level = zap.DebugLevel + case "info": + level = zap.InfoLevel + case "warn": + level = zap.WarnLevel + case "error": + level = zap.ErrorLevel + case "dpanic": + level = zap.DPanicLevel + case "panic": + level = zap.PanicLevel + case "fatal": + level = zap.FatalLevel + default: + level = zap.InfoLevel + } + + if level == zap.DebugLevel || level == zap.ErrorLevel { + logger = zap.New(getEncoderCore(), zap.AddStacktrace(level)) + } else { + logger = zap.New(getEncoderCore()) + } + if global.MG_CONFIG.Zap.ShowLine { + logger = logger.WithOptions(zap.AddCaller()) + } + return logger +} + +// getEncoderConfig 获取zapcore.EncoderConfig +func getEncoderConfig() (config zapcore.EncoderConfig) { + config = zapcore.EncoderConfig{ + MessageKey: "message", + LevelKey: "level", + TimeKey: "time", + NameKey: "logger", + CallerKey: "caller", + StacktraceKey: global.MG_CONFIG.Zap.StacktraceKey, + LineEnding: zapcore.DefaultLineEnding, + EncodeLevel: zapcore.LowercaseLevelEncoder, + EncodeTime: CustomTimeEncoder, + EncodeDuration: zapcore.SecondsDurationEncoder, + EncodeCaller: zapcore.FullCallerEncoder, + } + switch { + case global.MG_CONFIG.Zap.EncodeLevel == "LowercaseLevelEncoder": // 小写编码器(默认) + config.EncodeLevel = zapcore.LowercaseLevelEncoder + case global.MG_CONFIG.Zap.EncodeLevel == "LowercaseColorLevelEncoder": // 小写编码器带颜色 + config.EncodeLevel = zapcore.LowercaseColorLevelEncoder + case global.MG_CONFIG.Zap.EncodeLevel == "CapitalLevelEncoder": // 大写编码器 + config.EncodeLevel = zapcore.CapitalLevelEncoder + case global.MG_CONFIG.Zap.EncodeLevel == "CapitalColorLevelEncoder": // 大写编码器带颜色 + config.EncodeLevel = zapcore.CapitalColorLevelEncoder + default: + config.EncodeLevel = zapcore.LowercaseLevelEncoder + } + return config +} + +// getEncoder 获取zapcore.Encoder +func getEncoder() zapcore.Encoder { + if global.MG_CONFIG.Zap.Format == "json" { + return zapcore.NewJSONEncoder(getEncoderConfig()) + } + return zapcore.NewConsoleEncoder(getEncoderConfig()) +} + +// getEncoderCore 获取Encoder的zapcore.Core +func getEncoderCore() (core zapcore.Core) { + writer, err := utils.GetWriteSyncer() // 使用file-rotatelogs进行日志分割 + if err != nil { + fmt.Printf("Get Write Syncer Failed err:%v", err.Error()) + return + } + return zapcore.NewCore(getEncoder(), writer, level) +} + +// 自定义日志输出时间格式 +func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) { + enc.AppendString(t.Format(global.MG_CONFIG.Zap.Prefix + "2006/01/02 - 15:04:05.000")) +} diff --git a/deploy/.gitkeep b/deploy/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/deploy/admin-api-deployment.yaml b/deploy/admin-api-deployment.yaml new file mode 100644 index 0000000..12268ee --- /dev/null +++ b/deploy/admin-api-deployment.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{project}} + namespace: {{nameSpace}} +spec: + replicas: 1 + selector: + matchLabels: + app: {{project}} + template: + metadata: + labels: + app: {{project}} + spec: + containers: + - name: {{project}} + image: {{dockerServer}}/{{dockerOrg}}/{{project}}:{{version}} + imagePullPolicy: Always + ports: + - containerPort: 8001 + imagePullSecrets: + - name: bkb-images-secret + diff --git a/deploy/admin-api-service.yaml b/deploy/admin-api-service.yaml new file mode 100644 index 0000000..34930df --- /dev/null +++ b/deploy/admin-api-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{project}} + namespace: {{nameSpace}} +spec: + ports: + - port: 80 + targetPort: 8001 + name: {{project}} + selector: + app: {{project}} + type: ClusterIP diff --git a/docs/docs.go b/docs/docs.go new file mode 100644 index 0000000..d3308db --- /dev/null +++ b/docs/docs.go @@ -0,0 +1,11770 @@ +// Code generated by swaggo/swag. DO NOT EDIT +package docs + +import "github.com/swaggo/swag" + +const docTemplate = `{ + "schemes": {{ marshal .Schemes }}, + "swagger": "2.0", + "info": { + "description": "{{escape .Description}}", + "title": "{{.Title}}", + "contact": {}, + "version": "{{.Version}}" + }, + "host": "{{.Host}}", + "basePath": "{{.BasePath}}", + "paths": { + "/api/createApi": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "创建基础api", + "parameters": [ + { + "description": "api路径, api中文描述, api组, 方法", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysApi" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/deleteApi": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "删除api", + "parameters": [ + { + "description": "ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysApi" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/deleteApisByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "删除选中Api", + "parameters": [ + { + "description": "ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/getAllApis": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "获取所有的Api 不分页", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/getApiById": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "根据id获取api", + "parameters": [ + { + "description": "根据id获取api", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/getApiList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "分页获取API列表", + "parameters": [ + { + "description": "分页获取API列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SearchApiParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/updateApi": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "更新基础api", + "parameters": [ + { + "description": "api路径, api中文描述, api组, 方法", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysApi" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/createApplication": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "创建Application", + "parameters": [ + { + "description": "创建Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/deleteApplication": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "删除Application", + "parameters": [ + { + "description": "删除Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/deleteApplicationByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "批量删除Application", + "parameters": [ + { + "description": "批量删除Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/findApplication": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "用id查询Application", + "parameters": [ + { + "description": "用id查询Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/getApplicationList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "分页获取Application列表", + "parameters": [ + { + "description": "分页获取Application列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ApplicationSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/updateApplication": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "更新Application", + "parameters": [ + { + "description": "更新Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/copyAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "拷贝角色", + "parameters": [ + { + "description": "旧角色id, 新权限id, 新权限名, 新父角色id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/response.SysAuthorityCopyResponse" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"拷贝成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/createAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "创建角色", + "parameters": [ + { + "description": "权限id, 权限名, 父角色id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysAuthority" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/deleteAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "删除角色", + "parameters": [ + { + "description": "删除角色", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysAuthority" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/getAuthorityList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "分页获取角色列表", + "parameters": [ + { + "description": "页码, 每页大小", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/updateAuthority": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "更新角色信息", + "parameters": [ + { + "description": "权限id, 权限名, 父角色id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysAuthority" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "编辑banner【v1.1.0新增】", + "parameters": [ + { + "description": "id,data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateBanner" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "创建banner【v1.1.0新增】", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CreateBanner" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner/batchDelBanner": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "批量删除banner【v1.1.0新增】", + "parameters": [ + { + "description": "ids", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner/down-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "下移banner排序【v1.1.0新增】", + "parameters": [ + { + "description": "id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "分页获取banner列表【v1.1.0新增】", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "状态 0=下架 1=上架", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.BannerListResponse" + } + } + } + } + } + }, + "/banner/up-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "上移banner排序【v1.1.0新增】", + "parameters": [ + { + "description": "id,page,pageSize...", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/captcha": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Base" + ], + "summary": "生成验证码", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"验证码获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/chain": { + "get": { + "tags": [ + "Chain" + ], + "summary": "获取区块链数据", + "parameters": [ + { + "type": "string", + "description": "区块/合约hash", + "name": "hash", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.ChainResp" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/login": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Base" + ], + "summary": "用户登录", + "parameters": [ + { + "description": "用户名, 密码, 验证码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Login" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-fund-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台奖励账户数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.AdminFundData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-fund-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台奖励账户列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AdminBillFund" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/customer-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "用户账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/customer-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "用户账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/influence-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/influence-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-fund-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家营销账户数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.SellerFundData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-fund-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家营销账户记录列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SellerBillFund" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/business": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "用id查询商家", + "parameters": [ + { + "description": "用id查询Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/response.StoreInfoItem" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "更新商家", + "parameters": [ + { + "description": "更新Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SellerStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Businessv0.0.0" + ], + "summary": "创建Business", + "parameters": [ + { + "description": "创建Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SellerStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Businessv0.0.0" + ], + "summary": "删除Business", + "parameters": [ + { + "description": "删除Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SellerStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/business/deleteBusinessByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Businessv0.0.0" + ], + "summary": "批量删除商家", + "parameters": [ + { + "description": "批量删除Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/business/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "商家列表", + "parameters": [ + { + "description": "分页获取商家列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.SellerStoreInfo" + } + } + } + } + }, + "/business/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "商家搜索", + "parameters": [ + { + "description": "分页获取商家列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SearchStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.SellerStoreInfo" + } + } + } + } + }, + "/casbin/UpdateCasbin": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Casbin" + ], + "summary": "更新角色api权限", + "parameters": [ + { + "description": "权限id, 权限模型列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CasbinInReceive" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/casbin/getPolicyPathByAuthorityId": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Casbin" + ], + "summary": "获取权限列表", + "parameters": [ + { + "description": "权限id, 权限模型列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CasbinInReceive" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/category": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "查询单个商品分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "更新分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.UpdateCategory" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "创建分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.CreateCategory" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "删除分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/category/children": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "查询分类下级", + "parameters": [ + { + "type": "integer", + "description": "父id", + "name": "pid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/category/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "商品分类分页", + "parameters": [ + { + "type": "integer", + "description": "层级", + "name": "layer", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/dict/getDictDataList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "dict" + ], + "summary": "获取数据字典取值列表【v1.0】", + "parameters": [ + { + "type": "string", + "description": "取值 release_country=发布国家 release_channel=发布渠道 tag_type=标签类型", + "name": "typeCode", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/breakpointContinue": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "断点续传到服务器", + "parameters": [ + { + "type": "file", + "description": "an example for breakpoint resume, 断点续传示例", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"切片创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/findFile": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "创建文件", + "parameters": [ + { + "type": "file", + "description": "上传文件完成", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"file uploaded, 文件创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/removeChunk": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "删除切片", + "parameters": [ + { + "type": "file", + "description": "删除缓存切片", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"缓存切片删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/goods/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Goods" + ], + "summary": "商品列表", + "parameters": [ + { + "description": "分页获取商品列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.TbGoods4List" + } + } + } + } + }, + "/goods/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Goods" + ], + "summary": "商品搜索", + "parameters": [ + { + "description": "分页获取商品列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.TbGoods4List" + } + } + } + } + }, + "/menu/addBaseMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "新增菜单", + "parameters": [ + { + "description": "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/addMenuAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "增加menu和角色关联关系", + "parameters": [ + { + "description": "角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddMenuAuthorityInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/deleteBaseMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "删除菜单", + "parameters": [ + { + "description": "菜单id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getBaseMenuById": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "根据id获取菜单", + "parameters": [ + { + "description": "菜单id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getBaseMenuTree": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取用户动态路由", + "parameters": [ + { + "description": "空", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Empty" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取用户动态路由", + "parameters": [ + { + "description": "空", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Empty" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenuAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取指定角色menu", + "parameters": [ + { + "description": "角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetAuthorityId" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenuForList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取用户动态路由List", + "parameters": [ + { + "description": "空", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Empty" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenuList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "分页获取基础menu列表", + "parameters": [ + { + "description": "页码, 每页大小", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/updateBaseMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "更新菜单", + "parameters": [ + { + "description": "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/add-video": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "创建任务视频", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.AddMissionVideo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/claim-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务领取列表", + "parameters": [ + { + "type": "integer", + "description": "任务id", + "name": "mission_id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:已领取待发货 2:已发货 3:已收货推广中", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "任务标题", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "网红用户ID", + "name": "uuid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionClaimSimpleData" + } + } + } + } + } + }, + "/mission/claim-order": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务订单详情【v1.0】", + "parameters": [ + { + "type": "string", + "description": "订单编号", + "name": "order_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "$ref": "#/definitions/response.MissionClaimOrderResponse" + } + } + } + } + }, + "/mission/claim-order-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务订单列表【v1.0】", + "parameters": [ + { + "type": "string", + "description": "收件人姓名", + "name": "address_name", + "in": "query" + }, + { + "type": "string", + "description": "收件人手机号", + "name": "address_phone", + "in": "query" + }, + { + "type": "string", + "description": "任务标题", + "name": "mission_title", + "in": "query" + }, + { + "type": "string", + "description": "订单id", + "name": "order_id", + "in": "query" + }, + { + "type": "string", + "description": "订单时间结束", + "name": "order_time_end", + "in": "query" + }, + { + "type": "string", + "description": "订单时间起始", + "name": "order_time_start", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "string", + "description": "商品编号", + "name": "spu_no", + "in": "query" + }, + { + "type": "integer", + "description": "状态 2:待发货 3:已发货", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "网红用户ID", + "name": "uuid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionClaimOrderDetail" + } + } + } + } + } + }, + "/mission/claim-video-detail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "任务视频审核详情【v1.0】", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionClaimVideoDetail" + } + } + } + } + } + }, + "/mission/edit-video": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "编辑任务视频", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.EditMissionVideo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"编辑成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/influencer-summary-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取网红任务统计列表", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "name": "uuid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionClaimSummary" + } + } + } + } + } + }, + "/mission/mission": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务详情", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "$ref": "#/definitions/model.MissionDetail" + } + } + } + } + }, + "/mission/mission-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务列表", + "parameters": [ + { + "type": "integer", + "description": "是否有视频 1:是 2:否", + "name": "has_video", + "in": "query" + }, + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "$ref": "#/definitions/response.PageResult" + } + } + } + } + }, + "/mission/recommend/add-data": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission/recommend" + ], + "summary": "创建任务推荐关联", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.AddMissionRecommend" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/batch-del-data": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "批量删除任务推荐关联", + "parameters": [ + { + "description": "ids", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsUReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/down-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "上移任务推荐排序", + "parameters": [ + { + "description": "id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "分页获取任务推荐列表", + "parameters": [ + { + "type": "integer", + "description": "是否有视频 1:是 2:否", + "name": "has_video", + "in": "query" + }, + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionRecommendResponse" + } + } + } + } + } + }, + "/mission/recommend/up-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "上移任务推荐排序", + "parameters": [ + { + "description": "id,page,pageSize...", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/update-sort": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "修改任务推荐排序", + "parameters": [ + { + "description": "id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/global.BASE_ID_SORT" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/send-sys-reward": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "发送系统任务奖励", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/stop": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "结束任务", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/stop-detail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission" + ], + "summary": "获取任务结束详情", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/response.MissionStopData" + } + } + } + } + }, + "/mission/stop-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission" + ], + "summary": "分页获取任务结束申请列表", + "parameters": [ + { + "type": "integer", + "description": "审核状态 1:待审核 2:审核通过 3:审核不通过 4:已审核=审核通过+审核不通过", + "name": "audit_status", + "in": "query" + }, + { + "type": "integer", + "description": "是否有视频 1:是 2:否", + "name": "has_video", + "in": "query" + }, + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionStopData" + } + } + } + } + } + }, + "/mission/sys-reward-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取平台奖励列表【v1.0】", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "时间结束", + "name": "time_end", + "in": "query" + }, + { + "type": "string", + "description": "时间起始", + "name": "time_start", + "in": "query" + }, + { + "type": "string", + "description": "标题", + "name": "title", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysMissionReward" + } + } + } + } + } + }, + "/mission/tag-relation": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "打标签", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.CreateMissionTagRelation" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/video-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务视频列表", + "parameters": [ + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "string", + "description": "网红账号", + "name": "mission_claim_by", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "name": "source_type", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + }, + { + "type": "integer", + "description": "视频状态 1:待审核 2:审核通过 3:审核不通过", + "name": "video_status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionVideoResponse" + } + } + } + } + } + }, + "/order/detail": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "order" + ], + "summary": "获取订单详情", + "parameters": [ + { + "type": "string", + "description": "订单号", + "name": "orderID", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/model.OrderDetail" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/order/list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "order" + ], + "summary": "获取订单列表", + "parameters": [ + { + "type": "string", + "description": "网红码?", + "name": "code", + "in": "query" + }, + { + "type": "string", + "description": "订单下单时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "下单截至时间", + "name": "createdAtEnd", + "in": "query" + }, + { + "type": "string", + "description": "下单起始时间", + "name": "createdAtStart", + "in": "query" + }, + { + "type": "integer", + "description": "商品id", + "name": "goodsID", + "in": "query" + }, + { + "type": "string", + "description": "网红id", + "name": "influenceId", + "in": "query" + }, + { + "type": "string", + "description": "任务名称", + "name": "missionTitle", + "in": "query" + }, + { + "type": "string", + "description": "收件人姓名", + "name": "name", + "in": "query" + }, + { + "type": "string", + "description": "订单号", + "name": "orderID", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "收件人电话", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "description": "spu_no", + "name": "spu_no", + "in": "query" + }, + { + "type": "integer", + "description": "订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "商户编号", + "name": "storeNo", + "in": "query" + }, + { + "type": "string", + "description": "用户id", + "name": "userId", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.OrderList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/order/statistic": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "order" + ], + "summary": "获取数据统计", + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.DataStatistics" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/createOrganization": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "创建Organization", + "parameters": [ + { + "description": "创建Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/deleteOrganization": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "删除Organization", + "parameters": [ + { + "description": "删除Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/deleteOrganizationByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "批量删除Organization", + "parameters": [ + { + "description": "批量删除Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/findOrganization": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "用id查询Organization", + "parameters": [ + { + "description": "用id查询Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/getOrganizationList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "分页获取Organization列表", + "parameters": [ + { + "description": "分页获取Organization列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.OrganizationSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/updateOrganization": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "更新Organization", + "parameters": [ + { + "description": "更新Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/createProvider": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "创建Provider", + "parameters": [ + { + "description": "创建Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/deleteProvider": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "删除Provider", + "parameters": [ + { + "description": "删除Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/deleteProviderByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "批量删除Provider", + "parameters": [ + { + "description": "批量删除Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/findProvider": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "用id查询Provider", + "parameters": [ + { + "description": "用id查询Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/getProviderList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "分页获取Provider列表", + "parameters": [ + { + "description": "分页获取Provider列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ProviderSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/updateProvider": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "更新Provider", + "parameters": [ + { + "description": "更新Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/suser/deleteUser": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "删除用户", + "parameters": [ + { + "description": "用户ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/suser/getUserList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "分页获取用户列表", + "parameters": [ + { + "description": "页码, 每页大小", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SearchSysUserParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/createSysOperationRecord": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "创建SysOperationRecord", + "parameters": [ + { + "description": "创建SysOperationRecord", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysOperationRecord" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/deleteSysOperationRecord": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "删除SysOperationRecord", + "parameters": [ + { + "description": "SysOperationRecord模型", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysOperationRecord" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/deleteSysOperationRecordByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "批量删除SysOperationRecord", + "parameters": [ + { + "description": "批量删除SysOperationRecord", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/findSysOperationRecord": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "用id查询SysOperationRecord", + "parameters": [ + { + "description": "Id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysOperationRecord" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/getSysOperationRecordList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "分页获取SysOperationRecord列表", + "parameters": [ + { + "description": "页码, 每页大小, 搜索条件", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SysOperationRecordSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/getSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "System" + ], + "summary": "获取配置文件内容", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/reloadSystem": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "System" + ], + "summary": "重启系统", + "responses": { + "200": { + "description": "{\"code\":0,\"data\":{},\"msg\":\"重启系统成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/setSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "System" + ], + "summary": "设置配置文件内容", + "parameters": [ + { + "description": "设置配置文件内容", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.System" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"设置成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/tags": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "编辑标签", + "parameters": [ + { + "description": "id,data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.TagsCommon" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "创建标签", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.TagsCommon" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/tags/batchDelTags": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "批量删除标签", + "parameters": [ + { + "description": "ids", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/tags/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "分页获取标签列表", + "parameters": [ + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "标签类型 01-任务 02-任务视频 03-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "值", + "name": "value", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Tags" + } + } + } + } + } + } + }, + "/tags/relationTags": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "获取关联标签列表", + "parameters": [ + { + "type": "string", + "name": "relation_id", + "in": "query" + }, + { + "type": "string", + "name": "relation_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TagsDesc" + } + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "tags" + ], + "summary": "打标签", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.CreateTagRelation" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/changePassword": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "用户修改密码", + "parameters": [ + { + "description": "用户名, 原密码, 新密码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ChangePasswordStruct" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/createUser": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "创建User", + "parameters": [ + { + "description": "创建User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/deleteUser": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "删除User", + "parameters": [ + { + "description": "删除User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/deleteUserByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "批量删除User", + "parameters": [ + { + "description": "批量删除User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/findUser": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "用id查询User", + "parameters": [ + { + "type": "string", + "description": "用户id", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "$ref": "#/definitions/model.UserSimple" + } + } + } + } + }, + "/user/getUserInfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "获取用户信息", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/getUserList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "分页获取User列表", + "parameters": [ + { + "type": "string", + "description": "用户邮箱", + "name": "email", + "in": "query" + }, + { + "type": "string", + "name": "end_time", + "in": "query" + }, + { + "type": "string", + "name": "id_forbidden", + "in": "query" + }, + { + "type": "string", + "description": "昵称", + "name": "nick_name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户手机号", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "name": "start_time", + "in": "query" + }, + { + "type": "string", + "description": "customer-普通用户 influencer-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.UserSimple" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "分页获取系统User列表", + "parameters": [ + { + "type": "string", + "description": "用户邮箱", + "name": "email", + "in": "query" + }, + { + "type": "string", + "name": "end_time", + "in": "query" + }, + { + "type": "string", + "name": "id_forbidden", + "in": "query" + }, + { + "type": "string", + "description": "昵称", + "name": "nick_name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户手机号", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "name": "start_time", + "in": "query" + }, + { + "type": "string", + "description": "customer-普通用户 influencer-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.UserSimple" + } + } + } + } + }, + "/user/getUserSelectList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "获取用户选择器列表", + "parameters": [ + { + "type": "string", + "description": "nickName", + "name": "nickName", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/platformAuth": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "获取网红认证审核记录", + "parameters": [ + { + "type": "string", + "description": "用户邮箱", + "name": "email", + "in": "query" + }, + { + "type": "string", + "name": "end_time", + "in": "query" + }, + { + "type": "string", + "name": "id_forbidden", + "in": "query" + }, + { + "type": "string", + "description": "昵称", + "name": "nick_name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户手机号", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "description": "平台", + "name": "platform", + "in": "query" + }, + { + "type": "string", + "name": "start_time", + "in": "query" + }, + { + "type": "string", + "description": "认证状态 0:未认证 1:已认证 2:认证失败", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "customer-普通用户 influencer-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.PlatformAuthSimple" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "网红认证审核", + "parameters": [ + { + "description": "分页获取User列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PlatformAuthCheck" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/register": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "用户注册账号", + "parameters": [ + { + "description": "用户名, 昵称, 密码, 角色ID,姓名,手机", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysUser" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserAuthorities": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "设置用户权限", + "parameters": [ + { + "description": "用户UUID, 角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SetUserAuthorities" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "设置用户权限", + "parameters": [ + { + "description": "用户UUID, 角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SetUserAuth" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserInfo": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "设置用户信息", + "parameters": [ + { + "description": "ID, 用户名, 昵称, 头像链接", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysUser" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"设置成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/updateUser": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "更新User", + "parameters": [ + { + "description": "更新User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/userStatus": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "用户禁用启用", + "parameters": [ + { + "description": "分页获取User列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UserStatus" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wallet/fund/recharge": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "wallet" + ], + "summary": "奖励账户充值", + "parameters": [ + { + "description": "data...", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.FundRecharge" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/admin-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台提现数据", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BkbData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/admin-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台提现列表", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Withdrawal" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/influence-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红提现数据", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.InfluenceWithdrawalData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/influence-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红提现列表", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Withdrawal" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/seller-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家提现数据", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.SellerWithdrawalData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/seller-examine": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家提现审核", + "parameters": [ + { + "description": "data...", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.ExamineWithdrawal" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "string" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/seller-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家提现列表", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Withdrawal" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/status": { + "put": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "手动提现打款状态", + "parameters": [ + { + "description": "data...", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.TransferResult" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "string" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "config.AliyunOSS": { + "type": "object", + "properties": { + "accessKeyId": { + "type": "string" + }, + "accessKeySecret": { + "type": "string" + }, + "bucketName": { + "type": "string" + }, + "bucketUrl": { + "type": "string" + }, + "endpoint": { + "type": "string" + } + } + }, + "config.Autocode": { + "type": "object", + "properties": { + "root": { + "type": "string" + }, + "server": { + "type": "string" + }, + "serverApi": { + "type": "string" + }, + "serverInitialize": { + "type": "string" + }, + "serverModel": { + "type": "string" + }, + "serverRequest": { + "type": "string" + }, + "serverRouter": { + "type": "string" + }, + "serverService": { + "type": "string" + }, + "transferRestart": { + "type": "boolean" + }, + "web": { + "type": "string" + }, + "webApi": { + "type": "string" + }, + "webFlow": { + "type": "string" + }, + "webForm": { + "type": "string" + }, + "webTable": { + "type": "string" + } + } + }, + "config.Captcha": { + "type": "object", + "properties": { + "imgHeight": { + "description": "验证码高度", + "type": "integer" + }, + "imgWidth": { + "description": "验证码宽度", + "type": "integer" + }, + "keyLong": { + "description": "验证码长度", + "type": "integer" + } + } + }, + "config.Casbin": { + "type": "object", + "properties": { + "modelPath": { + "description": "存放casbin模型的相对路径", + "type": "string" + } + } + }, + "config.Detail": { + "type": "object", + "properties": { + "compareField": { + "description": "需要比较时间的字段", + "type": "string" + }, + "interval": { + "description": "时间间隔", + "type": "string" + }, + "tableName": { + "description": "需要清理的表名", + "type": "string" + } + } + }, + "config.Email": { + "type": "object", + "properties": { + "from": { + "description": "收件人", + "type": "string" + }, + "host": { + "description": "服务器地址", + "type": "string" + }, + "isSSL": { + "description": "是否SSL", + "type": "boolean" + }, + "nickname": { + "description": "昵称", + "type": "string" + }, + "port": { + "description": "端口", + "type": "integer" + }, + "secret": { + "description": "密钥", + "type": "string" + }, + "to": { + "description": "收件人:多个以英文逗号分隔", + "type": "string" + } + } + }, + "config.Excel": { + "type": "object", + "properties": { + "dir": { + "type": "string" + } + } + }, + "config.GormSettings": { + "type": "object", + "properties": { + "settings": { + "type": "array", + "items": { + "$ref": "#/definitions/config.Settings" + } + } + } + }, + "config.JPush": { + "type": "object", + "properties": { + "allUserSign": { + "description": "所有用户标签", + "type": "string" + }, + "androidIntent": { + "description": "安卓厂商通道包名", + "type": "string" + }, + "appkey": { + "description": "appkey", + "type": "string" + }, + "secret": { + "description": "密钥", + "type": "string" + } + } + }, + "config.JWT": { + "type": "object", + "properties": { + "bufferTime": { + "description": "缓冲时间", + "type": "integer" + }, + "expiresTime": { + "description": "过期时间", + "type": "integer" + }, + "signingKey": { + "description": "jwt签名", + "type": "string" + } + } + }, + "config.Local": { + "type": "object", + "properties": { + "path": { + "description": "本地文件路径", + "type": "string" + } + } + }, + "config.Minio": { + "type": "object", + "properties": { + "accessKeyID": { + "description": "用户ID", + "type": "string" + }, + "endpoint": { + "description": "端点", + "type": "string" + }, + "secretAccessKey": { + "description": "密钥", + "type": "string" + }, + "useSSL": { + "description": "是否使用ssl", + "type": "boolean" + } + } + }, + "config.Mysql": { + "type": "object", + "properties": { + "config": { + "description": "高级配置", + "type": "string" + }, + "dbname": { + "description": "数据库名", + "type": "string" + }, + "logMode": { + "description": "是否开启Gorm全局日志", + "type": "string" + }, + "logZap": { + "description": "是否通过zap写入日志文件", + "type": "boolean" + }, + "maxIdleConns": { + "description": "空闲中的最大连接数", + "type": "integer" + }, + "maxOpenConns": { + "description": "打开到数据库的最大连接数", + "type": "integer" + }, + "password": { + "description": "数据库密码", + "type": "string" + }, + "path": { + "description": "服务器地址:端口", + "type": "string" + }, + "username": { + "description": "数据库用户名", + "type": "string" + } + } + }, + "config.Paypal": { + "type": "object", + "properties": { + "cancel-url": { + "description": "取消支付跳转", + "type": "string" + }, + "client-id": { + "description": "用户ID", + "type": "string" + }, + "env": { + "description": "端点", + "type": "string" + }, + "notify-url": { + "description": "支付结果通知", + "type": "string" + }, + "return-url": { + "description": "支付完成跳转", + "type": "string" + }, + "secret": { + "description": "密钥", + "type": "string" + } + } + }, + "config.Qiniu": { + "type": "object", + "properties": { + "accessKey": { + "description": "秘钥AK", + "type": "string" + }, + "bucket": { + "description": "空间名称", + "type": "string" + }, + "imgPath": { + "description": "CDN加速域名", + "type": "string" + }, + "secretKey": { + "description": "秘钥SK", + "type": "string" + }, + "useCdnDomains": { + "description": "上传是否使用CDN上传加速", + "type": "boolean" + }, + "useHttps": { + "description": "是否使用https", + "type": "boolean" + }, + "zone": { + "description": "存储区域", + "type": "string" + } + } + }, + "config.Redis": { + "type": "object", + "properties": { + "addr": { + "description": "服务器地址:端口", + "type": "string" + }, + "db": { + "description": "redis的哪个数据库", + "type": "integer" + }, + "password": { + "description": "密码", + "type": "string" + } + } + }, + "config.Server": { + "type": "object", + "properties": { + "aliyunOSS": { + "$ref": "#/definitions/config.AliyunOSS" + }, + "autoCode": { + "description": "auto", + "allOf": [ + { + "$ref": "#/definitions/config.Autocode" + } + ] + }, + "captcha": { + "$ref": "#/definitions/config.Captcha" + }, + "casbin": { + "$ref": "#/definitions/config.Casbin" + }, + "email": { + "$ref": "#/definitions/config.Email" + }, + "excel": { + "$ref": "#/definitions/config.Excel" + }, + "gormSettings": { + "$ref": "#/definitions/config.GormSettings" + }, + "jpush": { + "$ref": "#/definitions/config.JPush" + }, + "jwt": { + "$ref": "#/definitions/config.JWT" + }, + "local": { + "$ref": "#/definitions/config.Local" + }, + "minio": { + "description": "oss", + "allOf": [ + { + "$ref": "#/definitions/config.Minio" + } + ] + }, + "mysql": { + "description": "gorm", + "allOf": [ + { + "$ref": "#/definitions/config.Mysql" + } + ] + }, + "paypal": { + "$ref": "#/definitions/config.Paypal" + }, + "qiniu": { + "$ref": "#/definitions/config.Qiniu" + }, + "redis": { + "$ref": "#/definitions/config.Redis" + }, + "system": { + "$ref": "#/definitions/config.System" + }, + "tencentCOS": { + "$ref": "#/definitions/config.TencentCOS" + }, + "timer": { + "$ref": "#/definitions/config.Timer" + }, + "zap": { + "$ref": "#/definitions/config.Zap" + } + } + }, + "config.Settings": { + "type": "object", + "properties": { + "bindTables": { + "type": "array", + "items": {} + }, + "dsnName": { + "type": "string" + } + } + }, + "config.System": { + "type": "object", + "properties": { + "addr": { + "description": "端口值", + "type": "integer" + }, + "dbType": { + "description": "数据库类型:mysql(默认)|sqlite|sqlserver|postgresql", + "type": "string" + }, + "env": { + "description": "环境值", + "type": "string" + }, + "ossType": { + "description": "Oss类型", + "type": "string" + }, + "useMultipoint": { + "description": "多点登录拦截", + "type": "boolean" + } + } + }, + "config.TencentCOS": { + "type": "object", + "properties": { + "baseURL": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "pathPrefix": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretID": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + }, + "config.Timer": { + "type": "object", + "properties": { + "detail": { + "type": "array", + "items": { + "$ref": "#/definitions/config.Detail" + } + }, + "spec": { + "description": "CRON表达式", + "type": "string" + }, + "start": { + "description": "是否启用", + "type": "boolean" + } + } + }, + "config.Zap": { + "type": "object", + "properties": { + "director": { + "description": "日志文件夹", + "type": "string" + }, + "encodeLevel": { + "description": "编码级", + "type": "string" + }, + "format": { + "description": "输出", + "type": "string" + }, + "level": { + "description": "级别", + "type": "string" + }, + "linkName": { + "description": "软链接名称", + "type": "string" + }, + "logInConsole": { + "description": "输出控制台", + "type": "boolean" + }, + "prefix": { + "description": "日志前缀", + "type": "string" + }, + "showLine": { + "description": "显示行", + "type": "boolean" + }, + "stacktraceKey": { + "description": "栈名", + "type": "string" + } + } + }, + "global.BASE_ID_SORT": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "sort": { + "type": "integer" + } + } + }, + "model.Account": { + "type": "object", + "properties": { + "account_name": { + "description": "户名", + "type": "string" + }, + "address": { + "description": "收款人地址", + "type": "string" + }, + "bank_code": { + "description": "收款行", + "type": "string" + }, + "card_number": { + "description": "银行卡号", + "type": "string" + }, + "country": { + "description": "国家/地区", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "currency": { + "description": "币种 USD:美元", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "idCard": { + "description": "身份证", + "type": "string" + }, + "is_default": { + "description": "是否为默认 0:非默认 1:默认", + "type": "boolean" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "platform": { + "description": "平台 saller(买家端) / customer(客户端) / influencer(网红端)", + "type": "string" + }, + "sort": { + "description": "排序值", + "type": "integer" + }, + "swift_code": { + "description": "银行国际代码", + "type": "string" + }, + "type": { + "description": "类型 1:paypal 2:银行卡", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userID": { + "description": "用户id", + "type": "string" + } + } + }, + "model.AdminBillFund": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserClaimView" + } + ] + }, + "price": { + "description": "金额", + "type": "number" + }, + "related_id": { + "description": "关联id 任务id", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "状态 1:进行中 2:已完成 3:已失败", + "type": "integer" + }, + "transaction_id": { + "description": "交易编号", + "type": "string" + }, + "transaction_type": { + "description": "类型 1-支出 2-收入", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_id": { + "type": "string" + } + } + }, + "model.Application": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "clientID": { + "description": "客户端ID", + "type": "string" + }, + "clientSecret": { + "description": "客户端密钥", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "logo": { + "description": "应用logo", + "type": "string" + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "provider": { + "description": "提供者", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.BillList": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "platform": { + "description": "平台 seller / customer / influencer", + "type": "string" + }, + "price": { + "description": "金额", + "type": "number" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "类型 1-支出 2-收入", + "type": "integer" + }, + "title": { + "description": "标题", + "type": "string" + }, + "transaction_id": { + "description": "交易编号", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "description": "用户信息", + "allOf": [ + { + "$ref": "#/definitions/model.UserView" + } + ] + }, + "user_id": { + "description": "用户id", + "type": "string" + } + } + }, + "model.Chain": { + "type": "object", + "properties": { + "address": { + "description": "合约地址", + "type": "string" + } + } + }, + "model.InfluencerUserClaimView": { + "type": "object", + "properties": { + "claim_no": { + "type": "string" + }, + "nick_name": { + "description": "昵称", + "type": "string" + }, + "phone": { + "description": "电话", + "type": "string" + }, + "uuid": { + "description": "用户uuid", + "type": "string" + } + } + }, + "model.InfluencerUserDesc": { + "type": "object", + "properties": { + "avatar": { + "description": "头像", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "email": { + "description": "用户邮箱", + "type": "string" + }, + "forbidden_operation": { + "description": "禁用操作人", + "type": "string" + }, + "forbidden_reason": { + "description": "禁用原因", + "type": "string" + }, + "forbidden_time": { + "description": "禁用时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "id_forbidden": { + "description": "TagsStr interface{} ` + "`" + `gorm:\"-\" json:\"tags\"` + "`" + ` //个人标签", + "type": "boolean" + }, + "nickName": { + "description": "昵称", + "type": "string" + }, + "phone": { + "description": "电话", + "type": "string" + }, + "platform": { + "description": "平台及地址" + }, + "tags": { + "description": "个人标签", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "uuid": { + "description": "用户uuid编码", + "type": "string" + } + } + }, + "model.InfluencerUserView": { + "type": "object", + "properties": { + "nick_name": { + "description": "昵称", + "type": "string" + }, + "phone": { + "description": "电话", + "type": "string" + }, + "uuid": { + "description": "用户uuid", + "type": "string" + } + } + }, + "model.Meta": { + "type": "object", + "properties": { + "closeTab": { + "description": "自动关闭tab", + "type": "boolean" + }, + "defaultMenu": { + "description": "是否是基础路由(开发中)", + "type": "boolean" + }, + "icon": { + "description": "菜单图标", + "type": "string" + }, + "keepAlive": { + "description": "是否缓存", + "type": "boolean" + }, + "title": { + "description": "菜单名", + "type": "string" + } + } + }, + "model.MissionClaimAddress": { + "type": "object", + "properties": { + "address_id": { + "description": "地址id", + "type": "integer" + }, + "bldg": { + "description": "apt,ste,bldg", + "type": "string" + }, + "city": { + "description": "city", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "default": { + "description": "是否默认地址 1-是 2-否", + "type": "integer" + }, + "firstName": { + "description": "first name", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "lastName": { + "description": "last name", + "type": "string" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "platform": { + "description": "平台 saller(买家端) / customer(客户端) / influencer(网红端)", + "type": "string" + }, + "state": { + "description": "state", + "type": "string" + }, + "street": { + "description": "street", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userId": { + "type": "string" + }, + "zipCode": { + "description": "zip code", + "type": "string" + } + } + }, + "model.MissionClaimDetail": { + "type": "object", + "properties": { + "achieve_num": { + "description": "完成数", + "type": "integer" + }, + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "hire_money": { + "description": "佣金", + "type": "number" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserView" + } + ] + }, + "mission": { + "description": "关联任务", + "allOf": [ + { + "$ref": "#/definitions/model.MissionDetail" + } + ] + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "order": { + "description": "任务订单", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimOrderInfo" + } + ] + }, + "status": { + "description": "状态 1:已领取待发货 2:已发货 3:已收货推广中", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video": { + "description": "上传视频", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimVideo" + } + ] + }, + "works": { + "description": "发布作品", + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionClaimWorks" + } + } + } + }, + "model.MissionClaimOrderDetail": { + "type": "object", + "properties": { + "address": { + "description": "任务订单地址", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimAddress" + } + ] + }, + "confirm_time": { + "description": "收货时间", + "type": "string" + }, + "courier": { + "description": "快递公司", + "type": "string" + }, + "courier_number": { + "description": "快递单号", + "type": "string" + }, + "courier_url": { + "description": "快递查询地址", + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "goods": { + "description": "任务订单商品", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimOrderGoods" + } + ] + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission_claim": { + "description": "任务领取记录", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimDetail" + } + ] + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "number": { + "description": "数量", + "type": "integer" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "send_time": { + "description": "发货时间", + "type": "string" + }, + "sku_no": { + "description": "sku编号", + "type": "string" + }, + "spu_no": { + "description": "spu编号", + "type": "string" + }, + "status": { + "description": "订单状态 2:待发货 3:已发货", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.MissionClaimOrderGoods": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "规格图片url", + "type": "string" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "price": { + "description": "价格", + "type": "number" + }, + "sku_no": { + "description": "sku编号", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "title": { + "description": "名称", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.MissionClaimOrderInfo": { + "type": "object", + "properties": { + "courier": { + "description": "快递公司", + "type": "string" + }, + "courier_number": { + "description": "快递单号", + "type": "string" + }, + "courier_url": { + "description": "快递查询地址", + "type": "string" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "order_goods": { + "description": "订单商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimOrderGoods" + } + ] + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "send_time": { + "description": "发货时间", + "type": "string" + }, + "status": { + "description": "订单状态 2:待发货 3:已发货", + "type": "integer" + } + } + }, + "model.MissionClaimSummary": { + "type": "object", + "properties": { + "bonus": { + "description": "佣金", + "type": "number" + }, + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "count": { + "description": "接任务数", + "type": "integer" + }, + "create_by": { + "description": "网红ID", + "type": "string" + }, + "first_claim_at": { + "description": "首次领取任务时间", + "type": "string" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserView" + } + ] + }, + "order_num": { + "description": "订单数", + "type": "integer" + }, + "platform": { + "type": "string" + }, + "transit_bonus": { + "description": "在途佣金", + "type": "number" + } + } + }, + "model.MissionClaimVideo": { + "type": "object", + "properties": { + "cover": { + "description": "视频封面", + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "mission_id": { + "description": "任务ID", + "type": "integer" + }, + "remark": { + "description": "审核理由", + "type": "string" + }, + "source_type": { + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "type": "integer" + }, + "status": { + "description": "状态 1:待审核 2:审核通过 3:审核不通过", + "type": "integer" + }, + "update_by": { + "description": "修改人", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "model.MissionClaimView": { + "type": "object", + "properties": { + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "create_by": { + "description": "网红uuid", + "type": "string" + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "mission_title": { + "description": "任务标题", + "type": "string" + }, + "user": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.UserView" + } + ] + } + } + }, + "model.MissionClaimWorks": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "homepage": { + "description": "作品主页地址", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "作品凭证截图", + "type": "string" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "type": { + "description": "平台 1:ins 2:Pinterest 3:tk 4:Twitter 5:Facebook 6:Reddit", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "model.MissionDetail": { + "type": "object", + "properties": { + "claim_days": { + "description": "任务完成天数", + "type": "integer" + }, + "claim_demands": { + "description": "任务拍摄要求", + "type": "string" + }, + "claim_num": { + "description": "接任务人数", + "type": "integer" + }, + "claim_stock": { + "description": "可接任务库存", + "type": "integer" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "description": { + "description": "描述/卖点", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.TbGoods4List" + } + ] + }, + "goods_status": { + "description": "关联商品状态 1:正常 2:已下架", + "type": "integer" + }, + "has_sample": { + "description": "是否有样品 0:没有 1:有", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "num": { + "description": "商品数量", + "type": "integer" + }, + "order_num": { + "description": "订单数", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "sample_num": { + "description": "样品数量", + "type": "integer" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "status": { + "description": "状态 1:未开始 2:进行中 3:已结束", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "tags": { + "description": "标签", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_channel_ids": { + "description": "视频发布渠道,多个渠道英文逗号连接", + "type": "string" + }, + "video_claim_num": { + "description": "关联视频数量", + "type": "integer" + }, + "video_country_id": { + "description": "视频发布国家", + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "model.MissionRecommend": { + "type": "object", + "properties": { + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "relation_id": { + "description": "关联ID,任务视频ID,添加视频只需要传relationId", + "type": "integer" + }, + "sort": { + "description": "倒序 //排序", + "type": "integer" + }, + "status": { + "description": "状态 1:上架 2:下架", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderAddress": { + "type": "object", + "properties": { + "bldg": { + "description": "apt,ste,bldg", + "type": "string" + }, + "city": { + "description": "city", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "default": { + "description": "是否默认地址 1-是 2-否", + "type": "integer" + }, + "firstName": { + "description": "first name", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "lastName": { + "description": "last name", + "type": "string" + }, + "orderID": { + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "platform": { + "description": "平台 saller(买家端) / customer(客户端) / influencer(网红端)", + "type": "string" + }, + "state": { + "description": "state", + "type": "string" + }, + "street": { + "description": "street", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userId": { + "type": "string" + }, + "zipCode": { + "description": "zip code", + "type": "string" + } + } + }, + "model.OrderDeliver": { + "type": "object", + "properties": { + "courier": { + "description": "快递公司", + "type": "string" + }, + "courierLink": { + "description": "快递链接", + "type": "string" + }, + "courierNumber": { + "description": "快递单号", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "orderID": { + "description": "订单号", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderDetail": { + "type": "object", + "properties": { + "IAmount": { + "description": "网红佣金", + "type": "string" + }, + "SAmount": { + "description": "入账", + "type": "string" + }, + "address": { + "description": "地址", + "allOf": [ + { + "$ref": "#/definitions/model.OrderAddress" + } + ] + }, + "captureID": { + "description": "paypal收款确认id", + "type": "string" + }, + "chain": { + "description": "区块链", + "allOf": [ + { + "$ref": "#/definitions/model.Chain" + } + ] + }, + "code": { + "description": "网红码?", + "type": "string" + }, + "commodID": { + "description": "商品id", + "type": "integer" + }, + "confirmTime": { + "description": "收货时间", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "deliver": { + "description": "发货信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderDeliver" + } + ] + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderGoodsDetail" + } + ] + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "number": { + "description": "数量", + "type": "integer" + }, + "orderID": { + "description": "订单号", + "type": "string" + }, + "paidPrice": { + "description": "实付价格", + "type": "number" + }, + "payTime": { + "description": "付款时间", + "type": "string" + }, + "price": { + "description": "商品价格", + "type": "number" + }, + "sendTime": { + "description": "发货时间", + "type": "string" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "status": { + "description": "订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "类型 1-普通订单 2-预售订单", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userID": { + "description": "用户id", + "type": "string" + } + } + }, + "model.OrderGoodsDetail": { + "type": "object", + "properties": { + "content": { + "description": "详情", + "type": "string" + }, + "content_text": { + "description": "详情-文字", + "type": "string" + }, + "cover": { + "description": "封面图", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "goods_specs": { + "description": "商品规格", + "type": "array", + "items": { + "$ref": "#/definitions/model.OrderGoodsSpecs" + } + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "images": { + "description": "图片", + "type": "string" + }, + "orderID": { + "description": "订单id", + "type": "string" + }, + "price_max": { + "description": "最高规格价格", + "type": "number" + }, + "price_min": { + "description": "最低规格价格", + "type": "number" + }, + "retail_price": { + "description": "吊牌价(零售指导价)", + "type": "number" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "spu_no": { + "description": "编号", + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "title": { + "description": "名称", + "type": "string" + }, + "title_eng": { + "description": "英文名称", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderGoodsSpecs": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "goods_id": { + "description": "spu id", + "type": "integer" + }, + "goods_no": { + "description": "商品编号", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "规格图片url", + "type": "string" + }, + "orderGoodsId": { + "type": "integer" + }, + "orderID": { + "description": "订单id", + "type": "string" + }, + "price": { + "description": "价格", + "type": "number" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "spu_no": { + "description": "商品编号", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderList": { + "type": "object", + "properties": { + "IAmount": { + "description": "网红佣金", + "type": "string" + }, + "SAmount": { + "description": "入账", + "type": "string" + }, + "address": { + "description": "地址", + "allOf": [ + { + "$ref": "#/definitions/model.OrderAddress" + } + ] + }, + "captureID": { + "description": "paypal收款确认id", + "type": "string" + }, + "code": { + "description": "网红码?", + "type": "string" + }, + "commodID": { + "description": "商品id", + "type": "integer" + }, + "confirmTime": { + "description": "收货时间", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "customerPhone": { + "description": "买家手机", + "type": "string" + }, + "deliver": { + "description": "发货信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderDeliver" + } + ] + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderGoodsDetail" + } + ] + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserClaimView" + } + ] + }, + "number": { + "description": "数量", + "type": "integer" + }, + "orderID": { + "description": "订单号", + "type": "string" + }, + "paidPrice": { + "description": "实付价格", + "type": "number" + }, + "payTime": { + "description": "付款时间", + "type": "string" + }, + "price": { + "description": "商品价格", + "type": "number" + }, + "sendTime": { + "description": "发货时间", + "type": "string" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "status": { + "description": "订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "类型 1-普通订单 2-预售订单", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userID": { + "description": "用户id", + "type": "string" + } + } + }, + "model.Organization": { + "type": "object", + "properties": { + "code": { + "description": "组织编码", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "组织名称", + "type": "string" + }, + "owner": { + "description": "组织所属", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.Platform": { + "type": "object", + "properties": { + "auth_msg": { + "description": "认证信息", + "type": "string" + }, + "auth_time": { + "description": "认证时间", + "type": "string" + }, + "check_user": { + "description": "审核人", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "image": { + "description": "图片", + "type": "string" + }, + "is_auth": { + "description": "是否认证 0:未认证 1:已认证 2:认证失败", + "type": "boolean" + }, + "platform": { + "description": "平台", + "type": "string" + }, + "platformName": { + "description": "平台名称", + "type": "string" + }, + "url": { + "description": "主页地址", + "type": "string" + } + } + }, + "model.PlatformAuthSimple": { + "type": "object", + "properties": { + "auth_msg": { + "description": "认证信息", + "type": "string" + }, + "auth_time": { + "description": "认证时间", + "type": "string" + }, + "check_user": { + "description": "审核人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "图片", + "type": "string" + }, + "is_auth": { + "description": "是否认证 0:未认证 1:已认证 2:认证失败", + "type": "boolean" + }, + "platform": { + "description": "平台", + "type": "string" + }, + "platformName": { + "description": "平台名称", + "type": "string" + }, + "status": { + "description": "认证状态 0:未认证 1:已认证 2:认证失败", + "type": "string" + }, + "tag_relation": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TagRelationDesc" + } + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "url": { + "description": "主页地址", + "type": "string" + }, + "user": { + "$ref": "#/definitions/model.UserSimple" + }, + "user_id": { + "description": "用户ID", + "type": "string" + } + } + }, + "model.Provider": { + "type": "object", + "properties": { + "auth_uri": { + "description": "认证URI", + "type": "string" + }, + "category": { + "description": "提供者分类 1-社交 2-支付 3-媒体 4-其他", + "type": "string" + }, + "client_id": { + "description": "客户端ID", + "type": "string" + }, + "client_secret": { + "description": "客户端密钥", + "type": "string" + }, + "code": { + "description": "提供者代码 google facebook twitter tiktok", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "提供者名称", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "redirect_uri": { + "description": "重定向URI", + "type": "string" + }, + "scope": { + "description": "作用域", + "type": "string" + }, + "token_uri": { + "description": "令牌URI", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_info_uri": { + "description": "用户信息URI", + "type": "string" + } + } + }, + "model.SellerBillFund": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission": { + "description": "领取任务信息", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimView" + } + ] + }, + "price": { + "description": "金额", + "type": "number" + }, + "related_id": { + "description": "关联id 任务id", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "seller": { + "description": "店铺信息", + "allOf": [ + { + "$ref": "#/definitions/model.StoreInfo" + } + ] + }, + "status": { + "description": "状态 1:进行中 2:已完成 3:已失败", + "type": "integer" + }, + "transaction_id": { + "description": "交易编号", + "type": "string" + }, + "transaction_type": { + "description": "类型 1-支出 2-收入", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_id": { + "description": "商家storeNo", + "type": "string" + } + } + }, + "model.SellerStore": { + "type": "object", + "properties": { + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "email": { + "description": "店铺联系email(注册账号email)", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "phone": { + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "1:个人店铺", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SellerStoreInfo": { + "type": "object", + "properties": { + "create_by": { + "description": "创建人", + "type": "string" + }, + "created_at": { + "type": "string" + }, + "email": { + "description": "店铺联系email(注册账号email)", + "type": "string" + }, + "goods_num": { + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "phone": { + "type": "string" + }, + "release_mission_nums": { + "description": "发布任务数", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "1:个人店铺", + "type": "integer" + }, + "valid_mission_num": { + "description": "有效任务数", + "type": "integer" + } + } + }, + "model.StoreInfo": { + "type": "object", + "properties": { + "email": { + "description": "联系方式", + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + } + } + }, + "model.SysApi": { + "type": "object", + "properties": { + "apiGroup": { + "description": "api组", + "type": "string" + }, + "appid": { + "description": "应用ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "description": { + "description": "api中文描述", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "method": { + "description": "方法:创建POST(默认)|查看GET|更新PUT|删除DELETE", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "path": { + "description": "api路径", + "type": "string" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SysAuthority": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "authorityDesc": { + "description": "角色描述", + "type": "string" + }, + "authorityId": { + "description": "角色ID", + "type": "integer" + }, + "authorityName": { + "description": "角色名", + "type": "string" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "defaultRouter": { + "description": "默认菜单(默认dashboard)", + "type": "string" + }, + "menus": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + }, + "organization": { + "description": "组织", + "type": "string" + }, + "parentId": { + "description": "父角色ID", + "type": "integer" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + } + } + }, + "model.SysBaseMenu": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "authoritys": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + }, + "component": { + "description": "对应前端文件路径", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "group": { + "description": "路由组", + "type": "string" + }, + "hidden": { + "description": "是否在列表隐藏", + "type": "boolean" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "meta": { + "description": "附加属性", + "allOf": [ + { + "$ref": "#/definitions/model.Meta" + } + ] + }, + "name": { + "description": "路由name", + "type": "string" + }, + "owner": { + "description": "组织所属", + "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenuParameter" + } + }, + "parentId": { + "description": "父菜单ID", + "type": "string" + }, + "path": { + "description": "路由path", + "type": "string" + }, + "sort": { + "description": "排序标记", + "type": "integer" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SysBaseMenuParameter": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "key": { + "description": "地址栏携带参数的key", + "type": "string" + }, + "sysBaseMenuID": { + "type": "integer" + }, + "type": { + "description": "地址栏携带参数为params还是query", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "value": { + "description": "地址栏携带参数的值", + "type": "string" + } + } + }, + "model.SysMissionReward": { + "type": "object", + "properties": { + "achieve_num": { + "description": "已完成任务次数", + "type": "integer" + }, + "audit_by": { + "description": "审核人", + "type": "string" + }, + "bonus": { + "description": "奖励金额", + "type": "number" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "status": { + "description": "订单状态 1-待发放 2-发放中 3-已发放", + "type": "integer" + }, + "title": { + "description": "组件id", + "type": "string" + }, + "type": { + "description": "奖励类型 1.视频上传 2.信息完善 3.商家任务", + "type": "integer" + }, + "update_by": { + "description": "更新人", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SysOperationRecord": { + "type": "object", + "properties": { + "agent": { + "description": "代理", + "type": "string" + }, + "apiDescription": { + "type": "string" + }, + "appid": { + "description": "应用ip", + "type": "string" + }, + "body": { + "description": "请求Body", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "error_message": { + "description": "错误信息", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "ip": { + "description": "请求ip", + "type": "string" + }, + "latency": { + "description": "延迟", + "type": "string" + }, + "method": { + "description": "请求方法", + "type": "string" + }, + "path": { + "description": "请求路径", + "type": "string" + }, + "resp": { + "description": "响应Body", + "type": "string" + }, + "status": { + "description": "请求状态", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "$ref": "#/definitions/model.SysUserSimple" + }, + "user_id": { + "description": "用户id", + "type": "integer" + } + } + }, + "model.SysUser": { + "type": "object", + "properties": { + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "authorityId": { + "description": "用户角色ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "fullName": { + "type": "string" + }, + "headerImg": { + "description": "用户头像", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "nickName": { + "description": "用户昵称", + "type": "string" + }, + "phone": { + "type": "string" + }, + "status": { + "description": "用户状态", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userName": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "description": "用户UUID", + "type": "string" + } + } + }, + "model.SysUserSimple": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "userName": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "model.System": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/config.Server" + } + } + }, + "model.TagRelationDesc": { + "type": "object", + "properties": { + "id": { + "description": "主键", + "type": "integer" + }, + "name": { + "description": "标签名称", + "type": "string" + } + } + }, + "model.Tags": { + "type": "object", + "properties": { + "createBy": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "type": { + "description": "标签类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "updateBy": { + "description": "修改人", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "description": "用户信息", + "allOf": [ + { + "$ref": "#/definitions/model.SysUserSimple" + } + ] + }, + "value": { + "description": "值", + "type": "string" + } + } + }, + "model.TagsDesc": { + "type": "object", + "properties": { + "id": { + "description": "主键", + "type": "integer" + }, + "value": { + "description": "值", + "type": "string" + } + } + }, + "model.TbGoods4List": { + "type": "object", + "properties": { + "cover": { + "description": "封面图(未使用)", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "images": { + "description": "图片列表", + "type": "string" + }, + "price_max": { + "description": "最高规格价格", + "type": "number" + }, + "price_min": { + "description": "最低规格价格", + "type": "number" + }, + "retail_price": { + "description": "吊牌价(零售指导价)", + "type": "number" + }, + "sales": { + "description": "总销售量", + "type": "integer" + }, + "sales_30": { + "description": "30天销售量", + "type": "integer" + }, + "spu_no": { + "description": "编号", + "type": "string" + }, + "status": { + "description": "1:上架 2:下架 3:售罄", + "type": "integer" + }, + "stock": { + "description": "总库存", + "type": "integer" + }, + "tags": { + "description": "标签", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "title_eng": { + "description": "英文标题", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.User": { + "type": "object", + "properties": { + "appid": { + "description": "用户所属应用", + "type": "string" + }, + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "authority_id": { + "description": "用户角色ID", + "type": "integer" + }, + "avatar": { + "description": "头像", + "type": "string" + }, + "country_code": { + "description": "用户手机号国家代码", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "douyin": { + "description": "抖音", + "type": "string" + }, + "email": { + "description": "用户邮箱", + "type": "string" + }, + "facebook": { + "description": "facebook", + "type": "string" + }, + "forbidden_operation": { + "description": "禁用操作人", + "type": "string" + }, + "forbidden_reason": { + "description": "禁用原因", + "type": "string" + }, + "forbidden_time": { + "description": "禁用时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "id_forbidden": { + "description": "是否禁用", + "type": "boolean" + }, + "instagram": { + "description": "instagram", + "type": "string" + }, + "is_auth": { + "description": "是否认证 0未认证 1已认证", + "type": "boolean" + }, + "nick_name": { + "description": "昵称", + "type": "string" + }, + "organization": { + "description": "用户所属组织", + "type": "string" + }, + "password": { + "description": "用户密码", + "type": "string" + }, + "password_salt": { + "description": "用户密码盐", + "type": "string" + }, + "phone": { + "description": "用户手机号", + "type": "string" + }, + "platform": { + "description": "平台及地址逗号隔开 eg:(ins:https://baidu.com/user/1,qq:12345678)", + "type": "string" + }, + "source": { + "description": "用户来源", + "type": "string" + }, + "tags": { + "description": "个人标签", + "type": "string" + }, + "type": { + "description": "用户类型(随用户所属而定)", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "username": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "description": "用户uuid编码", + "type": "string" + } + } + }, + "model.UserSimple": { + "type": "object", + "properties": { + "account": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Account" + } + }, + "avatar": { + "description": "头像", + "type": "string" + }, + "created_at": { + "description": "创建时间字符串", + "type": "string" + }, + "email": { + "description": "用户邮箱", + "type": "string" + }, + "id_forbidden": { + "description": "是否禁用", + "type": "boolean" + }, + "is_auth": { + "description": "是否认证 0未认证 1已认证", + "type": "boolean" + }, + "nick_name": { + "description": "昵称", + "type": "string" + }, + "order_count": { + "description": "订单数量", + "type": "integer" + }, + "phone": { + "description": "用户手机号", + "type": "string" + }, + "platform": { + "description": "平台", + "type": "array", + "items": { + "$ref": "#/definitions/model.Platform" + } + }, + "refund_count": { + "description": "退款数量", + "type": "integer" + }, + "source": { + "description": "用户来源", + "type": "string" + }, + "tags": { + "description": "个人标签", + "type": "string" + }, + "uuid": { + "description": "用户uuid编码", + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/model.Wallet" + } + } + }, + "model.UserView": { + "type": "object", + "properties": { + "email": { + "description": "邮箱", + "type": "string" + }, + "uuid": { + "description": "uuid", + "type": "string" + } + } + }, + "model.Wallet": { + "type": "object", + "properties": { + "accountName": { + "description": "户名", + "type": "string" + }, + "balance": { + "description": "可用余额", + "type": "number" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "fund": { + "description": "营销账户", + "type": "number" + }, + "fundLock": { + "description": "营销账户-锁定金额", + "type": "number" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "idCard": { + "description": "身份证", + "type": "string" + }, + "platform": { + "description": "平台 seller / customer / influencer", + "type": "string" + }, + "state": { + "description": "状态 0:正常 1:限制提现 2:禁止提现", + "type": "integer" + }, + "transitBalance": { + "description": "在途余额", + "type": "number" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userId": { + "type": "string" + } + } + }, + "model.Withdrawal": { + "type": "object", + "properties": { + "account_name": { + "description": "户名", + "type": "string" + }, + "account_type": { + "description": "账户类型 1:paypal 2:银行卡", + "type": "integer" + }, + "address": { + "description": "收款人地址", + "type": "string" + }, + "amount": { + "description": "金额", + "type": "number" + }, + "bank_code": { + "description": "收款行", + "type": "string" + }, + "bill_no": { + "description": "账单号", + "type": "string" + }, + "card_number": { + "description": "银行卡号", + "type": "string" + }, + "check_status": { + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "type": "string" + }, + "check_time": { + "description": "审核时间", + "type": "string" + }, + "country": { + "description": "国家/地区", + "type": "string" + }, + "create_by": { + "description": "创建人/店铺", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "currency": { + "description": "币种 USD:美元", + "type": "string" + }, + "flow_no": { + "description": "流水号", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "pay_id": { + "description": "支付id", + "type": "string" + }, + "platform": { + "description": "平台 1:网红 2:商家", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "提现状态 0:进行中 1:成功 2:失败", + "type": "string" + }, + "swift_code": { + "description": "银行国际代码", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "wallet_type": { + "description": "钱包类型 1:余额钱包 2:营销账户钱包", + "type": "integer" + } + } + }, + "request.AddMenuAuthorityInfo": { + "type": "object", + "properties": { + "authorityId": { + "description": "角色ID", + "type": "integer" + }, + "menus": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + } + }, + "request.AddMissionRecommend": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionRecommend" + } + } + } + }, + "request.AddMissionVideo": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "mission_id": { + "description": "领取任务id", + "type": "integer" + }, + "source_type": { + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "type": "integer" + }, + "tag_id": { + "type": "integer" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "request.ApplicationSearch": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "clientID": { + "description": "客户端ID", + "type": "string" + }, + "clientSecret": { + "description": "客户端密钥", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "logo": { + "description": "应用logo", + "type": "string" + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "provider": { + "description": "提供者", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "request.CasbinInReceive": { + "type": "object", + "properties": { + "authorityId": { + "description": "权限id", + "type": "integer" + }, + "casbinInfos": { + "type": "array", + "items": { + "$ref": "#/definitions/request.CasbinInfo" + } + } + } + }, + "request.CasbinInfo": { + "type": "object", + "properties": { + "method": { + "description": "方法", + "type": "string" + }, + "path": { + "description": "路径", + "type": "string" + } + } + }, + "request.ChangePasswordStruct": { + "type": "object", + "properties": { + "newPassword": { + "description": "新密码", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "request.CreateBanner": { + "type": "object", + "properties": { + "coverUrl": { + "description": "封面图", + "type": "string" + }, + "link": { + "description": "链接地址", + "type": "string" + }, + "linkType": { + "description": "链接类型 0:内链 1:外链", + "type": "string" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务", + "type": "string" + }, + "status": { + "description": "状态 0=下架 1=上架", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "type": { + "description": "任务-0101 平台奖励页-0102", + "type": "string" + } + } + }, + "request.CreateCategory": { + "type": "object", + "properties": { + "layer": { + "description": "层级", + "type": "integer" + }, + "name": { + "description": "名称", + "type": "string" + }, + "pid": { + "description": "父id", + "type": "integer" + } + } + }, + "request.CreateMissionTagRelation": { + "type": "object", + "properties": { + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "tagId": { + "description": "标签id", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.CreateTagRelation": { + "type": "object", + "properties": { + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "tagId": { + "description": "标签id", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.EditMissionVideo": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "id": { + "description": "任务视频ID", + "type": "integer" + }, + "tag_id": { + "type": "integer" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "request.Empty": { + "type": "object" + }, + "request.ExamineWithdrawal": { + "type": "object", + "properties": { + "check_status": { + "description": "审核状态 1:审核通过 2:审核未通过", + "type": "string" + }, + "flow_no": { + "description": "流水号", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + } + } + }, + "request.FundRecharge": { + "type": "object", + "properties": { + "amount": { + "description": "充值金额", + "type": "number" + }, + "payMode": { + "description": "支付方式 1-paypal", + "type": "integer" + } + } + }, + "request.GetAuthorityId": { + "type": "object", + "properties": { + "appid": { + "type": "string" + }, + "authorityId": { + "description": "角色ID", + "type": "integer" + } + } + }, + "request.GetById": { + "type": "object", + "properties": { + "id": { + "description": "主键ID", + "type": "number" + } + } + }, + "request.IdReq": { + "type": "object", + "properties": { + "id": { + "description": "id", + "type": "integer" + } + } + }, + "request.IdsReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.IdsUReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.Login": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "captcha": { + "description": "验证码", + "type": "string" + }, + "captchaId": { + "description": "验证码ID", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "request.OrganizationSearch": { + "type": "object", + "properties": { + "code": { + "description": "组织编码", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "组织名称", + "type": "string" + }, + "owner": { + "description": "组织所属", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "request.PageInfo": { + "type": "object", + "properties": { + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + } + } + }, + "request.PlatformAuthCheck": { + "type": "object", + "properties": { + "auth_msg": { + "description": "认证信息", + "type": "string" + }, + "check_result": { + "description": "认证结果 1:认证通过 2:认证失败", + "type": "string" + }, + "id": { + "description": "认证id", + "type": "integer" + } + } + }, + "request.ProviderSearch": { + "type": "object", + "properties": { + "auth_uri": { + "description": "认证URI", + "type": "string" + }, + "category": { + "description": "提供者分类 1-社交 2-支付 3-媒体 4-其他", + "type": "string" + }, + "client_id": { + "description": "客户端ID", + "type": "string" + }, + "client_secret": { + "description": "客户端密钥", + "type": "string" + }, + "code": { + "description": "提供者代码 google facebook twitter tiktok", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "提供者名称", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "redirect_uri": { + "description": "重定向URI", + "type": "string" + }, + "scope": { + "description": "作用域", + "type": "string" + }, + "token_uri": { + "description": "令牌URI", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_info_uri": { + "description": "用户信息URI", + "type": "string" + } + } + }, + "request.SearchApiParams": { + "type": "object", + "properties": { + "apiGroup": { + "description": "api组", + "type": "string" + }, + "appid": { + "description": "应用ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "desc": { + "description": "排序方式:升序false(默认)|降序true", + "type": "boolean" + }, + "description": { + "description": "api中文描述", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "method": { + "description": "方法:创建POST(默认)|查看GET|更新PUT|删除DELETE", + "type": "string" + }, + "orderKey": { + "description": "排序", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "path": { + "description": "api路径", + "type": "string" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "request.SearchStore": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "end_at": { + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "start_at": { + "type": "string" + }, + "store_no": { + "type": "string" + } + } + }, + "request.SearchSysUserParams": { + "type": "object", + "properties": { + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "authorityId": { + "description": "用户角色ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "fullName": { + "type": "string" + }, + "headerImg": { + "description": "用户头像", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "nickName": { + "description": "用户昵称", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "phone": { + "type": "string" + }, + "status": { + "description": "用户状态", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userName": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "description": "用户UUID", + "type": "string" + } + } + }, + "request.SetUserAuth": { + "type": "object", + "properties": { + "authorityId": { + "description": "UUID uuid.UUID ` + "`" + `json:\"uuid\"` + "`" + ` // 用户UUID", + "type": "string" + } + } + }, + "request.SetUserAuthorities": { + "type": "object", + "properties": { + "authorityIds": { + "description": "角色id", + "type": "array", + "items": { + "type": "string" + } + }, + "uuid": { + "type": "string" + } + } + }, + "request.SysOperationRecordSearch": { + "type": "object", + "properties": { + "agent": { + "description": "代理", + "type": "string" + }, + "apiDescription": { + "type": "string" + }, + "appid": { + "description": "应用ip", + "type": "string" + }, + "body": { + "description": "请求Body", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "createdAtEnd": { + "type": "string" + }, + "createdAtStart": { + "type": "string" + }, + "error_message": { + "description": "错误信息", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "ip": { + "description": "请求ip", + "type": "string" + }, + "latency": { + "description": "延迟", + "type": "string" + }, + "method": { + "description": "请求方法", + "type": "string" + }, + "nickName": { + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "path": { + "description": "请求路径", + "type": "string" + }, + "resp": { + "description": "响应Body", + "type": "string" + }, + "status": { + "description": "请求状态", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "$ref": "#/definitions/model.SysUserSimple" + }, + "user_id": { + "description": "用户id", + "type": "integer" + } + } + }, + "request.TagsCommon": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "type": { + "description": "标签类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "value": { + "description": "值", + "type": "string" + } + } + }, + "request.TransferResult": { + "type": "object", + "properties": { + "flow_no": { + "description": "流水号", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "状态 1:成功 2:失败", + "type": "string" + } + } + }, + "request.UpdateBanner": { + "type": "object", + "properties": { + "coverUrl": { + "description": "封面图", + "type": "string" + }, + "id": { + "description": "主键", + "type": "integer" + }, + "link": { + "description": "链接地址", + "type": "string" + }, + "linkType": { + "description": "链接类型 0:内链 1:外链", + "type": "string" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务", + "type": "string" + }, + "status": { + "description": "状态 0=下架 1=上架", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "type": { + "description": "任务-0101 平台奖励页-0102", + "type": "string" + } + } + }, + "request.UpdateCategory": { + "type": "object", + "properties": { + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "名称", + "type": "string" + } + } + }, + "request.UserStatus": { + "type": "object", + "properties": { + "forbidden_reason": { + "description": "禁用原因", + "type": "string" + }, + "id_forbidden": { + "description": "是否禁用 0:未禁用 1:已禁用", + "type": "boolean" + }, + "user_id": { + "description": "用户id", + "type": "string" + } + } + }, + "response.AdminFundData": { + "type": "object", + "properties": { + "expend": { + "description": "支出金额", + "type": "number" + }, + "expend_count": { + "description": "支出笔数", + "type": "integer" + }, + "recharge": { + "description": "充值金额", + "type": "number" + }, + "recharge_count": { + "description": "充值笔数", + "type": "integer" + } + } + }, + "response.BannerListResponse": { + "type": "object", + "properties": { + "coverUrl": { + "description": "封面图", + "type": "string" + }, + "id": { + "description": "主键", + "type": "integer" + }, + "link": { + "description": "链接地址", + "type": "string" + }, + "linkType": { + "description": "链接类型 0:内链 1:外链", + "type": "string" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationTitle": { + "description": "关联标题", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务", + "type": "string" + }, + "sortIndex": { + "description": "序号索引", + "type": "integer" + }, + "status": { + "description": "状态 0=下架 1=上架", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "type": { + "description": "任务-0101 平台奖励页-0102", + "type": "string" + } + } + }, + "response.BillData": { + "type": "object", + "properties": { + "expend": { + "description": "支出金额", + "type": "number" + }, + "expend_count": { + "description": "支出笔数", + "type": "integer" + }, + "income": { + "description": "收入金额", + "type": "number" + }, + "income_count": { + "description": "收入笔数", + "type": "integer" + } + } + }, + "response.BkbData": { + "type": "object", + "properties": { + "balance": { + "description": "余额账户", + "type": "number" + }, + "earn": { + "description": "抽成总额", + "type": "number" + }, + "reward": { + "type": "number" + }, + "turnover": { + "description": "交易额", + "type": "number" + }, + "unexamined": { + "description": "待处理金额", + "type": "number" + }, + "unexamined_count": { + "description": "待处理笔数", + "type": "integer" + } + } + }, + "response.ChainResp": { + "type": "object", + "properties": { + "block_adress": { + "description": "所在区块", + "type": "string" + }, + "block_height": { + "description": "块高度", + "type": "integer" + }, + "hash": { + "description": "交易哈希", + "type": "string" + }, + "time": { + "description": "上链时间", + "type": "string" + } + } + }, + "response.DataPiece": { + "type": "object", + "properties": { + "value1": { + "type": "string" + }, + "value2": { + "type": "string" + } + } + }, + "response.DataStatistics": { + "type": "object", + "properties": { + "influence": { + "description": "网红数据", + "allOf": [ + { + "$ref": "#/definitions/response.DataStatisticsInfluence" + } + ] + }, + "store": { + "description": "商家数据", + "allOf": [ + { + "$ref": "#/definitions/response.DataStatisticsStore" + } + ] + }, + "user": { + "description": "用户数据", + "allOf": [ + { + "$ref": "#/definitions/response.DataStatisticsUser" + } + ] + } + } + }, + "response.DataStatisticsInfluence": { + "type": "object", + "properties": { + "mission_num": { + "description": "任务数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "platform_num": { + "description": "发布平台数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "transit_reward": { + "description": "在途佣金", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "used_reward": { + "description": "可用佣金", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + } + } + }, + "response.DataStatisticsStore": { + "type": "object", + "properties": { + "goods_num": { + "description": "商品数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "mission_num": { + "description": "任务数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "transit_reward": { + "description": "在途佣金", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "used_cash": { + "description": "可提金额", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + } + } + }, + "response.DataStatisticsUser": { + "type": "object", + "properties": { + "money": { + "description": "总销售额", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "order_num": { + "description": "订单数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "pay_num": { + "description": "支付笔数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "visit": { + "description": "访问量", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + } + } + }, + "response.InfluenceWithdrawalData": { + "type": "object", + "properties": { + "balance": { + "description": "账户余额", + "type": "number" + }, + "unexamined": { + "description": "待处理金额", + "type": "number" + }, + "unexamined_count": { + "description": "待处理笔数", + "type": "integer" + } + } + }, + "response.MissionClaimGoods": { + "type": "object", + "properties": { + "goods_id": { + "description": "商品ID", + "type": "integer" + }, + "image": { + "description": "规格图片url", + "type": "string" + }, + "order_id": { + "description": "订单ID", + "type": "string" + }, + "price": { + "description": "价格", + "type": "number" + }, + "sales": { + "description": "总销售量", + "type": "number" + }, + "sales_30": { + "description": "30天销售量", + "type": "number" + }, + "sku_no": { + "description": "商品编码", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "spu_no": { + "description": "编号", + "type": "string" + }, + "status": { + "description": "1:上架 2:下架 3:售罄", + "type": "integer" + }, + "stock": { + "description": "库存", + "type": "integer" + }, + "tags": { + "description": "标签", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "title_eng": { + "description": "英文标题", + "type": "string" + } + } + }, + "response.MissionClaimInfo": { + "type": "object", + "properties": { + "claim_at": { + "description": "接任务时间", + "type": "string" + }, + "claim_days": { + "description": "任务完成天数", + "type": "integer" + }, + "claim_demands": { + "description": "任务拍摄要求", + "type": "string" + }, + "claim_num": { + "description": "接任务人数", + "type": "integer" + }, + "claim_stock": { + "description": "可接任务库存", + "type": "integer" + }, + "description": { + "description": "描述/卖点", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "has_sample": { + "description": "是否有样品 0:没有 1:有", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "order_num": { + "description": "订单数", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "sample_num": { + "description": "样品数量", + "type": "integer" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "status": { + "description": "状态 1:未开始 2:进行中 3:已结束", + "type": "integer" + }, + "title": { + "description": "任务名称", + "type": "string" + }, + "video_channel_ids": { + "description": "视频发布渠道,多个渠道英文逗号连接", + "type": "string" + }, + "video_country_id": { + "description": "视频发布国家", + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "response.MissionClaimOrderResponse": { + "type": "object", + "properties": { + "order": { + "$ref": "#/definitions/model.MissionClaimOrderDetail" + } + } + }, + "response.MissionClaimSimpleData": { + "type": "object", + "properties": { + "achieve_num": { + "description": "已完成商品数量", + "type": "integer" + }, + "claim_at": { + "description": "接任务时间", + "type": "string" + }, + "claim_days": { + "description": "完成任务时间", + "type": "integer" + }, + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "expire_at": { + "description": "任务推广过期时间", + "type": "string" + }, + "finished": { + "description": "任务完成状态 0:未完成 1:已完成", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "mission_title": { + "description": "任务名称", + "type": "string" + }, + "orderMoney": { + "description": "订单金额", + "type": "number" + }, + "orderNum": { + "description": "订单数", + "type": "integer" + }, + "rewardFinished": { + "description": "佣金结算", + "type": "number" + }, + "rewardUnfinished": { + "description": "在途佣金", + "type": "number" + }, + "sign_url": { + "description": "签约地址", + "type": "string" + }, + "status": { + "description": "状态 1:已领取待发货 2:已发货 3:已收货推广中", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video": { + "$ref": "#/definitions/model.MissionClaimVideo" + }, + "video_url": { + "type": "string" + } + } + }, + "response.MissionClaimVideoDetail": { + "type": "object", + "properties": { + "claim_goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/response.MissionClaimGoods" + } + ] + }, + "claim_video": { + "$ref": "#/definitions/model.MissionClaimVideo" + }, + "influencer_user": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserDesc" + } + ] + }, + "mission_claim": { + "description": "任务领取信息", + "allOf": [ + { + "$ref": "#/definitions/response.MissionClaimInfo" + } + ] + } + } + }, + "response.MissionRecommendResponse": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods_title": { + "type": "string" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "$ref": "#/definitions/model.InfluencerUserView" + }, + "mission_id": { + "type": "integer" + }, + "mission_status": { + "description": "任务状态", + "type": "integer" + }, + "relation_id": { + "description": "关联ID,任务视频ID,添加视频只需要传relationId", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "sort": { + "description": "倒序 //排序", + "type": "integer" + }, + "sort_index": { + "type": "integer" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "status": { + "description": "状态 1:上架 2:下架", + "type": "integer" + }, + "tag": { + "description": "todo 标签系统", + "type": "string" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "response.MissionStopData": { + "type": "object", + "properties": { + "claim_num": { + "description": "接任务人数", + "type": "integer" + }, + "description": { + "description": "描述/卖点", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.TbGoods4List" + } + ] + }, + "goods_title": { + "type": "string" + }, + "has_sample": { + "description": "是否有样品 0:没有 1:有", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "mission_id": { + "type": "integer" + }, + "mission_status": { + "description": "任务状态", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "remark": { + "type": "string" + }, + "sample_num": { + "description": "样品数量", + "type": "integer" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "tag": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "response.MissionVideoResponse": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods_title": { + "type": "string" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "influencer": { + "$ref": "#/definitions/model.InfluencerUserView" + }, + "mission_id": { + "type": "integer" + }, + "mission_status": { + "description": "任务状态", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "source_type": { + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "type": "integer" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "tag": { + "description": "todo 标签系统", + "type": "string" + }, + "title": { + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "response.PageResult": { + "type": "object", + "properties": { + "list": {}, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PayResult": { + "type": "object", + "properties": { + "pay_channel": { + "type": "string" + }, + "pay_id": { + "type": "string" + }, + "pay_return": { + "type": "string" + }, + "pay_status": { + "type": "string" + } + } + }, + "response.SellerFundData": { + "type": "object", + "properties": { + "expend": { + "description": "支出金额", + "type": "number" + }, + "expend_count": { + "description": "支出笔数", + "type": "integer" + }, + "lock": { + "description": "锁定金额", + "type": "number" + }, + "lock_count": { + "description": "锁定笔数", + "type": "integer" + } + } + }, + "response.SellerWithdrawalData": { + "type": "object", + "properties": { + "balance": { + "description": "余额账户", + "type": "number" + }, + "fund": { + "description": "营销账户", + "type": "number" + }, + "unexamined": { + "description": "待处理金额", + "type": "number" + }, + "unexamined_count": { + "description": "待处理笔数", + "type": "integer" + } + } + }, + "response.StoreInfoItem": { + "type": "object", + "properties": { + "balance": { + "description": "佣金", + "type": "number" + }, + "email": { + "description": "店铺联系email(注册账号email)", + "type": "string" + }, + "goods_num": { + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "papayl_name": { + "description": "paypal账号", + "type": "string" + }, + "phone": { + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "transit_balance": { + "description": "在途佣金", + "type": "number" + }, + "type": { + "description": "1:个人店铺", + "type": "integer" + }, + "valid_mission_num": { + "description": "有效任务数", + "type": "integer" + } + } + }, + "response.SysAuthorityCopyResponse": { + "type": "object", + "properties": { + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "oldAuthorityId": { + "description": "旧角色ID", + "type": "integer" + } + } + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "x-token", + "in": "header" + } + } +}` + +// SwaggerInfo holds exported Swagger Info so clients can modify it +var SwaggerInfo = &swag.Spec{ + Version: "0.0.1", + Host: "", + BasePath: "", + Schemes: []string{}, + Title: "Swagger Example API", + Description: "", + InfoInstanceName: "swagger", + SwaggerTemplate: docTemplate, +} + +func init() { + swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) +} diff --git a/docs/swagger.json b/docs/swagger.json new file mode 100644 index 0000000..58a37c6 --- /dev/null +++ b/docs/swagger.json @@ -0,0 +1,11745 @@ +{ + "swagger": "2.0", + "info": { + "title": "Swagger Example API", + "contact": {}, + "version": "0.0.1" + }, + "paths": { + "/api/createApi": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "创建基础api", + "parameters": [ + { + "description": "api路径, api中文描述, api组, 方法", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysApi" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/deleteApi": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "删除api", + "parameters": [ + { + "description": "ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysApi" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/deleteApisByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "删除选中Api", + "parameters": [ + { + "description": "ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/getAllApis": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "获取所有的Api 不分页", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/getApiById": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "根据id获取api", + "parameters": [ + { + "description": "根据id获取api", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/getApiList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "分页获取API列表", + "parameters": [ + { + "description": "分页获取API列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SearchApiParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/api/updateApi": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "更新基础api", + "parameters": [ + { + "description": "api路径, api中文描述, api组, 方法", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysApi" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/createApplication": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "创建Application", + "parameters": [ + { + "description": "创建Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/deleteApplication": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "删除Application", + "parameters": [ + { + "description": "删除Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/deleteApplicationByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "批量删除Application", + "parameters": [ + { + "description": "批量删除Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/findApplication": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "用id查询Application", + "parameters": [ + { + "description": "用id查询Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/getApplicationList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "分页获取Application列表", + "parameters": [ + { + "description": "分页获取Application列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ApplicationSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/application/updateApplication": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Applicationv0.0.0" + ], + "summary": "更新Application", + "parameters": [ + { + "description": "更新Application", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Application" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/copyAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "拷贝角色", + "parameters": [ + { + "description": "旧角色id, 新权限id, 新权限名, 新父角色id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/response.SysAuthorityCopyResponse" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"拷贝成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/createAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "创建角色", + "parameters": [ + { + "description": "权限id, 权限名, 父角色id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysAuthority" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/deleteAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "删除角色", + "parameters": [ + { + "description": "删除角色", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysAuthority" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/getAuthorityList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "分页获取角色列表", + "parameters": [ + { + "description": "页码, 每页大小", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/authority/updateAuthority": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Authority" + ], + "summary": "更新角色信息", + "parameters": [ + { + "description": "权限id, 权限名, 父角色id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysAuthority" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "编辑banner【v1.1.0新增】", + "parameters": [ + { + "description": "id,data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateBanner" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "创建banner【v1.1.0新增】", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CreateBanner" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner/batchDelBanner": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "批量删除banner【v1.1.0新增】", + "parameters": [ + { + "description": "ids", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner/down-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "下移banner排序【v1.1.0新增】", + "parameters": [ + { + "description": "id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/banner/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "分页获取banner列表【v1.1.0新增】", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "状态 0=下架 1=上架", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.BannerListResponse" + } + } + } + } + } + }, + "/banner/up-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "banner" + ], + "summary": "上移banner排序【v1.1.0新增】", + "parameters": [ + { + "description": "id,page,pageSize...", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/captcha": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Base" + ], + "summary": "生成验证码", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"验证码获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/chain": { + "get": { + "tags": [ + "Chain" + ], + "summary": "获取区块链数据", + "parameters": [ + { + "type": "string", + "description": "区块/合约hash", + "name": "hash", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.ChainResp" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/login": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "Base" + ], + "summary": "用户登录", + "parameters": [ + { + "description": "用户名, 密码, 验证码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Login" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"登陆成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-fund-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台奖励账户数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.AdminFundData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-fund-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台奖励账户列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.AdminBillFund" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/admin-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/customer-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "用户账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/customer-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "用户账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/influence-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/influence-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家账单数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BillData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-fund-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家营销账户数据", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.SellerFundData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-fund-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家营销账户记录列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:进行中 2:已完成 3:已失败", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "transaction_type", + "in": "query" + }, + { + "type": "string", + "description": "uuid", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SellerBillFund" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/bill/seller-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家账单列表", + "parameters": [ + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "是否已到账 1-是 2-否", + "name": "receipt", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + }, + { + "type": "integer", + "description": "类型 1-支出 2-收入", + "name": "status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.BillList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/business": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "用id查询商家", + "parameters": [ + { + "description": "用id查询Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/response.StoreInfoItem" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "更新商家", + "parameters": [ + { + "description": "更新Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SellerStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Businessv0.0.0" + ], + "summary": "创建Business", + "parameters": [ + { + "description": "创建Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SellerStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Businessv0.0.0" + ], + "summary": "删除Business", + "parameters": [ + { + "description": "删除Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SellerStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/business/deleteBusinessByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Businessv0.0.0" + ], + "summary": "批量删除商家", + "parameters": [ + { + "description": "批量删除Business", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/business/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "商家列表", + "parameters": [ + { + "description": "分页获取商家列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.SellerStoreInfo" + } + } + } + } + }, + "/business/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Business" + ], + "summary": "商家搜索", + "parameters": [ + { + "description": "分页获取商家列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SearchStore" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.SellerStoreInfo" + } + } + } + } + }, + "/casbin/UpdateCasbin": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Casbin" + ], + "summary": "更新角色api权限", + "parameters": [ + { + "description": "权限id, 权限模型列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CasbinInReceive" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/casbin/getPolicyPathByAuthorityId": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Casbin" + ], + "summary": "获取权限列表", + "parameters": [ + { + "description": "权限id, 权限模型列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CasbinInReceive" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/category": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "查询单个商品分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "更新分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.UpdateCategory" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "创建分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.CreateCategory" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "删除分类", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/category/children": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "查询分类下级", + "parameters": [ + { + "type": "integer", + "description": "父id", + "name": "pid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/category/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "category" + ], + "summary": "商品分类分页", + "parameters": [ + { + "type": "integer", + "description": "层级", + "name": "layer", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/dict/getDictDataList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "dict" + ], + "summary": "获取数据字典取值列表【v1.0】", + "parameters": [ + { + "type": "string", + "description": "取值 release_country=发布国家 release_channel=发布渠道 tag_type=标签类型", + "name": "typeCode", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/breakpointContinue": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "断点续传到服务器", + "parameters": [ + { + "type": "file", + "description": "an example for breakpoint resume, 断点续传示例", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"切片创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/findFile": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "创建文件", + "parameters": [ + { + "type": "file", + "description": "上传文件完成", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"file uploaded, 文件创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/removeChunk": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "删除切片", + "parameters": [ + { + "type": "file", + "description": "删除缓存切片", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"缓存切片删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/goods/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Goods" + ], + "summary": "商品列表", + "parameters": [ + { + "description": "分页获取商品列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.TbGoods4List" + } + } + } + } + }, + "/goods/search": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "tags": [ + "Goods" + ], + "summary": "商品搜索", + "parameters": [ + { + "description": "分页获取商品列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.TbGoods4List" + } + } + } + } + }, + "/menu/addBaseMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "新增菜单", + "parameters": [ + { + "description": "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/addMenuAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "增加menu和角色关联关系", + "parameters": [ + { + "description": "角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.AddMenuAuthorityInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/deleteBaseMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "删除菜单", + "parameters": [ + { + "description": "菜单id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getBaseMenuById": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "根据id获取菜单", + "parameters": [ + { + "description": "菜单id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getBaseMenuTree": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取用户动态路由", + "parameters": [ + { + "description": "空", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Empty" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取用户动态路由", + "parameters": [ + { + "description": "空", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Empty" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenuAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取指定角色menu", + "parameters": [ + { + "description": "角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetAuthorityId" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenuForList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "AuthorityMenu" + ], + "summary": "获取用户动态路由List", + "parameters": [ + { + "description": "空", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.Empty" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/getMenuList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "分页获取基础menu列表", + "parameters": [ + { + "description": "页码, 每页大小", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/menu/updateBaseMenu": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Menu" + ], + "summary": "更新菜单", + "parameters": [ + { + "description": "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/add-video": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "创建任务视频", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.AddMissionVideo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/claim-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务领取列表", + "parameters": [ + { + "type": "integer", + "description": "任务id", + "name": "mission_id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:已领取待发货 2:已发货 3:已收货推广中", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "任务标题", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "网红用户ID", + "name": "uuid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionClaimSimpleData" + } + } + } + } + } + }, + "/mission/claim-order": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务订单详情【v1.0】", + "parameters": [ + { + "type": "string", + "description": "订单编号", + "name": "order_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "$ref": "#/definitions/response.MissionClaimOrderResponse" + } + } + } + } + }, + "/mission/claim-order-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务订单列表【v1.0】", + "parameters": [ + { + "type": "string", + "description": "收件人姓名", + "name": "address_name", + "in": "query" + }, + { + "type": "string", + "description": "收件人手机号", + "name": "address_phone", + "in": "query" + }, + { + "type": "string", + "description": "任务标题", + "name": "mission_title", + "in": "query" + }, + { + "type": "string", + "description": "订单id", + "name": "order_id", + "in": "query" + }, + { + "type": "string", + "description": "订单时间结束", + "name": "order_time_end", + "in": "query" + }, + { + "type": "string", + "description": "订单时间起始", + "name": "order_time_start", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "string", + "description": "商品编号", + "name": "spu_no", + "in": "query" + }, + { + "type": "integer", + "description": "状态 2:待发货 3:已发货", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "网红用户ID", + "name": "uuid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionClaimOrderDetail" + } + } + } + } + } + }, + "/mission/claim-video-detail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "任务视频审核详情【v1.0】", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionClaimVideoDetail" + } + } + } + } + } + }, + "/mission/edit-video": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "编辑任务视频", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.EditMissionVideo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"编辑成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/influencer-summary-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取网红任务统计列表", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "name": "uuid", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionClaimSummary" + } + } + } + } + } + }, + "/mission/mission": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务详情", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "$ref": "#/definitions/model.MissionDetail" + } + } + } + } + }, + "/mission/mission-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务列表", + "parameters": [ + { + "type": "integer", + "description": "是否有视频 1:是 2:否", + "name": "has_video", + "in": "query" + }, + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "$ref": "#/definitions/response.PageResult" + } + } + } + } + }, + "/mission/recommend/add-data": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission/recommend" + ], + "summary": "创建任务推荐关联", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.AddMissionRecommend" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/batch-del-data": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "批量删除任务推荐关联", + "parameters": [ + { + "description": "ids", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsUReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/down-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "上移任务推荐排序", + "parameters": [ + { + "description": "id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "分页获取任务推荐列表", + "parameters": [ + { + "type": "integer", + "description": "是否有视频 1:是 2:否", + "name": "has_video", + "in": "query" + }, + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionRecommendResponse" + } + } + } + } + } + }, + "/mission/recommend/up-data": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "上移任务推荐排序", + "parameters": [ + { + "description": "id,page,pageSize...", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/recommend/update-sort": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission/recommend" + ], + "summary": "修改任务推荐排序", + "parameters": [ + { + "description": "id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/global.BASE_ID_SORT" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/send-sys-reward": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "发送系统任务奖励", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/stop": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "结束任务", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.IdReq" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/stop-detail": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission" + ], + "summary": "获取任务结束详情", + "parameters": [ + { + "type": "integer", + "description": "id", + "name": "id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/response.MissionStopData" + } + } + } + } + }, + "/mission/stop-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mission" + ], + "summary": "分页获取任务结束申请列表", + "parameters": [ + { + "type": "integer", + "description": "审核状态 1:待审核 2:审核通过 3:审核不通过 4:已审核=审核通过+审核不通过", + "name": "audit_status", + "in": "query" + }, + { + "type": "integer", + "description": "是否有视频 1:是 2:否", + "name": "has_video", + "in": "query" + }, + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionStopData" + } + } + } + } + } + }, + "/mission/sys-reward-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取平台奖励列表【v1.0】", + "parameters": [ + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "时间结束", + "name": "time_end", + "in": "query" + }, + { + "type": "string", + "description": "时间起始", + "name": "time_start", + "in": "query" + }, + { + "type": "string", + "description": "标题", + "name": "title", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysMissionReward" + } + } + } + } + } + }, + "/mission/tag-relation": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "打标签", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.CreateMissionTagRelation" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/mission/video-list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "mission" + ], + "summary": "获取任务视频列表", + "parameters": [ + { + "type": "integer", + "description": "佣金类型 1:固定佣金 2:比例抽成", + "name": "hire_type", + "in": "query" + }, + { + "type": "string", + "description": "网红账号", + "name": "mission_claim_by", + "in": "query" + }, + { + "type": "integer", + "description": "任务ID", + "name": "mission_id", + "in": "query" + }, + { + "type": "string", + "description": "筛选任务时间", + "name": "mission_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "商家邮箱", + "name": "seller_email", + "in": "query" + }, + { + "type": "string", + "description": "商家ID", + "name": "seller_id", + "in": "query" + }, + { + "type": "integer", + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "name": "source_type", + "in": "query" + }, + { + "type": "integer", + "description": "状态 1:未开始 2:进行中 3:已结束", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "名称", + "name": "title", + "in": "query" + }, + { + "type": "string", + "description": "视频发布渠道", + "name": "video_channel_id", + "in": "query" + }, + { + "type": "integer", + "description": "视频状态 1:待审核 2:审核通过 3:审核不通过", + "name": "video_status", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/response.MissionVideoResponse" + } + } + } + } + } + }, + "/order/detail": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "order" + ], + "summary": "获取订单详情", + "parameters": [ + { + "type": "string", + "description": "订单号", + "name": "orderID", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/model.OrderDetail" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/order/list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "order" + ], + "summary": "获取订单列表", + "parameters": [ + { + "type": "string", + "description": "网红码?", + "name": "code", + "in": "query" + }, + { + "type": "string", + "description": "订单下单时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "下单截至时间", + "name": "createdAtEnd", + "in": "query" + }, + { + "type": "string", + "description": "下单起始时间", + "name": "createdAtStart", + "in": "query" + }, + { + "type": "integer", + "description": "商品id", + "name": "goodsID", + "in": "query" + }, + { + "type": "string", + "description": "网红id", + "name": "influenceId", + "in": "query" + }, + { + "type": "string", + "description": "任务名称", + "name": "missionTitle", + "in": "query" + }, + { + "type": "string", + "description": "收件人姓名", + "name": "name", + "in": "query" + }, + { + "type": "string", + "description": "订单号", + "name": "orderID", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "收件人电话", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "description": "spu_no", + "name": "spu_no", + "in": "query" + }, + { + "type": "integer", + "description": "订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "商户编号", + "name": "storeNo", + "in": "query" + }, + { + "type": "string", + "description": "用户id", + "name": "userId", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.OrderList" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/order/statistic": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "order" + ], + "summary": "获取数据统计", + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.DataStatistics" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/createOrganization": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "创建Organization", + "parameters": [ + { + "description": "创建Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/deleteOrganization": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "删除Organization", + "parameters": [ + { + "description": "删除Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/deleteOrganizationByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "批量删除Organization", + "parameters": [ + { + "description": "批量删除Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/findOrganization": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "用id查询Organization", + "parameters": [ + { + "description": "用id查询Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/getOrganizationList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "分页获取Organization列表", + "parameters": [ + { + "description": "分页获取Organization列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.OrganizationSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/organization/updateOrganization": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Organizationv0.0.0" + ], + "summary": "更新Organization", + "parameters": [ + { + "description": "更新Organization", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Organization" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/createProvider": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "创建Provider", + "parameters": [ + { + "description": "创建Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/deleteProvider": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "删除Provider", + "parameters": [ + { + "description": "删除Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/deleteProviderByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "批量删除Provider", + "parameters": [ + { + "description": "批量删除Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/findProvider": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "用id查询Provider", + "parameters": [ + { + "description": "用id查询Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/getProviderList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "分页获取Provider列表", + "parameters": [ + { + "description": "分页获取Provider列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ProviderSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/provider/updateProvider": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Providerv0.0.0" + ], + "summary": "更新Provider", + "parameters": [ + { + "description": "更新Provider", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.Provider" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/suser/deleteUser": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "删除用户", + "parameters": [ + { + "description": "用户ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.GetById" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/suser/getUserList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "分页获取用户列表", + "parameters": [ + { + "description": "页码, 每页大小", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SearchSysUserParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/createSysOperationRecord": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "创建SysOperationRecord", + "parameters": [ + { + "description": "创建SysOperationRecord", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysOperationRecord" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/deleteSysOperationRecord": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "删除SysOperationRecord", + "parameters": [ + { + "description": "SysOperationRecord模型", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysOperationRecord" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/deleteSysOperationRecordByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "批量删除SysOperationRecord", + "parameters": [ + { + "description": "批量删除SysOperationRecord", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/findSysOperationRecord": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "用id查询SysOperationRecord", + "parameters": [ + { + "description": "Id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysOperationRecord" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/sysOperationRecord/getSysOperationRecordList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysOperationRecord" + ], + "summary": "分页获取SysOperationRecord列表", + "parameters": [ + { + "description": "页码, 每页大小, 搜索条件", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SysOperationRecordSearch" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/getSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "System" + ], + "summary": "获取配置文件内容", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/reloadSystem": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "System" + ], + "summary": "重启系统", + "responses": { + "200": { + "description": "{\"code\":0,\"data\":{},\"msg\":\"重启系统成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/setSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "System" + ], + "summary": "设置配置文件内容", + "parameters": [ + { + "description": "设置配置文件内容", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.System" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"设置成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/tags": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "编辑标签", + "parameters": [ + { + "description": "id,data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.TagsCommon" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "创建标签", + "parameters": [ + { + "description": "data", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.TagsCommon" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"创建成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/tags/batchDelTags": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "批量删除标签", + "parameters": [ + { + "description": "ids", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/tags/list": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "分页获取标签列表", + "parameters": [ + { + "type": "integer", + "name": "id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "标签类型 01-任务 02-任务视频 03-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "值", + "name": "value", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Tags" + } + } + } + } + } + } + }, + "/tags/relationTags": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "tags" + ], + "summary": "获取关联标签列表", + "parameters": [ + { + "type": "string", + "name": "relation_id", + "in": "query" + }, + { + "type": "string", + "name": "relation_type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TagsDesc" + } + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "tags": [ + "tags" + ], + "summary": "打标签", + "parameters": [ + { + "description": "params", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.CreateTagRelation" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 200, \"data\": {}}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/changePassword": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "用户修改密码", + "parameters": [ + { + "description": "用户名, 原密码, 新密码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.ChangePasswordStruct" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/createUser": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "创建User", + "parameters": [ + { + "description": "创建User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/deleteUser": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "删除User", + "parameters": [ + { + "description": "删除User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/deleteUserByIds": { + "delete": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "批量删除User", + "parameters": [ + { + "description": "批量删除User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"批量删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/findUser": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "用id查询User", + "parameters": [ + { + "type": "string", + "description": "用户id", + "name": "user_id", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"查询成功\"}", + "schema": { + "$ref": "#/definitions/model.UserSimple" + } + } + } + } + }, + "/user/getUserInfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "获取用户信息", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/getUserList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "分页获取User列表", + "parameters": [ + { + "type": "string", + "description": "用户邮箱", + "name": "email", + "in": "query" + }, + { + "type": "string", + "name": "end_time", + "in": "query" + }, + { + "type": "string", + "name": "id_forbidden", + "in": "query" + }, + { + "type": "string", + "description": "昵称", + "name": "nick_name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户手机号", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "name": "start_time", + "in": "query" + }, + { + "type": "string", + "description": "customer-普通用户 influencer-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.UserSimple" + } + } + } + }, + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "分页获取系统User列表", + "parameters": [ + { + "type": "string", + "description": "用户邮箱", + "name": "email", + "in": "query" + }, + { + "type": "string", + "name": "end_time", + "in": "query" + }, + { + "type": "string", + "name": "id_forbidden", + "in": "query" + }, + { + "type": "string", + "description": "昵称", + "name": "nick_name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户手机号", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "name": "start_time", + "in": "query" + }, + { + "type": "string", + "description": "customer-普通用户 influencer-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.UserSimple" + } + } + } + } + }, + "/user/getUserSelectList": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "获取用户选择器列表", + "parameters": [ + { + "type": "string", + "description": "nickName", + "name": "nickName", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/platformAuth": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "获取网红认证审核记录", + "parameters": [ + { + "type": "string", + "description": "用户邮箱", + "name": "email", + "in": "query" + }, + { + "type": "string", + "name": "end_time", + "in": "query" + }, + { + "type": "string", + "name": "id_forbidden", + "in": "query" + }, + { + "type": "string", + "description": "昵称", + "name": "nick_name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "用户手机号", + "name": "phone", + "in": "query" + }, + { + "type": "string", + "description": "平台", + "name": "platform", + "in": "query" + }, + { + "type": "string", + "name": "start_time", + "in": "query" + }, + { + "type": "string", + "description": "认证状态 0:未认证 1:已认证 2:认证失败", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "customer-普通用户 influencer-网红", + "name": "type", + "in": "query" + }, + { + "type": "string", + "name": "username", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "$ref": "#/definitions/model.PlatformAuthSimple" + } + } + } + }, + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "网红认证审核", + "parameters": [ + { + "description": "分页获取User列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PlatformAuthCheck" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/register": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "用户注册账号", + "parameters": [ + { + "description": "用户名, 昵称, 密码, 角色ID,姓名,手机", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysUser" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"注册成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserAuthorities": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "设置用户权限", + "parameters": [ + { + "description": "用户UUID, 角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SetUserAuthorities" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "设置用户权限", + "parameters": [ + { + "description": "用户UUID, 角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SetUserAuth" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserInfo": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "设置用户信息", + "parameters": [ + { + "description": "ID, 用户名, 昵称, 头像链接", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.SysUser" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"设置成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/updateUser": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "更新User", + "parameters": [ + { + "description": "更新User", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/model.User" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/userStatus": { + "put": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "User" + ], + "summary": "用户禁用启用", + "parameters": [ + { + "description": "分页获取User列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UserStatus" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wallet/fund/recharge": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "wallet" + ], + "summary": "奖励账户充值", + "parameters": [ + { + "description": "data...", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.FundRecharge" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/admin-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台提现数据", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.BkbData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/admin-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "平台提现列表", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Withdrawal" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/influence-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红提现数据", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.InfluenceWithdrawalData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/influence-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "网红提现列表", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Withdrawal" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/seller-data": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家提现数据", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "$ref": "#/definitions/response.SellerWithdrawalData" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/seller-examine": { + "post": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家提现审核", + "parameters": [ + { + "description": "data...", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.ExamineWithdrawal" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "string" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/seller-list": { + "get": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "商家提现列表", + "parameters": [ + { + "type": "string", + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "name": "check_status", + "in": "query" + }, + { + "type": "string", + "description": "处理状态 0:待处理 1:已处理", + "name": "deal_status", + "in": "query" + }, + { + "type": "string", + "description": "结束时间", + "name": "end_time", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "开始时间", + "name": "start_time", + "in": "query" + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Withdrawal" + } + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/withdrawal/status": { + "put": { + "security": [ + { + "Bearer": [] + } + ], + "tags": [ + "bill" + ], + "summary": "手动提现打款状态", + "parameters": [ + { + "description": "data...", + "name": "data", + "in": "body", + "schema": { + "$ref": "#/definitions/request.TransferResult" + } + } + ], + "responses": { + "200": { + "description": "{\"code\": 0, \"data\": [...]}", + "schema": { + "type": "string" + } + }, + "201": { + "description": "{\"code\": 1, \"message\": \"\"}", + "schema": { + "type": "string" + } + } + } + } + } + }, + "definitions": { + "config.AliyunOSS": { + "type": "object", + "properties": { + "accessKeyId": { + "type": "string" + }, + "accessKeySecret": { + "type": "string" + }, + "bucketName": { + "type": "string" + }, + "bucketUrl": { + "type": "string" + }, + "endpoint": { + "type": "string" + } + } + }, + "config.Autocode": { + "type": "object", + "properties": { + "root": { + "type": "string" + }, + "server": { + "type": "string" + }, + "serverApi": { + "type": "string" + }, + "serverInitialize": { + "type": "string" + }, + "serverModel": { + "type": "string" + }, + "serverRequest": { + "type": "string" + }, + "serverRouter": { + "type": "string" + }, + "serverService": { + "type": "string" + }, + "transferRestart": { + "type": "boolean" + }, + "web": { + "type": "string" + }, + "webApi": { + "type": "string" + }, + "webFlow": { + "type": "string" + }, + "webForm": { + "type": "string" + }, + "webTable": { + "type": "string" + } + } + }, + "config.Captcha": { + "type": "object", + "properties": { + "imgHeight": { + "description": "验证码高度", + "type": "integer" + }, + "imgWidth": { + "description": "验证码宽度", + "type": "integer" + }, + "keyLong": { + "description": "验证码长度", + "type": "integer" + } + } + }, + "config.Casbin": { + "type": "object", + "properties": { + "modelPath": { + "description": "存放casbin模型的相对路径", + "type": "string" + } + } + }, + "config.Detail": { + "type": "object", + "properties": { + "compareField": { + "description": "需要比较时间的字段", + "type": "string" + }, + "interval": { + "description": "时间间隔", + "type": "string" + }, + "tableName": { + "description": "需要清理的表名", + "type": "string" + } + } + }, + "config.Email": { + "type": "object", + "properties": { + "from": { + "description": "收件人", + "type": "string" + }, + "host": { + "description": "服务器地址", + "type": "string" + }, + "isSSL": { + "description": "是否SSL", + "type": "boolean" + }, + "nickname": { + "description": "昵称", + "type": "string" + }, + "port": { + "description": "端口", + "type": "integer" + }, + "secret": { + "description": "密钥", + "type": "string" + }, + "to": { + "description": "收件人:多个以英文逗号分隔", + "type": "string" + } + } + }, + "config.Excel": { + "type": "object", + "properties": { + "dir": { + "type": "string" + } + } + }, + "config.GormSettings": { + "type": "object", + "properties": { + "settings": { + "type": "array", + "items": { + "$ref": "#/definitions/config.Settings" + } + } + } + }, + "config.JPush": { + "type": "object", + "properties": { + "allUserSign": { + "description": "所有用户标签", + "type": "string" + }, + "androidIntent": { + "description": "安卓厂商通道包名", + "type": "string" + }, + "appkey": { + "description": "appkey", + "type": "string" + }, + "secret": { + "description": "密钥", + "type": "string" + } + } + }, + "config.JWT": { + "type": "object", + "properties": { + "bufferTime": { + "description": "缓冲时间", + "type": "integer" + }, + "expiresTime": { + "description": "过期时间", + "type": "integer" + }, + "signingKey": { + "description": "jwt签名", + "type": "string" + } + } + }, + "config.Local": { + "type": "object", + "properties": { + "path": { + "description": "本地文件路径", + "type": "string" + } + } + }, + "config.Minio": { + "type": "object", + "properties": { + "accessKeyID": { + "description": "用户ID", + "type": "string" + }, + "endpoint": { + "description": "端点", + "type": "string" + }, + "secretAccessKey": { + "description": "密钥", + "type": "string" + }, + "useSSL": { + "description": "是否使用ssl", + "type": "boolean" + } + } + }, + "config.Mysql": { + "type": "object", + "properties": { + "config": { + "description": "高级配置", + "type": "string" + }, + "dbname": { + "description": "数据库名", + "type": "string" + }, + "logMode": { + "description": "是否开启Gorm全局日志", + "type": "string" + }, + "logZap": { + "description": "是否通过zap写入日志文件", + "type": "boolean" + }, + "maxIdleConns": { + "description": "空闲中的最大连接数", + "type": "integer" + }, + "maxOpenConns": { + "description": "打开到数据库的最大连接数", + "type": "integer" + }, + "password": { + "description": "数据库密码", + "type": "string" + }, + "path": { + "description": "服务器地址:端口", + "type": "string" + }, + "username": { + "description": "数据库用户名", + "type": "string" + } + } + }, + "config.Paypal": { + "type": "object", + "properties": { + "cancel-url": { + "description": "取消支付跳转", + "type": "string" + }, + "client-id": { + "description": "用户ID", + "type": "string" + }, + "env": { + "description": "端点", + "type": "string" + }, + "notify-url": { + "description": "支付结果通知", + "type": "string" + }, + "return-url": { + "description": "支付完成跳转", + "type": "string" + }, + "secret": { + "description": "密钥", + "type": "string" + } + } + }, + "config.Qiniu": { + "type": "object", + "properties": { + "accessKey": { + "description": "秘钥AK", + "type": "string" + }, + "bucket": { + "description": "空间名称", + "type": "string" + }, + "imgPath": { + "description": "CDN加速域名", + "type": "string" + }, + "secretKey": { + "description": "秘钥SK", + "type": "string" + }, + "useCdnDomains": { + "description": "上传是否使用CDN上传加速", + "type": "boolean" + }, + "useHttps": { + "description": "是否使用https", + "type": "boolean" + }, + "zone": { + "description": "存储区域", + "type": "string" + } + } + }, + "config.Redis": { + "type": "object", + "properties": { + "addr": { + "description": "服务器地址:端口", + "type": "string" + }, + "db": { + "description": "redis的哪个数据库", + "type": "integer" + }, + "password": { + "description": "密码", + "type": "string" + } + } + }, + "config.Server": { + "type": "object", + "properties": { + "aliyunOSS": { + "$ref": "#/definitions/config.AliyunOSS" + }, + "autoCode": { + "description": "auto", + "allOf": [ + { + "$ref": "#/definitions/config.Autocode" + } + ] + }, + "captcha": { + "$ref": "#/definitions/config.Captcha" + }, + "casbin": { + "$ref": "#/definitions/config.Casbin" + }, + "email": { + "$ref": "#/definitions/config.Email" + }, + "excel": { + "$ref": "#/definitions/config.Excel" + }, + "gormSettings": { + "$ref": "#/definitions/config.GormSettings" + }, + "jpush": { + "$ref": "#/definitions/config.JPush" + }, + "jwt": { + "$ref": "#/definitions/config.JWT" + }, + "local": { + "$ref": "#/definitions/config.Local" + }, + "minio": { + "description": "oss", + "allOf": [ + { + "$ref": "#/definitions/config.Minio" + } + ] + }, + "mysql": { + "description": "gorm", + "allOf": [ + { + "$ref": "#/definitions/config.Mysql" + } + ] + }, + "paypal": { + "$ref": "#/definitions/config.Paypal" + }, + "qiniu": { + "$ref": "#/definitions/config.Qiniu" + }, + "redis": { + "$ref": "#/definitions/config.Redis" + }, + "system": { + "$ref": "#/definitions/config.System" + }, + "tencentCOS": { + "$ref": "#/definitions/config.TencentCOS" + }, + "timer": { + "$ref": "#/definitions/config.Timer" + }, + "zap": { + "$ref": "#/definitions/config.Zap" + } + } + }, + "config.Settings": { + "type": "object", + "properties": { + "bindTables": { + "type": "array", + "items": {} + }, + "dsnName": { + "type": "string" + } + } + }, + "config.System": { + "type": "object", + "properties": { + "addr": { + "description": "端口值", + "type": "integer" + }, + "dbType": { + "description": "数据库类型:mysql(默认)|sqlite|sqlserver|postgresql", + "type": "string" + }, + "env": { + "description": "环境值", + "type": "string" + }, + "ossType": { + "description": "Oss类型", + "type": "string" + }, + "useMultipoint": { + "description": "多点登录拦截", + "type": "boolean" + } + } + }, + "config.TencentCOS": { + "type": "object", + "properties": { + "baseURL": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "pathPrefix": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretID": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + }, + "config.Timer": { + "type": "object", + "properties": { + "detail": { + "type": "array", + "items": { + "$ref": "#/definitions/config.Detail" + } + }, + "spec": { + "description": "CRON表达式", + "type": "string" + }, + "start": { + "description": "是否启用", + "type": "boolean" + } + } + }, + "config.Zap": { + "type": "object", + "properties": { + "director": { + "description": "日志文件夹", + "type": "string" + }, + "encodeLevel": { + "description": "编码级", + "type": "string" + }, + "format": { + "description": "输出", + "type": "string" + }, + "level": { + "description": "级别", + "type": "string" + }, + "linkName": { + "description": "软链接名称", + "type": "string" + }, + "logInConsole": { + "description": "输出控制台", + "type": "boolean" + }, + "prefix": { + "description": "日志前缀", + "type": "string" + }, + "showLine": { + "description": "显示行", + "type": "boolean" + }, + "stacktraceKey": { + "description": "栈名", + "type": "string" + } + } + }, + "global.BASE_ID_SORT": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "sort": { + "type": "integer" + } + } + }, + "model.Account": { + "type": "object", + "properties": { + "account_name": { + "description": "户名", + "type": "string" + }, + "address": { + "description": "收款人地址", + "type": "string" + }, + "bank_code": { + "description": "收款行", + "type": "string" + }, + "card_number": { + "description": "银行卡号", + "type": "string" + }, + "country": { + "description": "国家/地区", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "currency": { + "description": "币种 USD:美元", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "idCard": { + "description": "身份证", + "type": "string" + }, + "is_default": { + "description": "是否为默认 0:非默认 1:默认", + "type": "boolean" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "platform": { + "description": "平台 saller(买家端) / customer(客户端) / influencer(网红端)", + "type": "string" + }, + "sort": { + "description": "排序值", + "type": "integer" + }, + "swift_code": { + "description": "银行国际代码", + "type": "string" + }, + "type": { + "description": "类型 1:paypal 2:银行卡", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userID": { + "description": "用户id", + "type": "string" + } + } + }, + "model.AdminBillFund": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserClaimView" + } + ] + }, + "price": { + "description": "金额", + "type": "number" + }, + "related_id": { + "description": "关联id 任务id", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "状态 1:进行中 2:已完成 3:已失败", + "type": "integer" + }, + "transaction_id": { + "description": "交易编号", + "type": "string" + }, + "transaction_type": { + "description": "类型 1-支出 2-收入", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_id": { + "type": "string" + } + } + }, + "model.Application": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "clientID": { + "description": "客户端ID", + "type": "string" + }, + "clientSecret": { + "description": "客户端密钥", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "logo": { + "description": "应用logo", + "type": "string" + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "provider": { + "description": "提供者", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.BillList": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "platform": { + "description": "平台 seller / customer / influencer", + "type": "string" + }, + "price": { + "description": "金额", + "type": "number" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "类型 1-支出 2-收入", + "type": "integer" + }, + "title": { + "description": "标题", + "type": "string" + }, + "transaction_id": { + "description": "交易编号", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "description": "用户信息", + "allOf": [ + { + "$ref": "#/definitions/model.UserView" + } + ] + }, + "user_id": { + "description": "用户id", + "type": "string" + } + } + }, + "model.Chain": { + "type": "object", + "properties": { + "address": { + "description": "合约地址", + "type": "string" + } + } + }, + "model.InfluencerUserClaimView": { + "type": "object", + "properties": { + "claim_no": { + "type": "string" + }, + "nick_name": { + "description": "昵称", + "type": "string" + }, + "phone": { + "description": "电话", + "type": "string" + }, + "uuid": { + "description": "用户uuid", + "type": "string" + } + } + }, + "model.InfluencerUserDesc": { + "type": "object", + "properties": { + "avatar": { + "description": "头像", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "email": { + "description": "用户邮箱", + "type": "string" + }, + "forbidden_operation": { + "description": "禁用操作人", + "type": "string" + }, + "forbidden_reason": { + "description": "禁用原因", + "type": "string" + }, + "forbidden_time": { + "description": "禁用时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "id_forbidden": { + "description": "TagsStr interface{} `gorm:\"-\" json:\"tags\"` //个人标签", + "type": "boolean" + }, + "nickName": { + "description": "昵称", + "type": "string" + }, + "phone": { + "description": "电话", + "type": "string" + }, + "platform": { + "description": "平台及地址" + }, + "tags": { + "description": "个人标签", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "uuid": { + "description": "用户uuid编码", + "type": "string" + } + } + }, + "model.InfluencerUserView": { + "type": "object", + "properties": { + "nick_name": { + "description": "昵称", + "type": "string" + }, + "phone": { + "description": "电话", + "type": "string" + }, + "uuid": { + "description": "用户uuid", + "type": "string" + } + } + }, + "model.Meta": { + "type": "object", + "properties": { + "closeTab": { + "description": "自动关闭tab", + "type": "boolean" + }, + "defaultMenu": { + "description": "是否是基础路由(开发中)", + "type": "boolean" + }, + "icon": { + "description": "菜单图标", + "type": "string" + }, + "keepAlive": { + "description": "是否缓存", + "type": "boolean" + }, + "title": { + "description": "菜单名", + "type": "string" + } + } + }, + "model.MissionClaimAddress": { + "type": "object", + "properties": { + "address_id": { + "description": "地址id", + "type": "integer" + }, + "bldg": { + "description": "apt,ste,bldg", + "type": "string" + }, + "city": { + "description": "city", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "default": { + "description": "是否默认地址 1-是 2-否", + "type": "integer" + }, + "firstName": { + "description": "first name", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "lastName": { + "description": "last name", + "type": "string" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "platform": { + "description": "平台 saller(买家端) / customer(客户端) / influencer(网红端)", + "type": "string" + }, + "state": { + "description": "state", + "type": "string" + }, + "street": { + "description": "street", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userId": { + "type": "string" + }, + "zipCode": { + "description": "zip code", + "type": "string" + } + } + }, + "model.MissionClaimDetail": { + "type": "object", + "properties": { + "achieve_num": { + "description": "完成数", + "type": "integer" + }, + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "hire_money": { + "description": "佣金", + "type": "number" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserView" + } + ] + }, + "mission": { + "description": "关联任务", + "allOf": [ + { + "$ref": "#/definitions/model.MissionDetail" + } + ] + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "order": { + "description": "任务订单", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimOrderInfo" + } + ] + }, + "status": { + "description": "状态 1:已领取待发货 2:已发货 3:已收货推广中", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video": { + "description": "上传视频", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimVideo" + } + ] + }, + "works": { + "description": "发布作品", + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionClaimWorks" + } + } + } + }, + "model.MissionClaimOrderDetail": { + "type": "object", + "properties": { + "address": { + "description": "任务订单地址", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimAddress" + } + ] + }, + "confirm_time": { + "description": "收货时间", + "type": "string" + }, + "courier": { + "description": "快递公司", + "type": "string" + }, + "courier_number": { + "description": "快递单号", + "type": "string" + }, + "courier_url": { + "description": "快递查询地址", + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "goods": { + "description": "任务订单商品", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimOrderGoods" + } + ] + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission_claim": { + "description": "任务领取记录", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimDetail" + } + ] + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "number": { + "description": "数量", + "type": "integer" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "send_time": { + "description": "发货时间", + "type": "string" + }, + "sku_no": { + "description": "sku编号", + "type": "string" + }, + "spu_no": { + "description": "spu编号", + "type": "string" + }, + "status": { + "description": "订单状态 2:待发货 3:已发货", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.MissionClaimOrderGoods": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "规格图片url", + "type": "string" + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "price": { + "description": "价格", + "type": "number" + }, + "sku_no": { + "description": "sku编号", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "title": { + "description": "名称", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.MissionClaimOrderInfo": { + "type": "object", + "properties": { + "courier": { + "description": "快递公司", + "type": "string" + }, + "courier_number": { + "description": "快递单号", + "type": "string" + }, + "courier_url": { + "description": "快递查询地址", + "type": "string" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "order_goods": { + "description": "订单商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimOrderGoods" + } + ] + }, + "order_id": { + "description": "订单号", + "type": "string" + }, + "send_time": { + "description": "发货时间", + "type": "string" + }, + "status": { + "description": "订单状态 2:待发货 3:已发货", + "type": "integer" + } + } + }, + "model.MissionClaimSummary": { + "type": "object", + "properties": { + "bonus": { + "description": "佣金", + "type": "number" + }, + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "count": { + "description": "接任务数", + "type": "integer" + }, + "create_by": { + "description": "网红ID", + "type": "string" + }, + "first_claim_at": { + "description": "首次领取任务时间", + "type": "string" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserView" + } + ] + }, + "order_num": { + "description": "订单数", + "type": "integer" + }, + "platform": { + "type": "string" + }, + "transit_bonus": { + "description": "在途佣金", + "type": "number" + } + } + }, + "model.MissionClaimVideo": { + "type": "object", + "properties": { + "cover": { + "description": "视频封面", + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "mission_id": { + "description": "任务ID", + "type": "integer" + }, + "remark": { + "description": "审核理由", + "type": "string" + }, + "source_type": { + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "type": "integer" + }, + "status": { + "description": "状态 1:待审核 2:审核通过 3:审核不通过", + "type": "integer" + }, + "update_by": { + "description": "修改人", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "model.MissionClaimView": { + "type": "object", + "properties": { + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "create_by": { + "description": "网红uuid", + "type": "string" + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "mission_title": { + "description": "任务标题", + "type": "string" + }, + "user": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.UserView" + } + ] + } + } + }, + "model.MissionClaimWorks": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "homepage": { + "description": "作品主页地址", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "作品凭证截图", + "type": "string" + }, + "mission_claim_id": { + "description": "领取任务id", + "type": "integer" + }, + "type": { + "description": "平台 1:ins 2:Pinterest 3:tk 4:Twitter 5:Facebook 6:Reddit", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "model.MissionDetail": { + "type": "object", + "properties": { + "claim_days": { + "description": "任务完成天数", + "type": "integer" + }, + "claim_demands": { + "description": "任务拍摄要求", + "type": "string" + }, + "claim_num": { + "description": "接任务人数", + "type": "integer" + }, + "claim_stock": { + "description": "可接任务库存", + "type": "integer" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "description": { + "description": "描述/卖点", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.TbGoods4List" + } + ] + }, + "goods_status": { + "description": "关联商品状态 1:正常 2:已下架", + "type": "integer" + }, + "has_sample": { + "description": "是否有样品 0:没有 1:有", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "num": { + "description": "商品数量", + "type": "integer" + }, + "order_num": { + "description": "订单数", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "sample_num": { + "description": "样品数量", + "type": "integer" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "status": { + "description": "状态 1:未开始 2:进行中 3:已结束", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "tags": { + "description": "标签", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_channel_ids": { + "description": "视频发布渠道,多个渠道英文逗号连接", + "type": "string" + }, + "video_claim_num": { + "description": "关联视频数量", + "type": "integer" + }, + "video_country_id": { + "description": "视频发布国家", + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "model.MissionRecommend": { + "type": "object", + "properties": { + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "relation_id": { + "description": "关联ID,任务视频ID,添加视频只需要传relationId", + "type": "integer" + }, + "sort": { + "description": "倒序 //排序", + "type": "integer" + }, + "status": { + "description": "状态 1:上架 2:下架", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderAddress": { + "type": "object", + "properties": { + "bldg": { + "description": "apt,ste,bldg", + "type": "string" + }, + "city": { + "description": "city", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "default": { + "description": "是否默认地址 1-是 2-否", + "type": "integer" + }, + "firstName": { + "description": "first name", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "lastName": { + "description": "last name", + "type": "string" + }, + "orderID": { + "type": "string" + }, + "phone": { + "description": "手机号", + "type": "string" + }, + "platform": { + "description": "平台 saller(买家端) / customer(客户端) / influencer(网红端)", + "type": "string" + }, + "state": { + "description": "state", + "type": "string" + }, + "street": { + "description": "street", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userId": { + "type": "string" + }, + "zipCode": { + "description": "zip code", + "type": "string" + } + } + }, + "model.OrderDeliver": { + "type": "object", + "properties": { + "courier": { + "description": "快递公司", + "type": "string" + }, + "courierLink": { + "description": "快递链接", + "type": "string" + }, + "courierNumber": { + "description": "快递单号", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "orderID": { + "description": "订单号", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderDetail": { + "type": "object", + "properties": { + "IAmount": { + "description": "网红佣金", + "type": "string" + }, + "SAmount": { + "description": "入账", + "type": "string" + }, + "address": { + "description": "地址", + "allOf": [ + { + "$ref": "#/definitions/model.OrderAddress" + } + ] + }, + "captureID": { + "description": "paypal收款确认id", + "type": "string" + }, + "chain": { + "description": "区块链", + "allOf": [ + { + "$ref": "#/definitions/model.Chain" + } + ] + }, + "code": { + "description": "网红码?", + "type": "string" + }, + "commodID": { + "description": "商品id", + "type": "integer" + }, + "confirmTime": { + "description": "收货时间", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "deliver": { + "description": "发货信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderDeliver" + } + ] + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderGoodsDetail" + } + ] + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "number": { + "description": "数量", + "type": "integer" + }, + "orderID": { + "description": "订单号", + "type": "string" + }, + "paidPrice": { + "description": "实付价格", + "type": "number" + }, + "payTime": { + "description": "付款时间", + "type": "string" + }, + "price": { + "description": "商品价格", + "type": "number" + }, + "sendTime": { + "description": "发货时间", + "type": "string" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "status": { + "description": "订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "类型 1-普通订单 2-预售订单", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userID": { + "description": "用户id", + "type": "string" + } + } + }, + "model.OrderGoodsDetail": { + "type": "object", + "properties": { + "content": { + "description": "详情", + "type": "string" + }, + "content_text": { + "description": "详情-文字", + "type": "string" + }, + "cover": { + "description": "封面图", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "goods_specs": { + "description": "商品规格", + "type": "array", + "items": { + "$ref": "#/definitions/model.OrderGoodsSpecs" + } + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "images": { + "description": "图片", + "type": "string" + }, + "orderID": { + "description": "订单id", + "type": "string" + }, + "price_max": { + "description": "最高规格价格", + "type": "number" + }, + "price_min": { + "description": "最低规格价格", + "type": "number" + }, + "retail_price": { + "description": "吊牌价(零售指导价)", + "type": "number" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "spu_no": { + "description": "编号", + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "title": { + "description": "名称", + "type": "string" + }, + "title_eng": { + "description": "英文名称", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderGoodsSpecs": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "goods_id": { + "description": "spu id", + "type": "integer" + }, + "goods_no": { + "description": "商品编号", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "规格图片url", + "type": "string" + }, + "orderGoodsId": { + "type": "integer" + }, + "orderID": { + "description": "订单id", + "type": "string" + }, + "price": { + "description": "价格", + "type": "number" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "spu_no": { + "description": "商品编号", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.OrderList": { + "type": "object", + "properties": { + "IAmount": { + "description": "网红佣金", + "type": "string" + }, + "SAmount": { + "description": "入账", + "type": "string" + }, + "address": { + "description": "地址", + "allOf": [ + { + "$ref": "#/definitions/model.OrderAddress" + } + ] + }, + "captureID": { + "description": "paypal收款确认id", + "type": "string" + }, + "code": { + "description": "网红码?", + "type": "string" + }, + "commodID": { + "description": "商品id", + "type": "integer" + }, + "confirmTime": { + "description": "收货时间", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "customerPhone": { + "description": "买家手机", + "type": "string" + }, + "deliver": { + "description": "发货信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderDeliver" + } + ] + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.OrderGoodsDetail" + } + ] + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserClaimView" + } + ] + }, + "number": { + "description": "数量", + "type": "integer" + }, + "orderID": { + "description": "订单号", + "type": "string" + }, + "paidPrice": { + "description": "实付价格", + "type": "number" + }, + "payTime": { + "description": "付款时间", + "type": "string" + }, + "price": { + "description": "商品价格", + "type": "number" + }, + "sendTime": { + "description": "发货时间", + "type": "string" + }, + "sku_no": { + "description": "商品规格编号", + "type": "string" + }, + "status": { + "description": "订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "类型 1-普通订单 2-预售订单", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userID": { + "description": "用户id", + "type": "string" + } + } + }, + "model.Organization": { + "type": "object", + "properties": { + "code": { + "description": "组织编码", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "组织名称", + "type": "string" + }, + "owner": { + "description": "组织所属", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.Platform": { + "type": "object", + "properties": { + "auth_msg": { + "description": "认证信息", + "type": "string" + }, + "auth_time": { + "description": "认证时间", + "type": "string" + }, + "check_user": { + "description": "审核人", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "image": { + "description": "图片", + "type": "string" + }, + "is_auth": { + "description": "是否认证 0:未认证 1:已认证 2:认证失败", + "type": "boolean" + }, + "platform": { + "description": "平台", + "type": "string" + }, + "platformName": { + "description": "平台名称", + "type": "string" + }, + "url": { + "description": "主页地址", + "type": "string" + } + } + }, + "model.PlatformAuthSimple": { + "type": "object", + "properties": { + "auth_msg": { + "description": "认证信息", + "type": "string" + }, + "auth_time": { + "description": "认证时间", + "type": "string" + }, + "check_user": { + "description": "审核人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "created_at": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "image": { + "description": "图片", + "type": "string" + }, + "is_auth": { + "description": "是否认证 0:未认证 1:已认证 2:认证失败", + "type": "boolean" + }, + "platform": { + "description": "平台", + "type": "string" + }, + "platformName": { + "description": "平台名称", + "type": "string" + }, + "status": { + "description": "认证状态 0:未认证 1:已认证 2:认证失败", + "type": "string" + }, + "tag_relation": { + "type": "array", + "items": { + "$ref": "#/definitions/model.TagRelationDesc" + } + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "url": { + "description": "主页地址", + "type": "string" + }, + "user": { + "$ref": "#/definitions/model.UserSimple" + }, + "user_id": { + "description": "用户ID", + "type": "string" + } + } + }, + "model.Provider": { + "type": "object", + "properties": { + "auth_uri": { + "description": "认证URI", + "type": "string" + }, + "category": { + "description": "提供者分类 1-社交 2-支付 3-媒体 4-其他", + "type": "string" + }, + "client_id": { + "description": "客户端ID", + "type": "string" + }, + "client_secret": { + "description": "客户端密钥", + "type": "string" + }, + "code": { + "description": "提供者代码 google facebook twitter tiktok", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "提供者名称", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "redirect_uri": { + "description": "重定向URI", + "type": "string" + }, + "scope": { + "description": "作用域", + "type": "string" + }, + "token_uri": { + "description": "令牌URI", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_info_uri": { + "description": "用户信息URI", + "type": "string" + } + } + }, + "model.SellerBillFund": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission": { + "description": "领取任务信息", + "allOf": [ + { + "$ref": "#/definitions/model.MissionClaimView" + } + ] + }, + "price": { + "description": "金额", + "type": "number" + }, + "related_id": { + "description": "关联id 任务id", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "seller": { + "description": "店铺信息", + "allOf": [ + { + "$ref": "#/definitions/model.StoreInfo" + } + ] + }, + "status": { + "description": "状态 1:进行中 2:已完成 3:已失败", + "type": "integer" + }, + "transaction_id": { + "description": "交易编号", + "type": "string" + }, + "transaction_type": { + "description": "类型 1-支出 2-收入", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_id": { + "description": "商家storeNo", + "type": "string" + } + } + }, + "model.SellerStore": { + "type": "object", + "properties": { + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "email": { + "description": "店铺联系email(注册账号email)", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "phone": { + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "1:个人店铺", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SellerStoreInfo": { + "type": "object", + "properties": { + "create_by": { + "description": "创建人", + "type": "string" + }, + "created_at": { + "type": "string" + }, + "email": { + "description": "店铺联系email(注册账号email)", + "type": "string" + }, + "goods_num": { + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "phone": { + "type": "string" + }, + "release_mission_nums": { + "description": "发布任务数", + "type": "integer" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "type": { + "description": "1:个人店铺", + "type": "integer" + }, + "valid_mission_num": { + "description": "有效任务数", + "type": "integer" + } + } + }, + "model.StoreInfo": { + "type": "object", + "properties": { + "email": { + "description": "联系方式", + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + } + } + }, + "model.SysApi": { + "type": "object", + "properties": { + "apiGroup": { + "description": "api组", + "type": "string" + }, + "appid": { + "description": "应用ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "description": { + "description": "api中文描述", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "method": { + "description": "方法:创建POST(默认)|查看GET|更新PUT|删除DELETE", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "path": { + "description": "api路径", + "type": "string" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SysAuthority": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "authorityDesc": { + "description": "角色描述", + "type": "string" + }, + "authorityId": { + "description": "角色ID", + "type": "integer" + }, + "authorityName": { + "description": "角色名", + "type": "string" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "defaultRouter": { + "description": "默认菜单(默认dashboard)", + "type": "string" + }, + "menus": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + }, + "organization": { + "description": "组织", + "type": "string" + }, + "parentId": { + "description": "父角色ID", + "type": "integer" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + } + } + }, + "model.SysBaseMenu": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "authoritys": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "children": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + }, + "component": { + "description": "对应前端文件路径", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "group": { + "description": "路由组", + "type": "string" + }, + "hidden": { + "description": "是否在列表隐藏", + "type": "boolean" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "meta": { + "description": "附加属性", + "allOf": [ + { + "$ref": "#/definitions/model.Meta" + } + ] + }, + "name": { + "description": "路由name", + "type": "string" + }, + "owner": { + "description": "组织所属", + "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenuParameter" + } + }, + "parentId": { + "description": "父菜单ID", + "type": "string" + }, + "path": { + "description": "路由path", + "type": "string" + }, + "sort": { + "description": "排序标记", + "type": "integer" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SysBaseMenuParameter": { + "type": "object", + "properties": { + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "key": { + "description": "地址栏携带参数的key", + "type": "string" + }, + "sysBaseMenuID": { + "type": "integer" + }, + "type": { + "description": "地址栏携带参数为params还是query", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "value": { + "description": "地址栏携带参数的值", + "type": "string" + } + } + }, + "model.SysMissionReward": { + "type": "object", + "properties": { + "achieve_num": { + "description": "已完成任务次数", + "type": "integer" + }, + "audit_by": { + "description": "审核人", + "type": "string" + }, + "bonus": { + "description": "奖励金额", + "type": "number" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "status": { + "description": "订单状态 1-待发放 2-发放中 3-已发放", + "type": "integer" + }, + "title": { + "description": "组件id", + "type": "string" + }, + "type": { + "description": "奖励类型 1.视频上传 2.信息完善 3.商家任务", + "type": "integer" + }, + "update_by": { + "description": "更新人", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.SysOperationRecord": { + "type": "object", + "properties": { + "agent": { + "description": "代理", + "type": "string" + }, + "apiDescription": { + "type": "string" + }, + "appid": { + "description": "应用ip", + "type": "string" + }, + "body": { + "description": "请求Body", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "error_message": { + "description": "错误信息", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "ip": { + "description": "请求ip", + "type": "string" + }, + "latency": { + "description": "延迟", + "type": "string" + }, + "method": { + "description": "请求方法", + "type": "string" + }, + "path": { + "description": "请求路径", + "type": "string" + }, + "resp": { + "description": "响应Body", + "type": "string" + }, + "status": { + "description": "请求状态", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "$ref": "#/definitions/model.SysUserSimple" + }, + "user_id": { + "description": "用户id", + "type": "integer" + } + } + }, + "model.SysUser": { + "type": "object", + "properties": { + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "authorityId": { + "description": "用户角色ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "fullName": { + "type": "string" + }, + "headerImg": { + "description": "用户头像", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "nickName": { + "description": "用户昵称", + "type": "string" + }, + "phone": { + "type": "string" + }, + "status": { + "description": "用户状态", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userName": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "description": "用户UUID", + "type": "string" + } + } + }, + "model.SysUserSimple": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "nickName": { + "type": "string" + }, + "userName": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "type": "string" + } + } + }, + "model.System": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/config.Server" + } + } + }, + "model.TagRelationDesc": { + "type": "object", + "properties": { + "id": { + "description": "主键", + "type": "integer" + }, + "name": { + "description": "标签名称", + "type": "string" + } + } + }, + "model.Tags": { + "type": "object", + "properties": { + "createBy": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "type": { + "description": "标签类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "updateBy": { + "description": "修改人", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "description": "用户信息", + "allOf": [ + { + "$ref": "#/definitions/model.SysUserSimple" + } + ] + }, + "value": { + "description": "值", + "type": "string" + } + } + }, + "model.TagsDesc": { + "type": "object", + "properties": { + "id": { + "description": "主键", + "type": "integer" + }, + "value": { + "description": "值", + "type": "string" + } + } + }, + "model.TbGoods4List": { + "type": "object", + "properties": { + "cover": { + "description": "封面图(未使用)", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "images": { + "description": "图片列表", + "type": "string" + }, + "price_max": { + "description": "最高规格价格", + "type": "number" + }, + "price_min": { + "description": "最低规格价格", + "type": "number" + }, + "retail_price": { + "description": "吊牌价(零售指导价)", + "type": "number" + }, + "sales": { + "description": "总销售量", + "type": "integer" + }, + "sales_30": { + "description": "30天销售量", + "type": "integer" + }, + "spu_no": { + "description": "编号", + "type": "string" + }, + "status": { + "description": "1:上架 2:下架 3:售罄", + "type": "integer" + }, + "stock": { + "description": "总库存", + "type": "integer" + }, + "tags": { + "description": "标签", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "title_eng": { + "description": "英文标题", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "model.User": { + "type": "object", + "properties": { + "appid": { + "description": "用户所属应用", + "type": "string" + }, + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "authority_id": { + "description": "用户角色ID", + "type": "integer" + }, + "avatar": { + "description": "头像", + "type": "string" + }, + "country_code": { + "description": "用户手机号国家代码", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "douyin": { + "description": "抖音", + "type": "string" + }, + "email": { + "description": "用户邮箱", + "type": "string" + }, + "facebook": { + "description": "facebook", + "type": "string" + }, + "forbidden_operation": { + "description": "禁用操作人", + "type": "string" + }, + "forbidden_reason": { + "description": "禁用原因", + "type": "string" + }, + "forbidden_time": { + "description": "禁用时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "id_forbidden": { + "description": "是否禁用", + "type": "boolean" + }, + "instagram": { + "description": "instagram", + "type": "string" + }, + "is_auth": { + "description": "是否认证 0未认证 1已认证", + "type": "boolean" + }, + "nick_name": { + "description": "昵称", + "type": "string" + }, + "organization": { + "description": "用户所属组织", + "type": "string" + }, + "password": { + "description": "用户密码", + "type": "string" + }, + "password_salt": { + "description": "用户密码盐", + "type": "string" + }, + "phone": { + "description": "用户手机号", + "type": "string" + }, + "platform": { + "description": "平台及地址逗号隔开 eg:(ins:https://baidu.com/user/1,qq:12345678)", + "type": "string" + }, + "source": { + "description": "用户来源", + "type": "string" + }, + "tags": { + "description": "个人标签", + "type": "string" + }, + "type": { + "description": "用户类型(随用户所属而定)", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "username": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "description": "用户uuid编码", + "type": "string" + } + } + }, + "model.UserSimple": { + "type": "object", + "properties": { + "account": { + "type": "array", + "items": { + "$ref": "#/definitions/model.Account" + } + }, + "avatar": { + "description": "头像", + "type": "string" + }, + "created_at": { + "description": "创建时间字符串", + "type": "string" + }, + "email": { + "description": "用户邮箱", + "type": "string" + }, + "id_forbidden": { + "description": "是否禁用", + "type": "boolean" + }, + "is_auth": { + "description": "是否认证 0未认证 1已认证", + "type": "boolean" + }, + "nick_name": { + "description": "昵称", + "type": "string" + }, + "order_count": { + "description": "订单数量", + "type": "integer" + }, + "phone": { + "description": "用户手机号", + "type": "string" + }, + "platform": { + "description": "平台", + "type": "array", + "items": { + "$ref": "#/definitions/model.Platform" + } + }, + "refund_count": { + "description": "退款数量", + "type": "integer" + }, + "source": { + "description": "用户来源", + "type": "string" + }, + "tags": { + "description": "个人标签", + "type": "string" + }, + "uuid": { + "description": "用户uuid编码", + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/model.Wallet" + } + } + }, + "model.UserView": { + "type": "object", + "properties": { + "email": { + "description": "邮箱", + "type": "string" + }, + "uuid": { + "description": "uuid", + "type": "string" + } + } + }, + "model.Wallet": { + "type": "object", + "properties": { + "accountName": { + "description": "户名", + "type": "string" + }, + "balance": { + "description": "可用余额", + "type": "number" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "fund": { + "description": "营销账户", + "type": "number" + }, + "fundLock": { + "description": "营销账户-锁定金额", + "type": "number" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "idCard": { + "description": "身份证", + "type": "string" + }, + "platform": { + "description": "平台 seller / customer / influencer", + "type": "string" + }, + "state": { + "description": "状态 0:正常 1:限制提现 2:禁止提现", + "type": "integer" + }, + "transitBalance": { + "description": "在途余额", + "type": "number" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userId": { + "type": "string" + } + } + }, + "model.Withdrawal": { + "type": "object", + "properties": { + "account_name": { + "description": "户名", + "type": "string" + }, + "account_type": { + "description": "账户类型 1:paypal 2:银行卡", + "type": "integer" + }, + "address": { + "description": "收款人地址", + "type": "string" + }, + "amount": { + "description": "金额", + "type": "number" + }, + "bank_code": { + "description": "收款行", + "type": "string" + }, + "bill_no": { + "description": "账单号", + "type": "string" + }, + "card_number": { + "description": "银行卡号", + "type": "string" + }, + "check_status": { + "description": "审核状态 0:待审核 1:审核通过 2:审核未通过", + "type": "string" + }, + "check_time": { + "description": "审核时间", + "type": "string" + }, + "country": { + "description": "国家/地区", + "type": "string" + }, + "create_by": { + "description": "创建人/店铺", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "currency": { + "description": "币种 USD:美元", + "type": "string" + }, + "flow_no": { + "description": "流水号", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "pay_id": { + "description": "支付id", + "type": "string" + }, + "platform": { + "description": "平台 1:网红 2:商家", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "提现状态 0:进行中 1:成功 2:失败", + "type": "string" + }, + "swift_code": { + "description": "银行国际代码", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "wallet_type": { + "description": "钱包类型 1:余额钱包 2:营销账户钱包", + "type": "integer" + } + } + }, + "request.AddMenuAuthorityInfo": { + "type": "object", + "properties": { + "authorityId": { + "description": "角色ID", + "type": "integer" + }, + "menus": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysBaseMenu" + } + } + } + }, + "request.AddMissionRecommend": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/model.MissionRecommend" + } + } + } + }, + "request.AddMissionVideo": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "mission_id": { + "description": "领取任务id", + "type": "integer" + }, + "source_type": { + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "type": "integer" + }, + "tag_id": { + "type": "integer" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "request.ApplicationSearch": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "clientID": { + "description": "客户端ID", + "type": "string" + }, + "clientSecret": { + "description": "客户端密钥", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "logo": { + "description": "应用logo", + "type": "string" + }, + "name": { + "description": "应用名称", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "provider": { + "description": "提供者", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "request.CasbinInReceive": { + "type": "object", + "properties": { + "authorityId": { + "description": "权限id", + "type": "integer" + }, + "casbinInfos": { + "type": "array", + "items": { + "$ref": "#/definitions/request.CasbinInfo" + } + } + } + }, + "request.CasbinInfo": { + "type": "object", + "properties": { + "method": { + "description": "方法", + "type": "string" + }, + "path": { + "description": "路径", + "type": "string" + } + } + }, + "request.ChangePasswordStruct": { + "type": "object", + "properties": { + "newPassword": { + "description": "新密码", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "request.CreateBanner": { + "type": "object", + "properties": { + "coverUrl": { + "description": "封面图", + "type": "string" + }, + "link": { + "description": "链接地址", + "type": "string" + }, + "linkType": { + "description": "链接类型 0:内链 1:外链", + "type": "string" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务", + "type": "string" + }, + "status": { + "description": "状态 0=下架 1=上架", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "type": { + "description": "任务-0101 平台奖励页-0102", + "type": "string" + } + } + }, + "request.CreateCategory": { + "type": "object", + "properties": { + "layer": { + "description": "层级", + "type": "integer" + }, + "name": { + "description": "名称", + "type": "string" + }, + "pid": { + "description": "父id", + "type": "integer" + } + } + }, + "request.CreateMissionTagRelation": { + "type": "object", + "properties": { + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "tagId": { + "description": "标签id", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.CreateTagRelation": { + "type": "object", + "properties": { + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "tagId": { + "description": "标签id", + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.EditMissionVideo": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "id": { + "description": "任务视频ID", + "type": "integer" + }, + "tag_id": { + "type": "integer" + }, + "video_url": { + "description": "视频上传地址", + "type": "string" + } + } + }, + "request.Empty": { + "type": "object" + }, + "request.ExamineWithdrawal": { + "type": "object", + "properties": { + "check_status": { + "description": "审核状态 1:审核通过 2:审核未通过", + "type": "string" + }, + "flow_no": { + "description": "流水号", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + } + } + }, + "request.FundRecharge": { + "type": "object", + "properties": { + "amount": { + "description": "充值金额", + "type": "number" + }, + "payMode": { + "description": "支付方式 1-paypal", + "type": "integer" + } + } + }, + "request.GetAuthorityId": { + "type": "object", + "properties": { + "appid": { + "type": "string" + }, + "authorityId": { + "description": "角色ID", + "type": "integer" + } + } + }, + "request.GetById": { + "type": "object", + "properties": { + "id": { + "description": "主键ID", + "type": "number" + } + } + }, + "request.IdReq": { + "type": "object", + "properties": { + "id": { + "description": "id", + "type": "integer" + } + } + }, + "request.IdsReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.IdsUReq": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "request.Login": { + "type": "object", + "properties": { + "appid": { + "description": "应用ID", + "type": "string" + }, + "captcha": { + "description": "验证码", + "type": "string" + }, + "captchaId": { + "description": "验证码ID", + "type": "string" + }, + "password": { + "description": "密码", + "type": "string" + }, + "username": { + "description": "用户名", + "type": "string" + } + } + }, + "request.OrganizationSearch": { + "type": "object", + "properties": { + "code": { + "description": "组织编码", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "组织名称", + "type": "string" + }, + "owner": { + "description": "组织所属", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "request.PageInfo": { + "type": "object", + "properties": { + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + } + } + }, + "request.PlatformAuthCheck": { + "type": "object", + "properties": { + "auth_msg": { + "description": "认证信息", + "type": "string" + }, + "check_result": { + "description": "认证结果 1:认证通过 2:认证失败", + "type": "string" + }, + "id": { + "description": "认证id", + "type": "integer" + } + } + }, + "request.ProviderSearch": { + "type": "object", + "properties": { + "auth_uri": { + "description": "认证URI", + "type": "string" + }, + "category": { + "description": "提供者分类 1-社交 2-支付 3-媒体 4-其他", + "type": "string" + }, + "client_id": { + "description": "客户端ID", + "type": "string" + }, + "client_secret": { + "description": "客户端密钥", + "type": "string" + }, + "code": { + "description": "提供者代码 google facebook twitter tiktok", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "提供者名称", + "type": "string" + }, + "owner": { + "description": "用户所属", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "redirect_uri": { + "description": "重定向URI", + "type": "string" + }, + "scope": { + "description": "作用域", + "type": "string" + }, + "token_uri": { + "description": "令牌URI", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user_info_uri": { + "description": "用户信息URI", + "type": "string" + } + } + }, + "request.SearchApiParams": { + "type": "object", + "properties": { + "apiGroup": { + "description": "api组", + "type": "string" + }, + "appid": { + "description": "应用ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "desc": { + "description": "排序方式:升序false(默认)|降序true", + "type": "boolean" + }, + "description": { + "description": "api中文描述", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "method": { + "description": "方法:创建POST(默认)|查看GET|更新PUT|删除DELETE", + "type": "string" + }, + "orderKey": { + "description": "排序", + "type": "string" + }, + "organization": { + "description": "组织", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "path": { + "description": "api路径", + "type": "string" + }, + "type": { + "description": "类型 admin-运营端 seller-商家端", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + } + } + }, + "request.SearchStore": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "end_at": { + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "start_at": { + "type": "string" + }, + "store_no": { + "type": "string" + } + } + }, + "request.SearchSysUserParams": { + "type": "object", + "properties": { + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/model.SysAuthority" + } + }, + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "authorityId": { + "description": "用户角色ID", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "fullName": { + "type": "string" + }, + "headerImg": { + "description": "用户头像", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "nickName": { + "description": "用户昵称", + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "phone": { + "type": "string" + }, + "status": { + "description": "用户状态", + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "userName": { + "description": "用户登录名", + "type": "string" + }, + "uuid": { + "description": "用户UUID", + "type": "string" + } + } + }, + "request.SetUserAuth": { + "type": "object", + "properties": { + "authorityId": { + "description": "UUID uuid.UUID `json:\"uuid\"` // 用户UUID", + "type": "string" + } + } + }, + "request.SetUserAuthorities": { + "type": "object", + "properties": { + "authorityIds": { + "description": "角色id", + "type": "array", + "items": { + "type": "string" + } + }, + "uuid": { + "type": "string" + } + } + }, + "request.SysOperationRecordSearch": { + "type": "object", + "properties": { + "agent": { + "description": "代理", + "type": "string" + }, + "apiDescription": { + "type": "string" + }, + "appid": { + "description": "应用ip", + "type": "string" + }, + "body": { + "description": "请求Body", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "createdAtEnd": { + "type": "string" + }, + "createdAtStart": { + "type": "string" + }, + "error_message": { + "description": "错误信息", + "type": "string" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "ip": { + "description": "请求ip", + "type": "string" + }, + "latency": { + "description": "延迟", + "type": "string" + }, + "method": { + "description": "请求方法", + "type": "string" + }, + "nickName": { + "type": "string" + }, + "page": { + "description": "页码", + "type": "integer" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" + }, + "path": { + "description": "请求路径", + "type": "string" + }, + "resp": { + "description": "响应Body", + "type": "string" + }, + "status": { + "description": "请求状态", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "user": { + "$ref": "#/definitions/model.SysUserSimple" + }, + "user_id": { + "description": "用户id", + "type": "integer" + } + } + }, + "request.TagsCommon": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "type": { + "description": "标签类型 01-任务 02-任务视频 03-网红", + "type": "string" + }, + "value": { + "description": "值", + "type": "string" + } + } + }, + "request.TransferResult": { + "type": "object", + "properties": { + "flow_no": { + "description": "流水号", + "type": "string" + }, + "remark": { + "description": "备注", + "type": "string" + }, + "status": { + "description": "状态 1:成功 2:失败", + "type": "string" + } + } + }, + "request.UpdateBanner": { + "type": "object", + "properties": { + "coverUrl": { + "description": "封面图", + "type": "string" + }, + "id": { + "description": "主键", + "type": "integer" + }, + "link": { + "description": "链接地址", + "type": "string" + }, + "linkType": { + "description": "链接类型 0:内链 1:外链", + "type": "string" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务", + "type": "string" + }, + "status": { + "description": "状态 0=下架 1=上架", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "type": { + "description": "任务-0101 平台奖励页-0102", + "type": "string" + } + } + }, + "request.UpdateCategory": { + "type": "object", + "properties": { + "id": { + "description": "主键ID", + "type": "integer" + }, + "name": { + "description": "名称", + "type": "string" + } + } + }, + "request.UserStatus": { + "type": "object", + "properties": { + "forbidden_reason": { + "description": "禁用原因", + "type": "string" + }, + "id_forbidden": { + "description": "是否禁用 0:未禁用 1:已禁用", + "type": "boolean" + }, + "user_id": { + "description": "用户id", + "type": "string" + } + } + }, + "response.AdminFundData": { + "type": "object", + "properties": { + "expend": { + "description": "支出金额", + "type": "number" + }, + "expend_count": { + "description": "支出笔数", + "type": "integer" + }, + "recharge": { + "description": "充值金额", + "type": "number" + }, + "recharge_count": { + "description": "充值笔数", + "type": "integer" + } + } + }, + "response.BannerListResponse": { + "type": "object", + "properties": { + "coverUrl": { + "description": "封面图", + "type": "string" + }, + "id": { + "description": "主键", + "type": "integer" + }, + "link": { + "description": "链接地址", + "type": "string" + }, + "linkType": { + "description": "链接类型 0:内链 1:外链", + "type": "string" + }, + "relationId": { + "description": "关联项目id", + "type": "string" + }, + "relationTitle": { + "description": "关联标题", + "type": "string" + }, + "relationType": { + "description": "关联类型 01-任务", + "type": "string" + }, + "sortIndex": { + "description": "序号索引", + "type": "integer" + }, + "status": { + "description": "状态 0=下架 1=上架", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "type": { + "description": "任务-0101 平台奖励页-0102", + "type": "string" + } + } + }, + "response.BillData": { + "type": "object", + "properties": { + "expend": { + "description": "支出金额", + "type": "number" + }, + "expend_count": { + "description": "支出笔数", + "type": "integer" + }, + "income": { + "description": "收入金额", + "type": "number" + }, + "income_count": { + "description": "收入笔数", + "type": "integer" + } + } + }, + "response.BkbData": { + "type": "object", + "properties": { + "balance": { + "description": "余额账户", + "type": "number" + }, + "earn": { + "description": "抽成总额", + "type": "number" + }, + "reward": { + "type": "number" + }, + "turnover": { + "description": "交易额", + "type": "number" + }, + "unexamined": { + "description": "待处理金额", + "type": "number" + }, + "unexamined_count": { + "description": "待处理笔数", + "type": "integer" + } + } + }, + "response.ChainResp": { + "type": "object", + "properties": { + "block_adress": { + "description": "所在区块", + "type": "string" + }, + "block_height": { + "description": "块高度", + "type": "integer" + }, + "hash": { + "description": "交易哈希", + "type": "string" + }, + "time": { + "description": "上链时间", + "type": "string" + } + } + }, + "response.DataPiece": { + "type": "object", + "properties": { + "value1": { + "type": "string" + }, + "value2": { + "type": "string" + } + } + }, + "response.DataStatistics": { + "type": "object", + "properties": { + "influence": { + "description": "网红数据", + "allOf": [ + { + "$ref": "#/definitions/response.DataStatisticsInfluence" + } + ] + }, + "store": { + "description": "商家数据", + "allOf": [ + { + "$ref": "#/definitions/response.DataStatisticsStore" + } + ] + }, + "user": { + "description": "用户数据", + "allOf": [ + { + "$ref": "#/definitions/response.DataStatisticsUser" + } + ] + } + } + }, + "response.DataStatisticsInfluence": { + "type": "object", + "properties": { + "mission_num": { + "description": "任务数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "platform_num": { + "description": "发布平台数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "transit_reward": { + "description": "在途佣金", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "used_reward": { + "description": "可用佣金", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + } + } + }, + "response.DataStatisticsStore": { + "type": "object", + "properties": { + "goods_num": { + "description": "商品数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "mission_num": { + "description": "任务数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "transit_reward": { + "description": "在途佣金", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "used_cash": { + "description": "可提金额", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + } + } + }, + "response.DataStatisticsUser": { + "type": "object", + "properties": { + "money": { + "description": "总销售额", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "order_num": { + "description": "订单数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "pay_num": { + "description": "支付笔数", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + }, + "visit": { + "description": "访问量", + "allOf": [ + { + "$ref": "#/definitions/response.DataPiece" + } + ] + } + } + }, + "response.InfluenceWithdrawalData": { + "type": "object", + "properties": { + "balance": { + "description": "账户余额", + "type": "number" + }, + "unexamined": { + "description": "待处理金额", + "type": "number" + }, + "unexamined_count": { + "description": "待处理笔数", + "type": "integer" + } + } + }, + "response.MissionClaimGoods": { + "type": "object", + "properties": { + "goods_id": { + "description": "商品ID", + "type": "integer" + }, + "image": { + "description": "规格图片url", + "type": "string" + }, + "order_id": { + "description": "订单ID", + "type": "string" + }, + "price": { + "description": "价格", + "type": "number" + }, + "sales": { + "description": "总销售量", + "type": "number" + }, + "sales_30": { + "description": "30天销售量", + "type": "number" + }, + "sku_no": { + "description": "商品编码", + "type": "string" + }, + "specs": { + "description": "规格", + "type": "string" + }, + "spu_no": { + "description": "编号", + "type": "string" + }, + "status": { + "description": "1:上架 2:下架 3:售罄", + "type": "integer" + }, + "stock": { + "description": "库存", + "type": "integer" + }, + "tags": { + "description": "标签", + "type": "string" + }, + "title": { + "description": "标题", + "type": "string" + }, + "title_eng": { + "description": "英文标题", + "type": "string" + } + } + }, + "response.MissionClaimInfo": { + "type": "object", + "properties": { + "claim_at": { + "description": "接任务时间", + "type": "string" + }, + "claim_days": { + "description": "任务完成天数", + "type": "integer" + }, + "claim_demands": { + "description": "任务拍摄要求", + "type": "string" + }, + "claim_num": { + "description": "接任务人数", + "type": "integer" + }, + "claim_stock": { + "description": "可接任务库存", + "type": "integer" + }, + "description": { + "description": "描述/卖点", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "has_sample": { + "description": "是否有样品 0:没有 1:有", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "order_num": { + "description": "订单数", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "sample_num": { + "description": "样品数量", + "type": "integer" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "status": { + "description": "状态 1:未开始 2:进行中 3:已结束", + "type": "integer" + }, + "title": { + "description": "任务名称", + "type": "string" + }, + "video_channel_ids": { + "description": "视频发布渠道,多个渠道英文逗号连接", + "type": "string" + }, + "video_country_id": { + "description": "视频发布国家", + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "response.MissionClaimOrderResponse": { + "type": "object", + "properties": { + "order": { + "$ref": "#/definitions/model.MissionClaimOrderDetail" + } + } + }, + "response.MissionClaimSimpleData": { + "type": "object", + "properties": { + "achieve_num": { + "description": "已完成商品数量", + "type": "integer" + }, + "claim_at": { + "description": "接任务时间", + "type": "string" + }, + "claim_days": { + "description": "完成任务时间", + "type": "integer" + }, + "claim_no": { + "description": "领取任务编号", + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "expire_at": { + "description": "任务推广过期时间", + "type": "string" + }, + "finished": { + "description": "任务完成状态 0:未完成 1:已完成", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "mission_id": { + "description": "任务id", + "type": "integer" + }, + "mission_title": { + "description": "任务名称", + "type": "string" + }, + "orderMoney": { + "description": "订单金额", + "type": "number" + }, + "orderNum": { + "description": "订单数", + "type": "integer" + }, + "rewardFinished": { + "description": "佣金结算", + "type": "number" + }, + "rewardUnfinished": { + "description": "在途佣金", + "type": "number" + }, + "sign_url": { + "description": "签约地址", + "type": "string" + }, + "status": { + "description": "状态 1:已领取待发货 2:已发货 3:已收货推广中", + "type": "integer" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video": { + "$ref": "#/definitions/model.MissionClaimVideo" + }, + "video_url": { + "type": "string" + } + } + }, + "response.MissionClaimVideoDetail": { + "type": "object", + "properties": { + "claim_goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/response.MissionClaimGoods" + } + ] + }, + "claim_video": { + "$ref": "#/definitions/model.MissionClaimVideo" + }, + "influencer_user": { + "description": "网红信息", + "allOf": [ + { + "$ref": "#/definitions/model.InfluencerUserDesc" + } + ] + }, + "mission_claim": { + "description": "任务领取信息", + "allOf": [ + { + "$ref": "#/definitions/response.MissionClaimInfo" + } + ] + } + } + }, + "response.MissionRecommendResponse": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "create_by": { + "description": "创建人", + "type": "string" + }, + "createdAt": { + "description": "创建时间", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods_title": { + "type": "string" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "influencer": { + "$ref": "#/definitions/model.InfluencerUserView" + }, + "mission_id": { + "type": "integer" + }, + "mission_status": { + "description": "任务状态", + "type": "integer" + }, + "relation_id": { + "description": "关联ID,任务视频ID,添加视频只需要传relationId", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "sort": { + "description": "倒序 //排序", + "type": "integer" + }, + "sort_index": { + "type": "integer" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "status": { + "description": "状态 1:上架 2:下架", + "type": "integer" + }, + "tag": { + "description": "todo 标签系统", + "type": "string" + }, + "title": { + "type": "string" + }, + "updatedAt": { + "description": "更新时间", + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "response.MissionStopData": { + "type": "object", + "properties": { + "claim_num": { + "description": "接任务人数", + "type": "integer" + }, + "description": { + "description": "描述/卖点", + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods": { + "description": "商品信息", + "allOf": [ + { + "$ref": "#/definitions/model.TbGoods4List" + } + ] + }, + "goods_title": { + "type": "string" + }, + "has_sample": { + "description": "是否有样品 0:没有 1:有", + "type": "integer" + }, + "has_video": { + "description": "是否有视频素材 0:没有 1:有", + "type": "integer" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "mission_id": { + "type": "integer" + }, + "mission_status": { + "description": "任务状态", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "remark": { + "type": "string" + }, + "sample_num": { + "description": "样品数量", + "type": "integer" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "tag": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "response.MissionVideoResponse": { + "type": "object", + "properties": { + "cover": { + "type": "string" + }, + "end_time": { + "description": "任务结束时间", + "type": "string" + }, + "goods_title": { + "type": "string" + }, + "hire_money": { + "description": "hire_type==1 佣金金额", + "type": "number" + }, + "hire_money_expect": { + "description": "预计佣金描述", + "type": "string" + }, + "hire_ratio": { + "description": "hire_type==2 抽成比例", + "type": "number" + }, + "hire_type": { + "description": "佣金类型 1:固定佣金 2:比例抽成", + "type": "integer" + }, + "id": { + "type": "integer" + }, + "influencer": { + "$ref": "#/definitions/model.InfluencerUserView" + }, + "mission_id": { + "type": "integer" + }, + "mission_status": { + "description": "任务状态", + "type": "integer" + }, + "release_channels": { + "description": "发布渠道", + "type": "string" + }, + "release_country": { + "description": "发布国家", + "type": "string" + }, + "seller": { + "$ref": "#/definitions/model.SellerStoreInfo" + }, + "source_type": { + "description": "类型:1:固定费用上传 2:奖励任务上传 3:后台上传", + "type": "integer" + }, + "start_time": { + "description": "任务起始时间", + "type": "string" + }, + "tag": { + "description": "todo 标签系统", + "type": "string" + }, + "title": { + "type": "string" + }, + "video_url": { + "type": "string" + } + } + }, + "response.PageResult": { + "type": "object", + "properties": { + "list": {}, + "page": { + "type": "integer" + }, + "pageSize": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "response.PayResult": { + "type": "object", + "properties": { + "pay_channel": { + "type": "string" + }, + "pay_id": { + "type": "string" + }, + "pay_return": { + "type": "string" + }, + "pay_status": { + "type": "string" + } + } + }, + "response.SellerFundData": { + "type": "object", + "properties": { + "expend": { + "description": "支出金额", + "type": "number" + }, + "expend_count": { + "description": "支出笔数", + "type": "integer" + }, + "lock": { + "description": "锁定金额", + "type": "number" + }, + "lock_count": { + "description": "锁定笔数", + "type": "integer" + } + } + }, + "response.SellerWithdrawalData": { + "type": "object", + "properties": { + "balance": { + "description": "余额账户", + "type": "number" + }, + "fund": { + "description": "营销账户", + "type": "number" + }, + "unexamined": { + "description": "待处理金额", + "type": "number" + }, + "unexamined_count": { + "description": "待处理笔数", + "type": "integer" + } + } + }, + "response.StoreInfoItem": { + "type": "object", + "properties": { + "balance": { + "description": "佣金", + "type": "number" + }, + "email": { + "description": "店铺联系email(注册账号email)", + "type": "string" + }, + "goods_num": { + "type": "integer" + }, + "id": { + "description": "主键ID", + "type": "integer" + }, + "papayl_name": { + "description": "paypal账号", + "type": "string" + }, + "phone": { + "type": "string" + }, + "store_no": { + "description": "店铺编号", + "type": "string" + }, + "transit_balance": { + "description": "在途佣金", + "type": "number" + }, + "type": { + "description": "1:个人店铺", + "type": "integer" + }, + "valid_mission_num": { + "description": "有效任务数", + "type": "integer" + } + } + }, + "response.SysAuthorityCopyResponse": { + "type": "object", + "properties": { + "authority": { + "$ref": "#/definitions/model.SysAuthority" + }, + "oldAuthorityId": { + "description": "旧角色ID", + "type": "integer" + } + } + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "x-token", + "in": "header" + } + } +} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml new file mode 100644 index 0000000..b4d6816 --- /dev/null +++ b/docs/swagger.yaml @@ -0,0 +1,7674 @@ +definitions: + config.AliyunOSS: + properties: + accessKeyId: + type: string + accessKeySecret: + type: string + bucketName: + type: string + bucketUrl: + type: string + endpoint: + type: string + type: object + config.Autocode: + properties: + root: + type: string + server: + type: string + serverApi: + type: string + serverInitialize: + type: string + serverModel: + type: string + serverRequest: + type: string + serverRouter: + type: string + serverService: + type: string + transferRestart: + type: boolean + web: + type: string + webApi: + type: string + webFlow: + type: string + webForm: + type: string + webTable: + type: string + type: object + config.Captcha: + properties: + imgHeight: + description: 验证码高度 + type: integer + imgWidth: + description: 验证码宽度 + type: integer + keyLong: + description: 验证码长度 + type: integer + type: object + config.Casbin: + properties: + modelPath: + description: 存放casbin模型的相对路径 + type: string + type: object + config.Detail: + properties: + compareField: + description: 需要比较时间的字段 + type: string + interval: + description: 时间间隔 + type: string + tableName: + description: 需要清理的表名 + type: string + type: object + config.Email: + properties: + from: + description: 收件人 + type: string + host: + description: 服务器地址 + type: string + isSSL: + description: 是否SSL + type: boolean + nickname: + description: 昵称 + type: string + port: + description: 端口 + type: integer + secret: + description: 密钥 + type: string + to: + description: 收件人:多个以英文逗号分隔 + type: string + type: object + config.Excel: + properties: + dir: + type: string + type: object + config.GormSettings: + properties: + settings: + items: + $ref: '#/definitions/config.Settings' + type: array + type: object + config.JPush: + properties: + allUserSign: + description: 所有用户标签 + type: string + androidIntent: + description: 安卓厂商通道包名 + type: string + appkey: + description: appkey + type: string + secret: + description: 密钥 + type: string + type: object + config.JWT: + properties: + bufferTime: + description: 缓冲时间 + type: integer + expiresTime: + description: 过期时间 + type: integer + signingKey: + description: jwt签名 + type: string + type: object + config.Local: + properties: + path: + description: 本地文件路径 + type: string + type: object + config.Minio: + properties: + accessKeyID: + description: 用户ID + type: string + endpoint: + description: 端点 + type: string + secretAccessKey: + description: 密钥 + type: string + useSSL: + description: 是否使用ssl + type: boolean + type: object + config.Mysql: + properties: + config: + description: 高级配置 + type: string + dbname: + description: 数据库名 + type: string + logMode: + description: 是否开启Gorm全局日志 + type: string + logZap: + description: 是否通过zap写入日志文件 + type: boolean + maxIdleConns: + description: 空闲中的最大连接数 + type: integer + maxOpenConns: + description: 打开到数据库的最大连接数 + type: integer + password: + description: 数据库密码 + type: string + path: + description: 服务器地址:端口 + type: string + username: + description: 数据库用户名 + type: string + type: object + config.Paypal: + properties: + cancel-url: + description: 取消支付跳转 + type: string + client-id: + description: 用户ID + type: string + env: + description: 端点 + type: string + notify-url: + description: 支付结果通知 + type: string + return-url: + description: 支付完成跳转 + type: string + secret: + description: 密钥 + type: string + type: object + config.Qiniu: + properties: + accessKey: + description: 秘钥AK + type: string + bucket: + description: 空间名称 + type: string + imgPath: + description: CDN加速域名 + type: string + secretKey: + description: 秘钥SK + type: string + useCdnDomains: + description: 上传是否使用CDN上传加速 + type: boolean + useHttps: + description: 是否使用https + type: boolean + zone: + description: 存储区域 + type: string + type: object + config.Redis: + properties: + addr: + description: 服务器地址:端口 + type: string + db: + description: redis的哪个数据库 + type: integer + password: + description: 密码 + type: string + type: object + config.Server: + properties: + aliyunOSS: + $ref: '#/definitions/config.AliyunOSS' + autoCode: + allOf: + - $ref: '#/definitions/config.Autocode' + description: auto + captcha: + $ref: '#/definitions/config.Captcha' + casbin: + $ref: '#/definitions/config.Casbin' + email: + $ref: '#/definitions/config.Email' + excel: + $ref: '#/definitions/config.Excel' + gormSettings: + $ref: '#/definitions/config.GormSettings' + jpush: + $ref: '#/definitions/config.JPush' + jwt: + $ref: '#/definitions/config.JWT' + local: + $ref: '#/definitions/config.Local' + minio: + allOf: + - $ref: '#/definitions/config.Minio' + description: oss + mysql: + allOf: + - $ref: '#/definitions/config.Mysql' + description: gorm + paypal: + $ref: '#/definitions/config.Paypal' + qiniu: + $ref: '#/definitions/config.Qiniu' + redis: + $ref: '#/definitions/config.Redis' + system: + $ref: '#/definitions/config.System' + tencentCOS: + $ref: '#/definitions/config.TencentCOS' + timer: + $ref: '#/definitions/config.Timer' + zap: + $ref: '#/definitions/config.Zap' + type: object + config.Settings: + properties: + bindTables: + items: {} + type: array + dsnName: + type: string + type: object + config.System: + properties: + addr: + description: 端口值 + type: integer + dbType: + description: 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql + type: string + env: + description: 环境值 + type: string + ossType: + description: Oss类型 + type: string + useMultipoint: + description: 多点登录拦截 + type: boolean + type: object + config.TencentCOS: + properties: + baseURL: + type: string + bucket: + type: string + pathPrefix: + type: string + region: + type: string + secretID: + type: string + secretKey: + type: string + type: object + config.Timer: + properties: + detail: + items: + $ref: '#/definitions/config.Detail' + type: array + spec: + description: CRON表达式 + type: string + start: + description: 是否启用 + type: boolean + type: object + config.Zap: + properties: + director: + description: 日志文件夹 + type: string + encodeLevel: + description: 编码级 + type: string + format: + description: 输出 + type: string + level: + description: 级别 + type: string + linkName: + description: 软链接名称 + type: string + logInConsole: + description: 输出控制台 + type: boolean + prefix: + description: 日志前缀 + type: string + showLine: + description: 显示行 + type: boolean + stacktraceKey: + description: 栈名 + type: string + type: object + global.BASE_ID_SORT: + properties: + id: + type: integer + sort: + type: integer + type: object + model.Account: + properties: + account_name: + description: 户名 + type: string + address: + description: 收款人地址 + type: string + bank_code: + description: 收款行 + type: string + card_number: + description: 银行卡号 + type: string + country: + description: 国家/地区 + type: string + createdAt: + description: 创建时间 + type: string + currency: + description: 币种 USD:美元 + type: string + id: + description: 主键ID + type: integer + idCard: + description: 身份证 + type: string + is_default: + description: 是否为默认 0:非默认 1:默认 + type: boolean + phone: + description: 手机号 + type: string + platform: + description: 平台 saller(买家端) / customer(客户端) / influencer(网红端) + type: string + sort: + description: 排序值 + type: integer + swift_code: + description: 银行国际代码 + type: string + type: + description: 类型 1:paypal 2:银行卡 + type: integer + updatedAt: + description: 更新时间 + type: string + userID: + description: 用户id + type: string + type: object + model.AdminBillFund: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + influencer: + allOf: + - $ref: '#/definitions/model.InfluencerUserClaimView' + description: 网红信息 + price: + description: 金额 + type: number + related_id: + description: 关联id 任务id + type: string + remark: + description: 备注 + type: string + status: + description: 状态 1:进行中 2:已完成 3:已失败 + type: integer + transaction_id: + description: 交易编号 + type: string + transaction_type: + description: 类型 1-支出 2-收入 + type: integer + updatedAt: + description: 更新时间 + type: string + user_id: + type: string + type: object + model.Application: + properties: + appid: + description: 应用ID + type: string + clientID: + description: 客户端ID + type: string + clientSecret: + description: 客户端密钥 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + logo: + description: 应用logo + type: string + name: + description: 应用名称 + type: string + organization: + description: 组织 + type: string + owner: + description: 用户所属 + type: string + provider: + description: 提供者 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.BillList: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + order_id: + description: 订单号 + type: string + platform: + description: 平台 seller / customer / influencer + type: string + price: + description: 金额 + type: number + remark: + description: 备注 + type: string + status: + description: 类型 1-支出 2-收入 + type: integer + title: + description: 标题 + type: string + transaction_id: + description: 交易编号 + type: string + updatedAt: + description: 更新时间 + type: string + user: + allOf: + - $ref: '#/definitions/model.UserView' + description: 用户信息 + user_id: + description: 用户id + type: string + type: object + model.Chain: + properties: + address: + description: 合约地址 + type: string + type: object + model.InfluencerUserClaimView: + properties: + claim_no: + type: string + nick_name: + description: 昵称 + type: string + phone: + description: 电话 + type: string + uuid: + description: 用户uuid + type: string + type: object + model.InfluencerUserDesc: + properties: + avatar: + description: 头像 + type: string + createdAt: + description: 创建时间 + type: string + email: + description: 用户邮箱 + type: string + forbidden_operation: + description: 禁用操作人 + type: string + forbidden_reason: + description: 禁用原因 + type: string + forbidden_time: + description: 禁用时间 + type: string + id: + description: 主键ID + type: integer + id_forbidden: + description: TagsStr interface{} `gorm:"-" json:"tags"` //个人标签 + type: boolean + nickName: + description: 昵称 + type: string + phone: + description: 电话 + type: string + platform: + description: 平台及地址 + tags: + description: 个人标签 + type: string + updatedAt: + description: 更新时间 + type: string + uuid: + description: 用户uuid编码 + type: string + type: object + model.InfluencerUserView: + properties: + nick_name: + description: 昵称 + type: string + phone: + description: 电话 + type: string + uuid: + description: 用户uuid + type: string + type: object + model.Meta: + properties: + closeTab: + description: 自动关闭tab + type: boolean + defaultMenu: + description: 是否是基础路由(开发中) + type: boolean + icon: + description: 菜单图标 + type: string + keepAlive: + description: 是否缓存 + type: boolean + title: + description: 菜单名 + type: string + type: object + model.MissionClaimAddress: + properties: + address_id: + description: 地址id + type: integer + bldg: + description: apt,ste,bldg + type: string + city: + description: city + type: string + createdAt: + description: 创建时间 + type: string + default: + description: 是否默认地址 1-是 2-否 + type: integer + firstName: + description: first name + type: string + id: + description: 主键ID + type: integer + lastName: + description: last name + type: string + mission_claim_id: + description: 领取任务id + type: integer + order_id: + description: 订单号 + type: string + phone: + description: 手机号 + type: string + platform: + description: 平台 saller(买家端) / customer(客户端) / influencer(网红端) + type: string + state: + description: state + type: string + street: + description: street + type: string + updatedAt: + description: 更新时间 + type: string + userId: + type: string + zipCode: + description: zip code + type: string + type: object + model.MissionClaimDetail: + properties: + achieve_num: + description: 完成数 + type: integer + claim_no: + description: 领取任务编号 + type: string + createdAt: + description: 创建时间 + type: string + hire_money: + description: 佣金 + type: number + id: + description: 主键ID + type: integer + influencer: + allOf: + - $ref: '#/definitions/model.InfluencerUserView' + description: 网红信息 + mission: + allOf: + - $ref: '#/definitions/model.MissionDetail' + description: 关联任务 + mission_id: + description: 任务id + type: integer + order: + allOf: + - $ref: '#/definitions/model.MissionClaimOrderInfo' + description: 任务订单 + status: + description: 状态 1:已领取待发货 2:已发货 3:已收货推广中 + type: integer + updatedAt: + description: 更新时间 + type: string + video: + allOf: + - $ref: '#/definitions/model.MissionClaimVideo' + description: 上传视频 + works: + description: 发布作品 + items: + $ref: '#/definitions/model.MissionClaimWorks' + type: array + type: object + model.MissionClaimOrderDetail: + properties: + address: + allOf: + - $ref: '#/definitions/model.MissionClaimAddress' + description: 任务订单地址 + confirm_time: + description: 收货时间 + type: string + courier: + description: 快递公司 + type: string + courier_number: + description: 快递单号 + type: string + courier_url: + description: 快递查询地址 + type: string + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + goods: + allOf: + - $ref: '#/definitions/model.MissionClaimOrderGoods' + description: 任务订单商品 + id: + description: 主键ID + type: integer + mission_claim: + allOf: + - $ref: '#/definitions/model.MissionClaimDetail' + description: 任务领取记录 + mission_claim_id: + description: 领取任务id + type: integer + number: + description: 数量 + type: integer + order_id: + description: 订单号 + type: string + send_time: + description: 发货时间 + type: string + sku_no: + description: sku编号 + type: string + spu_no: + description: spu编号 + type: string + status: + description: 订单状态 2:待发货 3:已发货 + type: integer + updatedAt: + description: 更新时间 + type: string + type: object + model.MissionClaimOrderGoods: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + image: + description: 规格图片url + type: string + order_id: + description: 订单号 + type: string + price: + description: 价格 + type: number + sku_no: + description: sku编号 + type: string + specs: + description: 规格 + type: string + title: + description: 名称 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.MissionClaimOrderInfo: + properties: + courier: + description: 快递公司 + type: string + courier_number: + description: 快递单号 + type: string + courier_url: + description: 快递查询地址 + type: string + mission_claim_id: + description: 领取任务id + type: integer + order_goods: + allOf: + - $ref: '#/definitions/model.MissionClaimOrderGoods' + description: 订单商品信息 + order_id: + description: 订单号 + type: string + send_time: + description: 发货时间 + type: string + status: + description: 订单状态 2:待发货 3:已发货 + type: integer + type: object + model.MissionClaimSummary: + properties: + bonus: + description: 佣金 + type: number + claim_no: + description: 领取任务编号 + type: string + count: + description: 接任务数 + type: integer + create_by: + description: 网红ID + type: string + first_claim_at: + description: 首次领取任务时间 + type: string + influencer: + allOf: + - $ref: '#/definitions/model.InfluencerUserView' + description: 网红信息 + order_num: + description: 订单数 + type: integer + platform: + type: string + transit_bonus: + description: 在途佣金 + type: number + type: object + model.MissionClaimVideo: + properties: + cover: + description: 视频封面 + type: string + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + mission_claim_id: + description: 领取任务id + type: integer + mission_id: + description: 任务ID + type: integer + remark: + description: 审核理由 + type: string + source_type: + description: 类型:1:固定费用上传 2:奖励任务上传 3:后台上传 + type: integer + status: + description: 状态 1:待审核 2:审核通过 3:审核不通过 + type: integer + update_by: + description: 修改人 + type: string + updatedAt: + description: 更新时间 + type: string + video_url: + description: 视频上传地址 + type: string + type: object + model.MissionClaimView: + properties: + claim_no: + description: 领取任务编号 + type: string + create_by: + description: 网红uuid + type: string + mission_id: + description: 任务id + type: integer + mission_title: + description: 任务标题 + type: string + user: + allOf: + - $ref: '#/definitions/model.UserView' + description: 网红信息 + type: object + model.MissionClaimWorks: + properties: + createdAt: + description: 创建时间 + type: string + homepage: + description: 作品主页地址 + type: string + id: + description: 主键ID + type: integer + image: + description: 作品凭证截图 + type: string + mission_claim_id: + description: 领取任务id + type: integer + type: + description: 平台 1:ins 2:Pinterest 3:tk 4:Twitter 5:Facebook 6:Reddit + type: integer + updatedAt: + description: 更新时间 + type: string + video_url: + description: 视频上传地址 + type: string + type: object + model.MissionDetail: + properties: + claim_days: + description: 任务完成天数 + type: integer + claim_demands: + description: 任务拍摄要求 + type: string + claim_num: + description: 接任务人数 + type: integer + claim_stock: + description: 可接任务库存 + type: integer + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + description: + description: 描述/卖点 + type: string + end_time: + description: 任务结束时间 + type: string + goods: + allOf: + - $ref: '#/definitions/model.TbGoods4List' + description: 商品信息 + goods_status: + description: 关联商品状态 1:正常 2:已下架 + type: integer + has_sample: + description: 是否有样品 0:没有 1:有 + type: integer + has_video: + description: 是否有视频素材 0:没有 1:有 + type: integer + hire_money: + description: hire_type==1 佣金金额 + type: number + hire_money_expect: + description: 预计佣金描述 + type: string + hire_ratio: + description: hire_type==2 抽成比例 + type: number + hire_type: + description: 佣金类型 1:固定佣金 2:比例抽成 + type: integer + id: + description: 主键ID + type: integer + num: + description: 商品数量 + type: integer + order_num: + description: 订单数 + type: integer + release_channels: + description: 发布渠道 + type: string + release_country: + description: 发布国家 + type: string + sample_num: + description: 样品数量 + type: integer + seller: + $ref: '#/definitions/model.SellerStoreInfo' + start_time: + description: 任务起始时间 + type: string + status: + description: 状态 1:未开始 2:进行中 3:已结束 + type: integer + store_no: + description: 店铺编号 + type: string + tags: + description: 标签 + type: string + title: + description: 标题 + type: string + updatedAt: + description: 更新时间 + type: string + video_channel_ids: + description: 视频发布渠道,多个渠道英文逗号连接 + type: string + video_claim_num: + description: 关联视频数量 + type: integer + video_country_id: + description: 视频发布国家 + type: string + video_url: + type: string + type: object + model.MissionRecommend: + properties: + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + relation_id: + description: 关联ID,任务视频ID,添加视频只需要传relationId + type: integer + sort: + description: 倒序 //排序 + type: integer + status: + description: 状态 1:上架 2:下架 + type: integer + updatedAt: + description: 更新时间 + type: string + type: object + model.OrderAddress: + properties: + bldg: + description: apt,ste,bldg + type: string + city: + description: city + type: string + createdAt: + description: 创建时间 + type: string + default: + description: 是否默认地址 1-是 2-否 + type: integer + firstName: + description: first name + type: string + id: + description: 主键ID + type: integer + lastName: + description: last name + type: string + orderID: + type: string + phone: + description: 手机号 + type: string + platform: + description: 平台 saller(买家端) / customer(客户端) / influencer(网红端) + type: string + state: + description: state + type: string + street: + description: street + type: string + updatedAt: + description: 更新时间 + type: string + userId: + type: string + zipCode: + description: zip code + type: string + type: object + model.OrderDeliver: + properties: + courier: + description: 快递公司 + type: string + courierLink: + description: 快递链接 + type: string + courierNumber: + description: 快递单号 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + orderID: + description: 订单号 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.OrderDetail: + properties: + IAmount: + description: 网红佣金 + type: string + SAmount: + description: 入账 + type: string + address: + allOf: + - $ref: '#/definitions/model.OrderAddress' + description: 地址 + captureID: + description: paypal收款确认id + type: string + chain: + allOf: + - $ref: '#/definitions/model.Chain' + description: 区块链 + code: + description: 网红码? + type: string + commodID: + description: 商品id + type: integer + confirmTime: + description: 收货时间 + type: string + createdAt: + description: 创建时间 + type: string + deliver: + allOf: + - $ref: '#/definitions/model.OrderDeliver' + description: 发货信息 + goods: + allOf: + - $ref: '#/definitions/model.OrderGoodsDetail' + description: 商品信息 + id: + description: 主键ID + type: integer + number: + description: 数量 + type: integer + orderID: + description: 订单号 + type: string + paidPrice: + description: 实付价格 + type: number + payTime: + description: 付款时间 + type: string + price: + description: 商品价格 + type: number + sendTime: + description: 发货时间 + type: string + sku_no: + description: 商品规格编号 + type: string + status: + description: 订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消 + type: integer + store_no: + description: 店铺编号 + type: string + type: + description: 类型 1-普通订单 2-预售订单 + type: integer + updatedAt: + description: 更新时间 + type: string + userID: + description: 用户id + type: string + type: object + model.OrderGoodsDetail: + properties: + content: + description: 详情 + type: string + content_text: + description: 详情-文字 + type: string + cover: + description: 封面图 + type: string + createdAt: + description: 创建时间 + type: string + goods_specs: + description: 商品规格 + items: + $ref: '#/definitions/model.OrderGoodsSpecs' + type: array + id: + description: 主键ID + type: integer + images: + description: 图片 + type: string + orderID: + description: 订单id + type: string + price_max: + description: 最高规格价格 + type: number + price_min: + description: 最低规格价格 + type: number + retail_price: + description: 吊牌价(零售指导价) + type: number + sku_no: + description: 商品规格编号 + type: string + specs: + description: 规格 + type: string + spu_no: + description: 编号 + type: string + store_no: + description: 店铺编号 + type: string + title: + description: 名称 + type: string + title_eng: + description: 英文名称 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.OrderGoodsSpecs: + properties: + createdAt: + description: 创建时间 + type: string + goods_id: + description: spu id + type: integer + goods_no: + description: 商品编号 + type: string + id: + description: 主键ID + type: integer + image: + description: 规格图片url + type: string + orderGoodsId: + type: integer + orderID: + description: 订单id + type: string + price: + description: 价格 + type: number + sku_no: + description: 商品规格编号 + type: string + specs: + description: 规格 + type: string + spu_no: + description: 商品编号 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.OrderList: + properties: + IAmount: + description: 网红佣金 + type: string + SAmount: + description: 入账 + type: string + address: + allOf: + - $ref: '#/definitions/model.OrderAddress' + description: 地址 + captureID: + description: paypal收款确认id + type: string + code: + description: 网红码? + type: string + commodID: + description: 商品id + type: integer + confirmTime: + description: 收货时间 + type: string + createdAt: + description: 创建时间 + type: string + customerPhone: + description: 买家手机 + type: string + deliver: + allOf: + - $ref: '#/definitions/model.OrderDeliver' + description: 发货信息 + goods: + allOf: + - $ref: '#/definitions/model.OrderGoodsDetail' + description: 商品信息 + id: + description: 主键ID + type: integer + influencer: + allOf: + - $ref: '#/definitions/model.InfluencerUserClaimView' + description: 网红信息 + number: + description: 数量 + type: integer + orderID: + description: 订单号 + type: string + paidPrice: + description: 实付价格 + type: number + payTime: + description: 付款时间 + type: string + price: + description: 商品价格 + type: number + sendTime: + description: 发货时间 + type: string + sku_no: + description: 商品规格编号 + type: string + status: + description: 订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消 + type: integer + store_no: + description: 店铺编号 + type: string + type: + description: 类型 1-普通订单 2-预售订单 + type: integer + updatedAt: + description: 更新时间 + type: string + userID: + description: 用户id + type: string + type: object + model.Organization: + properties: + code: + description: 组织编码 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + name: + description: 组织名称 + type: string + owner: + description: 组织所属 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.Platform: + properties: + auth_msg: + description: 认证信息 + type: string + auth_time: + description: 认证时间 + type: string + check_user: + description: 审核人 + type: string + created_at: + description: 创建时间 + type: string + image: + description: 图片 + type: string + is_auth: + description: 是否认证 0:未认证 1:已认证 2:认证失败 + type: boolean + platform: + description: 平台 + type: string + platformName: + description: 平台名称 + type: string + url: + description: 主页地址 + type: string + type: object + model.PlatformAuthSimple: + properties: + auth_msg: + description: 认证信息 + type: string + auth_time: + description: 认证时间 + type: string + check_user: + description: 审核人 + type: string + created_at: + description: 创建时间 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + image: + description: 图片 + type: string + is_auth: + description: 是否认证 0:未认证 1:已认证 2:认证失败 + type: boolean + platform: + description: 平台 + type: string + platformName: + description: 平台名称 + type: string + status: + description: 认证状态 0:未认证 1:已认证 2:认证失败 + type: string + tag_relation: + items: + $ref: '#/definitions/model.TagRelationDesc' + type: array + updatedAt: + description: 更新时间 + type: string + url: + description: 主页地址 + type: string + user: + $ref: '#/definitions/model.UserSimple' + user_id: + description: 用户ID + type: string + type: object + model.Provider: + properties: + auth_uri: + description: 认证URI + type: string + category: + description: 提供者分类 1-社交 2-支付 3-媒体 4-其他 + type: string + client_id: + description: 客户端ID + type: string + client_secret: + description: 客户端密钥 + type: string + code: + description: 提供者代码 google facebook twitter tiktok + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + name: + description: 提供者名称 + type: string + owner: + description: 用户所属 + type: string + redirect_uri: + description: 重定向URI + type: string + scope: + description: 作用域 + type: string + token_uri: + description: 令牌URI + type: string + updatedAt: + description: 更新时间 + type: string + user_info_uri: + description: 用户信息URI + type: string + type: object + model.SellerBillFund: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + mission: + allOf: + - $ref: '#/definitions/model.MissionClaimView' + description: 领取任务信息 + price: + description: 金额 + type: number + related_id: + description: 关联id 任务id + type: string + remark: + description: 备注 + type: string + seller: + allOf: + - $ref: '#/definitions/model.StoreInfo' + description: 店铺信息 + status: + description: 状态 1:进行中 2:已完成 3:已失败 + type: integer + transaction_id: + description: 交易编号 + type: string + transaction_type: + description: 类型 1-支出 2-收入 + type: integer + updatedAt: + description: 更新时间 + type: string + user_id: + description: 商家storeNo + type: string + type: object + model.SellerStore: + properties: + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + email: + description: 店铺联系email(注册账号email) + type: string + id: + description: 主键ID + type: integer + phone: + type: string + store_no: + description: 店铺编号 + type: string + type: + description: 1:个人店铺 + type: integer + updatedAt: + description: 更新时间 + type: string + type: object + model.SellerStoreInfo: + properties: + create_by: + description: 创建人 + type: string + created_at: + type: string + email: + description: 店铺联系email(注册账号email) + type: string + goods_num: + type: integer + id: + description: 主键ID + type: integer + phone: + type: string + release_mission_nums: + description: 发布任务数 + type: integer + store_no: + description: 店铺编号 + type: string + type: + description: 1:个人店铺 + type: integer + valid_mission_num: + description: 有效任务数 + type: integer + type: object + model.StoreInfo: + properties: + email: + description: 联系方式 + type: string + store_no: + description: 店铺编号 + type: string + type: object + model.SysApi: + properties: + apiGroup: + description: api组 + type: string + appid: + description: 应用ID + type: string + createdAt: + description: 创建时间 + type: string + description: + description: api中文描述 + type: string + id: + description: 主键ID + type: integer + method: + description: 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE + type: string + organization: + description: 组织 + type: string + path: + description: api路径 + type: string + type: + description: 类型 admin-运营端 seller-商家端 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.SysAuthority: + properties: + appid: + description: 应用ID + type: string + authorityDesc: + description: 角色描述 + type: string + authorityId: + description: 角色ID + type: integer + authorityName: + description: 角色名 + type: string + children: + items: + $ref: '#/definitions/model.SysAuthority' + type: array + defaultRouter: + description: 默认菜单(默认dashboard) + type: string + menus: + items: + $ref: '#/definitions/model.SysBaseMenu' + type: array + organization: + description: 组织 + type: string + parentId: + description: 父角色ID + type: integer + type: + description: 类型 admin-运营端 seller-商家端 + type: string + type: object + model.SysBaseMenu: + properties: + appid: + description: 应用ID + type: string + authoritys: + items: + $ref: '#/definitions/model.SysAuthority' + type: array + children: + items: + $ref: '#/definitions/model.SysBaseMenu' + type: array + component: + description: 对应前端文件路径 + type: string + createdAt: + description: 创建时间 + type: string + group: + description: 路由组 + type: string + hidden: + description: 是否在列表隐藏 + type: boolean + id: + description: 主键ID + type: integer + meta: + allOf: + - $ref: '#/definitions/model.Meta' + description: 附加属性 + name: + description: 路由name + type: string + owner: + description: 组织所属 + type: string + parameters: + items: + $ref: '#/definitions/model.SysBaseMenuParameter' + type: array + parentId: + description: 父菜单ID + type: string + path: + description: 路由path + type: string + sort: + description: 排序标记 + type: integer + type: + description: 类型 admin-运营端 seller-商家端 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.SysBaseMenuParameter: + properties: + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + key: + description: 地址栏携带参数的key + type: string + sysBaseMenuID: + type: integer + type: + description: 地址栏携带参数为params还是query + type: string + updatedAt: + description: 更新时间 + type: string + value: + description: 地址栏携带参数的值 + type: string + type: object + model.SysMissionReward: + properties: + achieve_num: + description: 已完成任务次数 + type: integer + audit_by: + description: 审核人 + type: string + bonus: + description: 奖励金额 + type: number + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + relationId: + description: 关联项目id + type: string + status: + description: 订单状态 1-待发放 2-发放中 3-已发放 + type: integer + title: + description: 组件id + type: string + type: + description: 奖励类型 1.视频上传 2.信息完善 3.商家任务 + type: integer + update_by: + description: 更新人 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.SysOperationRecord: + properties: + agent: + description: 代理 + type: string + apiDescription: + type: string + appid: + description: 应用ip + type: string + body: + description: 请求Body + type: string + createdAt: + description: 创建时间 + type: string + error_message: + description: 错误信息 + type: string + id: + description: 主键ID + type: integer + ip: + description: 请求ip + type: string + latency: + description: 延迟 + type: string + method: + description: 请求方法 + type: string + path: + description: 请求路径 + type: string + resp: + description: 响应Body + type: string + status: + description: 请求状态 + type: integer + updatedAt: + description: 更新时间 + type: string + user: + $ref: '#/definitions/model.SysUserSimple' + user_id: + description: 用户id + type: integer + type: object + model.SysUser: + properties: + authorities: + items: + $ref: '#/definitions/model.SysAuthority' + type: array + authority: + $ref: '#/definitions/model.SysAuthority' + authorityId: + description: 用户角色ID + type: string + createdAt: + description: 创建时间 + type: string + fullName: + type: string + headerImg: + description: 用户头像 + type: string + id: + description: 主键ID + type: integer + nickName: + description: 用户昵称 + type: string + phone: + type: string + status: + description: 用户状态 + type: string + updatedAt: + description: 更新时间 + type: string + userName: + description: 用户登录名 + type: string + uuid: + description: 用户UUID + type: string + type: object + model.SysUserSimple: + properties: + id: + type: integer + nickName: + type: string + userName: + description: 用户登录名 + type: string + uuid: + type: string + type: object + model.System: + properties: + config: + $ref: '#/definitions/config.Server' + type: object + model.TagRelationDesc: + properties: + id: + description: 主键 + type: integer + name: + description: 标签名称 + type: string + type: object + model.Tags: + properties: + createBy: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + type: + description: 标签类型 01-任务 02-任务视频 03-网红 + type: string + updateBy: + description: 修改人 + type: string + updatedAt: + description: 更新时间 + type: string + user: + allOf: + - $ref: '#/definitions/model.SysUserSimple' + description: 用户信息 + value: + description: 值 + type: string + type: object + model.TagsDesc: + properties: + id: + description: 主键 + type: integer + value: + description: 值 + type: string + type: object + model.TbGoods4List: + properties: + cover: + description: 封面图(未使用) + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + images: + description: 图片列表 + type: string + price_max: + description: 最高规格价格 + type: number + price_min: + description: 最低规格价格 + type: number + retail_price: + description: 吊牌价(零售指导价) + type: number + sales: + description: 总销售量 + type: integer + sales_30: + description: 30天销售量 + type: integer + spu_no: + description: 编号 + type: string + status: + description: 1:上架 2:下架 3:售罄 + type: integer + stock: + description: 总库存 + type: integer + tags: + description: 标签 + type: string + title: + description: 标题 + type: string + title_eng: + description: 英文标题 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + model.User: + properties: + appid: + description: 用户所属应用 + type: string + authorities: + items: + $ref: '#/definitions/model.SysAuthority' + type: array + authority: + $ref: '#/definitions/model.SysAuthority' + authority_id: + description: 用户角色ID + type: integer + avatar: + description: 头像 + type: string + country_code: + description: 用户手机号国家代码 + type: string + createdAt: + description: 创建时间 + type: string + douyin: + description: 抖音 + type: string + email: + description: 用户邮箱 + type: string + facebook: + description: facebook + type: string + forbidden_operation: + description: 禁用操作人 + type: string + forbidden_reason: + description: 禁用原因 + type: string + forbidden_time: + description: 禁用时间 + type: string + id: + description: 主键ID + type: integer + id_forbidden: + description: 是否禁用 + type: boolean + instagram: + description: instagram + type: string + is_auth: + description: 是否认证 0未认证 1已认证 + type: boolean + nick_name: + description: 昵称 + type: string + organization: + description: 用户所属组织 + type: string + password: + description: 用户密码 + type: string + password_salt: + description: 用户密码盐 + type: string + phone: + description: 用户手机号 + type: string + platform: + description: 平台及地址逗号隔开 eg:(ins:https://baidu.com/user/1,qq:12345678) + type: string + source: + description: 用户来源 + type: string + tags: + description: 个人标签 + type: string + type: + description: 用户类型(随用户所属而定) + type: string + updatedAt: + description: 更新时间 + type: string + username: + description: 用户登录名 + type: string + uuid: + description: 用户uuid编码 + type: string + type: object + model.UserSimple: + properties: + account: + items: + $ref: '#/definitions/model.Account' + type: array + avatar: + description: 头像 + type: string + created_at: + description: 创建时间字符串 + type: string + email: + description: 用户邮箱 + type: string + id_forbidden: + description: 是否禁用 + type: boolean + is_auth: + description: 是否认证 0未认证 1已认证 + type: boolean + nick_name: + description: 昵称 + type: string + order_count: + description: 订单数量 + type: integer + phone: + description: 用户手机号 + type: string + platform: + description: 平台 + items: + $ref: '#/definitions/model.Platform' + type: array + refund_count: + description: 退款数量 + type: integer + source: + description: 用户来源 + type: string + tags: + description: 个人标签 + type: string + uuid: + description: 用户uuid编码 + type: string + wallet: + $ref: '#/definitions/model.Wallet' + type: object + model.UserView: + properties: + email: + description: 邮箱 + type: string + uuid: + description: uuid + type: string + type: object + model.Wallet: + properties: + accountName: + description: 户名 + type: string + balance: + description: 可用余额 + type: number + createdAt: + description: 创建时间 + type: string + fund: + description: 营销账户 + type: number + fundLock: + description: 营销账户-锁定金额 + type: number + id: + description: 主键ID + type: integer + idCard: + description: 身份证 + type: string + platform: + description: 平台 seller / customer / influencer + type: string + state: + description: 状态 0:正常 1:限制提现 2:禁止提现 + type: integer + transitBalance: + description: 在途余额 + type: number + updatedAt: + description: 更新时间 + type: string + userId: + type: string + type: object + model.Withdrawal: + properties: + account_name: + description: 户名 + type: string + account_type: + description: 账户类型 1:paypal 2:银行卡 + type: integer + address: + description: 收款人地址 + type: string + amount: + description: 金额 + type: number + bank_code: + description: 收款行 + type: string + bill_no: + description: 账单号 + type: string + card_number: + description: 银行卡号 + type: string + check_status: + description: 审核状态 0:待审核 1:审核通过 2:审核未通过 + type: string + check_time: + description: 审核时间 + type: string + country: + description: 国家/地区 + type: string + create_by: + description: 创建人/店铺 + type: string + createdAt: + description: 创建时间 + type: string + currency: + description: 币种 USD:美元 + type: string + flow_no: + description: 流水号 + type: string + id: + description: 主键ID + type: integer + pay_id: + description: 支付id + type: string + platform: + description: 平台 1:网红 2:商家 + type: string + remark: + description: 备注 + type: string + status: + description: 提现状态 0:进行中 1:成功 2:失败 + type: string + swift_code: + description: 银行国际代码 + type: string + title: + description: 标题 + type: string + updatedAt: + description: 更新时间 + type: string + wallet_type: + description: 钱包类型 1:余额钱包 2:营销账户钱包 + type: integer + type: object + request.AddMenuAuthorityInfo: + properties: + authorityId: + description: 角色ID + type: integer + menus: + items: + $ref: '#/definitions/model.SysBaseMenu' + type: array + type: object + request.AddMissionRecommend: + properties: + list: + items: + $ref: '#/definitions/model.MissionRecommend' + type: array + type: object + request.AddMissionVideo: + properties: + cover: + type: string + mission_id: + description: 领取任务id + type: integer + source_type: + description: 类型:1:固定费用上传 2:奖励任务上传 3:后台上传 + type: integer + tag_id: + type: integer + video_url: + description: 视频上传地址 + type: string + type: object + request.ApplicationSearch: + properties: + appid: + description: 应用ID + type: string + clientID: + description: 客户端ID + type: string + clientSecret: + description: 客户端密钥 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + logo: + description: 应用logo + type: string + name: + description: 应用名称 + type: string + organization: + description: 组织 + type: string + owner: + description: 用户所属 + type: string + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + provider: + description: 提供者 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + request.CasbinInReceive: + properties: + authorityId: + description: 权限id + type: integer + casbinInfos: + items: + $ref: '#/definitions/request.CasbinInfo' + type: array + type: object + request.CasbinInfo: + properties: + method: + description: 方法 + type: string + path: + description: 路径 + type: string + type: object + request.ChangePasswordStruct: + properties: + newPassword: + description: 新密码 + type: string + password: + description: 密码 + type: string + username: + description: 用户名 + type: string + type: object + request.CreateBanner: + properties: + coverUrl: + description: 封面图 + type: string + link: + description: 链接地址 + type: string + linkType: + description: 链接类型 0:内链 1:外链 + type: string + relationId: + description: 关联项目id + type: string + relationType: + description: 关联类型 01-任务 + type: string + status: + description: 状态 0=下架 1=上架 + type: string + title: + description: 标题 + type: string + type: + description: 任务-0101 平台奖励页-0102 + type: string + type: object + request.CreateCategory: + properties: + layer: + description: 层级 + type: integer + name: + description: 名称 + type: string + pid: + description: 父id + type: integer + type: object + request.CreateMissionTagRelation: + properties: + relationId: + description: 关联项目id + type: string + relationType: + description: 关联类型 01-任务 02-任务视频 03-网红 + type: string + tagId: + description: 标签id + items: + type: integer + type: array + type: object + request.CreateTagRelation: + properties: + relationId: + description: 关联项目id + type: string + relationType: + description: 关联类型 01-任务 02-任务视频 03-网红 + type: string + tagId: + description: 标签id + items: + type: integer + type: array + type: object + request.EditMissionVideo: + properties: + cover: + type: string + id: + description: 任务视频ID + type: integer + tag_id: + type: integer + video_url: + description: 视频上传地址 + type: string + type: object + request.Empty: + type: object + request.ExamineWithdrawal: + properties: + check_status: + description: 审核状态 1:审核通过 2:审核未通过 + type: string + flow_no: + description: 流水号 + type: string + remark: + description: 备注 + type: string + type: object + request.FundRecharge: + properties: + amount: + description: 充值金额 + type: number + payMode: + description: 支付方式 1-paypal + type: integer + type: object + request.GetAuthorityId: + properties: + appid: + type: string + authorityId: + description: 角色ID + type: integer + type: object + request.GetById: + properties: + id: + description: 主键ID + type: number + type: object + request.IdReq: + properties: + id: + description: id + type: integer + type: object + request.IdsReq: + properties: + ids: + items: + type: integer + type: array + type: object + request.IdsUReq: + properties: + ids: + items: + type: integer + type: array + type: object + request.Login: + properties: + appid: + description: 应用ID + type: string + captcha: + description: 验证码 + type: string + captchaId: + description: 验证码ID + type: string + password: + description: 密码 + type: string + username: + description: 用户名 + type: string + type: object + request.OrganizationSearch: + properties: + code: + description: 组织编码 + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + name: + description: 组织名称 + type: string + owner: + description: 组织所属 + type: string + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + updatedAt: + description: 更新时间 + type: string + type: object + request.PageInfo: + properties: + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + type: object + request.PlatformAuthCheck: + properties: + auth_msg: + description: 认证信息 + type: string + check_result: + description: 认证结果 1:认证通过 2:认证失败 + type: string + id: + description: 认证id + type: integer + type: object + request.ProviderSearch: + properties: + auth_uri: + description: 认证URI + type: string + category: + description: 提供者分类 1-社交 2-支付 3-媒体 4-其他 + type: string + client_id: + description: 客户端ID + type: string + client_secret: + description: 客户端密钥 + type: string + code: + description: 提供者代码 google facebook twitter tiktok + type: string + createdAt: + description: 创建时间 + type: string + id: + description: 主键ID + type: integer + name: + description: 提供者名称 + type: string + owner: + description: 用户所属 + type: string + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + redirect_uri: + description: 重定向URI + type: string + scope: + description: 作用域 + type: string + token_uri: + description: 令牌URI + type: string + updatedAt: + description: 更新时间 + type: string + user_info_uri: + description: 用户信息URI + type: string + type: object + request.SearchApiParams: + properties: + apiGroup: + description: api组 + type: string + appid: + description: 应用ID + type: string + createdAt: + description: 创建时间 + type: string + desc: + description: 排序方式:升序false(默认)|降序true + type: boolean + description: + description: api中文描述 + type: string + id: + description: 主键ID + type: integer + method: + description: 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE + type: string + orderKey: + description: 排序 + type: string + organization: + description: 组织 + type: string + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + path: + description: api路径 + type: string + type: + description: 类型 admin-运营端 seller-商家端 + type: string + updatedAt: + description: 更新时间 + type: string + type: object + request.SearchStore: + properties: + email: + type: string + end_at: + type: string + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + start_at: + type: string + store_no: + type: string + type: object + request.SearchSysUserParams: + properties: + authorities: + items: + $ref: '#/definitions/model.SysAuthority' + type: array + authority: + $ref: '#/definitions/model.SysAuthority' + authorityId: + description: 用户角色ID + type: string + createdAt: + description: 创建时间 + type: string + fullName: + type: string + headerImg: + description: 用户头像 + type: string + id: + description: 主键ID + type: integer + nickName: + description: 用户昵称 + type: string + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + phone: + type: string + status: + description: 用户状态 + type: string + updatedAt: + description: 更新时间 + type: string + userName: + description: 用户登录名 + type: string + uuid: + description: 用户UUID + type: string + type: object + request.SetUserAuth: + properties: + authorityId: + description: UUID uuid.UUID `json:"uuid"` // 用户UUID + type: string + type: object + request.SetUserAuthorities: + properties: + authorityIds: + description: 角色id + items: + type: string + type: array + uuid: + type: string + type: object + request.SysOperationRecordSearch: + properties: + agent: + description: 代理 + type: string + apiDescription: + type: string + appid: + description: 应用ip + type: string + body: + description: 请求Body + type: string + createdAt: + description: 创建时间 + type: string + createdAtEnd: + type: string + createdAtStart: + type: string + error_message: + description: 错误信息 + type: string + id: + description: 主键ID + type: integer + ip: + description: 请求ip + type: string + latency: + description: 延迟 + type: string + method: + description: 请求方法 + type: string + nickName: + type: string + page: + description: 页码 + type: integer + pageSize: + description: 每页大小 + type: integer + path: + description: 请求路径 + type: string + resp: + description: 响应Body + type: string + status: + description: 请求状态 + type: integer + updatedAt: + description: 更新时间 + type: string + user: + $ref: '#/definitions/model.SysUserSimple' + user_id: + description: 用户id + type: integer + type: object + request.TagsCommon: + properties: + id: + type: integer + type: + description: 标签类型 01-任务 02-任务视频 03-网红 + type: string + value: + description: 值 + type: string + type: object + request.TransferResult: + properties: + flow_no: + description: 流水号 + type: string + remark: + description: 备注 + type: string + status: + description: 状态 1:成功 2:失败 + type: string + type: object + request.UpdateBanner: + properties: + coverUrl: + description: 封面图 + type: string + id: + description: 主键 + type: integer + link: + description: 链接地址 + type: string + linkType: + description: 链接类型 0:内链 1:外链 + type: string + relationId: + description: 关联项目id + type: string + relationType: + description: 关联类型 01-任务 + type: string + status: + description: 状态 0=下架 1=上架 + type: string + title: + description: 标题 + type: string + type: + description: 任务-0101 平台奖励页-0102 + type: string + type: object + request.UpdateCategory: + properties: + id: + description: 主键ID + type: integer + name: + description: 名称 + type: string + type: object + request.UserStatus: + properties: + forbidden_reason: + description: 禁用原因 + type: string + id_forbidden: + description: 是否禁用 0:未禁用 1:已禁用 + type: boolean + user_id: + description: 用户id + type: string + type: object + response.AdminFundData: + properties: + expend: + description: 支出金额 + type: number + expend_count: + description: 支出笔数 + type: integer + recharge: + description: 充值金额 + type: number + recharge_count: + description: 充值笔数 + type: integer + type: object + response.BannerListResponse: + properties: + coverUrl: + description: 封面图 + type: string + id: + description: 主键 + type: integer + link: + description: 链接地址 + type: string + linkType: + description: 链接类型 0:内链 1:外链 + type: string + relationId: + description: 关联项目id + type: string + relationTitle: + description: 关联标题 + type: string + relationType: + description: 关联类型 01-任务 + type: string + sortIndex: + description: 序号索引 + type: integer + status: + description: 状态 0=下架 1=上架 + type: string + title: + description: 标题 + type: string + type: + description: 任务-0101 平台奖励页-0102 + type: string + type: object + response.BillData: + properties: + expend: + description: 支出金额 + type: number + expend_count: + description: 支出笔数 + type: integer + income: + description: 收入金额 + type: number + income_count: + description: 收入笔数 + type: integer + type: object + response.BkbData: + properties: + balance: + description: 余额账户 + type: number + earn: + description: 抽成总额 + type: number + reward: + type: number + turnover: + description: 交易额 + type: number + unexamined: + description: 待处理金额 + type: number + unexamined_count: + description: 待处理笔数 + type: integer + type: object + response.ChainResp: + properties: + block_adress: + description: 所在区块 + type: string + block_height: + description: 块高度 + type: integer + hash: + description: 交易哈希 + type: string + time: + description: 上链时间 + type: string + type: object + response.DataPiece: + properties: + value1: + type: string + value2: + type: string + type: object + response.DataStatistics: + properties: + influence: + allOf: + - $ref: '#/definitions/response.DataStatisticsInfluence' + description: 网红数据 + store: + allOf: + - $ref: '#/definitions/response.DataStatisticsStore' + description: 商家数据 + user: + allOf: + - $ref: '#/definitions/response.DataStatisticsUser' + description: 用户数据 + type: object + response.DataStatisticsInfluence: + properties: + mission_num: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 任务数 + platform_num: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 发布平台数 + transit_reward: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 在途佣金 + used_reward: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 可用佣金 + type: object + response.DataStatisticsStore: + properties: + goods_num: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 商品数 + mission_num: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 任务数 + transit_reward: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 在途佣金 + used_cash: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 可提金额 + type: object + response.DataStatisticsUser: + properties: + money: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 总销售额 + order_num: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 订单数 + pay_num: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 支付笔数 + visit: + allOf: + - $ref: '#/definitions/response.DataPiece' + description: 访问量 + type: object + response.InfluenceWithdrawalData: + properties: + balance: + description: 账户余额 + type: number + unexamined: + description: 待处理金额 + type: number + unexamined_count: + description: 待处理笔数 + type: integer + type: object + response.MissionClaimGoods: + properties: + goods_id: + description: 商品ID + type: integer + image: + description: 规格图片url + type: string + order_id: + description: 订单ID + type: string + price: + description: 价格 + type: number + sales: + description: 总销售量 + type: number + sales_30: + description: 30天销售量 + type: number + sku_no: + description: 商品编码 + type: string + specs: + description: 规格 + type: string + spu_no: + description: 编号 + type: string + status: + description: 1:上架 2:下架 3:售罄 + type: integer + stock: + description: 库存 + type: integer + tags: + description: 标签 + type: string + title: + description: 标题 + type: string + title_eng: + description: 英文标题 + type: string + type: object + response.MissionClaimInfo: + properties: + claim_at: + description: 接任务时间 + type: string + claim_days: + description: 任务完成天数 + type: integer + claim_demands: + description: 任务拍摄要求 + type: string + claim_num: + description: 接任务人数 + type: integer + claim_stock: + description: 可接任务库存 + type: integer + description: + description: 描述/卖点 + type: string + end_time: + description: 任务结束时间 + type: string + has_sample: + description: 是否有样品 0:没有 1:有 + type: integer + has_video: + description: 是否有视频素材 0:没有 1:有 + type: integer + hire_money: + description: hire_type==1 佣金金额 + type: number + hire_money_expect: + description: 预计佣金描述 + type: string + hire_ratio: + description: hire_type==2 抽成比例 + type: number + hire_type: + description: 佣金类型 1:固定佣金 2:比例抽成 + type: integer + mission_id: + description: 任务id + type: integer + order_num: + description: 订单数 + type: integer + release_channels: + description: 发布渠道 + type: string + release_country: + description: 发布国家 + type: string + sample_num: + description: 样品数量 + type: integer + start_time: + description: 任务起始时间 + type: string + status: + description: 状态 1:未开始 2:进行中 3:已结束 + type: integer + title: + description: 任务名称 + type: string + video_channel_ids: + description: 视频发布渠道,多个渠道英文逗号连接 + type: string + video_country_id: + description: 视频发布国家 + type: string + video_url: + type: string + type: object + response.MissionClaimOrderResponse: + properties: + order: + $ref: '#/definitions/model.MissionClaimOrderDetail' + type: object + response.MissionClaimSimpleData: + properties: + achieve_num: + description: 已完成商品数量 + type: integer + claim_at: + description: 接任务时间 + type: string + claim_days: + description: 完成任务时间 + type: integer + claim_no: + description: 领取任务编号 + type: string + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + expire_at: + description: 任务推广过期时间 + type: string + finished: + description: 任务完成状态 0:未完成 1:已完成 + type: integer + has_video: + description: 是否有视频素材 0:没有 1:有 + type: integer + hire_money_expect: + description: 预计佣金描述 + type: string + hire_type: + description: 佣金类型 1:固定佣金 2:比例抽成 + type: integer + id: + description: 主键ID + type: integer + mission_id: + description: 任务id + type: integer + mission_title: + description: 任务名称 + type: string + orderMoney: + description: 订单金额 + type: number + orderNum: + description: 订单数 + type: integer + rewardFinished: + description: 佣金结算 + type: number + rewardUnfinished: + description: 在途佣金 + type: number + sign_url: + description: 签约地址 + type: string + status: + description: 状态 1:已领取待发货 2:已发货 3:已收货推广中 + type: integer + updatedAt: + description: 更新时间 + type: string + video: + $ref: '#/definitions/model.MissionClaimVideo' + video_url: + type: string + type: object + response.MissionClaimVideoDetail: + properties: + claim_goods: + allOf: + - $ref: '#/definitions/response.MissionClaimGoods' + description: 商品信息 + claim_video: + $ref: '#/definitions/model.MissionClaimVideo' + influencer_user: + allOf: + - $ref: '#/definitions/model.InfluencerUserDesc' + description: 网红信息 + mission_claim: + allOf: + - $ref: '#/definitions/response.MissionClaimInfo' + description: 任务领取信息 + type: object + response.MissionRecommendResponse: + properties: + cover: + type: string + create_by: + description: 创建人 + type: string + createdAt: + description: 创建时间 + type: string + end_time: + description: 任务结束时间 + type: string + goods_title: + type: string + hire_money: + description: hire_type==1 佣金金额 + type: number + hire_money_expect: + description: 预计佣金描述 + type: string + hire_ratio: + description: hire_type==2 抽成比例 + type: number + hire_type: + description: 佣金类型 1:固定佣金 2:比例抽成 + type: integer + id: + description: 主键ID + type: integer + influencer: + $ref: '#/definitions/model.InfluencerUserView' + mission_id: + type: integer + mission_status: + description: 任务状态 + type: integer + relation_id: + description: 关联ID,任务视频ID,添加视频只需要传relationId + type: integer + release_channels: + description: 发布渠道 + type: string + release_country: + description: 发布国家 + type: string + seller: + $ref: '#/definitions/model.SellerStoreInfo' + sort: + description: 倒序 //排序 + type: integer + sort_index: + type: integer + start_time: + description: 任务起始时间 + type: string + status: + description: 状态 1:上架 2:下架 + type: integer + tag: + description: todo 标签系统 + type: string + title: + type: string + updatedAt: + description: 更新时间 + type: string + video_url: + type: string + type: object + response.MissionStopData: + properties: + claim_num: + description: 接任务人数 + type: integer + description: + description: 描述/卖点 + type: string + end_time: + description: 任务结束时间 + type: string + goods: + allOf: + - $ref: '#/definitions/model.TbGoods4List' + description: 商品信息 + goods_title: + type: string + has_sample: + description: 是否有样品 0:没有 1:有 + type: integer + has_video: + description: 是否有视频素材 0:没有 1:有 + type: integer + hire_money: + description: hire_type==1 佣金金额 + type: number + hire_money_expect: + description: 预计佣金描述 + type: string + hire_ratio: + description: hire_type==2 抽成比例 + type: number + hire_type: + description: 佣金类型 1:固定佣金 2:比例抽成 + type: integer + id: + type: integer + mission_id: + type: integer + mission_status: + description: 任务状态 + type: integer + release_channels: + description: 发布渠道 + type: string + release_country: + description: 发布国家 + type: string + remark: + type: string + sample_num: + description: 样品数量 + type: integer + seller: + $ref: '#/definitions/model.SellerStoreInfo' + start_time: + description: 任务起始时间 + type: string + tag: + type: string + title: + type: string + type: object + response.MissionVideoResponse: + properties: + cover: + type: string + end_time: + description: 任务结束时间 + type: string + goods_title: + type: string + hire_money: + description: hire_type==1 佣金金额 + type: number + hire_money_expect: + description: 预计佣金描述 + type: string + hire_ratio: + description: hire_type==2 抽成比例 + type: number + hire_type: + description: 佣金类型 1:固定佣金 2:比例抽成 + type: integer + id: + type: integer + influencer: + $ref: '#/definitions/model.InfluencerUserView' + mission_id: + type: integer + mission_status: + description: 任务状态 + type: integer + release_channels: + description: 发布渠道 + type: string + release_country: + description: 发布国家 + type: string + seller: + $ref: '#/definitions/model.SellerStoreInfo' + source_type: + description: 类型:1:固定费用上传 2:奖励任务上传 3:后台上传 + type: integer + start_time: + description: 任务起始时间 + type: string + tag: + description: todo 标签系统 + type: string + title: + type: string + video_url: + type: string + type: object + response.PageResult: + properties: + list: {} + page: + type: integer + pageSize: + type: integer + total: + type: integer + type: object + response.PayResult: + properties: + pay_channel: + type: string + pay_id: + type: string + pay_return: + type: string + pay_status: + type: string + type: object + response.SellerFundData: + properties: + expend: + description: 支出金额 + type: number + expend_count: + description: 支出笔数 + type: integer + lock: + description: 锁定金额 + type: number + lock_count: + description: 锁定笔数 + type: integer + type: object + response.SellerWithdrawalData: + properties: + balance: + description: 余额账户 + type: number + fund: + description: 营销账户 + type: number + unexamined: + description: 待处理金额 + type: number + unexamined_count: + description: 待处理笔数 + type: integer + type: object + response.StoreInfoItem: + properties: + balance: + description: 佣金 + type: number + email: + description: 店铺联系email(注册账号email) + type: string + goods_num: + type: integer + id: + description: 主键ID + type: integer + papayl_name: + description: paypal账号 + type: string + phone: + type: string + store_no: + description: 店铺编号 + type: string + transit_balance: + description: 在途佣金 + type: number + type: + description: 1:个人店铺 + type: integer + valid_mission_num: + description: 有效任务数 + type: integer + type: object + response.SysAuthorityCopyResponse: + properties: + authority: + $ref: '#/definitions/model.SysAuthority' + oldAuthorityId: + description: 旧角色ID + type: integer + type: object +info: + contact: {} + title: Swagger Example API + version: 0.0.1 +paths: + /api/createApi: + post: + consumes: + - application/json + parameters: + - description: api路径, api中文描述, api组, 方法 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysApi' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建基础api + tags: + - SysApi + /api/deleteApi: + post: + consumes: + - application/json + parameters: + - description: ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysApi' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除api + tags: + - SysApi + /api/deleteApisByIds: + delete: + consumes: + - application/json + parameters: + - description: ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除选中Api + tags: + - SysApi + /api/getAllApis: + post: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取所有的Api 不分页 + tags: + - SysApi + /api/getApiById: + post: + consumes: + - application/json + parameters: + - description: 根据id获取api + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.GetById' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 根据id获取api + tags: + - SysApi + /api/getApiList: + post: + consumes: + - application/json + parameters: + - description: 分页获取API列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.SearchApiParams' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取API列表 + tags: + - SysApi + /api/updateApi: + post: + consumes: + - application/json + parameters: + - description: api路径, api中文描述, api组, 方法 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysApi' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"修改成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新基础api + tags: + - SysApi + /application/createApplication: + post: + consumes: + - application/json + parameters: + - description: 创建Application + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Application' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建Application + tags: + - Applicationv0.0.0 + /application/deleteApplication: + delete: + consumes: + - application/json + parameters: + - description: 删除Application + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Application' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除Application + tags: + - Applicationv0.0.0 + /application/deleteApplicationByIds: + delete: + consumes: + - application/json + parameters: + - description: 批量删除Application + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"批量删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除Application + tags: + - Applicationv0.0.0 + /application/findApplication: + get: + consumes: + - application/json + parameters: + - description: 用id查询Application + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Application' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用id查询Application + tags: + - Applicationv0.0.0 + /application/getApplicationList: + get: + consumes: + - application/json + parameters: + - description: 分页获取Application列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.ApplicationSearch' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取Application列表 + tags: + - Applicationv0.0.0 + /application/updateApplication: + put: + consumes: + - application/json + parameters: + - description: 更新Application + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Application' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新Application + tags: + - Applicationv0.0.0 + /authority/copyAuthority: + post: + consumes: + - application/json + parameters: + - description: 旧角色id, 新权限id, 新权限名, 新父角色id + in: body + name: data + required: true + schema: + $ref: '#/definitions/response.SysAuthorityCopyResponse' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"拷贝成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 拷贝角色 + tags: + - Authority + /authority/createAuthority: + post: + consumes: + - application/json + parameters: + - description: 权限id, 权限名, 父角色id + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysAuthority' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建角色 + tags: + - Authority + /authority/deleteAuthority: + post: + consumes: + - application/json + parameters: + - description: 删除角色 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysAuthority' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除角色 + tags: + - Authority + /authority/getAuthorityList: + post: + consumes: + - application/json + parameters: + - description: 页码, 每页大小 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PageInfo' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取角色列表 + tags: + - Authority + /authority/updateAuthority: + put: + consumes: + - application/json + parameters: + - description: 权限id, 权限名, 父角色id + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysAuthority' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新角色信息 + tags: + - Authority + /banner: + post: + consumes: + - application/json + parameters: + - description: data + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.CreateBanner' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建banner【v1.1.0新增】 + tags: + - banner + put: + consumes: + - application/json + parameters: + - description: id,data + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.UpdateBanner' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 编辑banner【v1.1.0新增】 + tags: + - banner + /banner/batchDelBanner: + delete: + consumes: + - application/json + parameters: + - description: ids + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除banner【v1.1.0新增】 + tags: + - banner + /banner/down-data: + put: + consumes: + - application/json + parameters: + - description: id + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"操作成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 下移banner排序【v1.1.0新增】 + tags: + - banner + /banner/list: + get: + consumes: + - application/json + parameters: + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 状态 0=下架 1=上架 + in: query + name: status + type: string + - description: 名称 + in: query + name: title + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + items: + $ref: '#/definitions/response.BannerListResponse' + type: array + security: + - ApiKeyAuth: [] + summary: 分页获取banner列表【v1.1.0新增】 + tags: + - banner + /banner/up-data: + put: + consumes: + - application/json + parameters: + - description: id,page,pageSize... + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"操作成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 上移banner排序【v1.1.0新增】 + tags: + - banner + /base/captcha: + post: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"验证码获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 生成验证码 + tags: + - Base + /base/chain: + get: + parameters: + - description: 区块/合约hash + in: query + name: hash + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/response.ChainResp' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + summary: 获取区块链数据 + tags: + - Chain + /base/login: + post: + parameters: + - description: 用户名, 密码, 验证码 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.Login' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"登陆成功"}' + schema: + type: string + summary: 用户登录 + tags: + - Base + /bill/admin-data: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.BillData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 平台账单数据 + tags: + - bill + /bill/admin-fund-data: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 状态 1:进行中 2:已完成 3:已失败 + in: query + name: status + type: integer + - description: 类型 1-支出 2-收入 + in: query + name: transaction_type + type: integer + - description: uuid + in: query + name: user_id + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.AdminFundData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 平台奖励账户数据 + tags: + - bill + /bill/admin-fund-list: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 状态 1:进行中 2:已完成 3:已失败 + in: query + name: status + type: integer + - description: 类型 1-支出 2-收入 + in: query + name: transaction_type + type: integer + - description: uuid + in: query + name: user_id + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.AdminBillFund' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 平台奖励账户列表 + tags: + - bill + /bill/admin-list: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.BillList' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 平台账单列表 + tags: + - bill + /bill/customer-data: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.BillData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 用户账单数据 + tags: + - bill + /bill/customer-list: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.BillList' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 用户账单列表 + tags: + - bill + /bill/influence-data: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.BillData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 网红账单数据 + tags: + - bill + /bill/influence-list: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.BillList' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 网红账单列表 + tags: + - bill + /bill/seller-data: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.BillData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 商家账单数据 + tags: + - bill + /bill/seller-fund-data: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 状态 1:进行中 2:已完成 3:已失败 + in: query + name: status + type: integer + - description: 类型 1-支出 2-收入 + in: query + name: transaction_type + type: integer + - description: uuid + in: query + name: user_id + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.SellerFundData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 商家营销账户数据 + tags: + - bill + /bill/seller-fund-list: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 状态 1:进行中 2:已完成 3:已失败 + in: query + name: status + type: integer + - description: 类型 1-支出 2-收入 + in: query + name: transaction_type + type: integer + - description: uuid + in: query + name: user_id + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.SellerBillFund' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 商家营销账户记录列表 + tags: + - bill + /bill/seller-list: + get: + parameters: + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 是否已到账 1-是 2-否 + in: query + name: receipt + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + - description: 类型 1-支出 2-收入 + in: query + name: status + type: integer + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.BillList' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 商家账单列表 + tags: + - bill + /business: + delete: + consumes: + - application/json + parameters: + - description: 删除Business + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SellerStore' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除Business + tags: + - Businessv0.0.0 + get: + consumes: + - application/json + parameters: + - description: 用id查询Business + in: body + name: data + required: true + schema: + $ref: '#/definitions/response.StoreInfoItem' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用id查询商家 + tags: + - Business + post: + consumes: + - application/json + parameters: + - description: 创建Business + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SellerStore' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建Business + tags: + - Businessv0.0.0 + put: + consumes: + - application/json + parameters: + - description: 更新Business + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SellerStore' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新商家 + tags: + - Business + /business/deleteBusinessByIds: + delete: + consumes: + - application/json + parameters: + - description: 批量删除Business + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"批量删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除商家 + tags: + - Businessv0.0.0 + /business/list: + get: + consumes: + - application/json + parameters: + - description: 分页获取商家列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PageInfo' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/model.SellerStoreInfo' + security: + - ApiKeyAuth: [] + summary: 商家列表 + tags: + - Business + /business/search: + get: + consumes: + - application/json + parameters: + - description: 分页获取商家列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.SearchStore' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/model.SellerStoreInfo' + security: + - ApiKeyAuth: [] + summary: 商家搜索 + tags: + - Business + /casbin/UpdateCasbin: + post: + consumes: + - application/json + parameters: + - description: 权限id, 权限模型列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.CasbinInReceive' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新角色api权限 + tags: + - Casbin + /casbin/getPolicyPathByAuthorityId: + post: + consumes: + - application/json + parameters: + - description: 权限id, 权限模型列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.CasbinInReceive' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取权限列表 + tags: + - Casbin + /category: + delete: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.IdsReq' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除分类 + tags: + - category + get: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.IdReq' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 查询单个商品分类 + tags: + - category + post: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.CreateCategory' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建分类 + tags: + - category + put: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.UpdateCategory' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新分类 + tags: + - category + /category/children: + get: + parameters: + - description: 父id + in: query + name: pid + type: integer + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 查询分类下级 + tags: + - category + /category/list: + get: + parameters: + - description: 层级 + in: query + name: layer + type: integer + - description: 名称 + in: query + name: name + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 商品分类分页 + tags: + - category + /dict/getDictDataList: + get: + consumes: + - application/json + parameters: + - description: 取值 release_country=发布国家 release_channel=发布渠道 tag_type=标签类型 + in: query + name: typeCode + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取数据字典取值列表【v1.0】 + tags: + - dict + /fileUploadAndDownload/breakpointContinue: + post: + consumes: + - multipart/form-data + parameters: + - description: an example for breakpoint resume, 断点续传示例 + in: formData + name: file + required: true + type: file + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"切片创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 断点续传到服务器 + tags: + - ExaFileUploadAndDownload + /fileUploadAndDownload/findFile: + post: + consumes: + - multipart/form-data + parameters: + - description: 上传文件完成 + in: formData + name: file + required: true + type: file + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"file uploaded, 文件创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建文件 + tags: + - ExaFileUploadAndDownload + /fileUploadAndDownload/removeChunk: + post: + consumes: + - multipart/form-data + parameters: + - description: 删除缓存切片 + in: formData + name: file + required: true + type: file + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"缓存切片删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除切片 + tags: + - ExaFileUploadAndDownload + /goods/list: + get: + consumes: + - application/json + parameters: + - description: 分页获取商品列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PageInfo' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/model.TbGoods4List' + security: + - ApiKeyAuth: [] + summary: 商品列表 + tags: + - Goods + /goods/search: + get: + consumes: + - application/json + parameters: + - description: 分页获取商品列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PageInfo' + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/model.TbGoods4List' + security: + - ApiKeyAuth: [] + summary: 商品搜索 + tags: + - Goods + /menu/addBaseMenu: + post: + consumes: + - application/json + parameters: + - description: 路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysBaseMenu' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"添加成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 新增菜单 + tags: + - Menu + /menu/addMenuAuthority: + post: + consumes: + - application/json + parameters: + - description: 角色ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.AddMenuAuthorityInfo' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"添加成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 增加menu和角色关联关系 + tags: + - AuthorityMenu + /menu/deleteBaseMenu: + post: + consumes: + - application/json + parameters: + - description: 菜单id + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.GetById' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除菜单 + tags: + - Menu + /menu/getBaseMenuById: + post: + consumes: + - application/json + parameters: + - description: 菜单id + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.GetById' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 根据id获取菜单 + tags: + - Menu + /menu/getBaseMenuTree: + post: + parameters: + - description: 空 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.Empty' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取用户动态路由 + tags: + - AuthorityMenu + /menu/getMenu: + post: + parameters: + - description: 空 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.Empty' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取用户动态路由 + tags: + - AuthorityMenu + /menu/getMenuAuthority: + post: + consumes: + - application/json + parameters: + - description: 角色ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.GetAuthorityId' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取指定角色menu + tags: + - AuthorityMenu + /menu/getMenuForList: + post: + parameters: + - description: 空 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.Empty' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取用户动态路由List + tags: + - AuthorityMenu + /menu/getMenuList: + post: + consumes: + - application/json + parameters: + - description: 页码, 每页大小 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PageInfo' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取基础menu列表 + tags: + - Menu + /menu/updateBaseMenu: + post: + consumes: + - application/json + parameters: + - description: 路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysBaseMenu' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新菜单 + tags: + - Menu + /mission/add-video: + post: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.AddMissionVideo' + responses: + "200": + description: '{"success":true,"data":{},"msg":"创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建任务视频 + tags: + - mission + /mission/claim-list: + get: + parameters: + - description: 任务id + in: query + name: mission_id + type: integer + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 状态 1:已领取待发货 2:已发货 3:已收货推广中 + in: query + name: status + type: integer + - description: 任务标题 + in: query + name: title + type: string + - description: 网红用户ID + in: query + name: uuid + type: string + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + items: + $ref: '#/definitions/response.MissionClaimSimpleData' + type: array + security: + - ApiKeyAuth: [] + summary: 获取任务领取列表 + tags: + - mission + /mission/claim-order: + get: + parameters: + - description: 订单编号 + in: query + name: order_id + type: string + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + $ref: '#/definitions/response.MissionClaimOrderResponse' + security: + - ApiKeyAuth: [] + summary: 获取任务订单详情【v1.0】 + tags: + - mission + /mission/claim-order-list: + get: + parameters: + - description: 收件人姓名 + in: query + name: address_name + type: string + - description: 收件人手机号 + in: query + name: address_phone + type: string + - description: 任务标题 + in: query + name: mission_title + type: string + - description: 订单id + in: query + name: order_id + type: string + - description: 订单时间结束 + in: query + name: order_time_end + type: string + - description: 订单时间起始 + in: query + name: order_time_start + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 商家ID + in: query + name: seller_id + type: string + - description: 商品编号 + in: query + name: spu_no + type: string + - description: 状态 2:待发货 3:已发货 + in: query + name: status + type: integer + - description: 网红用户ID + in: query + name: uuid + type: string + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + items: + $ref: '#/definitions/model.MissionClaimOrderDetail' + type: array + security: + - ApiKeyAuth: [] + summary: 获取任务订单列表【v1.0】 + tags: + - mission + /mission/claim-video-detail: + get: + parameters: + - description: id + in: query + name: id + type: integer + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + items: + $ref: '#/definitions/response.MissionClaimVideoDetail' + type: array + security: + - ApiKeyAuth: [] + summary: 任务视频审核详情【v1.0】 + tags: + - mission + /mission/edit-video: + put: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.EditMissionVideo' + responses: + "200": + description: '{"success":true,"data":{},"msg":"编辑成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 编辑任务视频 + tags: + - mission + /mission/influencer-summary-list: + get: + parameters: + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - in: query + name: uuid + type: string + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + items: + $ref: '#/definitions/model.MissionClaimSummary' + type: array + security: + - ApiKeyAuth: [] + summary: 获取网红任务统计列表 + tags: + - mission + /mission/mission: + get: + parameters: + - description: id + in: query + name: id + type: integer + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + $ref: '#/definitions/model.MissionDetail' + security: + - ApiKeyAuth: [] + summary: 获取任务详情 + tags: + - mission + /mission/mission-list: + get: + parameters: + - description: 是否有视频 1:是 2:否 + in: query + name: has_video + type: integer + - description: 佣金类型 1:固定佣金 2:比例抽成 + in: query + name: hire_type + type: integer + - description: 任务ID + in: query + name: mission_id + type: integer + - description: 筛选任务时间 + in: query + name: mission_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 商家邮箱 + in: query + name: seller_email + type: string + - description: 商家ID + in: query + name: seller_id + type: string + - description: 状态 1:未开始 2:进行中 3:已结束 + in: query + name: status + type: integer + - description: 名称 + in: query + name: title + type: string + - description: 视频发布渠道 + in: query + name: video_channel_id + type: string + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + $ref: '#/definitions/response.PageResult' + security: + - ApiKeyAuth: [] + summary: 获取任务列表 + tags: + - mission + /mission/recommend/add-data: + post: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.AddMissionRecommend' + responses: + "200": + description: '{"success":true,"data":{},"msg":"创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建任务推荐关联 + tags: + - mission/recommend + /mission/recommend/batch-del-data: + delete: + consumes: + - application/json + parameters: + - description: ids + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsUReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除任务推荐关联 + tags: + - mission/recommend + /mission/recommend/down-data: + put: + consumes: + - application/json + parameters: + - description: id + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"操作成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 上移任务推荐排序 + tags: + - mission/recommend + /mission/recommend/list: + get: + consumes: + - application/json + parameters: + - description: 是否有视频 1:是 2:否 + in: query + name: has_video + type: integer + - description: 佣金类型 1:固定佣金 2:比例抽成 + in: query + name: hire_type + type: integer + - description: 任务ID + in: query + name: mission_id + type: integer + - description: 筛选任务时间 + in: query + name: mission_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 商家邮箱 + in: query + name: seller_email + type: string + - description: 商家ID + in: query + name: seller_id + type: string + - description: 状态 1:未开始 2:进行中 3:已结束 + in: query + name: status + type: integer + - description: 名称 + in: query + name: title + type: string + - description: 视频发布渠道 + in: query + name: video_channel_id + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + items: + $ref: '#/definitions/response.MissionRecommendResponse' + type: array + security: + - ApiKeyAuth: [] + summary: 分页获取任务推荐列表 + tags: + - mission/recommend + /mission/recommend/up-data: + put: + consumes: + - application/json + parameters: + - description: id,page,pageSize... + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"操作成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 上移任务推荐排序 + tags: + - mission/recommend + /mission/recommend/update-sort: + put: + consumes: + - application/json + parameters: + - description: id + in: body + name: data + required: true + schema: + $ref: '#/definitions/global.BASE_ID_SORT' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"操作成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 修改任务推荐排序 + tags: + - mission/recommend + /mission/send-sys-reward: + post: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.IdReq' + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 发送系统任务奖励 + tags: + - mission + /mission/stop: + put: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.IdReq' + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 结束任务 + tags: + - mission + /mission/stop-detail: + get: + consumes: + - application/json + parameters: + - description: id + in: query + name: id + type: integer + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/response.MissionStopData' + security: + - ApiKeyAuth: [] + summary: 获取任务结束详情 + tags: + - mission + /mission/stop-list: + get: + consumes: + - application/json + parameters: + - description: 审核状态 1:待审核 2:审核通过 3:审核不通过 4:已审核=审核通过+审核不通过 + in: query + name: audit_status + type: integer + - description: 是否有视频 1:是 2:否 + in: query + name: has_video + type: integer + - description: 佣金类型 1:固定佣金 2:比例抽成 + in: query + name: hire_type + type: integer + - description: 任务ID + in: query + name: mission_id + type: integer + - description: 筛选任务时间 + in: query + name: mission_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 商家邮箱 + in: query + name: seller_email + type: string + - description: 商家ID + in: query + name: seller_id + type: string + - description: 状态 1:未开始 2:进行中 3:已结束 + in: query + name: status + type: integer + - description: 名称 + in: query + name: title + type: string + - description: 视频发布渠道 + in: query + name: video_channel_id + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + items: + $ref: '#/definitions/response.MissionStopData' + type: array + security: + - ApiKeyAuth: [] + summary: 分页获取任务结束申请列表 + tags: + - mission + /mission/sys-reward-list: + get: + parameters: + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 时间结束 + in: query + name: time_end + type: string + - description: 时间起始 + in: query + name: time_start + type: string + - description: 标题 + in: query + name: title + type: string + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + items: + $ref: '#/definitions/model.SysMissionReward' + type: array + security: + - ApiKeyAuth: [] + summary: 获取平台奖励列表【v1.0】 + tags: + - mission + /mission/tag-relation: + post: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.CreateMissionTagRelation' + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 打标签 + tags: + - mission + /mission/video-list: + get: + parameters: + - description: 佣金类型 1:固定佣金 2:比例抽成 + in: query + name: hire_type + type: integer + - description: 网红账号 + in: query + name: mission_claim_by + type: string + - description: 任务ID + in: query + name: mission_id + type: integer + - description: 筛选任务时间 + in: query + name: mission_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 商家邮箱 + in: query + name: seller_email + type: string + - description: 商家ID + in: query + name: seller_id + type: string + - description: 类型:1:固定费用上传 2:奖励任务上传 3:后台上传 + in: query + name: source_type + type: integer + - description: 状态 1:未开始 2:进行中 3:已结束 + in: query + name: status + type: integer + - description: 名称 + in: query + name: title + type: string + - description: 视频发布渠道 + in: query + name: video_channel_id + type: string + - description: 视频状态 1:待审核 2:审核通过 3:审核不通过 + in: query + name: video_status + type: integer + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + items: + $ref: '#/definitions/response.MissionVideoResponse' + type: array + security: + - ApiKeyAuth: [] + summary: 获取任务视频列表 + tags: + - mission + /order/detail: + get: + parameters: + - description: 订单号 + in: query + name: orderID + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/model.OrderDetail' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 获取订单详情 + tags: + - order + /order/list: + get: + parameters: + - description: 网红码? + in: query + name: code + type: string + - description: 订单下单时间 + in: query + name: createdAt + type: string + - description: 下单截至时间 + in: query + name: createdAtEnd + type: string + - description: 下单起始时间 + in: query + name: createdAtStart + type: string + - description: 商品id + in: query + name: goodsID + type: integer + - description: 网红id + in: query + name: influenceId + type: string + - description: 任务名称 + in: query + name: missionTitle + type: string + - description: 收件人姓名 + in: query + name: name + type: string + - description: 订单号 + in: query + name: orderID + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 收件人电话 + in: query + name: phone + type: string + - description: spu_no + in: query + name: spu_no + type: string + - description: 订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消 + in: query + name: status + type: integer + - description: 商户编号 + in: query + name: storeNo + type: string + - description: 用户id + in: query + name: userId + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.OrderList' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 获取订单列表 + tags: + - order + /order/statistic: + get: + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.DataStatistics' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 获取数据统计 + tags: + - order + /organization/createOrganization: + post: + consumes: + - application/json + parameters: + - description: 创建Organization + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Organization' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建Organization + tags: + - Organizationv0.0.0 + /organization/deleteOrganization: + delete: + consumes: + - application/json + parameters: + - description: 删除Organization + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Organization' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除Organization + tags: + - Organizationv0.0.0 + /organization/deleteOrganizationByIds: + delete: + consumes: + - application/json + parameters: + - description: 批量删除Organization + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"批量删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除Organization + tags: + - Organizationv0.0.0 + /organization/findOrganization: + get: + consumes: + - application/json + parameters: + - description: 用id查询Organization + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Organization' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用id查询Organization + tags: + - Organizationv0.0.0 + /organization/getOrganizationList: + get: + consumes: + - application/json + parameters: + - description: 分页获取Organization列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.OrganizationSearch' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取Organization列表 + tags: + - Organizationv0.0.0 + /organization/updateOrganization: + put: + consumes: + - application/json + parameters: + - description: 更新Organization + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Organization' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新Organization + tags: + - Organizationv0.0.0 + /provider/createProvider: + post: + consumes: + - application/json + parameters: + - description: 创建Provider + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Provider' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建Provider + tags: + - Providerv0.0.0 + /provider/deleteProvider: + delete: + consumes: + - application/json + parameters: + - description: 删除Provider + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Provider' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除Provider + tags: + - Providerv0.0.0 + /provider/deleteProviderByIds: + delete: + consumes: + - application/json + parameters: + - description: 批量删除Provider + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"批量删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除Provider + tags: + - Providerv0.0.0 + /provider/findProvider: + get: + consumes: + - application/json + parameters: + - description: 用id查询Provider + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Provider' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用id查询Provider + tags: + - Providerv0.0.0 + /provider/getProviderList: + get: + consumes: + - application/json + parameters: + - description: 分页获取Provider列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.ProviderSearch' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取Provider列表 + tags: + - Providerv0.0.0 + /provider/updateProvider: + put: + consumes: + - application/json + parameters: + - description: 更新Provider + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.Provider' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新Provider + tags: + - Providerv0.0.0 + /suser/deleteUser: + delete: + consumes: + - application/json + parameters: + - description: 用户ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.GetById' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除用户 + tags: + - SysUser + /suser/getUserList: + post: + consumes: + - application/json + parameters: + - description: 页码, 每页大小 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.SearchSysUserParams' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取用户列表 + tags: + - SysUser + /sysOperationRecord/createSysOperationRecord: + post: + consumes: + - application/json + parameters: + - description: 创建SysOperationRecord + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysOperationRecord' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建SysOperationRecord + tags: + - SysOperationRecord + /sysOperationRecord/deleteSysOperationRecord: + delete: + consumes: + - application/json + parameters: + - description: SysOperationRecord模型 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysOperationRecord' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除SysOperationRecord + tags: + - SysOperationRecord + /sysOperationRecord/deleteSysOperationRecordByIds: + delete: + consumes: + - application/json + parameters: + - description: 批量删除SysOperationRecord + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"批量删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除SysOperationRecord + tags: + - SysOperationRecord + /sysOperationRecord/findSysOperationRecord: + get: + consumes: + - application/json + parameters: + - description: Id + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysOperationRecord' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用id查询SysOperationRecord + tags: + - SysOperationRecord + /sysOperationRecord/getSysOperationRecordList: + get: + consumes: + - application/json + parameters: + - description: 页码, 每页大小, 搜索条件 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.SysOperationRecordSearch' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 分页获取SysOperationRecord列表 + tags: + - SysOperationRecord + /system/getSystemConfig: + post: + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取配置文件内容 + tags: + - System + /system/reloadSystem: + post: + produces: + - application/json + responses: + "200": + description: '{"code":0,"data":{},"msg":"重启系统成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 重启系统 + tags: + - System + /system/setSystemConfig: + post: + parameters: + - description: 设置配置文件内容 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.System' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"设置成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 设置配置文件内容 + tags: + - System + /tags: + post: + consumes: + - application/json + parameters: + - description: data + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.TagsCommon' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"创建成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建标签 + tags: + - tags + put: + consumes: + - application/json + parameters: + - description: id,data + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.TagsCommon' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 编辑标签 + tags: + - tags + /tags/batchDelTags: + delete: + consumes: + - application/json + parameters: + - description: ids + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除标签 + tags: + - tags + /tags/list: + get: + consumes: + - application/json + parameters: + - in: query + name: id + type: integer + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 标签类型 01-任务 02-任务视频 03-网红 + in: query + name: type + type: string + - description: 值 + in: query + name: value + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + items: + items: + $ref: '#/definitions/model.Tags' + type: array + type: array + security: + - ApiKeyAuth: [] + summary: 分页获取标签列表 + tags: + - tags + /tags/relationTags: + get: + consumes: + - application/json + parameters: + - in: query + name: relation_id + type: string + - in: query + name: relation_type + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + items: + $ref: '#/definitions/model.TagsDesc' + type: array + security: + - ApiKeyAuth: [] + summary: 获取关联标签列表 + tags: + - tags + post: + parameters: + - description: params + in: body + name: data + schema: + $ref: '#/definitions/request.CreateTagRelation' + responses: + "200": + description: '{"code": 200, "data": {}}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 打标签 + tags: + - tags + /user/changePassword: + put: + parameters: + - description: 用户名, 原密码, 新密码 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.ChangePasswordStruct' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"修改成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用户修改密码 + tags: + - SysUser + /user/createUser: + post: + consumes: + - application/json + parameters: + - description: 创建User + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.User' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建User + tags: + - User + /user/deleteUser: + delete: + consumes: + - application/json + parameters: + - description: 删除User + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.User' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除User + tags: + - User + /user/deleteUserByIds: + delete: + consumes: + - application/json + parameters: + - description: 批量删除User + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"批量删除成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 批量删除User + tags: + - User + /user/findUser: + get: + consumes: + - application/json + parameters: + - description: 用户id + in: query + name: user_id + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查询成功"}' + schema: + $ref: '#/definitions/model.UserSimple' + security: + - ApiKeyAuth: [] + summary: 用id查询User + tags: + - User + /user/getUserInfo: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取用户信息 + tags: + - SysUser + /user/getUserList: + get: + consumes: + - application/json + parameters: + - description: 用户邮箱 + in: query + name: email + type: string + - in: query + name: end_time + type: string + - in: query + name: id_forbidden + type: string + - description: 昵称 + in: query + name: nick_name + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 用户手机号 + in: query + name: phone + type: string + - in: query + name: start_time + type: string + - description: customer-普通用户 influencer-网红 + in: query + name: type + type: string + - in: query + name: username + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/model.UserSimple' + security: + - ApiKeyAuth: [] + summary: 分页获取User列表 + tags: + - User + post: + consumes: + - application/json + parameters: + - description: 用户邮箱 + in: query + name: email + type: string + - in: query + name: end_time + type: string + - in: query + name: id_forbidden + type: string + - description: 昵称 + in: query + name: nick_name + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 用户手机号 + in: query + name: phone + type: string + - in: query + name: start_time + type: string + - description: customer-普通用户 influencer-网红 + in: query + name: type + type: string + - in: query + name: username + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/model.UserSimple' + security: + - ApiKeyAuth: [] + summary: 分页获取系统User列表 + tags: + - User + /user/getUserSelectList: + get: + consumes: + - application/json + parameters: + - description: nickName + in: query + name: nickName + required: true + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取用户选择器列表 + tags: + - SysUser + /user/platformAuth: + get: + consumes: + - application/json + parameters: + - description: 用户邮箱 + in: query + name: email + type: string + - in: query + name: end_time + type: string + - in: query + name: id_forbidden + type: string + - description: 昵称 + in: query + name: nick_name + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 用户手机号 + in: query + name: phone + type: string + - description: 平台 + in: query + name: platform + type: string + - in: query + name: start_time + type: string + - description: 认证状态 0:未认证 1:已认证 2:认证失败 + in: query + name: status + type: string + - description: customer-普通用户 influencer-网红 + in: query + name: type + type: string + - in: query + name: username + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + $ref: '#/definitions/model.PlatformAuthSimple' + security: + - ApiKeyAuth: [] + summary: 获取网红认证审核记录 + tags: + - User + put: + consumes: + - application/json + parameters: + - description: 分页获取User列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PlatformAuthCheck' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 网红认证审核 + tags: + - User + /user/register: + post: + parameters: + - description: 用户名, 昵称, 密码, 角色ID,姓名,手机 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysUser' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"注册成功"}' + schema: + type: string + summary: 用户注册账号 + tags: + - SysUser + /user/setUserAuthorities: + post: + consumes: + - application/json + parameters: + - description: 用户UUID, 角色ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.SetUserAuthorities' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"修改成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 设置用户权限 + tags: + - SysUser + /user/setUserAuthority: + post: + consumes: + - application/json + parameters: + - description: 用户UUID, 角色ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.SetUserAuth' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"修改成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 设置用户权限 + tags: + - SysUser + /user/setUserInfo: + put: + consumes: + - application/json + parameters: + - description: ID, 用户名, 昵称, 头像链接 + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.SysUser' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"设置成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 设置用户信息 + tags: + - SysUser + /user/updateUser: + put: + consumes: + - application/json + parameters: + - description: 更新User + in: body + name: data + required: true + schema: + $ref: '#/definitions/model.User' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"更新成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新User + tags: + - User + /user/userStatus: + put: + consumes: + - application/json + parameters: + - description: 分页获取User列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.UserStatus' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 用户禁用启用 + tags: + - User + /wallet/fund/recharge: + post: + parameters: + - description: data... + in: body + name: data + schema: + $ref: '#/definitions/request.FundRecharge' + responses: + "200": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 奖励账户充值 + tags: + - wallet + /withdrawal/admin-data: + get: + parameters: + - description: 审核状态 0:待审核 1:审核通过 2:审核未通过 + in: query + name: check_status + type: string + - description: 处理状态 0:待处理 1:已处理 + in: query + name: deal_status + type: string + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.BkbData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 平台提现数据 + tags: + - bill + /withdrawal/admin-list: + get: + parameters: + - description: 审核状态 0:待审核 1:审核通过 2:审核未通过 + in: query + name: check_status + type: string + - description: 处理状态 0:待处理 1:已处理 + in: query + name: deal_status + type: string + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.Withdrawal' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 平台提现列表 + tags: + - bill + /withdrawal/influence-data: + get: + parameters: + - description: 审核状态 0:待审核 1:审核通过 2:审核未通过 + in: query + name: check_status + type: string + - description: 处理状态 0:待处理 1:已处理 + in: query + name: deal_status + type: string + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.InfluenceWithdrawalData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 网红提现数据 + tags: + - bill + /withdrawal/influence-list: + get: + parameters: + - description: 审核状态 0:待审核 1:审核通过 2:审核未通过 + in: query + name: check_status + type: string + - description: 处理状态 0:待处理 1:已处理 + in: query + name: deal_status + type: string + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.Withdrawal' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 网红提现列表 + tags: + - bill + /withdrawal/seller-data: + get: + parameters: + - description: 审核状态 0:待审核 1:审核通过 2:审核未通过 + in: query + name: check_status + type: string + - description: 处理状态 0:待处理 1:已处理 + in: query + name: deal_status + type: string + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + $ref: '#/definitions/response.SellerWithdrawalData' + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 商家提现数据 + tags: + - bill + /withdrawal/seller-examine: + post: + parameters: + - description: data... + in: body + name: data + schema: + $ref: '#/definitions/request.ExamineWithdrawal' + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + type: string + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 商家提现审核 + tags: + - bill + /withdrawal/seller-list: + get: + parameters: + - description: 审核状态 0:待审核 1:审核通过 2:审核未通过 + in: query + name: check_status + type: string + - description: 处理状态 0:待处理 1:已处理 + in: query + name: deal_status + type: string + - description: 结束时间 + in: query + name: end_time + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 开始时间 + in: query + name: start_time + type: string + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + items: + $ref: '#/definitions/model.Withdrawal' + type: array + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 商家提现列表 + tags: + - bill + /withdrawal/status: + put: + parameters: + - description: data... + in: body + name: data + schema: + $ref: '#/definitions/request.TransferResult' + responses: + "200": + description: '{"code": 0, "data": [...]}' + schema: + type: string + "201": + description: '{"code": 1, "message": ""}' + schema: + type: string + security: + - Bearer: [] + summary: 手动提现打款状态 + tags: + - bill +securityDefinitions: + ApiKeyAuth: + in: header + name: x-token + type: apiKey +swagger: "2.0" diff --git a/dto/customer.pb.go b/dto/customer.pb.go new file mode 100644 index 0000000..a2524b2 --- /dev/null +++ b/dto/customer.pb.go @@ -0,0 +1,1006 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: customer.proto + +package dto + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type LoginRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Phone string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"` + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` +} + +func (x *LoginRequest) Reset() { + *x = LoginRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginRequest) ProtoMessage() {} + +func (x *LoginRequest) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead. +func (*LoginRequest) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{0} +} + +func (x *LoginRequest) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *LoginRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +type SmsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Phone string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"` +} + +func (x *SmsRequest) Reset() { + *x = SmsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SmsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SmsRequest) ProtoMessage() {} + +func (x *SmsRequest) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SmsRequest.ProtoReflect.Descriptor instead. +func (*SmsRequest) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{1} +} + +func (x *SmsRequest) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +type WithdrawRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Phone string `protobuf:"bytes,1,opt,name=phone,proto3" json:"phone,omitempty"` //账户绑定手机号 + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` //验证码 + Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"` //提现金额 + AccountID int32 `protobuf:"varint,4,opt,name=accountID,proto3" json:"accountID,omitempty"` //账户id +} + +func (x *WithdrawRequest) Reset() { + *x = WithdrawRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WithdrawRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WithdrawRequest) ProtoMessage() {} + +func (x *WithdrawRequest) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use WithdrawRequest.ProtoReflect.Descriptor instead. +func (*WithdrawRequest) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{2} +} + +func (x *WithdrawRequest) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *WithdrawRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *WithdrawRequest) GetAmount() float64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *WithdrawRequest) GetAccountID() int32 { + if x != nil { + return x.AccountID + } + return 0 +} + +type CreateAddressRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + FirstName string `protobuf:"bytes,1,opt,name=firstName,proto3" json:"firstName,omitempty"` + LastName string `protobuf:"bytes,2,opt,name=lastName,proto3" json:"lastName,omitempty"` + Street string `protobuf:"bytes,3,opt,name=street,proto3" json:"street,omitempty"` + Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` + Bldg string `protobuf:"bytes,5,opt,name=bldg,proto3" json:"bldg,omitempty"` + City string `protobuf:"bytes,6,opt,name=city,proto3" json:"city,omitempty"` + State string `protobuf:"bytes,7,opt,name=state,proto3" json:"state,omitempty"` + ZipCode string `protobuf:"bytes,8,opt,name=zipCode,proto3" json:"zipCode,omitempty"` + Default int32 `protobuf:"varint,9,opt,name=default,proto3" json:"default,omitempty"` +} + +func (x *CreateAddressRequest) Reset() { + *x = CreateAddressRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAddressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAddressRequest) ProtoMessage() {} + +func (x *CreateAddressRequest) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateAddressRequest.ProtoReflect.Descriptor instead. +func (*CreateAddressRequest) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateAddressRequest) GetFirstName() string { + if x != nil { + return x.FirstName + } + return "" +} + +func (x *CreateAddressRequest) GetLastName() string { + if x != nil { + return x.LastName + } + return "" +} + +func (x *CreateAddressRequest) GetStreet() string { + if x != nil { + return x.Street + } + return "" +} + +func (x *CreateAddressRequest) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *CreateAddressRequest) GetBldg() string { + if x != nil { + return x.Bldg + } + return "" +} + +func (x *CreateAddressRequest) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *CreateAddressRequest) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *CreateAddressRequest) GetZipCode() string { + if x != nil { + return x.ZipCode + } + return "" +} + +func (x *CreateAddressRequest) GetDefault() int32 { + if x != nil { + return x.Default + } + return 0 +} + +type UpdateAddressRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + FirstName string `protobuf:"bytes,2,opt,name=firstName,proto3" json:"firstName,omitempty"` + LastName string `protobuf:"bytes,3,opt,name=lastName,proto3" json:"lastName,omitempty"` + Street string `protobuf:"bytes,4,opt,name=street,proto3" json:"street,omitempty"` + Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` + Bldg string `protobuf:"bytes,6,opt,name=bldg,proto3" json:"bldg,omitempty"` + City string `protobuf:"bytes,7,opt,name=city,proto3" json:"city,omitempty"` + State string `protobuf:"bytes,8,opt,name=state,proto3" json:"state,omitempty"` + ZipCode string `protobuf:"bytes,9,opt,name=zipCode,proto3" json:"zipCode,omitempty"` + Default int32 `protobuf:"varint,10,opt,name=default,proto3" json:"default,omitempty"` +} + +func (x *UpdateAddressRequest) Reset() { + *x = UpdateAddressRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateAddressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateAddressRequest) ProtoMessage() {} + +func (x *UpdateAddressRequest) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateAddressRequest.ProtoReflect.Descriptor instead. +func (*UpdateAddressRequest) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateAddressRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateAddressRequest) GetFirstName() string { + if x != nil { + return x.FirstName + } + return "" +} + +func (x *UpdateAddressRequest) GetLastName() string { + if x != nil { + return x.LastName + } + return "" +} + +func (x *UpdateAddressRequest) GetStreet() string { + if x != nil { + return x.Street + } + return "" +} + +func (x *UpdateAddressRequest) GetPhone() string { + if x != nil { + return x.Phone + } + return "" +} + +func (x *UpdateAddressRequest) GetBldg() string { + if x != nil { + return x.Bldg + } + return "" +} + +func (x *UpdateAddressRequest) GetCity() string { + if x != nil { + return x.City + } + return "" +} + +func (x *UpdateAddressRequest) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *UpdateAddressRequest) GetZipCode() string { + if x != nil { + return x.ZipCode + } + return "" +} + +func (x *UpdateAddressRequest) GetDefault() int32 { + if x != nil { + return x.Default + } + return 0 +} + +type IdRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *IdRequest) Reset() { + *x = IdRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdRequest) ProtoMessage() {} + +func (x *IdRequest) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdRequest.ProtoReflect.Descriptor instead. +func (*IdRequest) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{5} +} + +func (x *IdRequest) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +type CreateOrderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // 网红领取任务码 + SkuID int32 `protobuf:"varint,2,opt,name=skuID,proto3" json:"skuID,omitempty"` // skuId + Number int32 `protobuf:"varint,3,opt,name=number,proto3" json:"number,omitempty"` // 购买数量 + AddressID int32 `protobuf:"varint,4,opt,name=addressID,proto3" json:"addressID,omitempty"` // 地址id + PayMode int32 `protobuf:"varint,5,opt,name=payMode,proto3" json:"payMode,omitempty"` // 支付方式 1:paypal + Platform string `protobuf:"bytes,6,opt,name=platform,proto3" json:"platform,omitempty"` +} + +func (x *CreateOrderRequest) Reset() { + *x = CreateOrderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateOrderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateOrderRequest) ProtoMessage() {} + +func (x *CreateOrderRequest) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateOrderRequest.ProtoReflect.Descriptor instead. +func (*CreateOrderRequest) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateOrderRequest) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *CreateOrderRequest) GetSkuID() int32 { + if x != nil { + return x.SkuID + } + return 0 +} + +func (x *CreateOrderRequest) GetNumber() int32 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *CreateOrderRequest) GetAddressID() int32 { + if x != nil { + return x.AddressID + } + return 0 +} + +func (x *CreateOrderRequest) GetPayMode() int32 { + if x != nil { + return x.PayMode + } + return 0 +} + +func (x *CreateOrderRequest) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +type PaybackBody struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Attach string `protobuf:"bytes,1,opt,name=attach,proto3" json:"attach,omitempty"` + OutTradeNo string `protobuf:"bytes,2,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` + TransactionId string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + PayId string `protobuf:"bytes,4,opt,name=pay_id,json=payId,proto3" json:"pay_id,omitempty"` + CaptureId string `protobuf:"bytes,5,opt,name=capture_id,json=captureId,proto3" json:"capture_id,omitempty"` + Status string `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,7,opt,name=message,proto3" json:"message,omitempty"` + ResourceType string `protobuf:"bytes,8,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` +} + +func (x *PaybackBody) Reset() { + *x = PaybackBody{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaybackBody) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaybackBody) ProtoMessage() {} + +func (x *PaybackBody) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaybackBody.ProtoReflect.Descriptor instead. +func (*PaybackBody) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{7} +} + +func (x *PaybackBody) GetAttach() string { + if x != nil { + return x.Attach + } + return "" +} + +func (x *PaybackBody) GetOutTradeNo() string { + if x != nil { + return x.OutTradeNo + } + return "" +} + +func (x *PaybackBody) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *PaybackBody) GetPayId() string { + if x != nil { + return x.PayId + } + return "" +} + +func (x *PaybackBody) GetCaptureId() string { + if x != nil { + return x.CaptureId + } + return "" +} + +func (x *PaybackBody) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *PaybackBody) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *PaybackBody) GetResourceType() string { + if x != nil { + return x.ResourceType + } + return "" +} + +type OrderData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + All int64 `protobuf:"varint,1,opt,name=all,proto3" json:"all,omitempty"` // 全部 + Unpaid int64 `protobuf:"varint,2,opt,name=unpaid,proto3" json:"unpaid,omitempty"` // 未付款 + Unship int64 `protobuf:"varint,3,opt,name=unship,proto3" json:"unship,omitempty"` // 待发货 + Shipped int64 `protobuf:"varint,4,opt,name=shipped,proto3" json:"shipped,omitempty"` // 已发货 + Finished int64 `protobuf:"varint,5,opt,name=finished,proto3" json:"finished,omitempty"` // 已完成 + Cancel int64 `protobuf:"varint,6,opt,name=cancel,proto3" json:"cancel,omitempty"` // 已取消 +} + +func (x *OrderData) Reset() { + *x = OrderData{} + if protoimpl.UnsafeEnabled { + mi := &file_customer_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OrderData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OrderData) ProtoMessage() {} + +func (x *OrderData) ProtoReflect() protoreflect.Message { + mi := &file_customer_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OrderData.ProtoReflect.Descriptor instead. +func (*OrderData) Descriptor() ([]byte, []int) { + return file_customer_proto_rawDescGZIP(), []int{8} +} + +func (x *OrderData) GetAll() int64 { + if x != nil { + return x.All + } + return 0 +} + +func (x *OrderData) GetUnpaid() int64 { + if x != nil { + return x.Unpaid + } + return 0 +} + +func (x *OrderData) GetUnship() int64 { + if x != nil { + return x.Unship + } + return 0 +} + +func (x *OrderData) GetShipped() int64 { + if x != nil { + return x.Shipped + } + return 0 +} + +func (x *OrderData) GetFinished() int64 { + if x != nil { + return x.Finished + } + return 0 +} + +func (x *OrderData) GetCancel() int64 { + if x != nil { + return x.Cancel + } + return 0 +} + +var File_customer_proto protoreflect.FileDescriptor + +var file_customer_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x03, 0x61, 0x70, 0x69, 0x22, 0x38, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, + 0x22, 0x0a, 0x0a, 0x53, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, + 0x6f, 0x6e, 0x65, 0x22, 0x71, 0x0a, 0x0f, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x44, 0x22, 0xf0, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, + 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x72, + 0x65, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x72, 0x65, 0x65, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6c, 0x64, 0x67, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6c, 0x64, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, 0x74, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x7a, 0x69, 0x70, 0x43, 0x6f, 0x64, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x7a, 0x69, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x80, 0x02, 0x0a, 0x14, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x74, 0x72, 0x65, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, + 0x72, 0x65, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6c, + 0x64, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6c, 0x64, 0x67, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x69, + 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x7a, 0x69, 0x70, 0x43, + 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x7a, 0x69, 0x70, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x1b, 0x0a, 0x09, + 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaa, 0x01, 0x0a, 0x12, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x44, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x6b, 0x75, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x44, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x49, 0x44, + 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x70, 0x61, 0x79, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0xfb, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x62, 0x61, + 0x63, 0x6b, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x12, 0x20, + 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x6e, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x64, 0x65, 0x4e, 0x6f, + 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x61, 0x79, 0x5f, 0x69, + 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x79, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x09, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x61, + 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x03, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x70, 0x61, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x6e, 0x70, 0x61, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x6e, + 0x73, 0x68, 0x69, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x68, 0x69, 0x70, 0x70, 0x65, 0x64, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x73, 0x68, 0x69, 0x70, 0x70, 0x65, 0x64, 0x12, 0x1a, + 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x42, 0x0e, 0x5a, 0x0c, 0x73, 0x68, 0x6f, 0x70, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x64, + 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_customer_proto_rawDescOnce sync.Once + file_customer_proto_rawDescData = file_customer_proto_rawDesc +) + +func file_customer_proto_rawDescGZIP() []byte { + file_customer_proto_rawDescOnce.Do(func() { + file_customer_proto_rawDescData = protoimpl.X.CompressGZIP(file_customer_proto_rawDescData) + }) + return file_customer_proto_rawDescData +} + +var file_customer_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_customer_proto_goTypes = []interface{}{ + (*LoginRequest)(nil), // 0: api.LoginRequest + (*SmsRequest)(nil), // 1: api.SmsRequest + (*WithdrawRequest)(nil), // 2: api.WithdrawRequest + (*CreateAddressRequest)(nil), // 3: api.CreateAddressRequest + (*UpdateAddressRequest)(nil), // 4: api.UpdateAddressRequest + (*IdRequest)(nil), // 5: api.IdRequest + (*CreateOrderRequest)(nil), // 6: api.CreateOrderRequest + (*PaybackBody)(nil), // 7: api.PaybackBody + (*OrderData)(nil), // 8: api.OrderData +} +var file_customer_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_customer_proto_init() } +func file_customer_proto_init() { + if File_customer_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_customer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SmsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WithdrawRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAddressRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateAddressRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateOrderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PaybackBody); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_customer_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OrderData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_customer_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_customer_proto_goTypes, + DependencyIndexes: file_customer_proto_depIdxs, + MessageInfos: file_customer_proto_msgTypes, + }.Build() + File_customer_proto = out.File + file_customer_proto_rawDesc = nil + file_customer_proto_goTypes = nil + file_customer_proto_depIdxs = nil +} diff --git a/dto/customer.proto b/dto/customer.proto new file mode 100644 index 0000000..07cf4e8 --- /dev/null +++ b/dto/customer.proto @@ -0,0 +1,73 @@ +syntax = "proto3"; + +package api; + +option go_package = "shop-api/dto"; + +message LoginRequest{ + string phone = 1; + string code = 2; +} + +message SmsRequest { + string phone = 1; +} +message WithdrawRequest { + string phone = 1;//账户绑定手机号 + string code = 2; //验证码 + double amount = 3;//提现金额 + int32 accountID = 4;//账户id +} + +message CreateAddressRequest{ + string firstName = 1; + string lastName = 2; + string street = 3; + string phone = 4; + string bldg = 5; + string city = 6; + string state = 7; + string zipCode = 8; + int32 default = 9; +} +message UpdateAddressRequest{ + int64 id = 1; + string firstName = 2; + string lastName = 3; + string street = 4; + string phone = 5; + string bldg = 6; + string city = 7; + string state = 8; + string zipCode = 9; + int32 default = 10; +} +message IdRequest{ + int64 id = 1; +} +message CreateOrderRequest { + string code = 1;// 网红领取任务码 + int32 skuID = 2;// skuId + int32 number = 3;// 购买数量 + int32 addressID = 4;// 地址id + int32 payMode = 5;// 支付方式 1:paypal + string platform = 6; +} +message PaybackBody{ + string attach = 1; + string out_trade_no = 2; + string transaction_id = 3; + string pay_id = 4; + string capture_id = 5; + string status = 6; + string message = 7; + string resource_type = 8; +} +message OrderData{ + int64 all = 1;// 全部 + int64 unpaid = 2;// 未付款 + int64 unship = 3;// 待发货 + int64 shipped = 4;// 已发货 + int64 finished = 5;// 已完成 + int64 cancel = 6;// 已取消 +} \ No newline at end of file diff --git a/global/global.go b/global/global.go new file mode 100644 index 0000000..175db43 --- /dev/null +++ b/global/global.go @@ -0,0 +1,24 @@ +package global + +import ( + "pure-admin/config" + "pure-admin/initialize/api" + "pure-admin/utils/timer" + + "github.com/go-redis/redis" + "github.com/minio/minio-go/v7" + "github.com/spf13/viper" + "go.uber.org/zap" + "gorm.io/gorm" +) + +var ( + MG_DB *gorm.DB + MG_REDIS *redis.Client + MG_CONFIG config.Server + MG_VP *viper.Viper + MG_LOG *zap.Logger + PAY_CLIENT api.GreeterClient + MG_MINIO *minio.Client + MG_Timer timer.Timer = timer.NewTimerTask() +) diff --git a/global/model.go b/global/model.go new file mode 100644 index 0000000..6b56dab --- /dev/null +++ b/global/model.go @@ -0,0 +1,56 @@ +package global + +import ( + "time" + + "gorm.io/gorm" +) + +type MG_MODEL struct { + ID uint `gorm:"AUTO_INCREMENT;PRIMARY_KEY;" json:"id"` // 主键ID + CreatedAt time.Time `gorm:"index" json:"createdAt"` // 创建时间 + UpdatedAt time.Time `gorm:"index" json:"updatedAt"` // 更新时间 + DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间 +} + +type TIME_MODEL struct { + CreatedAt time.Time `json:"-"` + UpdatedAt time.Time `json:"-"` + DeletedAt gorm.DeletedAt `json:"-"` +} + +type TIME_MODEL_VIEW struct { + CreatedAtStr string `gorm:"-" json:"createdAt"` + UpdatedAtStr string `gorm:"-" json:"updatedAt"` +} + +type BASE_ID_STR struct { + ID string `gorm:"primary_key;size:50" json:"id" form:"id"` //主键 +} + +type ID_BACKUP_STR struct { + ID string `gorm:"primary_key;size:50" json:"id" form:"id"` //主键 + // Kid int `json:"kid" form:"kid"` + Backup int `json:"backup" form:"backup"` + Check int `json:"check" form:"check"` + CurrentCheck string `json:"currentCheck" form:"currentCheck"` +} + +type BASE_ID struct { + ID uint `gorm:"AUTO_INCREMENT;primary_key;" json:"id" form:"id"` //主键 +} + +type ID_SORT struct { + ID string `json:"id"` + Sort int `json:"sort"` +} + +type ID_COUNT struct { + ID string `json:"id"` + Count int `json:"count"` +} + +type BASE_ID_SORT struct { + ID uint `json:"id"` + Sort int `json:"sort"` +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b13f726 --- /dev/null +++ b/go.mod @@ -0,0 +1,159 @@ +module pure-admin + +go 1.20 + +require ( + github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible + github.com/casbin/casbin/v2 v2.77.2 + github.com/casbin/gorm-adapter/v3 v3.20.0 + github.com/dgrijalva/jwt-go v3.2.0+incompatible + github.com/fsnotify/fsnotify v1.6.0 + github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 + github.com/gin-gonic/gin v1.9.1 + github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231219111544-85740b179b09 + github.com/go-kratos/kratos/v2 v2.7.2 + github.com/go-redis/redis v6.15.9+incompatible + github.com/go-sql-driver/mysql v1.7.1 + github.com/gookit/color v1.5.4 + github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible + github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible + github.com/minio/minio-go/v7 v7.0.63 + github.com/mojocn/base64Captcha v1.3.5 + github.com/nacos-group/nacos-sdk-go v1.1.4 + github.com/pili-engineering/pili-sdk-go.v2 v0.0.0-20200608105005-bb506e708987 + github.com/qiniu/api.v7/v7 v7.8.2 + github.com/robfig/cron/v3 v3.0.1 + github.com/satori/go.uuid v1.2.0 + github.com/spf13/viper v1.17.0 + github.com/swaggo/swag v1.16.2 + github.com/taskcluster/slugid-go v1.1.0 + github.com/tencentyun/cos-go-sdk-v5 v0.7.44 + github.com/unrolled/secure v1.13.0 + github.com/xuri/excelize/v2 v2.8.0 + go.uber.org/zap v1.26.0 + google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb + google.golang.org/grpc v1.58.2 + gorm.io/driver/mysql v1.5.2 + gorm.io/gorm v1.25.5 +) + +require ( + github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 // indirect + github.com/buger/jsonparser v1.1.1 // indirect + github.com/go-errors/errors v1.0.1 // indirect + github.com/go-kratos/aegis v0.2.0 // indirect + github.com/go-playground/form/v4 v4.2.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/gorilla/mux v1.8.0 // indirect + github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect + google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect +) + +require ( + github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect + github.com/KyleBanks/depth v1.2.1 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/bytedance/sonic v1.9.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/clbanning/mxj v1.8.4 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/gin-contrib/gzip v0.0.6 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/glebarez/go-sqlite v1.20.3 // indirect + github.com/glebarez/sqlite v1.7.0 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.6 // indirect + github.com/go-openapi/spec v0.20.4 // indirect + github.com/go-openapi/swag v0.19.15 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect + github.com/golang-sql/sqlexp v0.1.0 // indirect + github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect + github.com/google/go-querystring v1.0.0 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.13.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.3.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect + github.com/jackc/pgtype v1.12.0 // indirect + github.com/jackc/pgx/v4 v4.17.2 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/jonboulle/clockwork v0.4.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/lestrrat-go/strftime v1.0.6 // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mailru/easyjson v0.7.6 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/microsoft/go-mssqldb v0.17.0 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/minio/sha256-simd v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/mozillazg/go-httpheader v0.2.1 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect + github.com/onsi/gomega v1.28.0 // indirect + github.com/pborman/uuid v1.2.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/qiniu/x v1.10.5 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 // indirect + github.com/richardlehane/mscfb v1.0.4 // indirect + github.com/richardlehane/msoleps v1.0.3 // indirect + github.com/rs/xid v1.5.0 // indirect + github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.10.0 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/swaggo/gin-swagger v1.3.0 + github.com/tidwall/gjson v1.14.4 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect + github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect + github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca // indirect + github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a // indirect + go.uber.org/multierr v1.10.0 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/image v0.11.0 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/text v0.13.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.13.0 // indirect + google.golang.org/protobuf v1.31.0 + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + gorm.io/driver/postgres v1.4.4 // indirect + gorm.io/driver/sqlserver v1.4.1 // indirect + gorm.io/plugin/dbresolver v1.3.0 // indirect + modernc.org/libc v1.22.2 // indirect + modernc.org/mathutil v1.5.0 // indirect + modernc.org/memory v1.5.0 // indirect + modernc.org/sqlite v1.20.3 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..5dd9059 --- /dev/null +++ b/go.sum @@ -0,0 +1,1046 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= +github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc= +github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= +github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= +github.com/agiledragon/gomonkey/v2 v2.2.0 h1:QJWqpdEhGV/JJy70sZ/LDnhbSlMrqHAWHcNOjz1kyuI= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18 h1:zOVTBdCKFd9JbCKz9/nt+FovbjPFmb7mUnp8nH9fQBA= +github.com/aliyun/alibaba-cloud-sdk-go v1.61.18/go.mod h1:v8ESoHo4SyHmuB4b1tJqDHxfTGEciD+yhvOU/5s1Rfk= +github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible h1:Sg/2xHwDrioHpxTN6WMiwbXTpUEinBpHsN7mG21Rc2k= +github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/casbin/casbin/v2 v2.77.2 h1:yQinn/w9x8AswiwqwtrXz93VU48R1aYTXdHEx4RI3jM= +github.com/casbin/casbin/v2 v2.77.2/go.mod h1:mzGx0hYW9/ksOSpw3wNjk3NRAroq5VMFYUQ6G43iGPk= +github.com/casbin/gorm-adapter/v3 v3.20.0 h1:VpGKTlL56xIkhNUOC07bnzwjA/xqfVOAbkt6sniVxMo= +github.com/casbin/gorm-adapter/v3 v3.20.0/go.mod h1:pvTTuyP2Es8VPHLyUssGtvOb3ETYD2tG7TfT5K8X2Sg= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= +github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.11.2-0.20230627204322-7d0032219fcb h1:kxNVXsNro/lpR5WD+P1FI/yUHn2G03Glber3k8cQL2Y= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 h1:6VSn3hB5U5GeA6kQw4TwWIWbOhtvR2hmbBJnTOtqTWc= +github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6/go.mod h1:YxOVT5+yHzKvwhsiSIWmbAYM3Dr9AEEbER2dVayfBkg= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w= +github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4= +github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk= +github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y= +github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= +github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/glebarez/go-sqlite v1.20.3 h1:89BkqGOXR9oRmG58ZrzgoY/Fhy5x0M+/WV48U5zVrZ4= +github.com/glebarez/go-sqlite v1.20.3/go.mod h1:u3N6D/wftiAzIOJtZl6BmedqxmmkDfH3q+ihjqxC9u0= +github.com/glebarez/sqlite v1.7.0 h1:A7Xj/KN2Lvie4Z4rrgQHY8MsbebX3NyWsL3n2i82MVI= +github.com/glebarez/sqlite v1.7.0/go.mod h1:PkeevrRlF/1BhQBCnzcMWzgrIk7IOop+qS2jUYLfHhk= +github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kratos/aegis v0.2.0 h1:dObzCDWn3XVjUkgxyBp6ZeWtx/do0DPZ7LY3yNSJLUQ= +github.com/go-kratos/aegis v0.2.0/go.mod h1:v0R2m73WgEEYB3XYu6aE2WcMwsZkJ/Rzuf5eVccm7bI= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231219111544-85740b179b09 h1:NRIOBWSh16Zf3eESytTTKkrPvXBlXQ3JfvfLA6s+rlg= +github.com/go-kratos/kratos/contrib/registry/nacos/v2 v2.0.0-20231219111544-85740b179b09/go.mod h1:1Ko5XhohmjsVssvNbRRy6ZwTHiBPlT9XskPnI1E6eUo= +github.com/go-kratos/kratos/v2 v2.7.2 h1:WVPGFNLKpv+0odMnCPxM4ZHa2hy9I5FOnwpG3Vv4w5c= +github.com/go-kratos/kratos/v2 v2.7.2/go.mod h1:rppuc8+pGL2UtXA29bgFHWKqaaF6b6GB2XIYiDvFBRk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.6 h1:UBIxjkht+AWIgYzCDSv2GN+E/togfwXUJFRTWhl2Jjs= +github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= +github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.20.4 h1:O8hJrt0UMnhHcluhIdUgCLRWyM2x7QkBXRvOs7m+O1M= +github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.15 h1:D2NRCBzS9/pEY3gP9Nl8aDqGUcPFrwG2p+CNFrLyrCM= +github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= +github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg= +github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= +github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= +github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= +github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= +github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= +github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/gookit/color v1.3.6/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= +github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= +github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= +github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= +github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= +github.com/jackc/pgconn v1.13.0 h1:3L1XMNV2Zvca/8BYhzcRFS70Lr0WlDg16Di6SFGAbys= +github.com/jackc/pgconn v1.13.0/go.mod h1:AnowpAqO4CMIIJNZl2VJp+KrkAZciAkhEl0W0JIobpI= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgmock v0.0.0-20201204152224-4fe30f7445fd/go.mod h1:hrBW0Enj2AZTNpt/7Y5rr2xe/9Mn757Wtb2xeBzPv2c= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 h1:DadwsjnMwFjfWc9y5Wi/+Zz7xoE5ALHsRQlOctkOiHc= +github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65/go.mod h1:5R2h2EEX+qri8jOWMbJCtaPWkrrNc7OHwsp2TCqp7ak= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.6/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgproto3/v2 v2.3.1 h1:nwj7qwf0S+Q7ISFfBndqeLwSwxs+4DPsbRFjECT1Y4Y= +github.com/jackc/pgproto3/v2 v2.3.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b h1:C8S2+VttkHFdOOCXJe+YGfa4vHYwlt4Zx+IVXQ97jYg= +github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM= +github.com/jackc/pgtype v1.12.0 h1:Dlq8Qvcch7kiehm8wPGIW0W3KsCCHJnRacKW0UM8n5w= +github.com/jackc/pgtype v1.12.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= +github.com/jackc/pgx/v4 v4.17.2 h1:0Ut0rpeKwvIVbMQ1KbMBU4h6wxehBI535LK6Flheh8E= +github.com/jackc/pgx/v4 v4.17.2/go.mod h1:lcxIZN44yMIrWI78a5CpucdD14hX0SBDbNRvjDBItsw= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= +github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4= +github.com/jonboulle/clockwork v0.4.0/go.mod h1:xgRqUGwRcjKCO1vbZUEtSLrqKoPSsUpK7fnezOII0kc= +github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA= +github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= +github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ= +github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= +github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/microsoft/go-mssqldb v0.17.0 h1:Fto83dMZPnYv1Zwx5vHHxpNraeEaUlQ/hhHLgZiaenE= +github.com/microsoft/go-mssqldb v0.17.0/go.mod h1:OkoNGhGEs8EZqchVTtochlXruEhEOaO4S0d2sB5aeGQ= +github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= +github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= +github.com/minio/minio-go/v7 v7.0.63 h1:GbZ2oCvaUdgT5640WJOpyDhhDxvknAJU2/T3yurwcbQ= +github.com/minio/minio-go/v7 v7.0.63/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4= +github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= +github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/mojocn/base64Captcha v1.3.5 h1:Qeilr7Ta6eDtG4S+tQuZ5+hO+QHbiGAJdi4PfoagaA0= +github.com/mojocn/base64Captcha v1.3.5/go.mod h1:/tTTXn4WTpX9CfrmipqRytCpJ27Uw3G6I7NcP2WwcmY= +github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= +github.com/mozillazg/go-httpheader v0.2.1 h1:geV7TrjbL8KXSyvghnFm+NyTux/hxwueTSrwhe88TQQ= +github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= +github.com/nacos-group/nacos-sdk-go v1.1.4 h1:qyrZ7HTWM4aeymFfqnbgNRERh7TWuER10pCB7ddRcTY= +github.com/nacos-group/nacos-sdk-go v1.1.4/go.mod h1:cBv9wy5iObs7khOqov1ERFQrCuTR4ILpgaiaVMxEmGI= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c= +github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8= +github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pili-engineering/pili-sdk-go.v2 v0.0.0-20200608105005-bb506e708987 h1:PIPYQRZ0S1yjLPO05uNtYz5fcsiJ5Xo/vdQCrwde0fM= +github.com/pili-engineering/pili-sdk-go.v2 v0.0.0-20200608105005-bb506e708987/go.mod h1:nd8f4Fi29T7yRtBjAZwPOvsRurUzq7Jja5vWUB+aprk= +github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/qiniu/api.v7/v7 v7.8.2 h1:f08kI0MmsJNzK4sUS8bG3HDH67ktwd/ji23Gkiy2ra4= +github.com/qiniu/api.v7/v7 v7.8.2/go.mod h1:FPsIqxh1Ym3X01sANE5ZwXfLZSWoCUp5+jNI8cLo3l0= +github.com/qiniu/x v1.10.5 h1:7V/CYWEmo9axJULvrJN6sMYh2FdY+esN5h8jwDkA4b0= +github.com/qiniu/x v1.10.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs= +github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578 h1:VstopitMQi3hZP0fzvnsLmzXZdQGc4bEcgu24cp+d4M= +github.com/remyoudompheng/bigfft v0.0.0-20230126093431-47fa9a501578/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/richardlehane/mscfb v1.0.4 h1:WULscsljNPConisD5hR0+OyZjwK46Pfyr6mPu5ZawpM= +github.com/richardlehane/mscfb v1.0.4/go.mod h1:YzVpcZg9czvAuhk9T+a3avCpcFPMUWm7gK3DypaEsUk= +github.com/richardlehane/msoleps v1.0.1/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/richardlehane/msoleps v1.0.3 h1:aznSZzrwYRl3rLKRT3gUk9am7T/mLNSnJINvN0AQoVM= +github.com/richardlehane/msoleps v1.0.3/go.mod h1:BWev5JBpU9Ko2WAgmZEuiz4/u3ZYTKbjLycmwiWUfWg= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= +github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= +github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= +github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= +github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= +github.com/swaggo/gin-swagger v1.3.0 h1:eOmp7r57oUgZPw2dJOjcGNMse9cvXcI4tTqBcnZtPsI= +github.com/swaggo/gin-swagger v1.3.0/go.mod h1:oy1BRA6WvgtCp848lhxce7BnWH4C8Bxa0m5SkWx+cS0= +github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y= +github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= +github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= +github.com/taskcluster/slugid-go v1.1.0 h1:SWsUplliyamdYzOKVM4+lDohZKuL63fKreGkvIKJ9aI= +github.com/taskcluster/slugid-go v1.1.0/go.mod h1:5sOAcPHjqso1UkKxSl77CkKgOwha0D9X0msBKBj0AOg= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.563/go.mod h1:7sCQWVkxcsR38nffDW057DRGk8mUjK1Ing/EFOK8s8Y= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/kms v1.0.563/go.mod h1:uom4Nvi9W+Qkom0exYiJ9VWJjXwyxtPYTkKkaLMlfE0= +github.com/tencentyun/cos-go-sdk-v5 v0.7.44 h1:Vvz28KVdmSUrwTH2MWgAMlhzUAh+lQBSSAW1J7qJDW8= +github.com/tencentyun/cos-go-sdk-v5 v0.7.44/go.mod h1:LUFnaqRmGk6pEHOaRmdn2dCZR2j0cSsM5xowWFPTPao= +github.com/tidwall/gjson v1.14.4 h1:uo0p8EbA09J7RQaflQ1aBRffTR7xedD2bcIVSYxLnkM= +github.com/tidwall/gjson v1.14.4/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.13/go.mod h1:jxau1n+/wyTGLQoCkjok9r5zFa/FxT6eI5HiHKQszjc= +github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= +github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ugorji/go/codec v1.1.13/go.mod h1:oNVt3Dq+FO91WNQ/9JnHKQP2QJxTzoN7wCBFCq1OeuU= +github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/unrolled/secure v1.13.0 h1:sdr3Phw2+f8Px8HE5sd1EHdj1aV3yUwed/uZXChLFsk= +github.com/unrolled/secure v1.13.0/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= +github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca h1:uvPMDVyP7PXMMioYdyPH+0O+Ta/UO1WFfNYMO3Wz0eg= +github.com/xuri/efp v0.0.0-20230802181842-ad255f2331ca/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI= +github.com/xuri/excelize/v2 v2.8.0 h1:Vd4Qy809fupgp1v7X+nCS/MioeQmYVVzi495UCTqB7U= +github.com/xuri/excelize/v2 v2.8.0/go.mod h1:6iA2edBTKxKbZAa7X5bDhcCg51xdOn1Ar5sfoXRGrQg= +github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a h1:Mw2VNrNNNjDtw68VsEj2+st+oCSn4Uz7vZw6TbhcV1o= +github.com/xuri/nfp v0.0.0-20230819163627-dc951e3ffe1a/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.11.0 h1:ds2RoQvBvYTiJkwpSFDwCcDFNX7DqjL2WsUgTNk0Ooo= +golang.org/x/image v0.11.0/go.mod h1:bglhjqbqVuEb9e9+eNR45Jfu7D+T4Qan+NhQk8Ck2P8= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220224120231-95c6836cb0e7/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA= +google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= +google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI= +google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= +google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= +gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/mysql v1.3.2/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U= +gorm.io/driver/mysql v1.5.2 h1:QC2HRskSE75wBuOxe0+iCkyJZ+RqpudsQtqkp+IMuXs= +gorm.io/driver/mysql v1.5.2/go.mod h1:pQLhh1Ut/WUAySdTHwBpBv6+JKcj+ua4ZFx1QQTBzb8= +gorm.io/driver/postgres v1.4.4 h1:zt1fxJ+C+ajparn0SteEnkoPg0BQ6wOWXEQ99bteAmw= +gorm.io/driver/postgres v1.4.4/go.mod h1:whNfh5WhhHs96honoLjBAMwJGYEuA3m1hvgUbNXhPCw= +gorm.io/driver/sqlserver v1.4.1 h1:t4r4r6Jam5E6ejqP7N82qAJIJAht27EGT41HyPfXRw0= +gorm.io/driver/sqlserver v1.4.1/go.mod h1:DJ4P+MeZbc5rvY58PnmN1Lnyvb5gw5NPzGshHDnJLig= +gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.23.7/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= +gorm.io/gorm v1.24.0/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= +gorm.io/gorm v1.25.2-0.20230530020048-26663ab9bf55/go.mod h1:L4uxeKpfBml98NYqVqwAdmV1a2nBtAec/cf3fpucW/k= +gorm.io/gorm v1.25.5 h1:zR9lOiiYf09VNh5Q1gphfyia1JpiClIWG9hQaxB/mls= +gorm.io/gorm v1.25.5/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8= +gorm.io/plugin/dbresolver v1.3.0 h1:uFDX3bIuH9Lhj5LY2oyqR/bU6pqWuDgas35NAPF4X3M= +gorm.io/plugin/dbresolver v1.3.0/go.mod h1:Pr7p5+JFlgDaiM6sOrli5olekJD16YRunMyA2S7ZfKk= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +modernc.org/libc v1.22.2 h1:4U7v51GyhlWqQmwCHj28Rdq2Yzwk55ovjFrdPjs8Hb0= +modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= +modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= +modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= +modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/sqlite v1.20.3 h1:SqGJMMxjj1PHusLxdYxeQSodg7Jxn9WWkaAQjKrntZs= +modernc.org/sqlite v1.20.3/go.mod h1:zKcGyrICaxNTMEHSr1HQ2GUraP0j+845GYw37+EyT6A= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/initialize/api/greeter.pb.go b/initialize/api/greeter.pb.go new file mode 100644 index 0000000..c817689 --- /dev/null +++ b/initialize/api/greeter.pb.go @@ -0,0 +1,2205 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v3.21.12 +// source: greeter.proto + +package api + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The response message containing the greetings +type PingReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *PingReply) Reset() { + *x = PingReply{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PingReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PingReply) ProtoMessage() {} + +func (x *PingReply) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PingReply.ProtoReflect.Descriptor instead. +func (*PingReply) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{0} +} + +func (x *PingReply) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type Country struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *Country) Reset() { + *x = Country{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Country) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Country) ProtoMessage() {} + +func (x *Country) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Country.ProtoReflect.Descriptor instead. +func (*Country) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{1} +} + +func (x *Country) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Country) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type CountryReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*Country `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` +} + +func (x *CountryReply) Reset() { + *x = CountryReply{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountryReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountryReply) ProtoMessage() {} + +func (x *CountryReply) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CountryReply.ProtoReflect.Descriptor instead. +func (*CountryReply) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{2} +} + +func (x *CountryReply) GetList() []*Country { + if x != nil { + return x.List + } + return nil +} + +type DistrictRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Country int32 `protobuf:"varint,1,opt,name=country,proto3" json:"country,omitempty"` +} + +func (x *DistrictRequest) Reset() { + *x = DistrictRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DistrictRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DistrictRequest) ProtoMessage() {} + +func (x *DistrictRequest) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DistrictRequest.ProtoReflect.Descriptor instead. +func (*DistrictRequest) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{3} +} + +func (x *DistrictRequest) GetCountry() int32 { + if x != nil { + return x.Country + } + return 0 +} + +type District struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"` + Adcode string `protobuf:"bytes,2,opt,name=adcode,proto3" json:"adcode,omitempty"` + ParentId int32 `protobuf:"varint,3,opt,name=parentId,proto3" json:"parentId,omitempty"` + Children []*District `protobuf:"bytes,4,rep,name=children,proto3" json:"children,omitempty"` +} + +func (x *District) Reset() { + *x = District{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *District) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*District) ProtoMessage() {} + +func (x *District) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use District.ProtoReflect.Descriptor instead. +func (*District) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{4} +} + +func (x *District) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *District) GetAdcode() string { + if x != nil { + return x.Adcode + } + return "" +} + +func (x *District) GetParentId() int32 { + if x != nil { + return x.ParentId + } + return 0 +} + +func (x *District) GetChildren() []*District { + if x != nil { + return x.Children + } + return nil +} + +type DistrictReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*District `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` +} + +func (x *DistrictReply) Reset() { + *x = DistrictReply{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DistrictReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DistrictReply) ProtoMessage() {} + +func (x *DistrictReply) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DistrictReply.ProtoReflect.Descriptor instead. +func (*DistrictReply) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{5} +} + +func (x *DistrictReply) GetList() []*District { + if x != nil { + return x.List + } + return nil +} + +type PayTransRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"` + Mchid string `protobuf:"bytes,2,opt,name=mchid,proto3" json:"mchid,omitempty"` + OutTradeNo string `protobuf:"bytes,3,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` + Attach string `protobuf:"bytes,4,opt,name=attach,proto3" json:"attach,omitempty"` + NotifyUrl string `protobuf:"bytes,5,opt,name=notify_url,json=notifyUrl,proto3" json:"notify_url,omitempty"` + Amount float64 `protobuf:"fixed64,6,opt,name=amount,proto3" json:"amount,omitempty"` + Currency string `protobuf:"bytes,7,opt,name=currency,proto3" json:"currency,omitempty"` + PayChannel string `protobuf:"bytes,8,opt,name=pay_channel,json=payChannel,proto3" json:"pay_channel,omitempty"` + ReturnUrl string `protobuf:"bytes,9,opt,name=return_url,json=returnUrl,proto3" json:"return_url,omitempty"` + CancelUrl string `protobuf:"bytes,10,opt,name=cancel_url,json=cancelUrl,proto3" json:"cancel_url,omitempty"` +} + +func (x *PayTransRequest) Reset() { + *x = PayTransRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayTransRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayTransRequest) ProtoMessage() {} + +func (x *PayTransRequest) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayTransRequest.ProtoReflect.Descriptor instead. +func (*PayTransRequest) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{6} +} + +func (x *PayTransRequest) GetAppid() string { + if x != nil { + return x.Appid + } + return "" +} + +func (x *PayTransRequest) GetMchid() string { + if x != nil { + return x.Mchid + } + return "" +} + +func (x *PayTransRequest) GetOutTradeNo() string { + if x != nil { + return x.OutTradeNo + } + return "" +} + +func (x *PayTransRequest) GetAttach() string { + if x != nil { + return x.Attach + } + return "" +} + +func (x *PayTransRequest) GetNotifyUrl() string { + if x != nil { + return x.NotifyUrl + } + return "" +} + +func (x *PayTransRequest) GetAmount() float64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *PayTransRequest) GetCurrency() string { + if x != nil { + return x.Currency + } + return "" +} + +func (x *PayTransRequest) GetPayChannel() string { + if x != nil { + return x.PayChannel + } + return "" +} + +func (x *PayTransRequest) GetReturnUrl() string { + if x != nil { + return x.ReturnUrl + } + return "" +} + +func (x *PayTransRequest) GetCancelUrl() string { + if x != nil { + return x.CancelUrl + } + return "" +} + +type PayTransResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *PayTransResponse) Reset() { + *x = PayTransResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayTransResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayTransResponse) ProtoMessage() {} + +func (x *PayTransResponse) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayTransResponse.ProtoReflect.Descriptor instead. +func (*PayTransResponse) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{7} +} + +func (x *PayTransResponse) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *PayTransResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *PayTransResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type PayUrlRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mchid string `protobuf:"bytes,1,opt,name=mchid,proto3" json:"mchid,omitempty"` + PayChannel string `protobuf:"bytes,2,opt,name=pay_channel,json=payChannel,proto3" json:"pay_channel,omitempty"` + TransactionId string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` +} + +func (x *PayUrlRequest) Reset() { + *x = PayUrlRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayUrlRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayUrlRequest) ProtoMessage() {} + +func (x *PayUrlRequest) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayUrlRequest.ProtoReflect.Descriptor instead. +func (*PayUrlRequest) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{8} +} + +func (x *PayUrlRequest) GetMchid() string { + if x != nil { + return x.Mchid + } + return "" +} + +func (x *PayUrlRequest) GetPayChannel() string { + if x != nil { + return x.PayChannel + } + return "" +} + +func (x *PayUrlRequest) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +type PayUrlResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PayChannel string `protobuf:"bytes,1,opt,name=pay_channel,json=payChannel,proto3" json:"pay_channel,omitempty"` + PayId string `protobuf:"bytes,2,opt,name=pay_id,json=payId,proto3" json:"pay_id,omitempty"` + PayReturn string `protobuf:"bytes,3,opt,name=pay_return,json=payReturn,proto3" json:"pay_return,omitempty"` + PayStatus string `protobuf:"bytes,4,opt,name=pay_status,json=payStatus,proto3" json:"pay_status,omitempty"` +} + +func (x *PayUrlResponse) Reset() { + *x = PayUrlResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayUrlResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayUrlResponse) ProtoMessage() {} + +func (x *PayUrlResponse) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayUrlResponse.ProtoReflect.Descriptor instead. +func (*PayUrlResponse) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{9} +} + +func (x *PayUrlResponse) GetPayChannel() string { + if x != nil { + return x.PayChannel + } + return "" +} + +func (x *PayUrlResponse) GetPayId() string { + if x != nil { + return x.PayId + } + return "" +} + +func (x *PayUrlResponse) GetPayReturn() string { + if x != nil { + return x.PayReturn + } + return "" +} + +func (x *PayUrlResponse) GetPayStatus() string { + if x != nil { + return x.PayStatus + } + return "" +} + +type PaybackRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Mchid string `protobuf:"bytes,1,opt,name=mchid,proto3" json:"mchid,omitempty"` + PayChannel string `protobuf:"bytes,2,opt,name=pay_channel,json=payChannel,proto3" json:"pay_channel,omitempty"` + PayId string `protobuf:"bytes,3,opt,name=pay_id,json=payId,proto3" json:"pay_id,omitempty"` + EventType string `protobuf:"bytes,4,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` +} + +func (x *PaybackRequest) Reset() { + *x = PaybackRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaybackRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaybackRequest) ProtoMessage() {} + +func (x *PaybackRequest) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaybackRequest.ProtoReflect.Descriptor instead. +func (*PaybackRequest) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{10} +} + +func (x *PaybackRequest) GetMchid() string { + if x != nil { + return x.Mchid + } + return "" +} + +func (x *PaybackRequest) GetPayChannel() string { + if x != nil { + return x.PayChannel + } + return "" +} + +func (x *PaybackRequest) GetPayId() string { + if x != nil { + return x.PayId + } + return "" +} + +func (x *PaybackRequest) GetEventType() string { + if x != nil { + return x.EventType + } + return "" +} + +type PaybackResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OutTradeNo string `protobuf:"bytes,1,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` + TradeState string `protobuf:"bytes,2,opt,name=trade_state,json=tradeState,proto3" json:"trade_state,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *PaybackResp) Reset() { + *x = PaybackResp{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaybackResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaybackResp) ProtoMessage() {} + +func (x *PaybackResp) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaybackResp.ProtoReflect.Descriptor instead. +func (*PaybackResp) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{11} +} + +func (x *PaybackResp) GetOutTradeNo() string { + if x != nil { + return x.OutTradeNo + } + return "" +} + +func (x *PaybackResp) GetTradeState() string { + if x != nil { + return x.TradeState + } + return "" +} + +func (x *PaybackResp) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type PayoutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"` + Mchid string `protobuf:"bytes,2,opt,name=mchid,proto3" json:"mchid,omitempty"` + OutTradeNo string `protobuf:"bytes,3,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` + Attach string `protobuf:"bytes,4,opt,name=attach,proto3" json:"attach,omitempty"` + NotifyUrl string `protobuf:"bytes,5,opt,name=notify_url,json=notifyUrl,proto3" json:"notify_url,omitempty"` + Amount float64 `protobuf:"fixed64,6,opt,name=amount,proto3" json:"amount,omitempty"` + Currency string `protobuf:"bytes,7,opt,name=currency,proto3" json:"currency,omitempty"` + PayChannel string `protobuf:"bytes,8,opt,name=pay_channel,json=payChannel,proto3" json:"pay_channel,omitempty"` + PaypalName string `protobuf:"bytes,9,opt,name=paypal_name,json=paypalName,proto3" json:"paypal_name,omitempty"` +} + +func (x *PayoutRequest) Reset() { + *x = PayoutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PayoutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PayoutRequest) ProtoMessage() {} + +func (x *PayoutRequest) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PayoutRequest.ProtoReflect.Descriptor instead. +func (*PayoutRequest) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{12} +} + +func (x *PayoutRequest) GetAppid() string { + if x != nil { + return x.Appid + } + return "" +} + +func (x *PayoutRequest) GetMchid() string { + if x != nil { + return x.Mchid + } + return "" +} + +func (x *PayoutRequest) GetOutTradeNo() string { + if x != nil { + return x.OutTradeNo + } + return "" +} + +func (x *PayoutRequest) GetAttach() string { + if x != nil { + return x.Attach + } + return "" +} + +func (x *PayoutRequest) GetNotifyUrl() string { + if x != nil { + return x.NotifyUrl + } + return "" +} + +func (x *PayoutRequest) GetAmount() float64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *PayoutRequest) GetCurrency() string { + if x != nil { + return x.Currency + } + return "" +} + +func (x *PayoutRequest) GetPayChannel() string { + if x != nil { + return x.PayChannel + } + return "" +} + +func (x *PayoutRequest) GetPaypalName() string { + if x != nil { + return x.PaypalName + } + return "" +} + +type GetPayTransOutTradeNoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"` + Mchid string `protobuf:"bytes,2,opt,name=mchid,proto3" json:"mchid,omitempty"` + OutTradeNo string `protobuf:"bytes,3,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` +} + +func (x *GetPayTransOutTradeNoRequest) Reset() { + *x = GetPayTransOutTradeNoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPayTransOutTradeNoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPayTransOutTradeNoRequest) ProtoMessage() {} + +func (x *GetPayTransOutTradeNoRequest) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPayTransOutTradeNoRequest.ProtoReflect.Descriptor instead. +func (*GetPayTransOutTradeNoRequest) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{13} +} + +func (x *GetPayTransOutTradeNoRequest) GetAppid() string { + if x != nil { + return x.Appid + } + return "" +} + +func (x *GetPayTransOutTradeNoRequest) GetMchid() string { + if x != nil { + return x.Mchid + } + return "" +} + +func (x *GetPayTransOutTradeNoRequest) GetOutTradeNo() string { + if x != nil { + return x.OutTradeNo + } + return "" +} + +type GetPayTransactionResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *GetPayTransaction `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` +} + +func (x *GetPayTransactionResp) Reset() { + *x = GetPayTransactionResp{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPayTransactionResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPayTransactionResp) ProtoMessage() {} + +func (x *GetPayTransactionResp) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPayTransactionResp.ProtoReflect.Descriptor instead. +func (*GetPayTransactionResp) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{14} +} + +func (x *GetPayTransactionResp) GetData() *GetPayTransaction { + if x != nil { + return x.Data + } + return nil +} + +type GetPayTransaction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Appid string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"` + Mchid string `protobuf:"bytes,2,opt,name=mchid,proto3" json:"mchid,omitempty"` +} + +func (x *GetPayTransaction) Reset() { + *x = GetPayTransaction{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPayTransaction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPayTransaction) ProtoMessage() {} + +func (x *GetPayTransaction) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetPayTransaction.ProtoReflect.Descriptor instead. +func (*GetPayTransaction) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{15} +} + +func (x *GetPayTransaction) GetAppid() string { + if x != nil { + return x.Appid + } + return "" +} + +func (x *GetPayTransaction) GetMchid() string { + if x != nil { + return x.Mchid + } + return "" +} + +type CloseBillRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` +} + +func (x *CloseBillRequest) Reset() { + *x = CloseBillRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CloseBillRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloseBillRequest) ProtoMessage() {} + +func (x *CloseBillRequest) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloseBillRequest.ProtoReflect.Descriptor instead. +func (*CloseBillRequest) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{16} +} + +func (x *CloseBillRequest) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +type PaypalWebhook struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreateTime string `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + ResourceType string `protobuf:"bytes,3,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"` + EventType string `protobuf:"bytes,4,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` + Summary string `protobuf:"bytes,5,opt,name=summary,proto3" json:"summary,omitempty"` + Resource *PaybackResource `protobuf:"bytes,6,opt,name=resource,proto3" json:"resource,omitempty"` +} + +func (x *PaypalWebhook) Reset() { + *x = PaypalWebhook{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaypalWebhook) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaypalWebhook) ProtoMessage() {} + +func (x *PaypalWebhook) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaypalWebhook.ProtoReflect.Descriptor instead. +func (*PaypalWebhook) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{17} +} + +func (x *PaypalWebhook) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PaypalWebhook) GetCreateTime() string { + if x != nil { + return x.CreateTime + } + return "" +} + +func (x *PaypalWebhook) GetResourceType() string { + if x != nil { + return x.ResourceType + } + return "" +} + +func (x *PaypalWebhook) GetEventType() string { + if x != nil { + return x.EventType + } + return "" +} + +func (x *PaypalWebhook) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +func (x *PaypalWebhook) GetResource() *PaybackResource { + if x != nil { + return x.Resource + } + return nil +} + +type PaybackResource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + CreateTime string `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime string `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` + Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + PurchaseUnits []*PurchaseUnit `protobuf:"bytes,6,rep,name=purchase_units,json=purchaseUnits,proto3" json:"purchase_units,omitempty"` + BatchHeader *BatchHeader `protobuf:"bytes,7,opt,name=batch_header,json=batchHeader,proto3" json:"batch_header,omitempty"` +} + +func (x *PaybackResource) Reset() { + *x = PaybackResource{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaybackResource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaybackResource) ProtoMessage() {} + +func (x *PaybackResource) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaybackResource.ProtoReflect.Descriptor instead. +func (*PaybackResource) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{18} +} + +func (x *PaybackResource) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PaybackResource) GetCreateTime() string { + if x != nil { + return x.CreateTime + } + return "" +} + +func (x *PaybackResource) GetUpdateTime() string { + if x != nil { + return x.UpdateTime + } + return "" +} + +func (x *PaybackResource) GetState() string { + if x != nil { + return x.State + } + return "" +} + +func (x *PaybackResource) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *PaybackResource) GetPurchaseUnits() []*PurchaseUnit { + if x != nil { + return x.PurchaseUnits + } + return nil +} + +func (x *PaybackResource) GetBatchHeader() *BatchHeader { + if x != nil { + return x.BatchHeader + } + return nil +} + +type PurchaseUnit struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payments *Payment `protobuf:"bytes,1,opt,name=payments,proto3" json:"payments,omitempty"` +} + +func (x *PurchaseUnit) Reset() { + *x = PurchaseUnit{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PurchaseUnit) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PurchaseUnit) ProtoMessage() {} + +func (x *PurchaseUnit) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PurchaseUnit.ProtoReflect.Descriptor instead. +func (*PurchaseUnit) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{19} +} + +func (x *PurchaseUnit) GetPayments() *Payment { + if x != nil { + return x.Payments + } + return nil +} + +type Payment struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Captures []*Capture `protobuf:"bytes,1,rep,name=captures,proto3" json:"captures,omitempty"` +} + +func (x *Payment) Reset() { + *x = Payment{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payment) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payment) ProtoMessage() {} + +func (x *Payment) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payment.ProtoReflect.Descriptor instead. +func (*Payment) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{20} +} + +func (x *Payment) GetCaptures() []*Capture { + if x != nil { + return x.Captures + } + return nil +} + +type BatchHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BatchStatus string `protobuf:"bytes,1,opt,name=batch_status,json=batchStatus,proto3" json:"batch_status,omitempty"` + PayoutBatchId string `protobuf:"bytes,2,opt,name=payout_batch_id,json=payoutBatchId,proto3" json:"payout_batch_id,omitempty"` + SenderBatchHeader *SenderBatchHeader `protobuf:"bytes,3,opt,name=sender_batch_header,json=senderBatchHeader,proto3" json:"sender_batch_header,omitempty"` +} + +func (x *BatchHeader) Reset() { + *x = BatchHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BatchHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BatchHeader) ProtoMessage() {} + +func (x *BatchHeader) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[21] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BatchHeader.ProtoReflect.Descriptor instead. +func (*BatchHeader) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{21} +} + +func (x *BatchHeader) GetBatchStatus() string { + if x != nil { + return x.BatchStatus + } + return "" +} + +func (x *BatchHeader) GetPayoutBatchId() string { + if x != nil { + return x.PayoutBatchId + } + return "" +} + +func (x *BatchHeader) GetSenderBatchHeader() *SenderBatchHeader { + if x != nil { + return x.SenderBatchHeader + } + return nil +} + +type SenderBatchHeader struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderBatchId string `protobuf:"bytes,1,opt,name=sender_batch_id,json=senderBatchId,proto3" json:"sender_batch_id,omitempty"` +} + +func (x *SenderBatchHeader) Reset() { + *x = SenderBatchHeader{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SenderBatchHeader) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SenderBatchHeader) ProtoMessage() {} + +func (x *SenderBatchHeader) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[22] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SenderBatchHeader.ProtoReflect.Descriptor instead. +func (*SenderBatchHeader) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{22} +} + +func (x *SenderBatchHeader) GetSenderBatchId() string { + if x != nil { + return x.SenderBatchId + } + return "" +} + +type Capture struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` + CreateTime string `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime string `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` +} + +func (x *Capture) Reset() { + *x = Capture{} + if protoimpl.UnsafeEnabled { + mi := &file_greeter_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Capture) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Capture) ProtoMessage() {} + +func (x *Capture) ProtoReflect() protoreflect.Message { + mi := &file_greeter_proto_msgTypes[23] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Capture.ProtoReflect.Descriptor instead. +func (*Capture) Descriptor() ([]byte, []int) { + return file_greeter_proto_rawDescGZIP(), []int{23} +} + +func (x *Capture) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Capture) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Capture) GetCreateTime() string { + if x != nil { + return x.CreateTime + } + return "" +} + +func (x *Capture) GetUpdateTime() string { + if x != nil { + return x.UpdateTime + } + return "" +} + +var File_greeter_proto protoreflect.FileDescriptor + +var file_greeter_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x67, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x03, 0x61, 0x70, 0x69, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x25, 0x0a, 0x09, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2d, 0x0a, 0x07, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x30, 0x0a, 0x0c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x20, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x44, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x72, 0x79, 0x22, 0x7f, 0x0a, 0x08, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x64, 0x63, 0x6f, 0x64, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x64, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, + 0x0a, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x08, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, 0x08, 0x63, 0x68, 0x69, + 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x22, 0x32, 0x0a, 0x0d, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x21, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x63, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0xa9, 0x02, 0x0a, 0x0f, 0x50, 0x61, + 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, + 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, + 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x75, 0x74, + 0x5f, 0x74, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x6f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x64, 0x65, 0x4e, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x74, 0x74, 0x61, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x74, 0x74, + 0x61, 0x63, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, + 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x5f, 0x63, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x79, + 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x74, + 0x75, 0x72, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x55, 0x72, 0x6c, 0x22, 0x6b, 0x0a, 0x10, 0x50, 0x61, 0x79, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x6d, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x79, + 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x70, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x22, 0x86, 0x01, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x79, 0x43, 0x68, + 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x61, 0x79, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x79, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, + 0x70, 0x61, 0x79, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x70, 0x61, 0x79, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, + 0x61, 0x79, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x61, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x7d, 0x0a, 0x0e, 0x50, 0x61, + 0x79, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x6d, 0x63, 0x68, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x63, 0x68, + 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, + 0x6e, 0x65, 0x6c, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x61, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x79, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6a, 0x0a, 0x0b, 0x50, 0x61, 0x79, + 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x5f, + 0x74, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x6f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x64, 0x65, 0x4e, 0x6f, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, + 0x61, 0x64, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x74, 0x72, 0x61, 0x64, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x8a, 0x02, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x63, + 0x68, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x64, 0x65, + 0x5f, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x54, 0x72, + 0x61, 0x64, 0x65, 0x4e, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x12, 0x1d, 0x0a, + 0x0a, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x79, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, + 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x4e, 0x61, + 0x6d, 0x65, 0x22, 0x6c, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x4f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x64, 0x65, 0x4e, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x63, 0x68, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x12, 0x20, + 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x6e, 0x6f, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x64, 0x65, 0x4e, 0x6f, + 0x22, 0x43, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, + 0x74, 0x50, 0x61, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, + 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6d, 0x63, 0x68, 0x69, 0x64, 0x22, 0x39, 0x0a, 0x10, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x42, + 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x22, 0xd0, 0x01, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x57, 0x65, 0x62, 0x68, + 0x6f, 0x6f, 0x6b, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x62, 0x61, + 0x63, 0x6b, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x22, 0x80, 0x02, 0x0a, 0x0f, 0x50, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x38, 0x0a, 0x0e, 0x70, 0x75, 0x72, 0x63, + 0x68, 0x61, 0x73, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x55, + 0x6e, 0x69, 0x74, 0x52, 0x0d, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x55, 0x6e, 0x69, + 0x74, 0x73, 0x12, 0x33, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x38, 0x0a, 0x0c, 0x50, 0x75, 0x72, 0x63, 0x68, + 0x61, 0x73, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x22, 0x33, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x08, + 0x63, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x52, 0x08, 0x63, 0x61, + 0x70, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x0b, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x70, 0x61, 0x79, + 0x6f, 0x75, 0x74, 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x42, 0x61, 0x74, 0x63, 0x68, 0x49, + 0x64, 0x12, 0x46, 0x0a, 0x13, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x11, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x11, 0x53, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, + 0x0a, 0x0f, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x22, 0x73, 0x0a, 0x07, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x9d, 0x07, 0x0a, 0x07, + 0x47, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, + 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x69, + 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x0d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x07, 0x12, + 0x05, 0x2f, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x4f, 0x0a, 0x0b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, + 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x11, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x72, 0x79, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x56, 0x0a, 0x0f, 0x44, 0x69, 0x73, 0x74, 0x72, + 0x69, 0x63, 0x74, 0x43, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x64, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x2f, 0x63, 0x61, 0x73, 0x63, 0x61, 0x64, 0x65, 0x12, + 0x5d, 0x0a, 0x11, 0x50, 0x61, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x41, 0x70, 0x70, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x50, 0x61, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x70, + 0x61, 0x79, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, + 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x12, + 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x55, 0x72, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x10, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0a, + 0x12, 0x08, 0x2f, 0x70, 0x61, 0x79, 0x2f, 0x75, 0x72, 0x6c, 0x12, 0x62, 0x0a, 0x14, 0x50, 0x61, + 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x70, 0x70, 0x55, + 0x72, 0x6c, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, + 0x61, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x70, 0x61, 0x79, 0x2f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x75, 0x72, 0x6c, 0x12, 0x50, + 0x0a, 0x0e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, + 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x62, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, + 0x01, 0x2a, 0x22, 0x0c, 0x2f, 0x70, 0x61, 0x79, 0x2f, 0x70, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, + 0x12, 0x52, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x50, 0x61, 0x79, 0x62, 0x61, 0x63, + 0x6b, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x57, 0x65, + 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x62, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, + 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x70, 0x61, 0x79, 0x70, 0x61, 0x6c, 0x2f, 0x63, 0x61, 0x6c, 0x6c, + 0x62, 0x61, 0x63, 0x6b, 0x12, 0x51, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, 0x41, + 0x70, 0x70, 0x55, 0x72, 0x6c, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x61, 0x79, 0x6f, + 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x50, 0x61, 0x79, 0x55, 0x72, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x01, 0x2a, 0x22, 0x0c, 0x2f, 0x70, 0x61, 0x79, 0x2f, + 0x70, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x73, 0x12, 0x6c, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x61, + 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, + 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x70, 0x61, 0x79, 0x2f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x75, 0x74, 0x54, 0x72, + 0x61, 0x64, 0x65, 0x4e, 0x6f, 0x12, 0x34, 0x0a, 0x09, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x42, 0x69, + 0x6c, 0x6c, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x42, 0x69, + 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x11, 0x5a, 0x0f, 0x62, + 0x6b, 0x62, 0x2d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_greeter_proto_rawDescOnce sync.Once + file_greeter_proto_rawDescData = file_greeter_proto_rawDesc +) + +func file_greeter_proto_rawDescGZIP() []byte { + file_greeter_proto_rawDescOnce.Do(func() { + file_greeter_proto_rawDescData = protoimpl.X.CompressGZIP(file_greeter_proto_rawDescData) + }) + return file_greeter_proto_rawDescData +} + +var file_greeter_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_greeter_proto_goTypes = []interface{}{ + (*PingReply)(nil), // 0: api.PingReply + (*Country)(nil), // 1: api.Country + (*CountryReply)(nil), // 2: api.CountryReply + (*DistrictRequest)(nil), // 3: api.DistrictRequest + (*District)(nil), // 4: api.District + (*DistrictReply)(nil), // 5: api.DistrictReply + (*PayTransRequest)(nil), // 6: api.PayTransRequest + (*PayTransResponse)(nil), // 7: api.PayTransResponse + (*PayUrlRequest)(nil), // 8: api.PayUrlRequest + (*PayUrlResponse)(nil), // 9: api.PayUrlResponse + (*PaybackRequest)(nil), // 10: api.PaybackRequest + (*PaybackResp)(nil), // 11: api.PaybackResp + (*PayoutRequest)(nil), // 12: api.PayoutRequest + (*GetPayTransOutTradeNoRequest)(nil), // 13: api.GetPayTransOutTradeNoRequest + (*GetPayTransactionResp)(nil), // 14: api.GetPayTransactionResp + (*GetPayTransaction)(nil), // 15: api.GetPayTransaction + (*CloseBillRequest)(nil), // 16: api.CloseBillRequest + (*PaypalWebhook)(nil), // 17: api.PaypalWebhook + (*PaybackResource)(nil), // 18: api.PaybackResource + (*PurchaseUnit)(nil), // 19: api.PurchaseUnit + (*Payment)(nil), // 20: api.Payment + (*BatchHeader)(nil), // 21: api.BatchHeader + (*SenderBatchHeader)(nil), // 22: api.SenderBatchHeader + (*Capture)(nil), // 23: api.Capture + (*emptypb.Empty)(nil), // 24: google.protobuf.Empty +} +var file_greeter_proto_depIdxs = []int32{ + 1, // 0: api.CountryReply.list:type_name -> api.Country + 4, // 1: api.District.children:type_name -> api.District + 4, // 2: api.DistrictReply.list:type_name -> api.District + 15, // 3: api.GetPayTransactionResp.data:type_name -> api.GetPayTransaction + 18, // 4: api.PaypalWebhook.resource:type_name -> api.PaybackResource + 19, // 5: api.PaybackResource.purchase_units:type_name -> api.PurchaseUnit + 21, // 6: api.PaybackResource.batch_header:type_name -> api.BatchHeader + 20, // 7: api.PurchaseUnit.payments:type_name -> api.Payment + 23, // 8: api.Payment.captures:type_name -> api.Capture + 22, // 9: api.BatchHeader.sender_batch_header:type_name -> api.SenderBatchHeader + 24, // 10: api.Greeter.Ping:input_type -> google.protobuf.Empty + 24, // 11: api.Greeter.CountryList:input_type -> google.protobuf.Empty + 3, // 12: api.Greeter.DistrictCascade:input_type -> api.DistrictRequest + 6, // 13: api.Greeter.PayTransactionApp:input_type -> api.PayTransRequest + 8, // 14: api.Greeter.GetPaymentUrl:input_type -> api.PayUrlRequest + 6, // 15: api.Greeter.PayTransactionAppUrl:input_type -> api.PayTransRequest + 10, // 16: api.Greeter.SuccessPayback:input_type -> api.PaybackRequest + 17, // 17: api.Greeter.PaypalPayback:input_type -> api.PaypalWebhook + 12, // 18: api.Greeter.PayoutsAppUrl:input_type -> api.PayoutRequest + 24, // 19: api.Greeter.GetPayTransaction:input_type -> google.protobuf.Empty + 16, // 20: api.Greeter.CloseBill:input_type -> api.CloseBillRequest + 0, // 21: api.Greeter.Ping:output_type -> api.PingReply + 2, // 22: api.Greeter.CountryList:output_type -> api.CountryReply + 5, // 23: api.Greeter.DistrictCascade:output_type -> api.DistrictReply + 7, // 24: api.Greeter.PayTransactionApp:output_type -> api.PayTransResponse + 9, // 25: api.Greeter.GetPaymentUrl:output_type -> api.PayUrlResponse + 9, // 26: api.Greeter.PayTransactionAppUrl:output_type -> api.PayUrlResponse + 11, // 27: api.Greeter.SuccessPayback:output_type -> api.PaybackResp + 11, // 28: api.Greeter.PaypalPayback:output_type -> api.PaybackResp + 9, // 29: api.Greeter.PayoutsAppUrl:output_type -> api.PayUrlResponse + 14, // 30: api.Greeter.GetPayTransaction:output_type -> api.GetPayTransactionResp + 0, // 31: api.Greeter.CloseBill:output_type -> api.PingReply + 21, // [21:32] is the sub-list for method output_type + 10, // [10:21] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_greeter_proto_init() } +func file_greeter_proto_init() { + if File_greeter_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_greeter_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PingReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Country); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountryReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DistrictRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*District); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DistrictReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayTransRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayTransResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayUrlRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayUrlResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PaybackRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PaybackResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PayoutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPayTransOutTradeNoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPayTransactionResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPayTransaction); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CloseBillRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PaypalWebhook); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PaybackResource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PurchaseUnit); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payment); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BatchHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SenderBatchHeader); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_greeter_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Capture); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_greeter_proto_rawDesc, + NumEnums: 0, + NumMessages: 24, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_greeter_proto_goTypes, + DependencyIndexes: file_greeter_proto_depIdxs, + MessageInfos: file_greeter_proto_msgTypes, + }.Build() + File_greeter_proto = out.File + file_greeter_proto_rawDesc = nil + file_greeter_proto_goTypes = nil + file_greeter_proto_depIdxs = nil +} diff --git a/initialize/api/greeter.proto b/initialize/api/greeter.proto new file mode 100644 index 0000000..97ff0ae --- /dev/null +++ b/initialize/api/greeter.proto @@ -0,0 +1,203 @@ +syntax = "proto3"; + +package api; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +option go_package = "bkb-payment/api"; + + +// The greeting service definition. +service Greeter { + // Sends a greeting + rpc Ping (google.protobuf.Empty) returns (PingReply) { + option (google.api.http) = { + get: "/ping" + }; + } + rpc CountryList (google.protobuf.Empty) returns (CountryReply) { + option (google.api.http) = { + get: "/country/list" + }; + } + rpc DistrictCascade (DistrictRequest) returns (DistrictReply) { + option (google.api.http) = { + get: "/district/cascade" + }; + } + rpc PayTransactionApp(PayTransRequest) returns (PayTransResponse) { + option (google.api.http) = { + post: "/pay/transaction" + body: "*" + }; + } + rpc GetPaymentUrl(PayUrlRequest) returns (PayUrlResponse) { + option (google.api.http) = { + get: "/pay/url" + }; + } + rpc PayTransactionAppUrl(PayTransRequest) returns (PayUrlResponse) { + option (google.api.http) = { + post: "/pay/transaction/url" + body: "*" + }; + } + rpc SuccessPayback(PaybackRequest) returns (PaybackResp) { + option (google.api.http) = { + post: "/pay/payback" + body: "*" + }; + } + rpc PaypalPayback(PaypalWebhook) returns (PaybackResp) { + option (google.api.http) = { + post: "/paypal/callback" + body: "*" + }; + } + rpc PayoutsAppUrl(PayoutRequest) returns (PayUrlResponse) { + option (google.api.http) = { + post: "/pay/payouts" + body: "*" + }; + } + rpc GetPayTransaction(google.protobuf.Empty) returns (GetPayTransactionResp) { + option (google.api.http) = { + get: "/pay/transaction/outTradeNo" + }; + } + rpc CloseBill(CloseBillRequest) returns (PingReply) { + + } + // rpc ClosePayTransaction(google.protobuf.Empty) returns (PingReply) { + // option (google.api.http) = { + // post: "/pay/transaction/outTradeNo/close" + // }; + // } +} + +// The response message containing the greetings +message PingReply { + string message = 1; +} +message Country{ + int32 id = 1; + string name = 2; +} +message CountryReply{ + repeated Country list = 1; +} +message DistrictRequest { + int32 country = 1; +} +message District { + string label = 1; + string adcode = 2; + int32 parentId = 3; + repeated District children = 4; +} +message DistrictReply{ + repeated District list = 1; +} +message PayTransRequest{ + string appid = 1; + string mchid = 2; + string out_trade_no = 3; + string attach = 4; + string notify_url = 5; + double amount = 6; + string currency = 7; + string pay_channel = 8; + string return_url = 9; + string cancel_url = 10; +} +message PayTransResponse{ + string transaction_id = 1; + string status = 2; + string message = 3; +} +message PayUrlRequest{ + string mchid = 1; + string pay_channel = 2; + string transaction_id = 3; +} +message PayUrlResponse{ + string pay_channel = 1; + string pay_id = 2; + string pay_return = 3; + string pay_status = 4; +} +message PaybackRequest{ + string mchid = 1; + string pay_channel = 2; + string pay_id = 3; + string event_type = 4; +} +message PaybackResp{ + string out_trade_no = 1; + string trade_state = 2; + string message = 3; +} +message PayoutRequest{ + string appid = 1; + string mchid = 2; + string out_trade_no = 3; + string attach = 4; + string notify_url = 5; + double amount = 6; + string currency = 7; + string pay_channel = 8; + string paypal_name = 9; +} +message GetPayTransOutTradeNoRequest{ + string appid = 1; + string mchid = 2; + string out_trade_no = 3; +} +message GetPayTransactionResp{ + GetPayTransaction data = 1; +} +message GetPayTransaction{ + string appid = 1; + string mchid = 2; +} +message CloseBillRequest{ + string transaction_id = 1; +} + +message PaypalWebhook{ + string id = 1; + string create_time = 2; + string resource_type = 3; + string event_type = 4; + string summary = 5; + PaybackResource resource = 6; +} +message PaybackResource{ + string id = 1; + string create_time = 2; + string update_time = 3; + string state = 4; + string status = 5; + repeated PurchaseUnit purchase_units = 6; + BatchHeader batch_header = 7; +} +message PurchaseUnit{ + Payment payments = 1; +} +message Payment{ + repeated Capture captures = 1; +} +message BatchHeader{ + string batch_status = 1; + string payout_batch_id = 2; + SenderBatchHeader sender_batch_header = 3; +} +message SenderBatchHeader{ + string sender_batch_id = 1; +} +message Capture{ + string id = 1; + string status = 2; + string create_time = 3; + string update_time = 4; +} \ No newline at end of file diff --git a/initialize/api/greeter_grpc.pb.go b/initialize/api/greeter_grpc.pb.go new file mode 100644 index 0000000..3ca6507 --- /dev/null +++ b/initialize/api/greeter_grpc.pb.go @@ -0,0 +1,482 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v3.21.12 +// source: greeter.proto + +package api + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Greeter_Ping_FullMethodName = "/api.Greeter/Ping" + Greeter_CountryList_FullMethodName = "/api.Greeter/CountryList" + Greeter_DistrictCascade_FullMethodName = "/api.Greeter/DistrictCascade" + Greeter_PayTransactionApp_FullMethodName = "/api.Greeter/PayTransactionApp" + Greeter_GetPaymentUrl_FullMethodName = "/api.Greeter/GetPaymentUrl" + Greeter_PayTransactionAppUrl_FullMethodName = "/api.Greeter/PayTransactionAppUrl" + Greeter_SuccessPayback_FullMethodName = "/api.Greeter/SuccessPayback" + Greeter_PaypalPayback_FullMethodName = "/api.Greeter/PaypalPayback" + Greeter_PayoutsAppUrl_FullMethodName = "/api.Greeter/PayoutsAppUrl" + Greeter_GetPayTransaction_FullMethodName = "/api.Greeter/GetPayTransaction" + Greeter_CloseBill_FullMethodName = "/api.Greeter/CloseBill" +) + +// GreeterClient is the client API for Greeter service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GreeterClient interface { + // Sends a greeting + Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PingReply, error) + CountryList(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CountryReply, error) + DistrictCascade(ctx context.Context, in *DistrictRequest, opts ...grpc.CallOption) (*DistrictReply, error) + PayTransactionApp(ctx context.Context, in *PayTransRequest, opts ...grpc.CallOption) (*PayTransResponse, error) + GetPaymentUrl(ctx context.Context, in *PayUrlRequest, opts ...grpc.CallOption) (*PayUrlResponse, error) + PayTransactionAppUrl(ctx context.Context, in *PayTransRequest, opts ...grpc.CallOption) (*PayUrlResponse, error) + SuccessPayback(ctx context.Context, in *PaybackRequest, opts ...grpc.CallOption) (*PaybackResp, error) + PaypalPayback(ctx context.Context, in *PaypalWebhook, opts ...grpc.CallOption) (*PaybackResp, error) + PayoutsAppUrl(ctx context.Context, in *PayoutRequest, opts ...grpc.CallOption) (*PayUrlResponse, error) + GetPayTransaction(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPayTransactionResp, error) + CloseBill(ctx context.Context, in *CloseBillRequest, opts ...grpc.CallOption) (*PingReply, error) +} + +type greeterClient struct { + cc grpc.ClientConnInterface +} + +func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient { + return &greeterClient{cc} +} + +func (c *greeterClient) Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PingReply, error) { + out := new(PingReply) + err := c.cc.Invoke(ctx, Greeter_Ping_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) CountryList(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CountryReply, error) { + out := new(CountryReply) + err := c.cc.Invoke(ctx, Greeter_CountryList_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) DistrictCascade(ctx context.Context, in *DistrictRequest, opts ...grpc.CallOption) (*DistrictReply, error) { + out := new(DistrictReply) + err := c.cc.Invoke(ctx, Greeter_DistrictCascade_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) PayTransactionApp(ctx context.Context, in *PayTransRequest, opts ...grpc.CallOption) (*PayTransResponse, error) { + out := new(PayTransResponse) + err := c.cc.Invoke(ctx, Greeter_PayTransactionApp_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) GetPaymentUrl(ctx context.Context, in *PayUrlRequest, opts ...grpc.CallOption) (*PayUrlResponse, error) { + out := new(PayUrlResponse) + err := c.cc.Invoke(ctx, Greeter_GetPaymentUrl_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) PayTransactionAppUrl(ctx context.Context, in *PayTransRequest, opts ...grpc.CallOption) (*PayUrlResponse, error) { + out := new(PayUrlResponse) + err := c.cc.Invoke(ctx, Greeter_PayTransactionAppUrl_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) SuccessPayback(ctx context.Context, in *PaybackRequest, opts ...grpc.CallOption) (*PaybackResp, error) { + out := new(PaybackResp) + err := c.cc.Invoke(ctx, Greeter_SuccessPayback_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) PaypalPayback(ctx context.Context, in *PaypalWebhook, opts ...grpc.CallOption) (*PaybackResp, error) { + out := new(PaybackResp) + err := c.cc.Invoke(ctx, Greeter_PaypalPayback_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) PayoutsAppUrl(ctx context.Context, in *PayoutRequest, opts ...grpc.CallOption) (*PayUrlResponse, error) { + out := new(PayUrlResponse) + err := c.cc.Invoke(ctx, Greeter_PayoutsAppUrl_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) GetPayTransaction(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetPayTransactionResp, error) { + out := new(GetPayTransactionResp) + err := c.cc.Invoke(ctx, Greeter_GetPayTransaction_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *greeterClient) CloseBill(ctx context.Context, in *CloseBillRequest, opts ...grpc.CallOption) (*PingReply, error) { + out := new(PingReply) + err := c.cc.Invoke(ctx, Greeter_CloseBill_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GreeterServer is the server API for Greeter service. +// All implementations must embed UnimplementedGreeterServer +// for forward compatibility +type GreeterServer interface { + // Sends a greeting + Ping(context.Context, *emptypb.Empty) (*PingReply, error) + CountryList(context.Context, *emptypb.Empty) (*CountryReply, error) + DistrictCascade(context.Context, *DistrictRequest) (*DistrictReply, error) + PayTransactionApp(context.Context, *PayTransRequest) (*PayTransResponse, error) + GetPaymentUrl(context.Context, *PayUrlRequest) (*PayUrlResponse, error) + PayTransactionAppUrl(context.Context, *PayTransRequest) (*PayUrlResponse, error) + SuccessPayback(context.Context, *PaybackRequest) (*PaybackResp, error) + PaypalPayback(context.Context, *PaypalWebhook) (*PaybackResp, error) + PayoutsAppUrl(context.Context, *PayoutRequest) (*PayUrlResponse, error) + GetPayTransaction(context.Context, *emptypb.Empty) (*GetPayTransactionResp, error) + CloseBill(context.Context, *CloseBillRequest) (*PingReply, error) + mustEmbedUnimplementedGreeterServer() +} + +// UnimplementedGreeterServer must be embedded to have forward compatible implementations. +type UnimplementedGreeterServer struct { +} + +func (UnimplementedGreeterServer) Ping(context.Context, *emptypb.Empty) (*PingReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") +} +func (UnimplementedGreeterServer) CountryList(context.Context, *emptypb.Empty) (*CountryReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountryList not implemented") +} +func (UnimplementedGreeterServer) DistrictCascade(context.Context, *DistrictRequest) (*DistrictReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method DistrictCascade not implemented") +} +func (UnimplementedGreeterServer) PayTransactionApp(context.Context, *PayTransRequest) (*PayTransResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayTransactionApp not implemented") +} +func (UnimplementedGreeterServer) GetPaymentUrl(context.Context, *PayUrlRequest) (*PayUrlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPaymentUrl not implemented") +} +func (UnimplementedGreeterServer) PayTransactionAppUrl(context.Context, *PayTransRequest) (*PayUrlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayTransactionAppUrl not implemented") +} +func (UnimplementedGreeterServer) SuccessPayback(context.Context, *PaybackRequest) (*PaybackResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SuccessPayback not implemented") +} +func (UnimplementedGreeterServer) PaypalPayback(context.Context, *PaypalWebhook) (*PaybackResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method PaypalPayback not implemented") +} +func (UnimplementedGreeterServer) PayoutsAppUrl(context.Context, *PayoutRequest) (*PayUrlResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PayoutsAppUrl not implemented") +} +func (UnimplementedGreeterServer) GetPayTransaction(context.Context, *emptypb.Empty) (*GetPayTransactionResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPayTransaction not implemented") +} +func (UnimplementedGreeterServer) CloseBill(context.Context, *CloseBillRequest) (*PingReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method CloseBill not implemented") +} +func (UnimplementedGreeterServer) mustEmbedUnimplementedGreeterServer() {} + +// UnsafeGreeterServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GreeterServer will +// result in compilation errors. +type UnsafeGreeterServer interface { + mustEmbedUnimplementedGreeterServer() +} + +func RegisterGreeterServer(s grpc.ServiceRegistrar, srv GreeterServer) { + s.RegisterService(&Greeter_ServiceDesc, srv) +} + +func _Greeter_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_Ping_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).Ping(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_CountryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).CountryList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_CountryList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).CountryList(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_DistrictCascade_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DistrictRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).DistrictCascade(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_DistrictCascade_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).DistrictCascade(ctx, req.(*DistrictRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_PayTransactionApp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PayTransRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).PayTransactionApp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_PayTransactionApp_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).PayTransactionApp(ctx, req.(*PayTransRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_GetPaymentUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PayUrlRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).GetPaymentUrl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_GetPaymentUrl_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).GetPaymentUrl(ctx, req.(*PayUrlRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_PayTransactionAppUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PayTransRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).PayTransactionAppUrl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_PayTransactionAppUrl_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).PayTransactionAppUrl(ctx, req.(*PayTransRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_SuccessPayback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PaybackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).SuccessPayback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_SuccessPayback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).SuccessPayback(ctx, req.(*PaybackRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_PaypalPayback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PaypalWebhook) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).PaypalPayback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_PaypalPayback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).PaypalPayback(ctx, req.(*PaypalWebhook)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_PayoutsAppUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PayoutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).PayoutsAppUrl(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_PayoutsAppUrl_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).PayoutsAppUrl(ctx, req.(*PayoutRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_GetPayTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).GetPayTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_GetPayTransaction_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).GetPayTransaction(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Greeter_CloseBill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CloseBillRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GreeterServer).CloseBill(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Greeter_CloseBill_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GreeterServer).CloseBill(ctx, req.(*CloseBillRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Greeter_ServiceDesc is the grpc.ServiceDesc for Greeter service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Greeter_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.Greeter", + HandlerType: (*GreeterServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _Greeter_Ping_Handler, + }, + { + MethodName: "CountryList", + Handler: _Greeter_CountryList_Handler, + }, + { + MethodName: "DistrictCascade", + Handler: _Greeter_DistrictCascade_Handler, + }, + { + MethodName: "PayTransactionApp", + Handler: _Greeter_PayTransactionApp_Handler, + }, + { + MethodName: "GetPaymentUrl", + Handler: _Greeter_GetPaymentUrl_Handler, + }, + { + MethodName: "PayTransactionAppUrl", + Handler: _Greeter_PayTransactionAppUrl_Handler, + }, + { + MethodName: "SuccessPayback", + Handler: _Greeter_SuccessPayback_Handler, + }, + { + MethodName: "PaypalPayback", + Handler: _Greeter_PaypalPayback_Handler, + }, + { + MethodName: "PayoutsAppUrl", + Handler: _Greeter_PayoutsAppUrl_Handler, + }, + { + MethodName: "GetPayTransaction", + Handler: _Greeter_GetPayTransaction_Handler, + }, + { + MethodName: "CloseBill", + Handler: _Greeter_CloseBill_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "greeter.proto", +} diff --git a/initialize/gorm.go b/initialize/gorm.go new file mode 100644 index 0000000..23f209d --- /dev/null +++ b/initialize/gorm.go @@ -0,0 +1,100 @@ +package initialize + +import ( + "os" + "pure-admin/global" + "pure-admin/initialize/internal" + "pure-admin/model" + + "go.uber.org/zap" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) + +//@function: Gorm +//@description: 初始化数据库并产生数据库全局变量 +//@return: *gorm.DB + +func Gorm() *gorm.DB { + switch global.MG_CONFIG.System.DbType { + case "mysql": + return GormMysql() + default: + return GormMysql() + } +} + +// MysqlTables +//@function: MysqlTables +//@description: 注册数据库表专用 +//@param: db *gorm.DB + +func MysqlTables(db *gorm.DB) { + err := db.AutoMigrate( + model.SysAuthority{}, + model.SysApi{}, + model.SysBaseMenu{}, + model.JwtBlacklist{}, + model.SysOperationRecord{}, + model.SellerStore{}, + model.Withdrawal{}, + //model.SysDictionary{}, + //model.SysDictionaryDetail{}, + //model.ExaFileUploadAndDownload{}, + //model.ExaFile{}, + //model.ExaFileChunk{}, + //model.ExaCustomer{}, + //model.ExaSimpleUploader{}, + + // Code generated by pure-admin Begin; DO NOT EDIT. + model.User{}, + model.Application{}, + model.Organization{}, + model.Provider{}, + model.Business{}, + model.MissionRecommend{}, + model.MissionClaimVideo{}, + model.Tags{}, + model.PlatformAuth{}, + model.TagRelation{}, + model.Banner{}, + model.StatisticMissionDaily{}, + // Code generated by pure-admin End; DO NOT EDIT. + ) + if err != nil { + global.MG_LOG.Error("register table failed", zap.Any("err", err)) + os.Exit(0) + } + + global.MG_LOG.Info("register table success") +} + +// @function: GormMysql +// @description: 初始化Mysql数据库 +// @return: *gorm.DB +func GormMysql() *gorm.DB { + m := global.MG_CONFIG.Mysql + if m.Dbname == "" { + return nil + } + dsn := m.Username + ":" + m.Password + "@tcp(" + m.Path + ")/" + m.Dbname + "?" + m.Config + mysqlConfig := mysql.Config{ + DSN: dsn, // DSN data source name + DefaultStringSize: 191, // string 类型字段的默认长度 + DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持 + DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引 + DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列 + SkipInitializeWithVersion: false, // 根据版本自动配置 + } + if db, err := gorm.Open(mysql.New(mysqlConfig), internal.Gorm.Config()); err != nil { + //global.GVA_LOG.Error("MySQL启动异常", zap.Any("err", err)) + //os.Exit(0) + //return nil + return nil + } else { + sqlDB, _ := db.DB() + sqlDB.SetMaxIdleConns(m.MaxIdleConns) + sqlDB.SetMaxOpenConns(m.MaxOpenConns) + return db + } +} diff --git a/initialize/grpc.go b/initialize/grpc.go new file mode 100644 index 0000000..91f1ee7 --- /dev/null +++ b/initialize/grpc.go @@ -0,0 +1,54 @@ +package initialize + +import ( + "context" + "fmt" + "github.com/go-kratos/kratos/contrib/registry/nacos/v2" + "pure-admin/global" + "pure-admin/initialize/api" + "time" + + "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/transport/grpc" + "github.com/nacos-group/nacos-sdk-go/clients" + "github.com/nacos-group/nacos-sdk-go/common/constant" + "github.com/nacos-group/nacos-sdk-go/vo" +) + +func init() { + sc := []constant.ServerConfig{ + *constant.NewServerConfig("72535c70-8d6d-400f-9893-4bb3e634f682.nacos.cn-north-4.cse.myhuaweicloud.com", 8848), + } + cc := constant.ClientConfig{ + NamespaceId: "dev", + TimeoutMs: 5000, + Username: "nacos", + Password: "nacos", + } + func() { + client, err := clients.NewNamingClient( + vo.NacosClientParam{ + ServerConfigs: sc, + ClientConfig: &cc, + }, + ) + if err != nil { + fmt.Println(err) + panic(err) + } + r := nacos.New(client) + + conn, err := grpc.DialInsecure( + context.Background(), + grpc.WithEndpoint("discovery:///bkb.payment.grpc"), + grpc.WithDiscovery(r), + grpc.WithMiddleware(recovery.Recovery()), + grpc.WithTimeout(10*time.Second), + ) + if err != nil { + panic(err) + } + + global.PAY_CLIENT = api.NewGreeterClient(conn) + }() +} diff --git a/initialize/internal/gorm.go b/initialize/internal/gorm.go new file mode 100644 index 0000000..f9bf421 --- /dev/null +++ b/initialize/internal/gorm.go @@ -0,0 +1,52 @@ +package internal + +import ( + "log" + "os" + "pure-admin/global" + "time" + + "gorm.io/gorm" + "gorm.io/gorm/logger" +) + +type DBBASE interface { + GetLogMode() string +} + +var Gorm = new(_gorm) + +type _gorm struct{} + +// Config gorm 自定义配置 +// Author [SliverHorn](https://github.com/SliverHorn) +func (g *_gorm) Config() *gorm.Config { + config := &gorm.Config{DisableForeignKeyConstraintWhenMigrating: true} + _default := logger.New(NewWriter(log.New(os.Stdout, "\r\n", log.LstdFlags)), logger.Config{ + SlowThreshold: 200 * time.Millisecond, + LogLevel: logger.Warn, + Colorful: true, + }) + var logMode DBBASE + switch global.MG_CONFIG.System.DbType { + case "mysql": + logMode = &global.MG_CONFIG.Mysql + break + default: + logMode = &global.MG_CONFIG.Mysql + } + + switch logMode.GetLogMode() { + case "silent", "Silent": + config.Logger = _default.LogMode(logger.Silent) + case "error", "Error": + config.Logger = _default.LogMode(logger.Error) + case "warn", "Warn": + config.Logger = _default.LogMode(logger.Warn) + case "info", "Info": + config.Logger = _default.LogMode(logger.Info) + default: + config.Logger = _default.LogMode(logger.Info) + } + return config +} diff --git a/initialize/internal/logger.go b/initialize/internal/logger.go new file mode 100644 index 0000000..fb9b9ea --- /dev/null +++ b/initialize/internal/logger.go @@ -0,0 +1,33 @@ +package internal + +import ( + "fmt" + "pure-admin/global" + + "gorm.io/gorm/logger" +) + +type writer struct { + logger.Writer +} + +// NewWriter writer 构造函数 +// Author [SliverHorn](https://github.com/SliverHorn) +func NewWriter(w logger.Writer) *writer { + return &writer{Writer: w} +} + +// Printf 格式化打印日志 +// Author [SliverHorn](https://github.com/SliverHorn) +func (w *writer) Printf(message string, data ...interface{}) { + var logZap bool + switch global.MG_CONFIG.System.DbType { + case "mysql": + logZap = global.MG_CONFIG.Mysql.LogZap + } + if logZap { + global.MG_LOG.Info(fmt.Sprintf(message+"\n", data...)) + } else { + w.Writer.Printf(message, data...) + } +} diff --git a/initialize/minio.go b/initialize/minio.go new file mode 100644 index 0000000..39d7df5 --- /dev/null +++ b/initialize/minio.go @@ -0,0 +1,22 @@ +package initialize + +import ( + "log" + "pure-admin/global" + + "github.com/minio/minio-go/v7" + "github.com/minio/minio-go/v7/pkg/credentials" +) + +func Minio() { + minioCfg := global.MG_CONFIG.Minio + // Initialize minio client object. + minioClient, err := minio.New(minioCfg.Endpoint, &minio.Options{ + Creds: credentials.NewStaticV4(minioCfg.AccessKeyID, minioCfg.SecretAccessKey, ""), + Secure: minioCfg.UseSSL, + }) + if err != nil { + log.Fatalln(err) + } + global.MG_MINIO = minioClient +} diff --git a/initialize/redis.go b/initialize/redis.go new file mode 100644 index 0000000..9cfdefc --- /dev/null +++ b/initialize/redis.go @@ -0,0 +1,24 @@ +package initialize + +import ( + "pure-admin/global" + + "github.com/go-redis/redis" + "go.uber.org/zap" +) + +func Redis() { + redisCfg := global.MG_CONFIG.Redis + client := redis.NewClient(&redis.Options{ + Addr: redisCfg.Addr, + Password: redisCfg.Password, // no password set + DB: redisCfg.DB, // use default DB + }) + pong, err := client.Ping().Result() + if err != nil { + global.MG_LOG.Error("redis connect ping failed, err:", zap.Any("err", err)) + } else { + global.MG_LOG.Info("redis connect ping response:", zap.String("pong", pong)) + global.MG_REDIS = client + } +} diff --git a/initialize/router.go b/initialize/router.go new file mode 100644 index 0000000..9ac3073 --- /dev/null +++ b/initialize/router.go @@ -0,0 +1,75 @@ +package initialize + +import ( + "net/http" + + "github.com/gin-gonic/gin" + ginSwagger "github.com/swaggo/gin-swagger" + "github.com/swaggo/gin-swagger/swaggerFiles" + + _ "pure-admin/docs" + "pure-admin/global" + "pure-admin/middleware" + "pure-admin/router" + "pure-admin/service" +) + +// 初始化总路由 + +func Routers() *gin.Engine { + var Router = gin.Default() + Router.StaticFS(global.MG_CONFIG.Local.Path, http.Dir(global.MG_CONFIG.Local.Path)) // 为用户头像和文件提供静态地址 + + // 跨域 + // Router.Use(middleware.Cors()) // 如需跨域可以打开 + + Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) + + Router.Any("/ueditor/controller", service.UeditorAction) // 百度富文本编辑器 + // 方便统一添加路由组前缀 多服务器上线使用 + PublicGroup := Router.Group("") + { + router.InitBaseRouter(PublicGroup) // 注册基础功能路由 不做鉴权 + // router.InitInitRouter(PublicGroup) // 自动初始化相关 + router.InitAutoCodeRouter(PublicGroup) // 创建自动化代码 + } + PrivateGroup := Router.Group("") + PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler()) + { + router.InitApiRouter(PrivateGroup) // 注册功能api路由 + // router.InitUserRouter(PrivateGroup) // 注册用户路由 + router.InitMenuRouter(PrivateGroup) // 注册menu路由 + router.InitCasbinRouter(PrivateGroup) // 权限相关路由 + router.InitAuthorityRouter(PrivateGroup) // 注册角色路由 + router.InitSysOperationRecordRouter(PrivateGroup) // 操作记录 + // router.InitJwtRouter(PrivateGroup) // jwt相关路由 + // router.InitCustomerRouter(PrivateGroup) // 客户路由 + // router.InitSystemRouter(PrivateGroup) // system相关路由 + // router.InitSimpleUploaderRouter(PrivateGroup) // 断点续传(插件版) + // router.InitEmailRouter(PrivateGroup) // 邮件相关路由 + // router.InitSysDictionaryRouter(PrivateGroup) // 字典管理 + // router.InitSysDictionaryDetailRouter(PrivateGroup) // 字典详情管理 + // router.InitFileUploadAndDownloadRouter(PrivateGroup) // 文件上传下载功能路由 + // router.InitExcelRouter(PrivateGroup) // 表格导入导出 + + // Code generated by pure-admin Begin; DO NOT EDIT. + router.InitUserRouter(PrivateGroup) + router.InitApplicationRouter(PrivateGroup) + router.InitOrganizationRouter(PrivateGroup) + router.InitProviderRouter(PrivateGroup) + router.InitBusinessRouter(PrivateGroup) + router.InitMissionRouter(PrivateGroup) //任务相关路由 + router.InitDictRouter(PrivateGroup) //字典相关路由 + router.InitOrderRouter(PrivateGroup) // 订单 + router.InitBillRouter(PrivateGroup) // 账单 + router.InitWithdrawalRouter(PrivateGroup) // 提现 + router.InitWalletRouter(PrivateGroup) // 钱包 + // Code generated by pure-admin End; DO NOT EDIT. + router.InitCategory(PrivateGroup) + router.InitTagRouter(PrivateGroup) + router.InitGoodsRouter(PrivateGroup) + router.InitBanner(PrivateGroup) + } + + return Router +} diff --git a/initialize/timer.go b/initialize/timer.go new file mode 100644 index 0000000..fa88e7a --- /dev/null +++ b/initialize/timer.go @@ -0,0 +1,27 @@ +package initialize + +import ( + "fmt" + "pure-admin/config" + "pure-admin/global" + "pure-admin/service" + "pure-admin/utils" +) + +func Timer() { + if global.MG_CONFIG.Timer.Start { + for _, detail := range global.MG_CONFIG.Timer.Detail { + go func(detail config.Detail) { + global.MG_Timer.AddTaskByFunc("ClearDB", global.MG_CONFIG.Timer.Spec, func() { + err := utils.ClearTable(global.MG_DB, detail.TableName, detail.CompareField, detail.Interval) + if err != nil { + fmt.Println("timer error:", err) + } + }) + }(detail) + } + } + + //定时任务 + service.TimingTask() +} diff --git a/initialize/validator.go b/initialize/validator.go new file mode 100644 index 0000000..2868c02 --- /dev/null +++ b/initialize/validator.go @@ -0,0 +1,22 @@ +package initialize + +import "pure-admin/utils" + +func init() { + _ = utils.RegisterRule("PageVerify", + utils.Rules{ + "Page": {utils.NotEmpty()}, + "PageSize": {utils.NotEmpty()}, + }, + ) + _ = utils.RegisterRule("IdVerify", + utils.Rules{ + "Id": {utils.NotEmpty()}, + }, + ) + _ = utils.RegisterRule("AuthorityIdVerify", + utils.Rules{ + "AuthorityId": {utils.NotEmpty()}, + }, + ) +} diff --git a/main.go b/main.go new file mode 100644 index 0000000..49ae54f --- /dev/null +++ b/main.go @@ -0,0 +1,33 @@ +package main + +import ( + "pure-admin/core" + "pure-admin/global" + "pure-admin/initialize" +) + +//go:generate go env -w GO111MODULE=on +//go:generate go env -w GOPROXY=https://goproxy.cn,direct +//go:generate go mod tidy +//go:generate go mod download + +// @title Swagger Example API +// @version 0.0.1 +// @securityDefinitions.apikey ApiKeyAuth +// @in header +// @name x-token +// @BasePath / +func main() { + global.MG_VP = core.Viper() // 初始化Viper + global.MG_LOG = core.Zap() // 初始化zap日志库 + global.MG_DB = initialize.Gorm() // gorm连接数据库 + //initialize.Minio() + initialize.Timer() + if global.MG_DB != nil { + // initialize.MysqlTables(global.MG_DB) //初始化表 + // 程序结束前关闭数据库链接 + db, _ := global.MG_DB.DB() + defer db.Close() + } + core.RunWindowsServer() +} diff --git a/middleware/casbin_rbac.go b/middleware/casbin_rbac.go new file mode 100644 index 0000000..0d43faf --- /dev/null +++ b/middleware/casbin_rbac.go @@ -0,0 +1,36 @@ +package middleware + +import ( + "pure-admin/global" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + + "github.com/gin-gonic/gin" +) + +// 拦截器 +func CasbinHandler() gin.HandlerFunc { + return func(c *gin.Context) { + claims, _ := c.Get("claims") + waitUse := claims.(*request.CustomClaims) + // 获取请求的URI + obj := c.Request.URL.RequestURI() + // 获取请求方法 + act := c.Request.Method + // 获取用户的角色 + sub := waitUse.AuthorityId + appid := waitUse.Appid + types := waitUse.Type + e := service.Casbin() + // 判断策略中是否存在 + success, _ := e.Enforce("api", appid, sub, obj, act, types) + if global.MG_CONFIG.System.Env == "develop" || success { + c.Next() + } else { + response.FailWithDetailed(gin.H{}, "权限不足", c) + c.Abort() + return + } + } +} diff --git a/middleware/cors.go b/middleware/cors.go new file mode 100644 index 0000000..4f262bc --- /dev/null +++ b/middleware/cors.go @@ -0,0 +1,26 @@ +package middleware + +import ( + "github.com/gin-gonic/gin" + "net/http" +) + +// 处理跨域请求,支持options访问 +func Cors() gin.HandlerFunc { + return func(c *gin.Context) { + method := c.Request.Method + origin := c.Request.Header.Get("Origin") + c.Header("Access-Control-Allow-Origin", origin) + c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id,X-Requested-With,X_Requested_With") + c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS,DELETE,PUT") + c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type") + c.Header("Access-Control-Allow-Credentials", "true") + + // 放行所有OPTIONS方法 + if method == "OPTIONS" { + c.AbortWithStatus(http.StatusNoContent) + } + // 处理请求 + c.Next() + } +} diff --git a/middleware/error.go b/middleware/error.go new file mode 100644 index 0000000..63e5ab5 --- /dev/null +++ b/middleware/error.go @@ -0,0 +1,61 @@ +package middleware + +import ( + "net" + "net/http" + "net/http/httputil" + "os" + "pure-admin/global" + "runtime/debug" + "strings" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志 +func GinRecovery(stack bool) gin.HandlerFunc { + return func(c *gin.Context) { + defer func() { + if err := recover(); err != nil { + // Check for a broken connection, as it is not really a + // condition that warrants a panic stack trace. + var brokenPipe bool + if ne, ok := err.(*net.OpError); ok { + if se, ok := ne.Err.(*os.SyscallError); ok { + if strings.Contains(strings.ToLower(se.Error()), "broken pipe") || strings.Contains(strings.ToLower(se.Error()), "connection reset by peer") { + brokenPipe = true + } + } + } + + httpRequest, _ := httputil.DumpRequest(c.Request, false) + if brokenPipe { + global.MG_LOG.Error(c.Request.URL.Path, + zap.Any("error", err), + zap.String("request", string(httpRequest)), + ) + // If the connection is dead, we can't write a status to it. + _ = c.Error(err.(error)) // nolint: errcheck + c.Abort() + return + } + + if stack { + global.MG_LOG.Error("[Recovery from panic]", + zap.Any("error", err), + zap.String("request", string(httpRequest)), + zap.String("stack", string(debug.Stack())), + ) + } else { + global.MG_LOG.Error("[Recovery from panic]", + zap.Any("error", err), + zap.String("request", string(httpRequest)), + ) + } + c.AbortWithStatus(http.StatusInternalServerError) + } + }() + c.Next() + } +} diff --git a/middleware/jwt.go b/middleware/jwt.go new file mode 100644 index 0000000..384caaf --- /dev/null +++ b/middleware/jwt.go @@ -0,0 +1,144 @@ +package middleware + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "strconv" + "time" + + "github.com/dgrijalva/jwt-go" + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +func JWTAuth() gin.HandlerFunc { + return func(c *gin.Context) { + // 我们这里jwt鉴权取头部信息 x-token 登录时回返回token信息 这里前端需要把token存储到cookie或者本地localStorage中 不过需要跟后端协商过期时间 可以约定刷新令牌或者重新登录 + token := c.Request.Header.Get("x-token") + if token == "" { + response.FailWithDetailed(gin.H{"reload": true}, "未登录或非法访问", c) + c.Abort() + return + } + if service.IsBlacklist(token) { + response.FailWithDetailed(gin.H{"reload": true}, "您的帐户异地登陆或令牌失效", c) + c.Abort() + return + } + j := NewJWT() + // parseToken 解析token包含的信息 + claims, err := j.ParseToken(token) + if err != nil { + if err == TokenExpired { + response.FailWithDetailed(gin.H{"reload": true}, "授权已过期", c) + c.Abort() + return + } + response.FailWithDetailed(gin.H{"reload": true}, err.Error(), c) + c.Abort() + return + } + if err, _ = service.FindUserByUuid(claims.UUID.String()); err != nil { + _ = service.JsonInBlacklist(model.JwtBlacklist{Jwt: token}) + response.FailWithDetailed(gin.H{"reload": true}, err.Error(), c) + c.Abort() + } + if claims.ExpiresAt-time.Now().Unix() < claims.BufferTime { + claims.ExpiresAt = time.Now().Unix() + global.MG_CONFIG.JWT.ExpiresTime + newToken, _ := j.CreateToken(*claims) + newClaims, _ := j.ParseToken(newToken) + c.Header("new-token", newToken) + c.Header("new-expires-at", strconv.FormatInt(newClaims.ExpiresAt, 10)) + if global.MG_CONFIG.System.UseMultipoint { + err, RedisJwtToken := service.GetRedisJWT(newClaims.UUID.String()) + if err != nil { + global.MG_LOG.Error("get redis jwt failed", zap.Any("err", err)) + } else { // 当之前的取成功时才进行拉黑操作 + _ = service.JsonInBlacklist(model.JwtBlacklist{Jwt: RedisJwtToken}) + } + // 无论如何都要记录当前的活跃状态 + _ = service.SetRedisJWT(newToken, newClaims.UUID.String()) + } + } + c.Set("claims", claims) + c.Next() + } +} + +type JWT struct { + SigningKey []byte +} + +var ( + TokenExpired = errors.New("Token is expired") + TokenNotValidYet = errors.New("Token not active yet") + TokenMalformed = errors.New("That's not even a token") + TokenInvalid = errors.New("Couldn't handle this token:") +) + +func NewJWT() *JWT { + return &JWT{ + []byte(global.MG_CONFIG.JWT.SigningKey), + } +} + +// 创建一个token +func (j *JWT) CreateToken(claims request.CustomClaims) (string, error) { + token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) + return token.SignedString(j.SigningKey) +} + +// 解析 token +func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error) { + token, err := jwt.ParseWithClaims(tokenString, &request.CustomClaims{}, func(token *jwt.Token) (i interface{}, e error) { + return j.SigningKey, nil + }) + if err != nil { + if ve, ok := err.(*jwt.ValidationError); ok { + if ve.Errors&jwt.ValidationErrorMalformed != 0 { + return nil, TokenMalformed + } else if ve.Errors&jwt.ValidationErrorExpired != 0 { + // Token is expired + return nil, TokenExpired + } else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 { + return nil, TokenNotValidYet + } else { + return nil, TokenInvalid + } + } + } + if token != nil { + if claims, ok := token.Claims.(*request.CustomClaims); ok && token.Valid { + return claims, nil + } + return nil, TokenInvalid + + } else { + return nil, TokenInvalid + + } + +} + +// 更新token +//func (j *JWT) RefreshToken(tokenString string) (string, error) { +// jwt.TimeFunc = func() time.Time { +// return time.Unix(0, 0) +// } +// token, err := jwt.ParseWithClaims(tokenString, &request.CustomClaims{}, func(token *jwt.Token) (interface{}, error) { +// return j.SigningKey, nil +// }) +// if err != nil { +// return "", err +// } +// if claims, ok := token.Claims.(*request.CustomClaims); ok && token.Valid { +// jwt.TimeFunc = time.Now +// claims.StandardClaims.ExpiresAt = time.Now().Unix() + 60*60*24*7 +// return j.CreateToken(*claims) +// } +// return "", TokenInvalid +//} diff --git a/middleware/loadtls.go b/middleware/loadtls.go new file mode 100644 index 0000000..69efe95 --- /dev/null +++ b/middleware/loadtls.go @@ -0,0 +1,26 @@ +package middleware + +import ( + "fmt" + "github.com/gin-gonic/gin" + "github.com/unrolled/secure" +) + +// 用https把这个中间件在router里面use一下就好 + +func LoadTls() gin.HandlerFunc { + return func(c *gin.Context) { + middleware := secure.New(secure.Options{ + SSLRedirect: true, + SSLHost: "localhost:443", + }) + err := middleware.Process(c.Writer, c.Request) + if err != nil { + // 如果出现错误,请不要继续 + fmt.Println(err) + return + } + // 继续往下处理 + c.Next() + } +} diff --git a/middleware/need_init.go b/middleware/need_init.go new file mode 100644 index 0000000..5caeac6 --- /dev/null +++ b/middleware/need_init.go @@ -0,0 +1,23 @@ +package middleware + +import ( + "pure-admin/global" + "pure-admin/model/response" + + "github.com/gin-gonic/gin" +) + +// 处理跨域请求,支持options访问 +func NeedInit() gin.HandlerFunc { + return func(c *gin.Context) { + if global.MG_DB == nil { + response.OkWithDetailed(gin.H{ + "needInit": true, + }, "前往初始化数据库", c) + c.Abort() + } else { + c.Next() + } + // 处理请求 + } +} diff --git a/middleware/operation.go b/middleware/operation.go new file mode 100644 index 0000000..d46c032 --- /dev/null +++ b/middleware/operation.go @@ -0,0 +1,87 @@ +package middleware + +import ( + "bytes" + "io/ioutil" + "net/http" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/service" + "strconv" + "time" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +func OperationRecord() gin.HandlerFunc { + return func(c *gin.Context) { + var ( + body []byte + userId int + appid string + ) + if c.Request.Method != http.MethodGet { + var err error + body, err = ioutil.ReadAll(c.Request.Body) + if err != nil { + global.MG_LOG.Error("read body from request error:", zap.Any("err", err)) + } else { + c.Request.Body = ioutil.NopCloser(bytes.NewBuffer(body)) + } + } + if claims, ok := c.Get("claims"); ok { + waitUse := claims.(*request.CustomClaims) + userId = int(waitUse.ID) + appid = waitUse.Appid + } else { + id, err := strconv.Atoi(c.Request.Header.Get("x-user-id")) + if err != nil { + userId = 0 + } + userId = id + } + record := model.SysOperationRecord{ + Ip: c.ClientIP(), + Method: c.Request.Method, + Path: c.Request.URL.Path, + Agent: c.Request.UserAgent(), + Body: string(body), + UserID: userId, + Appid: appid, + } + // 存在某些未知错误 TODO + //values := c.Request.Header.Values("content-type") + //if len(values) >0 && strings.Contains(values[0], "boundary") { + // record.Body = "file" + //} + writer := responseBodyWriter{ + ResponseWriter: c.Writer, + body: &bytes.Buffer{}, + } + c.Writer = writer + now := time.Now() + + c.Next() + + latency := time.Now().Sub(now) + record.ErrorMessage = c.Errors.ByType(gin.ErrorTypePrivate).String() + record.Status = c.Writer.Status() + record.Latency = latency + record.Resp = writer.body.String() + if err := service.CreateSysOperationRecord(record); err != nil { + global.MG_LOG.Error("create operation record error:", zap.Any("err", err)) + } + } +} + +type responseBodyWriter struct { + gin.ResponseWriter + body *bytes.Buffer +} + +func (r responseBodyWriter) Write(b []byte) (int, error) { + r.body.Write(b) + return r.ResponseWriter.Write(b) +} diff --git a/model/account.go b/model/account.go new file mode 100644 index 0000000..30722f5 --- /dev/null +++ b/model/account.go @@ -0,0 +1,30 @@ +package model + +import "pure-admin/global" + +type BankCard struct { + AccountName string `gorm:"size:50" json:"account_name"` // 户名 + BankCode string `gorm:"size:50" json:"bank_code"` // 收款行 + SwiftCode string `gorm:"size:20" json:"swift_code"` // 银行国际代码 + CardNumber string `gorm:"size:50" json:"card_number"` // 银行卡号 + Address string `gorm:"size:255" json:"address"` // 收款人地址 + Country string `gorm:"size:255" json:"country"` // 国家/地区 + Currency string `gorm:"size:10" json:"currency"` // 币种 USD:美元 +} + +type Account struct { + global.MG_MODEL + Platform string `gorm:"size:50" json:"platform"` //平台 saller(买家端) / customer(客户端) / influencer(网红端) + UserID string `gorm:"size:50;index" json:"userID"` //用户id + Type int `gorm:"type:int(1)" json:"type"` // 类型 1:paypal 2:银行卡 + BankCard + + IDCard string `gorm:"size:30" json:"idCard"` //身份证 + Phone string `gorm:"size:20" json:"phone"` //手机号 + Sort int `gorm:"type:int" json:"sort"` // 排序值 + IsDefault bool `gorm:"type:tinyint" json:"is_default"` // 是否为默认 0:非默认 1:默认 +} + +func (Account) TableName() string { + return "account" +} diff --git a/model/address.go b/model/address.go new file mode 100644 index 0000000..629b1fb --- /dev/null +++ b/model/address.go @@ -0,0 +1,22 @@ +package model + +import "pure-admin/global" + +type Address struct { + global.MG_MODEL + UserID string `gorm:"size:50" json:"userId"` + FirstName string `gorm:"size:50" json:"firstName"` //first name + LastName string `gorm:"size:50" json:"lastName"` //last name + Phone string `gorm:"size:20" json:"phone"` //手机号 + Street string `gorm:"size:50" json:"street"` //street + Bldg string `gorm:"size:100" json:"bldg"` //apt,ste,bldg + City string `gorm:"size:50" json:"city"` //city + State string `gorm:"size:50" json:"state"` //state + ZipCode string `gorm:"size:50" json:"zipCode"` //zip code + Default int `gorm:"tinyint(1)" json:"default"` //是否默认地址 1-是 2-否 + Platform string `gorm:"size:50" json:"platform"` //平台 saller(买家端) / customer(客户端) / influencer(网红端) +} + +func (Address) TableName() string { + return "address" +} diff --git a/model/application.go b/model/application.go new file mode 100755 index 0000000..dd3f4ea --- /dev/null +++ b/model/application.go @@ -0,0 +1,23 @@ +// 自动生成模板Application +package model + +import ( + "pure-admin/global" +) + +// 如果含有time.Time 请自行import time包 +type Application struct { + global.MG_MODEL + Owner string `gorm:"size:50;comment:用户所属" json:"owner" ` // 用户所属 + Name string `gorm:"size:50;comment:应用名称" json:"name" ` // 应用名称 + Appid string `gorm:"size:50;comment:应用ID" json:"appid" ` // 应用ID + Logo string `gorm:"size:255;comment:应用logo" json:"logo" ` // 应用logo + Organization string `gorm:"size:50;comment:组织" json:"organization" ` // 组织 + Provider string `gorm:"type:text;comment:提供者" json:"provider" ` // 提供者 + ClientID string `gorm:"size:50;comment:客户端ID" json:"clientID" ` // 客户端ID + ClientSecret string `gorm:"size:50;comment:客户端密钥" json:"clientSecret" ` // 客户端密钥 +} + +func (Application) TableName() string { + return "application" +} diff --git a/model/banner.go b/model/banner.go new file mode 100644 index 0000000..6d70588 --- /dev/null +++ b/model/banner.go @@ -0,0 +1,28 @@ +package model + +import "pure-admin/global" + +const MAX_BANNER_LIMIT = 20 + +type Banner struct { + RelationId string `gorm:"size:50" json:"relationId"` //关联项目id + RelationType string `gorm:"size:4" json:"relationType"` //关联类型 01-任务 + Title string `gorm:"size:80" json:"title"` //标题 + CoverUrl string `gorm:"size:500" json:"coverUrl"` //封面图 + LinkType string `gorm:"size:2" json:"linkType" form:"linkType"` //链接类型 0:内链 1:外链 + Link string `gorm:"size:500" json:"link"` //链接地址 + Type string `gorm:"size:4" json:"type"` //任务-0101 平台奖励页-0102 + Sort int `gorm:"" json:"sort"` //排序 + Status string `gorm:"size:4" json:"status"` //状态 0=下架 1=上架 + CreateBy string `gorm:"size:64" json:"createBy"` //创建人 + UpdateBy string `gorm:"size:64" json:"updateBy"` //更新人 + global.MG_MODEL +} + +func (q *Banner) New() error { + return global.MG_DB.Model(&Banner{}).Create(&q).Error +} + +func (Banner) TableName() string { + return "banner" +} diff --git a/model/bill.go b/model/bill.go new file mode 100644 index 0000000..bd56330 --- /dev/null +++ b/model/bill.go @@ -0,0 +1,42 @@ +package model + +import ( + "pure-admin/global" +) + +type Bill struct { + global.MG_MODEL + UserID string `gorm:"size:50;index" json:"userID"` //用户id + Type string `gorm:"size:1;default:1" json:"type"` //类型 1-佣金 2-订单 3-提现 + Title string `gorm:"size:255" json:"title"` // 账单标题 + Account string `gorm:"size:50" json:"account"` //收款账户(提现) + OrderID string `gorm:"size:50" json:"order_id"` //关联订单id + Price float64 `gorm:"type:decimal(10,2)" json:"price"` //价格 + Balance float64 `gorm:"type:decimal(10,2)" json:"balance"` //余额 + Status int `gorm:"type:int(1);default:0" json:"status"` //类型 1-支出 2-收入 + Receipt int `gorm:"type:tinyint(1)" json:"receipt"` //是否已到账 1-是 2-否 3-已取消付款 + Remark string `gorm:"size:50" json:"remark"` //备注 + Platform string `gorm:"size:50" json:"platform"` //平台 seller / customer / influencer + TransactionId string `gorm:"size:50" json:"transaction_id"` // 交易编号 +} + +type BillList struct { + global.MG_MODEL + UserID string `json:"user_id"` // 用户id + Title string `json:"title"` // 标题 + OrderID string `json:"order_id"` // 订单号 + Price float64 `json:"price"` // 金额 + Status int `json:"status"` // 类型 1-支出 2-收入 + Remark string `json:"remark"` // 备注 + Platform string `json:"platform"` // 平台 seller / customer / influencer + TransactionId string `json:"transaction_id"` // 交易编号 + User UserView `gorm:"-" json:"user"` // 用户信息 +} + +func (Bill) TableName() string { + return "bill" +} + +func (BillList) TableName() string { + return "bill" +} diff --git a/model/bill_fund.go b/model/bill_fund.go new file mode 100644 index 0000000..1c4d2e2 --- /dev/null +++ b/model/bill_fund.go @@ -0,0 +1,47 @@ +package model + +import "pure-admin/global" + +type BillFund struct { // 账户 + global.MG_MODEL + UserID string `gorm:"size:50;index" json:"userID"` // 用户id + TransactionType int `gorm:"type:int(1);default:1" json:"transaction_type"` // 类型 1-支出 2-收入 + TransactionId string `gorm:"size:50;unique" json:"transaction_id"` // 交易编号 + Title string `gorm:"size:255" json:"title"` // 账单标题 + Price float64 `gorm:"type:decimal(10,2)" json:"price"` // 金额 + Balance float64 `gorm:"type:decimal(10,2)" json:"balance"` // 余额 + Platform string `gorm:"size:20" json:"platform"` // 平台 seller bkb + Remark string `gorm:"size:50" json:"remark"` // 备注 + RelatedId string `gorm:"size:50" json:"related_id"` // 关联id 任务id + PayId string `gorm:"size:50" json:"pay_id"` // 支付id + Status int `gorm:"size:1" json:"status"` // 状态 1:进行中 2:已完成 3:已失败 +} + +type SellerBillFund struct { + global.MG_MODEL + UserID string `json:"user_id"` // 商家storeNo + TransactionType int `json:"transaction_type"` // 类型 1-支出 2-收入 + TransactionId string `json:"transaction_id"` // 交易编号 + Price float64 `json:"price"` // 金额 + Remark string `json:"remark"` // 备注 + RelatedId string `json:"related_id"` // 关联id 任务id + Status int `json:"status"` // 状态 1:进行中 2:已完成 3:已失败 + Seller StoreInfo `json:"seller"` // 店铺信息 + Mission MissionClaimView `json:"mission"` // 领取任务信息 +} + +type AdminBillFund struct { + global.MG_MODEL + UserID string `json:"user_id"` // + TransactionType int `json:"transaction_type"` // 类型 1-支出 2-收入 + TransactionId string `json:"transaction_id"` // 交易编号 + Price float64 `json:"price"` // 金额 + Remark string `json:"remark"` // 备注 + RelatedId string `json:"related_id"` // 关联id 任务id + Status int `json:"status"` // 状态 1:进行中 2:已完成 3:已失败 + InfluencerUser InfluencerUserClaimView `gorm:"-" json:"influencer"` // 网红信息 +} + +func (BillFund) TableName() string { + return "bill_fund" +} diff --git a/model/brochure.go b/model/brochure.go new file mode 100644 index 0000000..fc557f3 --- /dev/null +++ b/model/brochure.go @@ -0,0 +1,28 @@ +package model + +import "pure-admin/global" + +type SysBrochure struct { //单页 协议、条款等 + global.BASE_ID + Title string `gorm:"size:10" json:"title"` //标题 + Type string `gorm:"size:30" sql:"index" json:"type"` //类型 + Content string `gorm:"type:text" json:"content"` //内容 + Src string `gorm:"size:500" json:"src"` //静态页面html + + global.TIME_MODEL +} + +type SysBrochure4List struct { + global.BASE_ID + Title string `gorm:"size:10" json:"title"` //标题 + global.TIME_MODEL + global.TIME_MODEL_VIEW +} + +func (SysBrochure) TableName() string { + return "sys_brochure" +} + +func (SysBrochure4List) TableName() string { + return "sys_brochure" +} diff --git a/model/business.go b/model/business.go new file mode 100755 index 0000000..2071deb --- /dev/null +++ b/model/business.go @@ -0,0 +1,18 @@ +// 自动生成模板Business +package model + +import ( + "pure-admin/global" +) + +// 如果含有time.Time 请自行import time包 +type Business struct { + global.MG_MODEL + Name string `json:"name" form:"" gorm:"size:20"` + Email string `json:"email" form:"" gorm:"size:100"` + Phone string `json:"phone" form:"" gorm:"size:20"` +} + +func (Business) TableName() string { + return "business" +} diff --git a/model/category.go b/model/category.go new file mode 100644 index 0000000..c617860 --- /dev/null +++ b/model/category.go @@ -0,0 +1,39 @@ +package model + +import ( + "gorm.io/gorm" + + "pure-admin/global" +) + +type TbCategory struct { // 商品分类 + global.MG_MODEL + Name string `gorm:"type:varchar(100);not null;comment:商品分类名称" json:"name"` // 名称 + Pid uint `gorm:"type:int(11);comment:父id" json:"pid"` // 父id + Layer int `gorm:"type:int(1)" json:"layer"` // 层数 + IsLeaf bool `gorm:"type:tinyint(1)" json:"is_leaf"` // 是否叶子分类 + Status int `gorm:"type:tinyint(1);comment:状态 1:正常" json:"status"` // 状态 +} + +type TbCategoryTree struct { + ID uint `json:"id"` // + DeletedAt gorm.DeletedAt `json:"-"` // 删除时间 + Layer int `json:"-"` // + Name string `json:"name"` // 名称 + Pid uint `json:"pid"` // 父id + IsLeaf bool `json:"is_leaf"` // 是否叶子分类 + Children []*TbCategoryTree `gorm:"-" json:"children"` // 子节点 +} + +func (TbCategory) TableName() string { + return "tb_category" +} + +func (TbCategoryTree) TableName() string { + return "tb_category" +} + +type CategoryParentTree struct { + TbCategory + Parent *CategoryParentTree `json:"-"` // 父节点 +} diff --git a/model/customer_user.go b/model/customer_user.go new file mode 100644 index 0000000..e085d26 --- /dev/null +++ b/model/customer_user.go @@ -0,0 +1,27 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type CustomerUser struct { + global.MG_MODEL + UUID string `gorm:"unique;size:64" json:"uuid"` //用户uuid编码 + NickName string `gorm:"size:20" json:"nickName"` //昵称 + Phone string `gorm:"size:20" json:"phone"` //电话 + Avatar string `gorm:"size:255" json:"avatar"` //头像 + IDForbidden bool `json:"id_forbidden"` //是否禁用 + ForbiddenTime *time.Time `json:"forbidden_time"` //禁用时间 + ForbiddenReason string `json:"forbidden_reason"` //禁用原因 + ForbiddenOperation string `json:"forbidden_operation"` //禁用操作人 +} + +type CustomerLogin struct { + Phone string `gorm:"size:20" json:"phone"` //电话 + Code string `json:"code"` //验证码 +} + +func (CustomerUser) TableName() string { + return "customer_user" +} diff --git a/model/dict.go b/model/dict.go new file mode 100644 index 0000000..2209809 --- /dev/null +++ b/model/dict.go @@ -0,0 +1,50 @@ +package model + +import "pure-admin/global" + +const ( + ReleaseCountryCode = "release_country" + ReleaseChannelCode = "release_channel" + TagTypeCode = "tag_type" +) + +type SysDictType struct { //数据字典分类 + global.BASE_ID + PID int `gorm:"" json:"pid"` //父ID + Code string `gorm:"UNIQUE;size:20" json:"code"` //编码 + Name string `gorm:"size:20" json:"name"` //名称 + Type string `gorm:"size:10" json:"type"` //类型 + Status string `gorm:"size:1" json:"status"` //可用状态 1正常 0删除 + Desc string `gorm:"size:30" json:"desc"` //描述 + IsFixed int `gorm:"type:tinyint(1)" json:"isFixed"` //0默认为不固定 1固定 + //DynamicField string `gorm:"type:varchar(255)" json:"dynamic_field"` //动态字段编码 + + global.TIME_MODEL +} + +type SysDictData struct { //数据字典取值 + global.BASE_ID + TypeCode string `gorm:"size:20" json:"typeCode"` //编码 + Sort int `gorm:"" json:"sort"` //排序 + Label string `gorm:"size:30" json:"label"` //标签 + Value string `gorm:"size:10" json:"value"` //值 + IsDefault int `gorm:"type:tinyint(1)" json:"isDefault"` //是否为默认值 1是 0否 + Desc string `gorm:"size:50" json:"desc"` //描述 + Status string `gorm:"size:1" json:"status"` //可用状态 1正常 0删除 + + global.TIME_MODEL +} + +type SysDictDataView struct { + Label string `json:"label"` //标签 + Value string `json:"value"` //值 + IsDefault int `json:"isDefault"` //是否为默认值 1是 0否 +} + +func (SysDictType) TableName() string { + return "sys_dict_type" +} + +func (SysDictData) TableName() string { + return "sys_dict_data" +} diff --git a/model/dt_statistic_order.go b/model/dt_statistic_order.go new file mode 100644 index 0000000..6873d52 --- /dev/null +++ b/model/dt_statistic_order.go @@ -0,0 +1,41 @@ +package model + +import "pure-admin/global" + +type DtStatisticOrder struct { // 数据统计-订单 + global.MG_MODEL + Value string `gorm:"size:20" json:"value"` // 统计对象 eg:20231020(按天统计) + Unit string `gorm:"size:10" json:"unit"` // 单位 hour/day/month/all + Type int `gorm:"type:tinyint(1)" json:"type"` // 关联类型 0:无 1:用户 2:任务领取id 3:店铺id 4:spu_no + RelationId string `gorm:"size:60" json:"relation_id"` // 关联id 用户id/任务领取id/店铺id + NewOrderNum int64 `gorm:"type:int" json:"new_order_num"` // 创建订单数 + NewOrderMoney float64 `gorm:"type:decimal(10,2)" json:"new_order_money"` // 创建订单金额 + OrderNum int64 `gorm:"type:int" json:"order_num"` // 订单数 + OrderMoney float64 `gorm:"type:decimal(10,2)" json:"order_money"` // 订单金额 + OrderDoneNum int64 `gorm:"type:int" json:"order_done_num"` // 订单完成数 + SaleVolume int64 `gorm:"type:int" json:"sale_volume"` // 销售量 + SettleReward float64 `gorm:"type:decimal(10,2)" json:"settle_reward"` // 结算佣金 + TransitReward float64 `gorm:"type:decimal(10,2)" json:"transit_reward"` // 在途佣金 + OrderCancelNum int64 `gorm:"type:int" json:"order_cancel_num"` // 订单取消数 + OrderCancelMoney float64 `gorm:"type:decimal(10,2)" json:"order_cancel_money"` // 订单取消金额 + //Income float64 `gorm:"type:decimal(10,2)" json:"income"` // 收入 +} + +type Statistic struct { + Value string `json:"value"` // + RelationId string `json:"relation_id"` // + NewOrderNum int64 `json:"new_order_num"` // + NewOrderMoney float64 `json:"new_order_money"` // + OrderNum int64 `json:"order_num"` // + OrderMoney float64 `json:"order_money"` // + OrderDoneNum int64 `json:"order_done_num"` // + SaleVolume int64 `json:"sale_volume"` // + SettleReward float64 `json:"settle_reward"` // + TransitReward float64 `json:"transit_reward"` // + OrderCancelNum int64 `json:"order_cancel_num"` // + OrderCancelMoney float64 `json:"order_cancel_money"` // +} + +func (DtStatisticOrder) TableName() string { + return "dt_statistic_order" +} diff --git a/model/exa_breakpoint_continue.go b/model/exa_breakpoint_continue.go new file mode 100644 index 0000000..4efdce9 --- /dev/null +++ b/model/exa_breakpoint_continue.go @@ -0,0 +1,24 @@ +package model + +import ( + "pure-admin/global" +) + +// file struct, 文件结构体 +type ExaFile struct { + FileName string + FileMd5 string + FilePath string + ExaFileChunk []ExaFileChunk + ChunkTotal int + IsFinish bool + global.MG_MODEL +} + +// file chunk struct, 切片结构体 +type ExaFileChunk struct { + ExaFileID uint + FileChunkNumber int + FileChunkPath string + global.MG_MODEL +} diff --git a/model/goods_visit.go b/model/goods_visit.go new file mode 100644 index 0000000..b5b77c6 --- /dev/null +++ b/model/goods_visit.go @@ -0,0 +1,13 @@ +package model + +import "pure-admin/global" + +type GoodsVisit struct { + global.MG_MODEL + UserID string `gorm:"size:50;index" json:"user_id"` // 用户id + GoodsID uint `gorm:"size:50" json:"goods_id"` +} + +func (GoodsVisit) TableName() string { + return "goods_visit" +} diff --git a/model/influencer_user.go b/model/influencer_user.go new file mode 100644 index 0000000..152fe70 --- /dev/null +++ b/model/influencer_user.go @@ -0,0 +1,63 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type InfluencerUser struct { + global.MG_MODEL + UUID string `gorm:"unique;size:64" json:"uuid"` //用户uuid编码 + NickName string `gorm:"size:20" json:"nickName"` //昵称 + Phone string `gorm:"size:20" json:"phone"` //电话 + Email string `json:"email" form:"email" gorm:"size:255"` //用户邮箱 + Avatar string `gorm:"size:255" json:"avatar"` //头像 + Platform string `gorm:"size:500" json:"platform"` //平台及地址逗号隔开 eg:(ins:https://baidu.com/user/1,qq:12345678) + Tags string `gorm:"size:500" json:"tags"` //个人标签 + IDForbidden bool `json:"id_forbidden"` //是否禁用 + ForbiddenTime *time.Time `json:"forbidden_time"` //禁用时间 + ForbiddenReason string `json:"forbidden_reason"` //禁用原因 + ForbiddenOperation string `json:"forbidden_operation"` //禁用操作人 +} + +type InfluencerUserDesc struct { + global.MG_MODEL + UUID string `gorm:"unique;size:64" json:"uuid"` //用户uuid编码 + NickName string `gorm:"size:20" json:"nickName"` //昵称 + Phone string `gorm:"size:20" json:"phone"` //电话 + Email string `json:"email" form:"email" gorm:"size:255"` //用户邮箱 + Avatar string `gorm:"size:255" json:"avatar"` //头像 + Platform string `gorm:"size:500" json:"-"` //平台及地址逗号隔开 eg:(ins:https://baidu.com/user/1,qq:12345678) + PlatformStr interface{} `gorm:"-" json:"platform"` //平台及地址 + Tags string `gorm:"size:500" json:"tags"` //个人标签 + //TagsStr interface{} `gorm:"-" json:"tags"` //个人标签 + IDForbidden bool `gorm:"-" json:"id_forbidden"` //是否禁用 + ForbiddenTime *time.Time `json:"forbidden_time"` //禁用时间 + ForbiddenReason string `json:"forbidden_reason"` //禁用原因 + ForbiddenOperation string `json:"forbidden_operation"` //禁用操作人 +} + +type InfluencerUserView struct { + UUID string `json:"uuid"` //用户uuid + NickName string `json:"nick_name"` //昵称 + Phone string `json:"phone"` //电话 +} + +type InfluencerUserClaimView struct { + UUID string `json:"uuid"` //用户uuid + NickName string `json:"nick_name"` //昵称 + Phone string `json:"phone"` //电话 + ClaimNo string `json:"claim_no"` +} + +func (InfluencerUser) TableName() string { + return "user" +} + +func (InfluencerUserView) TableName() string { + return "user" +} + +func (InfluencerUserDesc) TableName() string { + return "user" +} diff --git a/model/mission.go b/model/mission.go new file mode 100644 index 0000000..08f60a7 --- /dev/null +++ b/model/mission.go @@ -0,0 +1,83 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type Mission struct { //任务 + Title string `gorm:"type:varchar(255);" json:"title"` //标题 + GoodsId uint `gorm:"type:int(11)" json:"goods_id"` //关联商品 + GoodsStatus int `gorm:"type:tinyint(1);" json:"goods_status"` //关联商品状态 1:正常 2:已下架 + Num int64 `gorm:"type:int(11)" json:"num"` //商品数量 + HireType int `gorm:"type:tinyint(1)" json:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + HireMoney float64 `gorm:"type:decimal(10,2);" json:"hire_money"` //hire_type==1 佣金金额 + HireRatio float64 `gorm:"type:decimal(10,2);" json:"hire_ratio"` //hire_type==2 抽成比例 + StartTime *time.Time `gorm:"column:start_time" json:"start_time"` //任务起始时间 + EndTime *time.Time `gorm:"column:end_time" json:"end_time"` //任务结束时间 + ClaimNum int64 `gorm:"type:int(11);" json:"claim_num"` //接任务人数 + CollectionNum int64 `gorm:"type:int(11)" json:"collection_num"` //收藏人数 + ClaimDays int `gorm:"type:tinyint(11)" json:"claim_days"` //任务完成天数 + ClaimDemands string `gorm:"type:varchar(500);" json:"claim_demands"` //任务拍摄要求 + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + Status int `gorm:"type:tinyint(1);" json:"status"` //状态 1:未开始 2:进行中 3:已结束 + ClaimStock int64 `json:"claim_stock"` //可接任务库存 + FundLock float64 `gorm:"type:decimal(10,2)" json:"fund_lock"` // 任务锁定营销账户金额 + Sample //样品 + VideoMaterial //视频素材 + Description string `gorm:"type:varchar(2000);" json:"description"` //描述/卖点 + StoreNo string `gorm:"type:varchar(60);" json:"store_no"` // 店铺编号 + + global.MG_MODEL +} + +type MissionDetail struct { + Title string `json:"title"` //标题 + GoodsId uint `json:"-"` // + GoodsStatus int `json:"goods_status"` //关联商品状态 1:正常 2:已下架 + Goods TbGoods4List `gorm:"ForeignKey:GoodsId" json:"goods"` //商品信息 + Num int64 `json:"num"` //商品数量 + HireType int `json:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + HireMoney float64 `json:"hire_money"` //hire_type==1 佣金金额 + HireRatio float64 `json:"hire_ratio"` //hire_type==2 抽成比例 + HireMoneyExpect string `gorm:"-" json:"hire_money_expect"` //预计佣金描述 + StartTime *time.Time `json:"start_time"` //任务起始时间 + EndTime *time.Time `json:"end_time"` //任务结束时间 + Status int `json:"status"` //状态 1:未开始 2:进行中 3:已结束 + ClaimNum int64 `json:"claim_num"` //接任务人数 + ClaimStock int64 `json:"claim_stock"` //可接任务库存 + OrderNum int64 `gorm:"-" json:"order_num"` //订单数 + ClaimDays int `gorm:"type:tinyint(11)" json:"claim_days"` //任务完成天数 + ClaimDemands string `gorm:"type:varchar(500);" json:"claim_demands"` //任务拍摄要求 + Description string `gorm:"type:varchar(2000);" json:"description"` //描述/卖点 + Sample + VideoMaterial + ReleaseCountry string `gorm:"-" json:"release_country"` //发布国家 + ReleaseChannels string `gorm:"-" json:"release_channels"` //发布渠道 + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + Seller SellerStoreInfo `json:"seller" gorm:"ForeignKey:CreateBy;References:CreateBy"` + VideoClaimNum int64 `json:"video_claim_num" gorm:"-"` //关联视频数量 + Tags string `json:"tags" gorm:"-"` //标签 + StoreNo string `gorm:"type:varchar(60);" json:"store_no"` // 店铺编号 + global.MG_MODEL +} + +type Sample struct { + HasSample int `gorm:"type:tinyint(1);default:0" json:"has_sample"` //是否有样品 0:没有 1:有 + SampleNum int `gorm:"type:tinyint(11);" json:"sample_num"` //样品数量 +} + +type VideoMaterial struct { + HasVideo int `gorm:"type:tinyint(1);default:0" json:"has_video"` //是否有视频素材 0:没有 1:有 + VideoUrl string `json:"video_url"` + VideoChannelIds string `json:"video_channel_ids"` //视频发布渠道,多个渠道英文逗号连接 + VideoCountryId string `json:"video_country_id"` //视频发布国家 +} + +func (Mission) TableName() string { + return "mission" +} + +func (MissionDetail) TableName() string { + return "mission" +} diff --git a/model/mission_claim.go b/model/mission_claim.go new file mode 100644 index 0000000..30dec38 --- /dev/null +++ b/model/mission_claim.go @@ -0,0 +1,85 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type MissionClaim struct { //领取任务记录 + MissionId uint `gorm:"type:int(11)" json:"mission_id"` //任务id + ClaimNo string `gorm:"unique;type:varchar(60);" json:"claim_no"` //领取任务编号 + AchieveNum int64 `gorm:"type:int(11)" json:"achieve_num"` //已完成商品数量 + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + Status int `gorm:"type:tinyint(1)" json:"status"` //状态 1:已领取待发货 2:已发货 3:已收货推广中 + ExpireAt time.Time `json:"expire_at"` //任务推广过期时间 + Finished int `gorm:"type:tinyint(1);" json:"finished"` // 任务完成状态 0:未完成 1:已完成 + OrderNum int64 `gorm:"type:int" json:"orderNum"` // 订单数 + OrderMoney float64 `gorm:"type:decimal(10,2)" json:"orderMoney"` // 订单金额 + RewardFinished float64 `gorm:"type:decimal(10,2)" json:"rewardFinished"` // 佣金结算 + RewardUnfinished float64 `gorm:"type:decimal(10,2)" json:"rewardUnfinished"` // 在途佣金 + global.MG_MODEL +} + +type MissionClaimDetail struct { + global.MG_MODEL + MissionId uint `json:"mission_id"` //任务id + ClaimNo string `json:"claim_no"` //领取任务编号 + AchieveNum int64 `json:"achieve_num"` //完成数 + Status int `json:"status"` //状态 1:已领取待发货 2:已发货 3:已收货推广中 + HireMoney float64 `gorm:"-" json:"hire_money"` //佣金 + CreateBy string `json:"-"` + Influencer InfluencerUserView `gorm:"ForeignKey:UUID;References:CreateBy" json:"influencer"` //网红信息 + Works []MissionClaimWorks `gorm:"ForeignKey:MissionClaimId;References:ID" json:"works"` //发布作品 + Mission MissionDetail `gorm:"ForeignKey:MissionId;AssociationForeignKey:ID" json:"mission"` //关联任务 + Order MissionClaimOrderInfo `gorm:"ForeignKey:MissionClaimId;AssociationForeignKey:ID" json:"order"` //任务订单 + Video MissionClaimVideo `gorm:"ForeignKey:MissionClaimId;References:ID" json:"video"` //上传视频 +} + +type MissionClaimInfluencer struct { + global.MG_MODEL + MissionId uint `json:"mission_id"` //任务id + ClaimNo string `json:"claim_no"` //领取任务编号 + AchieveNum int64 `json:"achieve_num"` //完成数 + Status int `json:"status"` //状态 1:已领取待发货 2:已发货 3:已收货推广中 + HireMoney float64 `gorm:"-" json:"hire_money"` //佣金 + CreateBy string `json:"-"` + Influencer InfluencerUserDesc `gorm:"ForeignKey:UUID;References:CreateBy" json:"influencer"` //网红信息 + Works []MissionClaimWorks `gorm:"ForeignKey:MissionClaimId;References:ID" json:"works"` //发布作品 + Video MissionClaimVideo `gorm:"ForeignKey:MissionClaimId;References:ID" json:"video"` //上传视频 +} + +type MissionClaimInfo struct { + MissionId uint `json:"mission_id"` //任务id + ClaimNo string `json:"claim_no"` //领取任务编号 + HireType int `gorm:"type:tinyint(1)" json:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + HireMoney float64 `gorm:"type:decimal(10,2);" json:"hire_money"` //hire_type==1 佣金金额 + HireRatio float64 `gorm:"type:decimal(10,2);" json:"hire_ratio"` //hire_type==2 抽成比例 +} + +type MissionClaimSummary struct { + ClaimNo string `json:"claim_no"` //领取任务编号 + Count int64 `json:"count"` //接任务数 + OrderNum int64 `json:"order_num"` // 订单数 + Bonus float64 `json:"bonus"` // 佣金 + TransitBonus float64 `json:"transit_bonus"` // 在途佣金 + FirstClaimAt time.Time `json:"first_claim_at"` //首次领取任务时间 + CreateBy string `json:"create_by"` //网红ID + Influencer InfluencerUserView `json:"influencer"` //网红信息 + Platform string `json:"platform"` +} + +type MissionClaimView struct { + MissionId uint `json:"mission_id"` // 任务id + ClaimNo string `json:"claim_no"` // 领取任务编号 + CreateBy string `json:"create_by"` // 网红uuid + User UserView `json:"user"` // 网红信息 + MissionTitle string `json:"mission_title"` // 任务标题 +} + +func (MissionClaim) TableName() string { + return "mission_claim" +} + +func (MissionClaimDetail) TableName() string { + return "mission_claim" +} diff --git a/model/mission_claim_address.go b/model/mission_claim_address.go new file mode 100644 index 0000000..a406497 --- /dev/null +++ b/model/mission_claim_address.go @@ -0,0 +1,12 @@ +package model + +type MissionClaimAddress struct { //领取任务地址 + Address + AddressId uint `gorm:"type:int(11)" json:"address_id"` //地址id + MissionClaimId uint `gorm:"type:int(11)" json:"mission_claim_id"` //领取任务id + OrderID string `gorm:"size:50;index" json:"order_id"` //订单号 +} + +func (MissionClaimAddress) TableName() string { + return "mission_claim_address" +} diff --git a/model/mission_claim_order.go b/model/mission_claim_order.go new file mode 100644 index 0000000..af4f193 --- /dev/null +++ b/model/mission_claim_order.go @@ -0,0 +1,52 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type MissionClaimOrder struct { //任务领取sku订单 + global.MG_MODEL + OrderID string `gorm:"size:50;index" json:"order_id"` //订单号 + MissionClaimId uint `gorm:"type:int(11)" json:"mission_claim_id"` //领取任务id + SpuNo string `gorm:"type:varchar(60);" json:"spu_no"` //spu编号 + SkuNo string `gorm:"type:varchar(60);" json:"sku_no"` //sku编号 + Number int `gorm:"type:int(10)" json:"number"` //数量 + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + Status int `gorm:"type:int(1)" json:"status"` //订单状态 2:待发货 3:已发货 + SendTime *time.Time `gorm:"" json:"send_time"` //发货时间 + Courier string `gorm:"size:50" json:"courier"` //快递公司 + CourierUrl string `gorm:"size:255" json:"courier_url"` //快递查询地址 + CourierNumber string `gorm:"size:50" json:"courier_number"` //快递单号 + ConfirmTime *time.Time `gorm:"" json:"confirm_time"` //收货时间 +} + +type MissionClaimOrderDetail struct { + MissionClaimOrder + Goods MissionClaimOrderGoods `gorm:"ForeignKey:OrderID;References:OrderID" json:"goods"` //任务订单商品 + Address MissionClaimAddress `gorm:"ForeignKey:OrderID;References:OrderID" json:"address"` //任务订单地址 + MissionClaim MissionClaimDetail `gorm:"ForeignKey:MissionClaimId;References:ID" json:"mission_claim"` //任务领取记录 +} + +type MissionClaimOrderInfo struct { + OrderID string `json:"order_id"` //订单号 + MissionClaimId uint `json:"mission_claim_id"` //领取任务id + Status int `json:"status"` //订单状态 2:待发货 3:已发货 + Courier string `json:"courier"` //快递公司 + CourierUrl string `json:"courier_url"` //快递查询地址 + CourierNumber string `json:"courier_number"` //快递单号 + SendTime *time.Time `gorm:"send_time" json:"send_time"` //发货时间 + OrderGoods MissionClaimOrderGoods `gorm:"ForeignKey:OrderID;references:OrderID;" json:"order_goods"` //订单商品信息 +} + +func (MissionClaimOrder) TableName() string { + return "mission_claim_order" +} + +func (MissionClaimOrderDetail) TableName() string { + return "mission_claim_order" +} + +func (MissionClaimOrderInfo) TableName() string { + return "mission_claim_order" +} diff --git a/model/mission_claim_order_goods.go b/model/mission_claim_order_goods.go new file mode 100644 index 0000000..a11c924 --- /dev/null +++ b/model/mission_claim_order_goods.go @@ -0,0 +1,17 @@ +package model + +import "pure-admin/global" + +type MissionClaimOrderGoods struct { //任务订单关联商品 + global.MG_MODEL + OrderID string `gorm:"size:50;index" json:"order_id"` //订单号 + SkuNo string `gorm:"type:varchar(60);" json:"sku_no"` //sku编号 + Title string `gorm:"type:varchar(255);" json:"title"` //名称 + Image string `gorm:"size:255" json:"image"` //规格图片url + Specs string `gorm:"type:text;" json:"specs"` //规格 + Price float64 `gorm:"type:decimal(10,2);" json:"price"` //价格 +} + +func (MissionClaimOrderGoods) TableName() string { + return "mission_claim_order_goods" +} diff --git a/model/mission_claim_video.go b/model/mission_claim_video.go new file mode 100644 index 0000000..18363c9 --- /dev/null +++ b/model/mission_claim_video.go @@ -0,0 +1,30 @@ +package model + +import "pure-admin/global" + +type MissionClaimVideo struct { //固定费用上传视频 + global.MG_MODEL + MissionClaimId uint `gorm:"type:int(11)" json:"mission_claim_id"` //领取任务id + VideoUrl string `gorm:"size:255" json:"video_url"` //视频上传地址 + Cover string `json:"cover" gorm:"size:255"` //视频封面 + Remark string `json:"remark"` //审核理由 + Status int `json:"status"` //状态 1:待审核 2:审核通过 3:审核不通过 + SourceType int `json:"source_type" gorm:"type:tinyint(1);default:1"` //类型:1:固定费用上传 2:奖励任务上传 3:后台上传 + MissionId uint `json:"mission_id"` //任务ID + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + UpdateBy string `gorm:"size:64" json:"update_by"` //修改人 +} + +type MissionClaimVideoDetail struct { + MissionClaimVideo + Mission MissionDetail `gorm:"ForeignKey:ID;References:MissionId" json:"mission"` //任务信息 + Influencer InfluencerUserView `gorm:"ForeignKey:UUID;References:CreateBy" json:"influencer"` //网红信息 +} + +func (MissionClaimVideo) TableName() string { + return "mission_claim_video" +} + +func (MissionClaimVideoDetail) TableName() string { + return "mission_claim_video" +} diff --git a/model/mission_claim_works.go b/model/mission_claim_works.go new file mode 100644 index 0000000..74124da --- /dev/null +++ b/model/mission_claim_works.go @@ -0,0 +1,16 @@ +package model + +import "pure-admin/global" + +type MissionClaimWorks struct { //领取任务发布的作品 + global.MG_MODEL + MissionClaimId uint `gorm:"type:int(11)" json:"mission_claim_id"` //领取任务id + Type int `gorm:"type:tinyint(1)" json:"type"` //平台 1:ins 2:Pinterest 3:tk 4:Twitter 5:Facebook 6:Reddit + Homepage string `gorm:"size:255" json:"homepage"` //作品主页地址 + Image string `json:"image"` //作品凭证截图 + VideoUrl string `gorm:"size:255" json:"video_url"` //视频上传地址 +} + +func (MissionClaimWorks) TableName() string { + return "mission_claim_works" +} diff --git a/model/mission_recommend.go b/model/mission_recommend.go new file mode 100644 index 0000000..ddfeced --- /dev/null +++ b/model/mission_recommend.go @@ -0,0 +1,27 @@ +package model + +import ( + "pure-admin/global" +) + +type MissionRecommend struct { //任务推荐 + RelationId uint `gorm:"type:int(11);" json:"relation_id"` //关联ID,任务视频ID,添加视频只需要传relationId + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + Status int `gorm:"type:tinyint(1);" json:"status"` //状态 1:上架 2:下架 + Sort int `gorm:"type:tinyint(2)" json:"sort"` //倒序 //排序 + UpdateBy string `gorm:"size:64" json:"-"` //更新人 + global.MG_MODEL +} + +type MissionRecommendDetail struct { //任务推荐 + MissionRecommend //更新人 + MissionVideo MissionClaimVideoDetail `gorm:"ForeignKey:ID;References:RelationId" json:"mission_video"` //任务视频信息 +} + +func (MissionRecommend) TableName() string { + return "mission_recommend" +} + +func (MissionRecommendDetail) TableName() string { + return "mission_recommend" +} diff --git a/model/mission_stop.go b/model/mission_stop.go new file mode 100644 index 0000000..ab1b86a --- /dev/null +++ b/model/mission_stop.go @@ -0,0 +1,25 @@ +package model + +import "pure-admin/global" + +type MissionStop struct { //固定费用上传视频 + global.MG_MODEL + Remark string `json:"remark"` + Status int `json:"status"` //状态 1:待审核 2:审核通过 3:审核不通过 + MissionId uint `json:"mission_id"` //任务ID + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + AuditBy string `size:"64" json:"audit_by"` //审核人 +} + +type MissionStopDetail struct { + MissionStop + Mission MissionDetail `json:"mission" gorm:"ForeignKey:ID;References:MissionId"` //任务信息 +} + +func (MissionStop) TableName() string { + return "mission_stop" +} + +func (MissionStopDetail) TableName() string { + return "mission_stop" +} diff --git a/model/notify.go b/model/notify.go new file mode 100644 index 0000000..9fdbc79 --- /dev/null +++ b/model/notify.go @@ -0,0 +1,16 @@ +package model + +import "pure-admin/global" + +type Notify struct { // 通知 + global.MG_MODEL + UserId string `gorm:"size:64" json:"userId"` // 用户id + RelationType string `gorm:"size:1" json:"relation_type"` // 关联类型 1-提现 + RelationId string `gorm:"size:64" json:"relation_id"` // 关联id + Title string `gorm:"size:255" json:"title"` // 通知标题 + Content string `gorm:"size:255" json:"content"` // 通知内容 +} + +func (Notify) TableName() string { + return "notify" +} diff --git a/model/order.go b/model/order.go new file mode 100644 index 0000000..2f6058b --- /dev/null +++ b/model/order.go @@ -0,0 +1,69 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type Order struct { + global.MG_MODEL + OrderID string `gorm:"size:50;index" json:"orderID"` //订单号 + StoreNo string `gorm:"size:60" json:"store_no"` // 店铺编号 + CaptureID string `gorm:"size:50" json:"captureID"` //paypal收款确认id + Code string `gorm:"size:20" json:"code"` //网红码? + UserID string `gorm:"size:50;index" json:"userID"` //用户id + CommodID uint `gorm:"size:50;index" json:"commodID"` //商品id + SkuNo string `gorm:"type:varchar(60);" json:"sku_no"` //商品规格编号 + Type int `gorm:"type:int(1);default:1" json:"type"` //类型 1-普通订单 2-预售订单 + Price float64 `gorm:"type:decimal(10,2)" json:"price"` //商品价格 + Number int `gorm:"type:int(10)" json:"number"` //数量 + PaidPrice float64 `gorm:"type:decimal(10,2)" json:"paidPrice"` //实付价格 + Status int `gorm:"type:int(1)" json:"status"` //订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消 + PayTime *time.Time `gorm:"" json:"payTime"` //付款时间 + SendTime *time.Time `gorm:"" json:"sendTime"` //发货时间 + ConfirmTime *time.Time `gorm:"" json:"confirmTime"` //收货时间 +} + +type OrderList struct { + Order + Goods OrderGoodsDetail `gorm:"-" json:"goods"` // 商品信息 + Address OrderAddress `gorm:"-" json:"address"` //地址 + Deliver OrderDeliver `gorm:"-" json:"deliver"` //发货信息 + InfluencerUser InfluencerUserClaimView `gorm:"-" json:"influencer"` //网红信息 + CustomerPhone string `gorm:"-" json:"customerPhone"` //买家手机 + InfluencerAmount string `gorm:"-" json:"IAmount"` //网红佣金 + SellerAmount string `gorm:"-" json:"SAmount"` //入账 +} + +type OrderDetail struct { + Order + Goods OrderGoodsDetail `gorm:"-" json:"goods"` // 商品信息 + Address OrderAddress `gorm:"-" json:"address"` //地址 + Deliver OrderDeliver `gorm:"-" json:"deliver"` //发货信息 + Chain Chain `gorm:"-" json:"chain"` // 区块链 + InfluencerAmount string `gorm:"-" json:"IAmount"` //网红佣金 + SellerAmount string `gorm:"-" json:"SAmount"` //入账 +} + +type Chain struct { + Address string `json:"address"` // 合约地址 +} + +type OrderSummary struct { + Code string `json:"code"` + Count int `json:"count"` + Bonus float64 `json:"bonus"` //网红佣金 + Sales float64 `json:"sales"` //入账 +} + +func (Order) TableName() string { + return "order" +} + +func (OrderList) TableName() string { + return "order" +} + +func (OrderDetail) TableName() string { + return "order" +} diff --git a/model/order_address.go b/model/order_address.go new file mode 100644 index 0000000..f8fc843 --- /dev/null +++ b/model/order_address.go @@ -0,0 +1,12 @@ +package model + +// 记录订单中的收货地址 +type OrderAddress struct { + Address + OrderID string `gorm:"size:50" json:"orderID"` + Platform string `gorm:"size:50" json:"platform"` //平台 saller(买家端) / customer(客户端) / influencer(网红端) +} + +func (OrderAddress) TableName() string { + return "order_address" +} diff --git a/model/order_deliver.go b/model/order_deliver.go new file mode 100644 index 0000000..c16272f --- /dev/null +++ b/model/order_deliver.go @@ -0,0 +1,26 @@ +package model + +import "pure-admin/global" + +type OrderDeliver struct { + global.MG_MODEL + OrderID string `gorm:"size:50" json:"orderID"` //订单号 + CourierNumber string `gorm:"size:50" json:"courierNumber"` //快递单号 + Courier string `gorm:"size:50" json:"courier"` //快递公司 + CourierLink string `gorm:"size:255" json:"courierLink"` //快递链接 +} + +type OrderDeliverDesc struct { + OrderID string `gorm:"size:50" json:"orderID"` //订单号 + CourierNumber string `gorm:"size:50" json:"courierNumber"` //快递单号 + Courier string `gorm:"size:50" json:"courier"` //快递公司 + CourierLink string `gorm:"size:255" json:"courierLink"` //快递链接 +} + +type PutDeliver struct { + Data []OrderDeliverDesc `json:"data"` +} + +func (OrderDeliver) TableName() string { + return "order_deliver" +} diff --git a/model/order_goods.go b/model/order_goods.go new file mode 100644 index 0000000..a757573 --- /dev/null +++ b/model/order_goods.go @@ -0,0 +1,25 @@ +package model + +import "pure-admin/global" + +type OrderGoods struct { + global.MG_MODEL + OrderID string `gorm:"size:50" json:"orderID"` // 订单id + SpuNo string `gorm:"type:varchar(60);" json:"spu_no"` // 商品编号 + SkuNo string `gorm:"type:varchar(60);" json:"sku_no"` // 商品规格编号 + Specs string `gorm:"type:text;" json:"specs"` // 规格 + TbGoodsBase +} + +type OrderGoodsDetail struct { + OrderGoods + GoodsSpecs []OrderGoodsSpecs `gorm:"ForeignKey:ID;AssociationForeignKey:OrderGoodsId" json:"goods_specs"` // 商品规格 +} + +func (OrderGoods) TableName() string { + return "order_goods" +} + +func (OrderGoodsDetail) TableName() string { + return "order_goods" +} diff --git a/model/order_goods_specs.go b/model/order_goods_specs.go new file mode 100644 index 0000000..1fd530d --- /dev/null +++ b/model/order_goods_specs.go @@ -0,0 +1,14 @@ +package model + +import "pure-admin/global" + +type OrderGoodsSpecs struct { + global.MG_MODEL + TbGoodsSpecsBase + OrderID string `gorm:"size:50" json:"orderID"` // 订单id + OrderGoodsId uint `json:"orderGoodsId"` // +} + +func (OrderGoodsSpecs) TableName() string { + return "order_goods_specs" +} diff --git a/model/order_post_sale.go b/model/order_post_sale.go new file mode 100644 index 0000000..a9ada74 --- /dev/null +++ b/model/order_post_sale.go @@ -0,0 +1,31 @@ +package model + +import "pure-admin/global" + +type OrderPostSale struct { // 订单售后记录 + global.MG_MODEL + Type int `gorm:"type:tinyint(1)" json:"type"` // 售后类型 1:仅退款 + OrderID string `gorm:"size:50" json:"orderId"` // 订单号 + StoreNo string `gorm:"size:60" json:"store_no"` // 店铺编号 + UserID string `gorm:"size:50" json:"userId"` // 用户id + Amount float64 `gorm:"type:decimal(10,2)" json:"amount"` // 退款金额 + Reason string `gorm:"size:1" json:"reason"` // 退款原因 + Images string `gorm:"size:255" json:"images"` // 图片 + Videos string `gorm:"size:255" json:"videos"` // 视频 + Status int `gorm:"type:tinyint(1)" json:"status"` // 处理状态 1:已提交 2:已处理 3:已拒绝 4:已撤回 + RefundStatus int `gorm:"type:tinyint(1)" json:"refundStatus"` // 退款状态 1:退款中 2:退款成功 3:退款失败 +} + +type OrderPostSaleDetail struct { + OrderPostSale + Order OrderDetail `gorm:"-" json:"order"` +} + +type CountMap struct { + Key string `json:"key"` + Value int64 `json:"value"` +} + +func (OrderPostSale) TableName() string { + return "order_post_sale" +} diff --git a/model/organization.go b/model/organization.go new file mode 100755 index 0000000..c6a5da5 --- /dev/null +++ b/model/organization.go @@ -0,0 +1,18 @@ +// 自动生成模板Organization +package model + +import ( + "pure-admin/global" +) + +// 如果含有time.Time 请自行import time包 +type Organization struct { + global.MG_MODEL + Code string `gorm:"size:50;comment:组织编码" json:"code" ` // 组织编码 + Owner string `gorm:"size:50;comment:用户所属" json:"owner" ` // 组织所属 + Name string `gorm:"size:50;comment:组织名称" json:"name" ` // 组织名称 +} + +func (Organization) TableName() string { + return "organization" +} diff --git a/model/platform_auth.go b/model/platform_auth.go new file mode 100644 index 0000000..885b01e --- /dev/null +++ b/model/platform_auth.go @@ -0,0 +1,39 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type PlatformAuth struct { + global.MG_MODEL + UserID string `json:"user_id" gorm:"type:varchar(60);comment:用户ID"` //用户ID + Platform + Status string `json:"status" gorm:"size:1;comment:认证状态 0:未认证 1:已认证 2:认证失败"` //认证状态 0:未认证 1:已认证 2:认证失败 +} + +type PlatformAuthSimple struct { + PlatformAuth + User UserSimple `gorm:"-" json:"user"` + TagRelationDesc []TagRelationDesc `gorm:"-" json:"tag_relation"` +} + +type Platform struct { + Platform string `json:"platform"` //平台 + PlatformName string `gorm:"-" json:"platformName"` //平台名称 + Url string `json:"url"` //主页地址 + Image string `json:"image"` //图片 + IsAuth bool `json:"is_auth"` //是否认证 0:未认证 1:已认证 2:认证失败 + AuthMsg string `json:"auth_msg"` //认证信息 + CreatedAt *time.Time `json:"created_at" gorm:"-"` //创建时间 + AuthTime string `json:"auth_time" gorm:"type:datetime"` //认证时间 + CheckUser string `json:"check_user" gorm:"type:varchar(60)"` //审核人 +} + +func (PlatformAuth) TableName() string { + return "platform_auth" +} + +func (PlatformAuthSimple) TableName() string { + return "platform_auth" +} diff --git a/model/provider.go b/model/provider.go new file mode 100755 index 0000000..e6fa2e2 --- /dev/null +++ b/model/provider.go @@ -0,0 +1,26 @@ +// 自动生成模板Provider +package model + +import ( + "pure-admin/global" +) + +// 如果含有time.Time 请自行import time包 +type Provider struct { + global.MG_MODEL + Owner string `gorm:"size:50;comment:用户所属" json:"owner" ` // 用户所属 + Name string `gorm:"size:50;comment:提供者名称" json:"name" ` // 提供者名称 + Category string `gorm:"size:50;comment:提供者分类" json:"category" ` // 提供者分类 1-社交 2-支付 3-媒体 4-其他 + Code string `gorm:"size:50;comment:提供者代码" json:"code" ` // 提供者代码 google facebook twitter tiktok + ClientID string `gorm:"size:50;comment:客户端ID" json:"client_id" ` // 客户端ID + ClientSecret string `gorm:"size:50;comment:客户端密钥" json:"client_secret" ` // 客户端密钥 + Scope string `gorm:"size:50;comment:作用域" json:"scope" ` // 作用域 + RedirectURI string `gorm:"size:50;comment:重定向URI" json:"redirect_uri" ` // 重定向URI + AuthURI string `gorm:"size:50;comment:认证URI" json:"auth_uri" ` // 认证URI + TokenURI string `gorm:"size:50;comment:令牌URI" json:"token_uri" ` // 令牌URI + UserInfoURI string `gorm:"size:50;comment:用户信息URI" json:"user_info_uri" ` // 用户信息URI +} + +func (Provider) TableName() string { + return "provider" +} diff --git a/model/request/application.go b/model/request/application.go new file mode 100755 index 0000000..2beae9c --- /dev/null +++ b/model/request/application.go @@ -0,0 +1,8 @@ +package request + +import "pure-admin/model" + +type ApplicationSearch struct{ + model.Application + PageInfo +} \ No newline at end of file diff --git a/model/request/banner.go b/model/request/banner.go new file mode 100644 index 0000000..031e2bc --- /dev/null +++ b/model/request/banner.go @@ -0,0 +1,34 @@ +package request + +import ( + "pure-admin/global" +) + +type CreateBanner struct { + RelationId string `gorm:"size:50" json:"relationId"` //关联项目id + RelationType string `gorm:"size:4" json:"relationType"` //关联类型 01-任务 + Title string `gorm:"size:80" json:"title"` //标题 + CoverUrl string `gorm:"size:500" json:"coverUrl"` //封面图 + LinkType string `gorm:"size:2" json:"linkType" form:"linkType"` //链接类型 0:内链 1:外链 + Link string `gorm:"size:500" json:"link"` //链接地址 + Type string `gorm:"size:4" json:"type"` //任务-0101 平台奖励页-0102 + Status string `gorm:"size:4" json:"status"` //状态 0=下架 1=上架 +} + +type UpdateBanner struct { + global.BASE_ID + RelationId string `gorm:"size:50" json:"relationId"` //关联项目id + RelationType string `gorm:"size:4" json:"relationType"` //关联类型 01-任务 + Title string `gorm:"size:80" json:"title"` //标题 + CoverUrl string `gorm:"size:500" json:"coverUrl"` //封面图 + LinkType string `gorm:"size:2" json:"linkType" form:"linkType"` //链接类型 0:内链 1:外链 + Link string `gorm:"size:500" json:"link"` //链接地址 + Type string `gorm:"size:4" json:"type"` //任务-0101 平台奖励页-0102 + Status string `gorm:"size:4" json:"status"` //状态 0=下架 1=上架 +} + +type SearchBanner struct { + Title string `json:"title" form:"title"` //名称 + Status string `json:"status" form:"status"` //状态 0=下架 1=上架 + PageInfo +} diff --git a/model/request/bill.go b/model/request/bill.go new file mode 100644 index 0000000..281c35b --- /dev/null +++ b/model/request/bill.go @@ -0,0 +1,52 @@ +package request + +type SearchTimeArea struct { + StartTime string `json:"start_time" form:"start_time"` // 开始时间 + EndTime string `json:"end_time" form:"end_time"` // 结束时间 +} + +type BillSearch struct { + SearchTimeArea + Status int `json:"status" form:"status"` // 类型 1-支出 2-收入 + Receipt int `json:"receipt" form:"receipt"` // 是否已到账 1-是 2-否 + PageInfo +} + +type WithdrawalSearch struct { + SearchTimeArea + CheckStatus string `json:"check_status" form:"check_status"` // 审核状态 0:待审核 1:审核通过 2:审核未通过 + DealStatus string `json:"deal_status" form:"deal_status"` // 处理状态 0:待处理 1:已处理 + PageInfo +} + +type ExamineWithdrawal struct { + FlowNo string `json:"flow_no"` // 流水号 + CheckStatus string `json:"check_status"` // 审核状态 1:审核通过 2:审核未通过 + Remark string `json:"remark"` // 备注 +} + +type RetryWithdrawal struct { + FlowNo string `json:"flow_no"` // 流水号 +} + +type TransferWithdrawal struct { + FlowNo string `json:"flow_no"` // 流水号 + AccountType string `json:"account_type"` // 账户类型 paypal + Account string `json:"account"` // 账户 + AccountName string `json:"account_name"` // 账户名 + Amount float64 `json:"amount"` // 金额 +} + +type TransferResult struct { + FlowNo string `json:"flow_no"` // 流水号 + Status string `json:"status"` // 状态 1:成功 2:失败 + Remark string `json:"remark"` // 备注 +} + +type BillFundSearch struct { + SearchTimeArea + PageInfo + UserID string `json:"user_id" form:"user_id"` // uuid + TransactionType int `json:"transaction_type" form:"transaction_type"` // 类型 1-支出 2-收入 + Status int `json:"status" form:"status"` // 状态 1:进行中 2:已完成 3:已失败 +} diff --git a/model/request/business.go b/model/request/business.go new file mode 100755 index 0000000..0f75540 --- /dev/null +++ b/model/request/business.go @@ -0,0 +1,17 @@ +package request + +type SearchStore struct { + StoreNo string `json:"store_no" form:"store_no"` + Email string `json:"email" form:"email"` + StartAt string `json:"start_at" form:"start_at"` + EndAt string `json:"end_at" form:"end_at"` + PageInfo +} + +type SearchGoods struct { + PageInfo + Id uint `json:"id" form:"id"` + Title string `json:"title" form:"title" ` + StoreNo string `json:"store_no" form:"store_no"` + Status int `json:"status" form:"status"` +} diff --git a/model/request/category.go b/model/request/category.go new file mode 100644 index 0000000..b2a4293 --- /dev/null +++ b/model/request/category.go @@ -0,0 +1,26 @@ +package request + +type ListCategoryChildren struct { + Pid int `json:"pid" form:"pid"` // 父id +} + +type ListCategoryPage struct { + PageInfo + + One string `json:"one" form:"one"` + Two string `json:"two" form:"two"` + Three string `json:"three" form:"three"` + Four string `json:"four" form:"four"` + Five string `json:"five" form:"five"` +} + +type CreateCategory struct { + Name string `json:"name" form:"name"` // 名称 + Pid int `json:"pid" form:"pid"` // 父id + Layer int `json:"layer"` // 层级 +} + +type UpdateCategory struct { + Id uint `json:"id" form:"id"` // 主键ID + Name string `json:"name" form:"name"` // 名称 +} diff --git a/model/request/chain.go b/model/request/chain.go new file mode 100644 index 0000000..f4d4718 --- /dev/null +++ b/model/request/chain.go @@ -0,0 +1,5 @@ +package request + +type ChainParams struct { + Hash string `json:"hash" form:"hash"` // 区块/合约hash +} diff --git a/model/request/common.go b/model/request/common.go new file mode 100644 index 0000000..764089b --- /dev/null +++ b/model/request/common.go @@ -0,0 +1,77 @@ +package request + +import "time" + +// Paging common input parameter structure +type PageInfo struct { + Page int `json:"page" form:"page"` // 页码 + PageSize int `json:"pageSize" form:"pageSize"` // 每页大小 +} + +// Find by id structure +type GetById struct { + ID float64 `json:"id" form:"id"` // 主键ID +} + +type IdsReq struct { + Ids []int `json:"ids" form:"ids"` +} + +type IdsStrReq struct { + Ids []string `json:"ids" form:"ids"` +} + +type IdStrReq struct { + ID string `json:"id" form:"id"` +} + +type StatusParam struct { + Status string `json:"status" form:"status"` + ID string `json:"id" form:"id"` +} + +type IdReq struct { + ID uint `json:"id" form:"id"` //id +} + +type IdsUReq struct { + Ids []int `json:"ids" form:"ids"` +} + +type StatusParams struct { + Status string `json:"status"` + IdsStrReq +} + +type StatusParamsInt struct { + Status int `json:"status"` + IdsStrReq +} + +type ChannelId struct { + ChannelId string `json:"channelId" form:"channelId"` +} + +type StructParams map[string]interface{} + +// Get role by id structure +type GetAuthorityId struct { + AuthorityId uint // 角色ID + Appid string +} + +type Empty struct{} + +type TimeZoneStruct struct { + TimeZone *time.Location `json:"-"` +} + +type StatusIntParam struct { + Status string `json:"status" form:"status"` + ID uint `json:"id" form:"id"` +} + +type InfluencerSummaryListParam struct { + Uuid string `json:"uuid" form:"uuid"` + PageInfo +} diff --git a/model/request/dict.go b/model/request/dict.go new file mode 100644 index 0000000..3950b1d --- /dev/null +++ b/model/request/dict.go @@ -0,0 +1,5 @@ +package request + +type SearchDictDataParams struct { + TypeCode string `json:"typeCode" form:"typeCode"` //取值 release_country=发布国家 release_channel=发布渠道 tag_type=标签类型 +} diff --git a/model/request/jwt.go b/model/request/jwt.go new file mode 100644 index 0000000..c714416 --- /dev/null +++ b/model/request/jwt.go @@ -0,0 +1,19 @@ +package request + +import ( + "github.com/dgrijalva/jwt-go" + uuid "github.com/satori/go.uuid" +) + +// Custom claims structure +type CustomClaims struct { + UUID uuid.UUID + ID uint + NickName string + AuthorityId uint + Organization string + Appid string + Type string + BufferTime int64 + jwt.StandardClaims +} diff --git a/model/request/mission.go b/model/request/mission.go new file mode 100644 index 0000000..425915f --- /dev/null +++ b/model/request/mission.go @@ -0,0 +1,109 @@ +package request + +import ( + "pure-admin/model" +) + +type AddMissionRecommend struct { + List []model.MissionRecommend `json:"list"` +} + +type SearchMission struct { + Title string `json:"title" form:"title"` //名称 + Status int `json:"status" form:"status"` //状态 1:未开始 2:进行中 3:已结束 + MissionTime string `json:"mission_time" form:"mission_time"` //筛选任务时间 + VideoChannelId string `json:"video_channel_id" form:"video_channel_id"` //视频发布渠道 + HireType int `json:"hire_type" form:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + SellerId string `json:"seller_id" form:"seller_id"` //商家ID + SellerEmail string `json:"seller_email" form:"seller_email"` //商家邮箱 + MissionId uint `json:"mission_id" form:"mission_id"` //任务ID + HasVideo int `json:"has_video" form:"has_video"` //是否有视频 1:是 2:否 + PageInfo +} + +type SearchMissionVideo struct { + Title string `json:"title" form:"title"` //名称 + Status int `json:"status" form:"status"` //状态 1:未开始 2:进行中 3:已结束 + MissionTime string `json:"mission_time" form:"mission_time"` //筛选任务时间 + VideoChannelId string `json:"video_channel_id" form:"video_channel_id"` //视频发布渠道 + HireType int `json:"hire_type" form:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + SellerId string `json:"seller_id" form:"seller_id"` //商家ID + MissionId uint `json:"mission_id" form:"mission_id"` //任务ID + VideoStatus int `json:"video_status" form:"video_status"` //视频状态 1:待审核 2:审核通过 3:审核不通过 + MissionClaimBy string `json:"mission_claim_by" form:"mission_claim_by"` //网红账号 + SourceType int `json:"source_type" form:"source_type"` //类型:1:固定费用上传 2:奖励任务上传 3:后台上传 + SellerEmail string `json:"seller_email" form:"seller_email"` //商家邮箱 + PageInfo +} + +type AddMissionVideo struct { + MissionId uint `json:"mission_id"` //领取任务id + TagId uint `json:"tag_id"` + VideoUrl string `json:"video_url"` //视频上传地址 + Cover string `json:"cover"` + SourceType int `json:"source_type"` //类型:1:固定费用上传 2:奖励任务上传 3:后台上传 +} + +type EditMissionVideo struct { + ID uint `json:"id"` //任务视频ID + TagId uint `json:"tag_id"` + VideoUrl string `json:"video_url"` //视频上传地址 + Cover string `json:"cover"` +} + +type SearchStopMission struct { + SearchMission + AuditStatus int `json:"audit_status" form:"audit_status"` //审核状态 1:待审核 2:审核通过 3:审核不通过 4:已审核=审核通过+审核不通过 +} + +type MissionTags struct { + MissionId uint `json:"mission_id"` //任务ID + Value string `json:"value"` //标签值 + Type string `json:"type"` //类型 + TagId uint `json:"tag_id"` //标签ID +} + +type SearchMissionClaim struct { + CreateBy string `json:"-"` //领取人 + MissionId uint `json:"mission_id" form:"mission_id"` //任务id + Status int `json:"status" form:"status"` //状态 1:已领取待发货 2:已发货 3:已收货推广中 + Uuid string `json:"uuid" form:"uuid"` //网红用户ID + Title string `json:"title" form:"title"` //任务标题 + PageInfo +} + +type SearchSysReward struct { + Title string `json:"title" form:"title"` //标题 + TimeStart string `json:"time_start" form:"time_start"` //时间起始 + TimeEnd string `json:"time_end" form:"time_end"` //时间结束 + PageInfo +} + +type CreateMissionTagRelation struct { + TagId []uint `json:"tagId"` //标签id + RelationId string `gorm:"size:50" json:"relationId"` //关联项目id + RelationType string `gorm:"size:4" json:"relationType"` //关联类型 01-任务 02-任务视频 03-网红 +} + +type OrderId struct { + OrderID string `json:"order_id" form:"order_id"` //订单编号 +} + +type SearchMissionClaimOrder struct { + OrderID string `json:"order_id" form:"order_id"` //订单id + Status int `json:"status" form:"status"` //状态 2:待发货 3:已发货 + SpuNo string `json:"spu_no" form:"spu_no"` //商品编号 + AddressName string `json:"address_name" form:"address_name"` //收件人姓名 + AddressPhone string `json:"address_phone" form:"address_phone"` //收件人手机号 + OrderTimeStart string `json:"order_time_start" form:"order_time_start"` //订单时间起始 + OrderTimeEnd string `json:"order_time_end" form:"order_time_end"` //订单时间结束 + SellerId string `json:"seller_id" form:"seller_id"` //商家ID + Uuid string `json:"uuid" form:"uuid"` //网红用户ID + MissionTitle string `json:"mission_title" form:"mission_title"` // 任务标题 + PageInfo +} + +type SearchMissionFund struct { + SearchTimeArea + CreateBy string `json:"create_by" form:"create_by"` +} diff --git a/model/request/notify.go b/model/request/notify.go new file mode 100644 index 0000000..e4db75a --- /dev/null +++ b/model/request/notify.go @@ -0,0 +1,8 @@ +package request + +type CreateNotify struct { + UserId string `json:"user_id"` + RelationType string `json:"relation_type"` + RelationId string `json:"relation_id"` + Title string `json:"title"` +} diff --git a/model/request/order.go b/model/request/order.go new file mode 100644 index 0000000..0a51fa4 --- /dev/null +++ b/model/request/order.go @@ -0,0 +1,31 @@ +package request + +type SearchOrderList struct { + OrderID string `json:"orderID" form:"orderID"` // 订单号 + Code string `json:"code" form:"code"` // 网红码? + Status int `json:"status" form:"status"` // 订单状态 1-待付款 2-待发货 3-已发货 4-已完成 5-已取消 + GoodsID int `json:"goodsID" form:"goodsID"` // 商品id + SpuNo string `json:"spu_no" form:"spu_no"` // spu_no + Name string `json:"name" form:"name"` // 收件人姓名 + Phone string `json:"phone" form:"phone"` // 收件人电话 + CreatedAt string `json:"createdAt" form:"createdAt"` // 订单下单时间 + CreatedAtStart string `json:"createdAtStart" form:"createdAtStart"` // 下单起始时间 + CreatedAtEnd string `json:"createdAtEnd" form:"createdAtEnd"` // 下单截至时间 + UserId string `json:"userId" form:"userId"` // 用户id + InfluenceId string `json:"influenceId" form:"influenceId"` // 网红id + StoreNo string `json:"storeNo" form:"storeNo"` // 商户编号 + MissionTitle string `json:"missionTitle" form:"missionTitle"` // 任务名称 + PageInfo +} +type SearchOrderDetail struct { + OrderID string `json:"orderID" form:"orderID"` //订单号 +} + +type SearchOrderPostSale struct { + OrderId string `json:"orderId" form:"orderId"` // 订单号 + Status int `json:"status" form:"status"` // 处理状态 1:待审核 2:退款中 3:退款成功 4:退款失败 + UserId string `json:"userId" form:"userId"` // 用户id + UserIds []string `json:"userIds" form:"userIds"` // 用户ids + CreatedAtStart string `json:"createdAtStart" form:"createdAtStart"` // 创建时间区间开始 + CreatedAtEnd string `json:"createdAtEnd" form:"createdAtEnd"` // 创建时间区间结束 +} diff --git a/model/request/organization.go b/model/request/organization.go new file mode 100755 index 0000000..8f6286e --- /dev/null +++ b/model/request/organization.go @@ -0,0 +1,8 @@ +package request + +import "pure-admin/model" + +type OrganizationSearch struct{ + model.Organization + PageInfo +} \ No newline at end of file diff --git a/model/request/provider.go b/model/request/provider.go new file mode 100755 index 0000000..2ef8c96 --- /dev/null +++ b/model/request/provider.go @@ -0,0 +1,8 @@ +package request + +import "pure-admin/model" + +type ProviderSearch struct{ + model.Provider + PageInfo +} \ No newline at end of file diff --git a/model/request/statistic.go b/model/request/statistic.go new file mode 100644 index 0000000..56164ef --- /dev/null +++ b/model/request/statistic.go @@ -0,0 +1,8 @@ +package request + +type Statistic struct { + Values []string + Unit string + T int + RelationId string +} diff --git a/model/request/sys_api.go b/model/request/sys_api.go new file mode 100644 index 0000000..42909af --- /dev/null +++ b/model/request/sys_api.go @@ -0,0 +1,11 @@ +package request + +import "pure-admin/model" + +// api分页条件查询及排序结构体 +type SearchApiParams struct { + model.SysApi + PageInfo + OrderKey string `json:"orderKey"` // 排序 + Desc bool `json:"desc"` // 排序方式:升序false(默认)|降序true +} diff --git a/model/request/sys_autocode.go b/model/request/sys_autocode.go new file mode 100644 index 0000000..d97be35 --- /dev/null +++ b/model/request/sys_autocode.go @@ -0,0 +1,16 @@ +package request + +type DBReq struct { + Database string `json:"database" gorm:"column:database"` +} + +type TableReq struct { + TableName string `json:"tableName"` +} + +type ColumnReq struct { + ColumnName string `json:"columnName" gorm:"column:column_name"` + DataType string `json:"dataType" gorm:"column:data_type"` + DataTypeLong string `json:"dataTypeLong" gorm:"column:data_type_long"` + ColumnComment string `json:"columnComment" gorm:"column:column_comment"` +} diff --git a/model/request/sys_casbin.go b/model/request/sys_casbin.go new file mode 100644 index 0000000..b3ffec4 --- /dev/null +++ b/model/request/sys_casbin.go @@ -0,0 +1,13 @@ +package request + +// Casbin info structure +type CasbinInfo struct { + Path string `json:"path"` // 路径 + Method string `json:"method"` // 方法 +} + +// Casbin structure for input parameters +type CasbinInReceive struct { + AuthorityId uint `json:"authorityId"` // 权限id + CasbinInfos []CasbinInfo `json:"casbinInfos"` +} diff --git a/model/request/sys_dictionary.go b/model/request/sys_dictionary.go new file mode 100644 index 0000000..a09c2bf --- /dev/null +++ b/model/request/sys_dictionary.go @@ -0,0 +1,8 @@ +package request + +import "pure-admin/model" + +type SysDictionarySearch struct { + model.SysDictionary + PageInfo +} diff --git a/model/request/sys_dictionary_detail.go b/model/request/sys_dictionary_detail.go new file mode 100644 index 0000000..6546447 --- /dev/null +++ b/model/request/sys_dictionary_detail.go @@ -0,0 +1,8 @@ +package request + +import "pure-admin/model" + +type SysDictionaryDetailSearch struct { + model.SysDictionaryDetail + PageInfo +} diff --git a/model/request/sys_init.go b/model/request/sys_init.go new file mode 100644 index 0000000..3f994cf --- /dev/null +++ b/model/request/sys_init.go @@ -0,0 +1,9 @@ +package request + +type InitDB struct { + Host string `json:"host"` // 服务器地址 + Port string `json:"port"` // 数据库连接端口 + UserName string `json:"userName" binding:"required"` // 数据库用户名 + Password string `json:"password"` // 数据库密码 + DBName string `json:"dbName" binding:"required"` // 数据库名 +} diff --git a/model/request/sys_menu.go b/model/request/sys_menu.go new file mode 100644 index 0000000..1e0878c --- /dev/null +++ b/model/request/sys_menu.go @@ -0,0 +1,9 @@ +package request + +import "pure-admin/model" + +// Add menu authority info structure +type AddMenuAuthorityInfo struct { + Menus []model.SysBaseMenu + AuthorityId uint // 角色ID +} diff --git a/model/request/sys_operation_record.go b/model/request/sys_operation_record.go new file mode 100644 index 0000000..00e9f14 --- /dev/null +++ b/model/request/sys_operation_record.go @@ -0,0 +1,11 @@ +package request + +import "pure-admin/model" + +type SysOperationRecordSearch struct { + model.SysOperationRecord + CreatedAtStart string `json:"createdAtStart" form:"createdAtStart"` + CreatedAtEnd string `json:"createdAtEnd" form:"createdAtEnd"` + NickName string `json:"nickName" form:"nickName"` + PageInfo +} diff --git a/model/request/sys_user.go b/model/request/sys_user.go new file mode 100644 index 0000000..df95e10 --- /dev/null +++ b/model/request/sys_user.go @@ -0,0 +1,47 @@ +package request + +import "pure-admin/model" + +// User register structure +type Register struct { + Username string `json:"userName"` + Phone string `json:"phone"` + Password string `json:"passWord"` + NickName string `json:"nickName" gorm:"default:'QMPlusUser'"` + HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"` + AuthorityId uint `json:"authorityId" gorm:"default:888"` + AuthorityIds []uint `json:"authorityIds"` +} + +// User login structure +type Login struct { + Username string `json:"username"` // 用户名 + Password string `json:"password"` // 密码 + Captcha string `json:"captcha"` // 验证码 + CaptchaId string `json:"captchaId"` // 验证码ID + Appid string `json:"appid"` // 应用ID +} + +// Modify user's auth structure +type SetUserAuthorities struct { + UUID string `json:"uuid"` + AuthorityIds []string `json:"authorityIds"` // 角色id +} + +// Modify password structure +type ChangePasswordStruct struct { + Username string `json:"username"` // 用户名 + Password string `json:"password"` // 密码 + NewPassword string `json:"newPassword"` // 新密码 +} + +// Modify user's auth structure +type SetUserAuth struct { + //UUID uuid.UUID `json:"uuid"` // 用户UUID + AuthorityId string `json:"authorityId"` // 角色ID +} + +type SearchSysUserParams struct { + model.SysUser + PageInfo +} diff --git a/model/request/tags.go b/model/request/tags.go new file mode 100644 index 0000000..2d0f40e --- /dev/null +++ b/model/request/tags.go @@ -0,0 +1,23 @@ +package request + +type SearchTags struct { + TagsCommon + PageInfo +} + +type TagsCommon struct { + ID uint `json:"id"` + Type string `json:"type" form:"type"` //标签类型 01-任务 02-任务视频 03-网红 + Value string `json:"value" form:"value"` //值 +} + +type RaletionTags struct { + RelationType string `json:"relation_type" form:"relation_type"` + RelationID string `json:"relation_id" from:"relation_id"` +} + +type CreateTagRelation struct { + TagId []uint `json:"tagId"` //标签id + RelationId string `gorm:"size:50" json:"relationId"` //关联项目id + RelationType string `gorm:"size:4" json:"relationType"` //关联类型 01-任务 02-任务视频 03-网红 +} diff --git a/model/request/user.go b/model/request/user.go new file mode 100755 index 0000000..4beba5e --- /dev/null +++ b/model/request/user.go @@ -0,0 +1,53 @@ +package request + +import ( + "pure-admin/model" + "time" +) + +type UserSearch struct { + model.User + PageInfo +} + +type UserSimpleSearch struct { + Username string `gorm:"size:128" json:"username"` + NickName string `gorm:"size:20" json:"nick_name" form:"nick_name"` //昵称 + Type string `json:"type" form:"type" gorm:"size:255"` //customer-普通用户 influencer-网红 + Phone string `gorm:"-" json:"phone" form:"phone"` //用户手机号 + Email string `gorm:"-" json:"email" form:"email"` //用户邮箱 + StartTime string `json:"start_time" form:"start_time"` + EndTime string `json:"end_time" form:"end_time"` + IDForbidden string `json:"id_forbidden" form:"id_forbidden"` + PageInfo +} + +type UserSearchByID struct { + UserID string `json:"user_id" form:"user_id"` //用户id +} + +type Platform struct { + Platform string `json:"platform"` //平台 + Url string `json:"url"` //主页地址 + Image string `json:"image"` //图片 + IsAuth bool `json:"is_auth"` //是否认证 + CreatedAt *time.Time `json:"created_at" gorm:"-"` //创建时间 +} + +type PlatformAuthSearch struct { + Platform string `json:"platform" form:"platform"` //平台 + Status string `json:"status" form:"status"` //认证状态 0:未认证 1:已认证 2:认证失败 + UserSimpleSearch +} + +type PlatformAuthCheck struct { + ID uint `json:"id"` //认证id + Status string `json:"check_result"` //认证结果 1:认证通过 2:认证失败 + AuthMsg string `json:"auth_msg"` //认证信息 +} + +type UserStatus struct { + UserID string `json:"user_id"` //用户id + IDForbidden bool `json:"id_forbidden"` //是否禁用 0:未禁用 1:已禁用 + ForbiddenReason string `json:"forbidden_reason"` //禁用原因 +} diff --git a/model/request/wallet.go b/model/request/wallet.go new file mode 100644 index 0000000..e97c6a7 --- /dev/null +++ b/model/request/wallet.go @@ -0,0 +1,6 @@ +package request + +type FundRecharge struct { + PayMode int `json:"payMode"` //支付方式 1-paypal + Amount float64 `json:"amount"` // 充值金额 +} diff --git a/model/response/banner.go b/model/response/banner.go new file mode 100644 index 0000000..7a5b888 --- /dev/null +++ b/model/response/banner.go @@ -0,0 +1,18 @@ +package response + +import "pure-admin/global" + +type BannerListResponse struct { + global.BASE_ID + RelationId string `json:"relationId"` //关联项目id + RelationType string `json:"relationType"` //关联类型 01-任务 + Title string `json:"title"` //标题 + CoverUrl string `json:"coverUrl"` //封面图 + LinkType string `json:"linkType"` //链接类型 0:内链 1:外链 + Link string `json:"link"` //链接地址 + Type string `json:"type"` //任务-0101 平台奖励页-0102 + Status string ` json:"status"` //状态 0=下架 1=上架 + SortIndex int `json:"sortIndex"` //序号索引 + RelationTitle string `json:"relationTitle"` //关联标题 + +} diff --git a/model/response/bill.go b/model/response/bill.go new file mode 100644 index 0000000..dd53adc --- /dev/null +++ b/model/response/bill.go @@ -0,0 +1,44 @@ +package response + +type BillData struct { + Income float64 `json:"income"` // 收入金额 + IncomeCount int64 `json:"income_count"` // 收入笔数 + Expend float64 `json:"expend"` // 支出金额 + ExpendCount int64 `json:"expend_count"` // 支出笔数 +} + +type InfluenceWithdrawalData struct { + Balance float64 `json:"balance"` // 账户余额 + Unexamined float64 `json:"unexamined"` // 待处理金额 + UnexaminedCount int64 `json:"unexamined_count"` // 待处理笔数 +} + +type SellerWithdrawalData struct { + Balance float64 `json:"balance"` // 余额账户 + Fund float64 `json:"fund"` // 营销账户 + Unexamined float64 `json:"unexamined"` // 待处理金额 + UnexaminedCount int64 `json:"unexamined_count"` // 待处理笔数 +} + +type SellerFundData struct { + Expend float64 `json:"expend"` // 支出金额 + ExpendCount int64 `json:"expend_count"` // 支出笔数 + Lock float64 `json:"lock"` // 锁定金额 + LockCount int64 `json:"lock_count"` // 锁定笔数 +} + +type BkbData struct { + Turnover float64 `json:"turnover"` // 交易额 + Earn float64 `json:"earn"` // 抽成总额 + Reward float64 `json:"reward"` // + Balance float64 `json:"balance"` // 余额账户 + Unexamined float64 `json:"unexamined"` // 待处理金额 + UnexaminedCount int64 `json:"unexamined_count"` // 待处理笔数 +} + +type AdminFundData struct { + Expend float64 `json:"expend"` // 支出金额 + ExpendCount int64 `json:"expend_count"` // 支出笔数 + Recharge float64 `json:"recharge"` // 充值金额 + RechargeCount int64 `json:"recharge_count"` // 充值笔数 +} diff --git a/model/response/chain.go b/model/response/chain.go new file mode 100644 index 0000000..488a138 --- /dev/null +++ b/model/response/chain.go @@ -0,0 +1,10 @@ +package response + +import "time" + +type ChainResp struct { + Time *time.Time `json:"time"` // 上链时间 + BlockHeight int64 `json:"block_height"` // 块高度 + BlockAddress string `json:"block_adress"` // 所在区块 + Hash string `json:"hash"` // 交易哈希 +} diff --git a/model/response/common.go b/model/response/common.go new file mode 100644 index 0000000..361869f --- /dev/null +++ b/model/response/common.go @@ -0,0 +1,31 @@ +package response + +import "time" + +type PageResult struct { + List any `json:"list"` + Total int64 `json:"total"` + Page int `json:"page"` + PageSize int `json:"pageSize"` +} + +type SelectListResult struct { + List any `json:"list"` +} + +type Goods struct { + Id uint `json:"id"` + CreatedAt time.Time `gorm:"index" json:"createdAt"` + Title string `json:"title"` // 标题 + Cover string `json:"cover"` // 封面图(未使用) + Images string `json:"images"` // 图片列表 + RetailPrice float64 `json:"retail_price"` // 吊牌价(零售指导价) + PriceMin float64 `json:"price_min"` // 最低规格价格 + PriceMax float64 `json:"price_max"` // 最高规格价格 + Stock int64 `json:"stock"` // 总库存 + Sales int64 `json:"sales"` // 总销售量 + Sales30 int64 `json:"sales_30"` // 30天销售量 + + Tags string `json:"tags"` // 标签 + StoreNo string `json:"store_no"` +} diff --git a/model/response/exa_breakpoint_continue.go b/model/response/exa_breakpoint_continue.go new file mode 100644 index 0000000..f21443a --- /dev/null +++ b/model/response/exa_breakpoint_continue.go @@ -0,0 +1,11 @@ +package response + +import "pure-admin/model" + +type FilePathResponse struct { + FilePath string `json:"filePath"` +} + +type FileResponse struct { + File model.ExaFile `json:"file"` +} diff --git a/model/response/mission.go b/model/response/mission.go new file mode 100644 index 0000000..fd2c0fd --- /dev/null +++ b/model/response/mission.go @@ -0,0 +1,140 @@ +package response + +import ( + "pure-admin/model" + "time" +) + +type MissionRecommendResponse struct { + SortIndex int `json:"sort_index"` + model.MissionRecommend + MissionVideoCommonData +} + +type MissionVideoResponse struct { + ID uint `json:"id"` + SourceType int `json:"source_type" gorm:"type:tinyint(1);default:1"` //类型:1:固定费用上传 2:奖励任务上传 3:后台上传 + MissionVideoCommonData +} + +type MissionVideoCommonData struct { + MissionId uint `json:"mission_id"` + VideoUrl string `json:"video_url"` + Cover string `json:"cover"` + Title string `json:"title"` + GoodsTitle string `json:"goods_title"` + Influencer model.InfluencerUserView `json:"influencer"` + //todo 标签系统 + Tag string `json:"tag"` + MissionStatus int `json:"mission_status"` //任务状态 + StartTime *time.Time `json:"start_time"` //任务起始时间 + EndTime *time.Time `json:"end_time"` //任务结束时间 + HireType int `json:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + HireMoney float64 `json:"hire_money"` //hire_type==1 佣金金额 + HireRatio float64 `json:"hire_ratio"` //hire_type==2 抽成比例 + HireMoneyExpect string `gorm:"-" json:"hire_money_expect"` //预计佣金描述 + ReleaseCountry string `gorm:"-" json:"release_country"` //发布国家 + ReleaseChannels string `gorm:"-" json:"release_channels"` //发布渠道 + Seller model.SellerStoreInfo `json:"seller"` +} + +type MissionClaimVideo struct { + model.MissionClaimVideo + MissionId uint `json:"mission_id"` //任务id + MissionTitle string `json:"mission_title"` //任务名称 + GoodsTitle string `json:"goods_title"` //商品名称 + InfluencerUser model.InfluencerUserView `json:"influencer_user"` //网红信息 + ClaimAt time.Time `json:"claim_at"` //接任务时间 + ClaimDays int `json:"claim_days"` //完成任务时间 + HireMoneyExpect string `gorm:"-" json:"hire_money_expect"` //预计佣金描述 +} + +type MissionClaimVideoDetail struct { + ClaimVideo model.MissionClaimVideo `json:"claim_video"` + InfluencerUser model.InfluencerUserDesc `json:"influencer_user"` //网红信息 + ClaimGoods MissionClaimGoods `json:"claim_goods"` //商品信息 + MissionClaim MissionClaimInfo `json:"mission_claim"` //任务领取信息 +} + +type MissionClaimGoods struct { + GoodsId uint `json:"goods_id"` //商品ID + OrderId string `json:"order_id"` //订单ID + SpuNo string `json:"spu_no"` //编号 + Title string `json:"title"` //标题 + TitleEng string `json:"title_eng"` //英文标题 + Sales float64 `json:"sales"` //总销售量 + Sales30 float64 `json:"sales_30"` //30天销售量 + Status int `json:"status"` //1:上架 2:下架 3:售罄 + Specs string `json:"specs"` //规格 + SkuNo string `json:"sku_no"` //商品编码 + Stock int64 `json:"stock"` //库存 + Price float64 `json:"price"` //价格 + Image string `json:"image"` //规格图片url + Tags string `json:"tags"` //标签 +} + +type MissionClaimInfo struct { + MissionId uint `json:"mission_id"` //任务id + Title string `json:"title"` //任务名称 + ClaimAt time.Time `json:"claim_at"` //接任务时间 + HireType int `json:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + HireMoney float64 `json:"hire_money"` //hire_type==1 佣金金额 + HireRatio float64 `json:"hire_ratio"` //hire_type==2 抽成比例 + HireMoneyExpect string `gorm:"-" json:"hire_money_expect"` //预计佣金描述 + StartTime *time.Time `json:"start_time"` //任务起始时间 + EndTime *time.Time `json:"end_time"` //任务结束时间 + Status int `json:"status"` //状态 1:未开始 2:进行中 3:已结束 + ClaimNum int64 `json:"claim_num"` //接任务人数 + ClaimStock int64 `json:"claim_stock"` //可接任务库存 + OrderNum int64 `gorm:"-" json:"order_num"` //订单数 + ClaimDays int `gorm:"type:tinyint(11)" json:"claim_days"` //任务完成天数 + ClaimDemands string `gorm:"type:varchar(500);" json:"claim_demands"` //任务拍摄要求 + Description string `gorm:"type:varchar(2000);" json:"description"` //描述/卖点 + model.Sample + model.VideoMaterial + ReleaseCountry string `gorm:"-" json:"release_country"` //发布国家 + ReleaseChannels string `gorm:"-" json:"release_channels"` //发布渠道 +} + +type MissionCommonData struct { + MissionId uint `json:"mission_id"` + Title string `json:"title"` + GoodsTitle string `json:"goods_title"` + Tag string `json:"tag"` + MissionStatus int `json:"mission_status"` //任务状态 + StartTime *time.Time `json:"start_time"` //任务起始时间 + EndTime *time.Time `json:"end_time"` //任务结束时间 + HireType int `json:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + HireMoney float64 `json:"hire_money"` //hire_type==1 佣金金额 + HireRatio float64 `json:"hire_ratio"` //hire_type==2 抽成比例 + HireMoneyExpect string `json:"hire_money_expect"` //预计佣金描述 + ReleaseCountry string `json:"release_country"` //发布国家 + ReleaseChannels string `json:"release_channels"` //发布渠道 + ClaimNum int64 `json:"claim_num"` //接任务人数 + Seller model.SellerStoreInfo `json:"seller"` + Description string `json:"description"` //描述/卖点 + HasSample int `json:"has_sample"` //是否有样品 0:没有 1:有 + HasVideo int `json:"has_video"` //是否有视频素材 0:没有 1:有 + SampleNum int `json:"sample_num"` //样品数量 +} + +type MissionStopData struct { + Remark string `json:"remark"` + ID uint `json:"id"` + MissionCommonData + Goods model.TbGoods4List `json:"goods"` //商品信息 +} + +type MissionClaimSimpleData struct { + model.MissionClaim + Video model.MissionClaimVideo `json:"video"` + MissionId uint `json:"mission_id"` //任务id + MissionTitle string `json:"mission_title"` //任务名称 + ClaimAt time.Time `json:"claim_at"` //接任务时间 + ClaimDays int `json:"claim_days"` //完成任务时间 + HireMoneyExpect string `json:"hire_money_expect"` //预计佣金描述 + HireType int `json:"hire_type"` //佣金类型 1:固定佣金 2:比例抽成 + VideoUrl string `json:"video_url"` + HasVideo int `json:"has_video"` //是否有视频素材 0:没有 1:有 + SignUrl string `json:"sign_url"` //签约地址 +} diff --git a/model/response/order.go b/model/response/order.go new file mode 100644 index 0000000..86ef117 --- /dev/null +++ b/model/response/order.go @@ -0,0 +1,33 @@ +package response + +type DataPiece struct { + Value1 string `json:"value1"` + Value2 string `json:"value2"` +} + +type DataStatisticsUser struct { + Money DataPiece `json:"money"` // 总销售额 + Visit DataPiece `json:"visit"` // 访问量 + PayNum DataPiece `json:"pay_num"` // 支付笔数 + OrderNum DataPiece `json:"order_num"` // 订单数 +} + +type DataStatisticsInfluence struct { + MissionNum DataPiece `json:"mission_num"` // 任务数 + PlatformNum DataPiece `json:"platform_num"` // 发布平台数 + TransitReward DataPiece `json:"transit_reward"` // 在途佣金 + UsedReward DataPiece `json:"used_reward"` // 可用佣金 +} + +type DataStatisticsStore struct { + MissionNum DataPiece `json:"mission_num"` // 任务数 + GoodsNum DataPiece `json:"goods_num"` // 商品数 + TransitReward DataPiece `json:"transit_reward"` // 在途佣金 + UsedCash DataPiece `json:"used_cash"` // 可提金额 +} + +type DataStatistics struct { + User DataStatisticsUser `json:"user"` // 用户数据 + Influence DataStatisticsInfluence `json:"influence"` // 网红数据 + Store DataStatisticsStore `json:"store"` // 商家数据 +} diff --git a/model/response/response.go b/model/response/response.go new file mode 100644 index 0000000..48d321a --- /dev/null +++ b/model/response/response.go @@ -0,0 +1,64 @@ +package response + +import ( + "github.com/gin-gonic/gin" + "net/http" + "pure-admin/model" +) + +type Response struct { + Code int `json:"code"` + Data interface{} `json:"data"` + Msg string `json:"msg"` +} + +const ( + ERROR = 7 + API_ERROR = 1 //接口返回错误 + SUCCESS = 0 +) + +func Result(code int, data interface{}, msg string, c *gin.Context) { + // 开始时间 + c.JSON(http.StatusOK, Response{ + code, + data, + msg, + }) +} + +func Ok(c *gin.Context) { + Result(SUCCESS, map[string]interface{}{}, "操作成功", c) +} + +func OkWithMessage(message string, c *gin.Context) { + Result(SUCCESS, map[string]interface{}{}, message, c) +} + +func OkWithDataMessage(data interface{}, message string, c *gin.Context) { + Result(SUCCESS, data, message, c) +} + +func OkWithData(data interface{}, c *gin.Context) { + Result(SUCCESS, data, "操作成功", c) +} + +func OkWithDetailed(data interface{}, message string, c *gin.Context) { + Result(SUCCESS, data, message, c) +} + +func Fail(c *gin.Context) { + Result(ERROR, map[string]interface{}{}, "操作失败", c) +} + +func FailWithMessage(message string, c *gin.Context) { + Result(API_ERROR, map[string]interface{}{}, message, c) +} + +func FailWithDetailed(data interface{}, message string, c *gin.Context) { + Result(ERROR, data, message, c) +} + +type MissionClaimOrderResponse struct { + Order model.MissionClaimOrderDetail `json:"order"` +} diff --git a/model/response/setting.go b/model/response/setting.go new file mode 100644 index 0000000..fd62000 --- /dev/null +++ b/model/response/setting.go @@ -0,0 +1,7 @@ +package response + +import "pure-admin/model" + +type SysBrochureResponse struct { + SysBrochure model.SysBrochure `json:"sysBrochure"` +} diff --git a/model/response/store.go b/model/response/store.go new file mode 100644 index 0000000..570d866 --- /dev/null +++ b/model/response/store.go @@ -0,0 +1,15 @@ +package response + +type StoreInfoItem struct { + ID uint `gorm:"AUTO_INCREMENT;PRIMARY_KEY;" json:"id"` // 主键ID + StoreNo string `json:"store_no"` // 店铺编号 + Type int `json:"type"` // 1:个人店铺 + Email string `json:"email"` // 店铺联系email(注册账号email) + + ValidMissionNum int64 `gorm:"-" json:"valid_mission_num"` // 有效任务数 + GoodsNum int64 `gorm:"-" json:"goods_num"` + Phone string `json:"phone"` + Balance float64 `json:"balance"` // 佣金 + TransitBalance float64 `json:"transit_balance"` // 在途佣金 + PapaylName string `json:"papayl_name"` // paypal账号 +} diff --git a/model/response/sys_api.go b/model/response/sys_api.go new file mode 100644 index 0000000..18946a0 --- /dev/null +++ b/model/response/sys_api.go @@ -0,0 +1,11 @@ +package response + +import "pure-admin/model" + +type SysAPIResponse struct { + Api model.SysApi `json:"api"` +} + +type SysAPIListResponse struct { + Apis []model.SysApi `json:"apis"` +} diff --git a/model/response/sys_authority.go b/model/response/sys_authority.go new file mode 100644 index 0000000..061d2e3 --- /dev/null +++ b/model/response/sys_authority.go @@ -0,0 +1,13 @@ +package response + +import "pure-admin/model" + +type SysAuthorityResponse struct { + Authority model.SysAuthority `json:"authority"` +} + +type SysAuthorityCopyResponse struct { + Authority model.SysAuthority `json:"authority"` + Appid string `json:"-"` + OldAuthorityId uint `json:"oldAuthorityId"` // 旧角色ID +} diff --git a/model/response/sys_captcha.go b/model/response/sys_captcha.go new file mode 100644 index 0000000..9e78035 --- /dev/null +++ b/model/response/sys_captcha.go @@ -0,0 +1,6 @@ +package response + +type SysCaptchaResponse struct { + CaptchaId string `json:"captchaId"` + PicPath string `json:"picPath"` +} diff --git a/model/response/sys_casbin.go b/model/response/sys_casbin.go new file mode 100644 index 0000000..2dc5275 --- /dev/null +++ b/model/response/sys_casbin.go @@ -0,0 +1,7 @@ +package response + +import "pure-admin/model/request" + +type PolicyPathResponse struct { + Paths []request.CasbinInfo `json:"paths"` +} diff --git a/model/response/sys_menu.go b/model/response/sys_menu.go new file mode 100644 index 0000000..28497aa --- /dev/null +++ b/model/response/sys_menu.go @@ -0,0 +1,15 @@ +package response + +import "pure-admin/model" + +type SysMenusResponse struct { + Menus []model.SysMenu `json:"menus"` +} + +type SysBaseMenusResponse struct { + Menus []model.SysBaseMenu `json:"menus"` +} + +type SysBaseMenuResponse struct { + Menu model.SysBaseMenu `json:"menu"` +} diff --git a/model/response/sys_system.go b/model/response/sys_system.go new file mode 100644 index 0000000..a3c3018 --- /dev/null +++ b/model/response/sys_system.go @@ -0,0 +1,7 @@ +package response + +import "pure-admin/config" + +type SysConfigResponse struct { + Config config.Server `json:"config"` +} diff --git a/model/response/sys_user.go b/model/response/sys_user.go new file mode 100644 index 0000000..a6df3d0 --- /dev/null +++ b/model/response/sys_user.go @@ -0,0 +1,15 @@ +package response + +import ( + "pure-admin/model" +) + +type SysUserResponse struct { + User model.User `json:"user"` +} + +type LoginResponse struct { + User model.User `json:"user"` + Token string `json:"token"` + ExpiresAt int64 `json:"expiresAt"` +} diff --git a/model/response/wallet.go b/model/response/wallet.go new file mode 100644 index 0000000..5f4d84a --- /dev/null +++ b/model/response/wallet.go @@ -0,0 +1,8 @@ +package response + +type PayResult struct { + PayChannel string `json:"pay_channel"` + PayId string `json:"pay_id"` + PayReturn string `json:"pay_return"` + PayStatus string `json:"pay_status"` +} diff --git a/model/seller_store.go b/model/seller_store.go new file mode 100644 index 0000000..0845f99 --- /dev/null +++ b/model/seller_store.go @@ -0,0 +1,82 @@ +package model + +import ( + "pure-admin/global" +) + +type SellerStore struct { // 店铺 + StoreNo string `gorm:"unique;type:varchar(60);" json:"store_no"` // 店铺编号 + Type int `gorm:"type:tinyint(1)" json:"type"` // 1:个人店铺 + CreateBy string `gorm:"type:varchar(60);" json:"create_by"` // 创建人 + Email string `gorm:"type:varchar(100);" json:"email"` // 店铺联系email(注册账号email) + global.MG_MODEL + Phone string `gorm:"type:varchar(60);" json:"phone"` +} + +type SellerStoreInfo struct { + ID uint `gorm:"AUTO_INCREMENT;PRIMARY_KEY;" json:"id"` // 主键ID + StoreNo string `json:"store_no"` // 店铺编号 + Type int `json:"type"` // 1:个人店铺 + Email string `json:"email"` // 店铺联系email(注册账号email) + Phone string `json:"phone"` + ReleaseMissionNum int64 `gorm:"-" json:"release_mission_nums"` // 发布任务数 + ValidMissionNum int64 `gorm:"-" json:"valid_mission_num"` // 有效任务数 + GoodsNum int64 `gorm:"-" json:"goods_num"` + CreatedAt string `gorm:"created_at" json:"created_at"` + CreateBy string `gorm:"type:varchar(60);" json:"create_by"` // 创建人 +} + +type StoreInfo struct { + StoreNo string `json:"store_no"` // 店铺编号 + Email string `json:"email"` // 联系方式 +} + +func (SellerStore) TableName() string { + return "seller_store" +} + +func (SellerStoreInfo) TableName() string { + return "seller_store" +} + +type Sum struct { + TotalCount int64 `gorm:"column:total_count" json:"total_count"` + CreateBy string `gorm:"column:create_by" json:"create_by"` + StoreNo string `gorm:"column:store_no" json:"store_no"` +} + +func GetMissionCount(ids []string) (m map[string]int64, err error) { + result := make([]*Sum, 0) + m = make(map[string]int64) + err = global.MG_DB.Model(&Mission{}).Select("store_no,count(1) as total_count").Where("store_no in (?)", ids). + Group("store_no").Scan(&result).Error + for _, v := range result { + m[v.StoreNo] = v.TotalCount + } + + return +} + +func GetGoodsCount(ids []string) (m map[string]int64, err error) { + result := make([]*Sum, 0) + m = make(map[string]int64) + err = global.MG_DB.Model(&TbGoods{}).Select("store_no,count(1) as total_count").Where("store_no in (?)", ids). + Group("store_no").Scan(&result).Error + for _, v := range result { + m[v.StoreNo] = v.TotalCount + } + + return +} + +func GetBusinessEmail(ids []string) (m map[string]string, err error) { + result := make([]*StoreInfo, 0) + m = make(map[string]string) + err = global.MG_DB.Model(&SellerStore{}).Select("store_no,email").Where("store_no in (?)", ids). + Scan(&result).Error + for _, v := range result { + m[v.StoreNo] = v.Email + } + + return +} diff --git a/model/seller_user.go b/model/seller_user.go new file mode 100644 index 0000000..9aedb7e --- /dev/null +++ b/model/seller_user.go @@ -0,0 +1,18 @@ +package model + +import "pure-admin/global" + +type SellerUser struct { //商家端用户 + UUID string `json:"uuid" gorm:"unique;type:varchar(60);comment:用户UUID"` // 用户UUID + HeaderImg string `json:"header_img" gorm:"type:varchar(200);comment:用户头像"` // 用户头像 + PhoneCode string `json:"phone_code" gorm:"type:varchar(10);comment:手机国际区号"` // + Phone string `json:"phone" gorm:"unique;type:varchar(20);comment:手机号"` // + Password string `json:"-" gorm:"type:varchar(60);comment:用户登录密码"` // 用户登录密码 + Email string `json:"email" gorm:"unique;type:varchar(100);comment:邮箱"` // + Status string `json:"status" gorm:"type:ENUM('1','0');default:'1';comment:用户状态 1.启用 0.禁用"` // 用户状态 + global.MG_MODEL +} + +func (SellerUser) TableName() string { + return "seller_user" +} diff --git a/model/statistic_mission_daily.go b/model/statistic_mission_daily.go new file mode 100644 index 0000000..c88b349 --- /dev/null +++ b/model/statistic_mission_daily.go @@ -0,0 +1,16 @@ +package model + +import "pure-admin/global" + +type StatisticMissionDaily struct { // 数据统计-任务 + global.MG_MODEL + Type string `gorm:"size:20" json:"type"` //类型 total:累计数据 daily:单日数据 + Date string `gorm:"size:20" json:"date"` // 日期 eg:2023-10-20(按天统计) + ReleaseNum int64 `gorm:"type:bigint" json:"release_num"` // 任务发布数 + ClaimNum int64 `gorm:"type:bigint" json:"claim_num"` // 领取任务数 + WorksNum int64 `gorm:"type:bigint" json:"works_num"` // 发布作品数 +} + +func (StatisticMissionDaily) TableName() string { + return "statistic_mission_daily" +} diff --git a/model/sys_api.go b/model/sys_api.go new file mode 100644 index 0000000..fe70274 --- /dev/null +++ b/model/sys_api.go @@ -0,0 +1,14 @@ +package model + +import "pure-admin/global" + +type SysApi struct { + Organization string `gorm:"size:50;comment:组织" json:"organization" ` // 组织 + Appid string `gorm:"size:50;comment:应用ID" json:"appid" ` // 应用ID + Type string `json:"type" gorm:"comment:类型"` // 类型 admin-运营端 seller-商家端 + Path string `json:"path" gorm:"type:varchar(100);comment:api路径"` // api路径 + Description string `json:"description" gorm:"type:varchar(100);comment:api中文描述"` // api中文描述 + ApiGroup string `json:"apiGroup" gorm:"type:varchar(100);comment:api组"` // api组 + Method string `json:"method" gorm:"default:POST;type:varchar(100);comment:方法"` // 方法:创建POST(默认)|查看GET|更新PUT|删除DELETE + global.MG_MODEL +} diff --git a/model/sys_authority.go b/model/sys_authority.go new file mode 100644 index 0000000..85a3c70 --- /dev/null +++ b/model/sys_authority.go @@ -0,0 +1,28 @@ +package model + +import ( + "pure-admin/global" +) + +type SysAuthority struct { + global.TIME_MODEL + Organization string `gorm:"size:50;comment:组织" json:"organization" ` // 组织 + Appid string `gorm:"size:50;comment:应用ID" json:"appid" ` // 应用ID + Type string `gorm:"size:50;comment:类型" json:"type" ` // 类型 admin-运营端 seller-商家端 + AuthorityId uint `json:"authorityId" gorm:"primary_key;AUTO_INCREMENT;comment:角色ID;size:10"` // 角色ID + AuthorityName string `json:"authorityName" gorm:"type:varchar(100);comment:角色名"` // 角色名 + AuthorityDesc string `json:"authorityDesc" gorm:"type:varchar(255);comment:角色描述"` // 角色描述 + ParentId uint `json:"parentId" gorm:"size:90;comment:父角色ID"` // 父角色ID + Children []SysAuthority `json:"children" gorm:"-"` + SysBaseMenus []SysBaseMenu `json:"menus" gorm:"many2many:sys_authority_menus;"` + DefaultRouter string `json:"defaultRouter" gorm:"comment:默认菜单;default:dashboard"` // 默认菜单(默认dashboard) +} + +type SysAuthoritySimple struct { + AuthorityId string `json:"authorityId" gorm:"not null;unique;primary_key;comment:角色ID;size:90"` // 角色ID + AuthorityName string `json:"authorityName" gorm:"type:varchar(100);comment:角色名"` // 角色名 +} + +func (SysAuthoritySimple) TableName() string { + return "sys_authorities" +} diff --git a/model/sys_authority_menu.go b/model/sys_authority_menu.go new file mode 100644 index 0000000..af7085c --- /dev/null +++ b/model/sys_authority_menu.go @@ -0,0 +1,18 @@ +package model + +//type SysMenu struct { +// SysBaseMenu +// MenuId string `json:"menuId" gorm:"comment:菜单ID"` +// AuthorityId string `json:"-" gorm:"comment:角色ID"` +// Children []SysMenu `json:"children" gorm:"-"` +// Parameters []SysBaseMenuParameter `json:"parameters" gorm:"foreignKey:SysBaseMenuID;references:MenuId"` +//} + +//func (s SysMenu) TableName() string { +// return "authority_menu" +//} + +type SysAuthorityMenu struct { + SysBaseMenuId uint `json:"sys_base_menu_id"` + SysAuthorityAuthorityId uint `json:"sys_authority_authority_id"` +} diff --git a/model/sys_auto_code.go b/model/sys_auto_code.go new file mode 100644 index 0000000..73b68f4 --- /dev/null +++ b/model/sys_auto_code.go @@ -0,0 +1,31 @@ +package model + +import "errors" + +// 初始版本自动化代码工具 +type AutoCodeStruct struct { + StructName string `json:"structName"` // Struct名称 + TableName string `json:"tableName"` // 表名 + PackageName string `json:"packageName"` // 文件名称 + HumpPackageName string `json:"humpPackageName"` // go文件名称 + Abbreviation string `json:"abbreviation"` // Struct简称 + Description string `json:"description"` // Struct中文名称 + AutoCreateApiToSql bool `json:"autoCreateApiToSql"` // 是否自动创建api + AutoMoveFile bool `json:"autoMoveFile"` // 是否自动移动文件 + Fields []*Field `json:"fields"` +} + +type Field struct { + FieldName string `json:"fieldName"` // Field名 + FieldDesc string `json:"fieldDesc"` // 中文名 + FieldType string `json:"fieldType"` // Field数据类型 + FieldJson string `json:"fieldJson"` // FieldJson + DataType string `json:"dataType"` // 数据库字段类型 + DataTypeLong string `json:"dataTypeLong"` // 数据库字段长度 + Comment string `json:"comment"` // 数据库字段描述 + ColumnName string `json:"columnName"` // 数据库字段 + FieldSearchType string `json:"fieldSearchType"` // 搜索条件 + DictType string `json:"dictType"` // 字典 +} + +var AutoMoveErr error = errors.New("创建代码成功并移动文件成功") diff --git a/model/sys_base_menu.go b/model/sys_base_menu.go new file mode 100644 index 0000000..9c10c32 --- /dev/null +++ b/model/sys_base_menu.go @@ -0,0 +1,52 @@ +package model + +import ( + "pure-admin/global" +) + +type SysBaseMenu struct { + global.MG_MODEL + MenuLevel uint `json:"-"` + Owner string `json:"owner" gorm:"comment:组织所属"` // 组织所属 + Appid string `gorm:"size:50;comment:应用ID" json:"appid" ` // 应用ID + Type string `json:"type" gorm:"comment:类型"` // 类型 admin-运营端 seller-商家端 + ParentId string `json:"parentId" gorm:"comment:父菜单ID"` // 父菜单ID + Path string `json:"path" gorm:"comment:路由path"` // 路由path + Name string `json:"name" gorm:"comment:路由name"` // 路由name + Group string `json:"group" gorm:"comment:路由组"` // 路由组 + Hidden bool `json:"hidden" gorm:"comment:是否在列表隐藏"` // 是否在列表隐藏 + Component string `json:"component" gorm:"comment:对应前端文件路径"` // 对应前端文件路径 + Sort int `json:"sort" gorm:"comment:排序标记"` // 排序标记 + Meta `json:"meta" gorm:"comment:附加属性"` // 附加属性 + SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"` + Children []SysBaseMenu `json:"children" gorm:"-"` + Parameters []SysBaseMenuParameter `json:"parameters"` +} + +type Meta struct { + KeepAlive bool `json:"keepAlive" gorm:"comment:是否缓存"` // 是否缓存 + DefaultMenu bool `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"` // 是否是基础路由(开发中) + Title string `json:"title" gorm:"comment:菜单名"` // 菜单名 + Icon string `json:"icon" gorm:"comment:菜单图标"` // 菜单图标 + CloseTab bool `json:"closeTab" gorm:"comment:自动关闭tab"` // 自动关闭tab +} + +type SysBaseMenuParameter struct { + SysBaseMenuID uint + Type string `json:"type" gorm:"comment:地址栏携带参数为params还是query"` // 地址栏携带参数为params还是query + Key string `json:"key" gorm:"comment:地址栏携带参数的key"` // 地址栏携带参数的key + Value string `json:"value" gorm:"comment:地址栏携带参数的值"` // 地址栏携带参数的值 + global.MG_MODEL +} + +type SysMenu struct { + SysBaseMenu + //MenuId string `json:"menuId" gorm:"comment:菜单ID"` + //AuthorityId string `json:"-" gorm:"comment:角色ID"` + Children []SysMenu `json:"children" gorm:"-"` + Parameters []SysBaseMenuParameter `json:"parameters" gorm:"foreignKey:SysBaseMenuID;references:ID"` +} + +func (s SysMenu) TableName() string { + return "sys_base_menus" +} diff --git a/model/sys_casbin.go b/model/sys_casbin.go new file mode 100644 index 0000000..80350b9 --- /dev/null +++ b/model/sys_casbin.go @@ -0,0 +1,8 @@ +package model + +type CasbinModel struct { + Ptype string `json:"ptype" gorm:"column:ptype"` + AuthorityId uint `json:"rolename" gorm:"column:v0"` + Path string `json:"path" gorm:"column:sys"` + Method string `json:"method" gorm:"column:v2"` +} diff --git a/model/sys_config.go b/model/sys_config.go new file mode 100644 index 0000000..3fb3cf1 --- /dev/null +++ b/model/sys_config.go @@ -0,0 +1,25 @@ +package model + +import "pure-admin/global" + +type SysConfig struct { + ID int `gorm:"AUTO_INCREMENT;primary_key" json:"-"` //主键 + Label string `gorm:"unique;size:30" sql:"index" json:"-"` //唯一标记 + Value1 string `gorm:"size:100" sql:"index" json:"value1"` //取值1 + ValueType string `gorm:"type:enum('string','number','bool');default:'string'" json:"-"` //值的类型 + Desc string `gorm:"size:100" json:"desc"` //描述信息 + Show bool `gorm:"type:tinyint(1);default:0" json:"-"` //是否提供给APP + global.TIME_MODEL +} + +type SysConfigView struct { + ID int `json:"id"` + Label string `json:"label"` + Value1 string `json:"value1"` + ValueType string `json:"valueType"` + Show bool `json:"show"` +} + +func (SysConfig) TableName() string { + return "sys_config" +} diff --git a/model/sys_dictionary.go b/model/sys_dictionary.go new file mode 100644 index 0000000..75007ba --- /dev/null +++ b/model/sys_dictionary.go @@ -0,0 +1,14 @@ +// 自动生成模板SysDictionary +package model + +import "pure-admin/global" + +// 如果含有time.Time 请自行import time包 +type SysDictionary struct { + Name string `json:"name" form:"name" gorm:"column:name;comment:字典名(中)"` // 字典名(中) + Type string `json:"type" form:"type" gorm:"column:type;comment:字典名(英)"` // 字典名(英) + Status *bool `json:"status" form:"status" gorm:"column:status;comment:状态"` // 状态 + Desc string `json:"desc" form:"desc" gorm:"column:desc;comment:描述"` // 描述 + SysDictionaryDetails []SysDictionaryDetail `json:"sysDictionaryDetails" form:"sysDictionaryDetails"` + global.MG_MODEL +} diff --git a/model/sys_dictionary_detail.go b/model/sys_dictionary_detail.go new file mode 100644 index 0000000..cfc60ba --- /dev/null +++ b/model/sys_dictionary_detail.go @@ -0,0 +1,14 @@ +// 自动生成模板SysDictionaryDetail +package model + +import "pure-admin/global" + +// 如果含有time.Time 请自行import time包 +type SysDictionaryDetail struct { + Label string `json:"label" form:"label" gorm:"type:varchar(200);column:label;comment:展示值"` // 展示值 + Value int `json:"value" form:"value" gorm:"type:bigint(20);column:value;comment:字典值"` // 字典值 + Status *bool `json:"status" form:"status" gorm:"type:tinyint(1);column:status;comment:启用状态"` // 启用状态 + Sort int `json:"sort" form:"sort" gorm:"type:bigint(20);column:sort;comment:排序标记"` // 排序标记 + SysDictionaryID int `json:"sysDictionaryID" form:"sysDictionaryID" gorm:"type:bigint(20);column:sys_dictionary_id;comment:关联标记"` // 关联标记 + global.MG_MODEL +} diff --git a/model/sys_initdb.go b/model/sys_initdb.go new file mode 100644 index 0000000..05ee62e --- /dev/null +++ b/model/sys_initdb.go @@ -0,0 +1,5 @@ +package model + +type InitDBFunc interface { + Init() (err error) +} diff --git a/model/sys_jwt_blacklist.go b/model/sys_jwt_blacklist.go new file mode 100644 index 0000000..b777ef6 --- /dev/null +++ b/model/sys_jwt_blacklist.go @@ -0,0 +1,8 @@ +package model + +import "pure-admin/global" + +type JwtBlacklist struct { + Jwt string `gorm:"type:text;comment:jwt"` + global.MG_MODEL +} diff --git a/model/sys_mission_reward.go b/model/sys_mission_reward.go new file mode 100644 index 0000000..08d1d14 --- /dev/null +++ b/model/sys_mission_reward.go @@ -0,0 +1,21 @@ +package model + +import "pure-admin/global" + +// 平台任务奖励 +type SysMissionReward struct { + global.MG_MODEL + Title string `json:"title" gorm:"size:255"` //组件id + Type int `json:"type" gorm:"tinyint(1) comment:奖励类型 1.视频上传 2.信息完善 3.商家任务"` //奖励类型 1.视频上传 2.信息完善 3.商家任务 + RelationId string `gorm:"size:64" json:"relationId"` //关联项目id + Bonus float64 `json:"bonus" gorm:"type:decimal(10,2)"` //奖励金额 + Status int `gorm:"type:int(1)" json:"status"` //订单状态 1-待发放 2-发放中 3-已发放 + AchieveNum int64 `gorm:"type:int(11)" json:"achieve_num"` //已完成任务次数 + CreateBy string `gorm:"size:64" json:"create_by"` //创建人 + UpdateBy string `gorm:"size:64" json:"update_by"` //更新人 + AuditBy string `gorm:"size:64" json:"audit_by"` //审核人 +} + +func (SysMissionReward) TableName() string { + return "sys_mission_reward" +} diff --git a/model/sys_operation_record.go b/model/sys_operation_record.go new file mode 100644 index 0000000..0b0e177 --- /dev/null +++ b/model/sys_operation_record.go @@ -0,0 +1,25 @@ +// 自动生成模板SysOperationRecord +package model + +import ( + "pure-admin/global" + "time" +) + +// 如果含有time.Time 请自行import time包 +type SysOperationRecord struct { + Ip string `json:"ip" form:"ip" gorm:"type:varchar(30);column:ip;comment:请求ip"` // 请求ip + Appid string `json:"appid" form:"appid" gorm:"type:varchar(30);column:appid;comment:应用id"` // 应用ip + Method string `json:"method" form:"method" gorm:"type:varchar(100);column:method;index;comment:请求方法"` // 请求方法 + Path string `json:"path" form:"path" gorm:"type:varchar(100);column:path;index;comment:请求路径"` // 请求路径 + Status int `json:"status" form:"status" gorm:"type:varchar(20);column:status;index;comment:请求状态"` // 请求状态 + Latency time.Duration `json:"latency" form:"latency" gorm:"column:latency;comment:延迟" swaggertype:"string"` // 延迟 + Agent string `json:"agent" form:"agent" gorm:"type:varchar(200);column:agent;comment:代理"` // 代理 + ErrorMessage string `json:"error_message" form:"error_message" gorm:"type:varchar(200);column:error_message;comment:错误信息"` // 错误信息 + Body string `json:"body" form:"body" gorm:"type:longtext;column:body;comment:请求Body"` // 请求Body + Resp string `json:"resp" form:"resp" gorm:"type:longtext;column:resp;comment:响应Body"` // 响应Body + UserID int `json:"user_id" form:"user_id" gorm:"type:bigint(20);column:user_id;index;comment:用户id"` // 用户id + User SysUserSimple `json:"user" gorm:"foreignKey:ID;references:UserID;comment:用户关联作者"` + ApiDescription string `gorm:"-" json:"apiDescription"` + global.MG_MODEL +} diff --git a/model/sys_system.go b/model/sys_system.go new file mode 100644 index 0000000..c478de2 --- /dev/null +++ b/model/sys_system.go @@ -0,0 +1,10 @@ +package model + +import ( + "pure-admin/config" +) + +// 配置文件结构体 +type System struct { + Config config.Server +} diff --git a/model/sys_user.go b/model/sys_user.go new file mode 100644 index 0000000..d717714 --- /dev/null +++ b/model/sys_user.go @@ -0,0 +1,37 @@ +package model + +import ( + "pure-admin/global" + + uuid "github.com/satori/go.uuid" +) + +type SysUser struct { + UUID uuid.UUID `json:"uuid" gorm:"type:varchar(60);comment:用户UUID"` // 用户UUID + Username string `json:"userName" gorm:"type:varchar(30);comment:用户登录名"` // 用户登录名 + Password string `json:"-" gorm:"type:varchar(60);comment:用户登录密码"` // 用户登录密码 + NickName string `json:"nickName" gorm:"type:varchar(30);default:系统用户;comment:用户昵称"` // 用户昵称 + HeaderImg string `json:"headerImg" gorm:"type:varchar(200);default:http://qmplusimg.henrongyi.top/head.png;comment:用户头像"` // 用户头像 + FullName string `json:"fullName" gorm:"type:varchar(30);comment:真实姓名"` // + Phone string `json:"phone" gorm:"type:varchar(15);comment:手机号"` // + Status string `json:"status" gorm:"type:ENUM('1','0');default:'1';comment:用户状态 1.启用 0.禁用"` // 用户状态 + AuthorityId string `json:"authorityId" gorm:"default:888;comment:用户角色ID"` // 用户角色ID + Authority SysAuthority `json:"authority" gorm:"foreignKey:AuthorityId;references:AuthorityId;comment:用户角色"` // + Authorities []SysAuthority `json:"authorities" gorm:"many2many:sys_user_authority;ForeignKey:UUID;JoinForeignKey:SysUserId;References:AuthorityId;JoinReferences:SysAuthorityId"` // + global.MG_MODEL +} + +type SysUserSimple struct { + Username string `json:"userName"` // 用户登录名 + ID uint `json:"id"` + UUID uuid.UUID `json:"uuid"` + NickName string `json:"nickName"` +} + +func (SysUserSimple) TableName() string { + return "user" +} + +func (SysUser) TableName() string { + return "user" +} diff --git a/model/tag_relation.go b/model/tag_relation.go new file mode 100644 index 0000000..8252f57 --- /dev/null +++ b/model/tag_relation.go @@ -0,0 +1,26 @@ +package model + +import "pure-admin/global" + +// 组件内容 +type TagRelation struct { + global.MG_MODEL + TagId uint `json:"tagId"` //组件id + RelationId string `gorm:"size:50" json:"relationId"` //关联项目id + RelationType string `gorm:"size:4" json:"relationType"` //项目类型 01-任务 02-任务视频 03-网红 + CreateBy string `gorm:"size:64" json:"createBy"` //创建人 + UpdateBy string `gorm:"size:64" json:"updateBy"` //更新人 +} + +type TagRelationDesc struct { + ID uint `gorm:"AUTO_INCREMENT;primary_key;" json:"id" form:"id"` //主键 + Name string `gorm:"size:20" json:"name"` //标签名称 +} + +func (TagRelation) TableName() string { + return "tag_relation" +} + +func (TagRelationDesc) TableName() string { + return "tag_relation" +} diff --git a/model/tags.go b/model/tags.go new file mode 100644 index 0000000..d3fc809 --- /dev/null +++ b/model/tags.go @@ -0,0 +1,27 @@ +package model + +import ( + "pure-admin/global" +) + +type Tags struct { //标签 + Value string `gorm:"size:100" json:"value"` //值 + CreateBy string `gorm:"size:64" json:"createBy"` //创建人 + UpdateBy string `gorm:"size:64" json:"updateBy"` //修改人 + Type string `gorm:"size:10; comment:类型" json:"type"` //标签类型 01-任务 02-任务视频 03-网红 + User SysUserSimple `json:"user" gorm:"ForeignKey:UUID;References:CreateBy"` //用户信息 + global.MG_MODEL +} + +type TagsDesc struct { + global.BASE_ID + Value string `gorm:"size:100" json:"value"` //值 +} + +func (Tags) TableName() string { + return "tags" +} + +func (TagsDesc) TableName() string { + return "tags" +} diff --git a/model/tb_goods.go b/model/tb_goods.go new file mode 100644 index 0000000..8036380 --- /dev/null +++ b/model/tb_goods.go @@ -0,0 +1,87 @@ +package model + +import ( + "pure-admin/global" +) + +type TbGoodsBase struct { + SpuNo string `gorm:"unique;type:varchar(60);" json:"spu_no"` // 编号 + Title string `gorm:"type:mediumtext" json:"title"` // 名称 + TitleEng string `gorm:"type:mediumtext" json:"title_eng"` // 英文名称 + Cover string `gorm:"type:varchar(255);" json:"cover"` // 封面图 + Images string `gorm:"type:mediumtext;" json:"images"` // 图片 + Content string `gorm:"type:mediumtext;" json:"content"` // 详情 + ContentText string `gorm:"type:mediumtext;" json:"content_text"` // 详情-文字 + RetailPrice float64 `gorm:"type:decimal(10,2);" json:"retail_price"` // 吊牌价(零售指导价) + PriceMin float64 `gorm:"type:decimal(10,2);" json:"price_min"` // 最低规格价格 + PriceMax float64 `gorm:"type:decimal(10,2);" json:"price_max"` // 最高规格价格 + StoreNo string `gorm:"type:varchar(60);" json:"store_no"` // 店铺编号 +} + +type TbGoods struct { // spu + TbGoodsBase + CategoryId uint `gorm:"type:int(11);not null;" json:"category_id"` // 分类id + ListPrice float64 `gorm:"type:decimal(10,2);" json:"list_price"` // 列表价格 + AttributeList string `gorm:"type:text;" json:"attribute_list"` // 规格列表 + Stock int64 `gorm:"type:int(11);comment:总库存" json:"stock"` // 总库存 + Sales int64 `gorm:"type:int(11);comment:总销售量" json:"sales"` // 总销售量 + Views int64 `gorm:"size:11;comment:商品浏览量" json:"views"` // 商品浏览量 + Favourites int64 `gorm:"size:11;comment:商品喜欢量" json:"favourites"` // 商品喜欢量 + CollectionNum int64 `gorm:"type:int(11)" json:"collection_num"` // 收藏人数 + Tags string `gorm:"type:varchar(255);" json:"tags"` // 标签 + Online string `gorm:"type:ENUM('on','off');comment:商品上下架状态" json:"online" form:"online"` // 上下架状态 on/off + CreateBy string `gorm:"size:64" json:"create_by"` // 创建人 + + StoreNo string `gorm:"type:varchar(60);" json:"store_no"` //店铺编号 + // SaleStatus int `gorm:"type:tinyint(1);" json:"sale_status"` //销售状态 1:正常 2:已售罄 + global.MG_MODEL +} + +type TbGoods4List struct { + SpuNo string `json:"spu_no"` // 编号 + Title string `json:"title"` // 标题 + TitleEng string `json:"title_eng"` // 英文标题 + Cover string `json:"cover"` // 封面图(未使用) + Images string `json:"images"` // 图片列表 + RetailPrice float64 `json:"retail_price"` // 吊牌价(零售指导价) + PriceMin float64 `json:"price_min"` // 最低规格价格 + PriceMax float64 `json:"price_max"` // 最高规格价格 + Stock int64 `json:"stock"` // 总库存 + Sales int64 `json:"sales"` // 总销售量 + Sales30 int64 `json:"sales_30"` // 30天销售量 + Status int `json:"status"` // 1:上架 2:下架 3:售罄 + Online string `json:"-"` // 上下架状态 on/off + Tags string `json:"tags"` // 标签 + global.MG_MODEL +} + +type TbGoodsDetail struct { + CategoryId uint `json:"category_id"` // 分类id + SpuNo string `json:"spu_no"` // 编号 + Title string `json:"title"` // 标题 + TitleEng string `json:"title_eng"` // 英文标题 + Cover string `json:"cover"` // 封面图(未使用) + Images string `json:"images"` // 图片 + RetailPrice float64 `json:"retail_price"` // 吊牌价(零售指导价) + Content string `json:"content"` // 商品详情 + ContentText string `json:"content_text"` // 商品详情-文字 + Sales int64 `json:"sales"` // + Stock int64 `json:"stock"` // 总库存 + Tags string `json:"tags"` // 标签 + Online string `json:"online"` // 上下架状态 on/off + StoreNo string `json:"store_no"` + Specs []TbGoodsSpecsDetail `gorm:"ForeignKey:GoodsId;AssociationForeignKey:ID" json:"specs"` // 规格 + global.MG_MODEL +} + +func (TbGoods) TableName() string { + return "tb_goods" +} + +func (TbGoods4List) TableName() string { + return "tb_goods" +} + +func (TbGoodsDetail) TableName() string { + return "tb_goods" +} diff --git a/model/tb_goods_specs.go b/model/tb_goods_specs.go new file mode 100644 index 0000000..765d85b --- /dev/null +++ b/model/tb_goods_specs.go @@ -0,0 +1,42 @@ +package model + +import "pure-admin/global" + +type TbGoodsSpecsBase struct { + GoodsId uint `gorm:"type:int(11)" json:"goods_id"` // spu id + SpuNo string `gorm:"type:varchar(60);" json:"spu_no"` // 商品编号 + SkuNo string `gorm:"type:varchar(60);" json:"sku_no"` // 商品规格编号 + Specs string `gorm:"type:text;" json:"specs"` // 规格 + Price float64 `gorm:"type:decimal(10,2);" json:"price"` // 价格 + Image string `gorm:"size:255" json:"image"` // 规格图片url + GoodsNo string `gorm:"size:255" json:"goods_no"` // 商品编号 +} + +type TbGoodsSpecs struct { // sku + global.MG_MODEL + TbGoodsSpecsBase + Stock int64 `gorm:"type:int(11);" json:"stock"` // 库存 + Status int `gorm:"type:tinyint(1);comment:状态 1:正常" json:"status"` // 状态 +} + +type TbGoodsSpecsDetail struct { + global.MG_MODEL + GoodsId uint `json:"goods_id"` + Specs string `json:"specs"` //规格 + SkuNo string `json:"sku_no"` //商品编码 + Stock int64 `json:"stock"` //库存 + Price float64 `json:"price"` //价格 + Image string `json:"image"` //规格图片url + GoodsNo string `json:"goods_no"` //商品编号 + Tags string `gorm:"type:varchar(255);" json:"tags"` //标签 + Online string `gorm:"type:ENUM('on','off');comment:商品上下架状态" json:"online" form:"online"` //上下架状态 on/off + +} + +func (TbGoodsSpecs) TableName() string { + return "tb_goods_specs" +} + +func (TbGoodsSpecsDetail) TableName() string { + return "tb_goods_specs" +} diff --git a/model/user.go b/model/user.go new file mode 100755 index 0000000..3f7e102 --- /dev/null +++ b/model/user.go @@ -0,0 +1,81 @@ +// 自动生成模板User +package model + +import ( + "pure-admin/global" + "time" + + uuid "github.com/satori/go.uuid" +) + +// 如果含有time.Time 请自行import time包 +type User struct { + global.MG_MODEL + UUID uuid.UUID `gorm:"unique;size:64" json:"uuid"` //用户uuid编码 + Username string `gorm:"size:128" json:"username"` //用户登录名 + NickName string `gorm:"size:20" json:"nick_name"` //昵称 + Avatar string `gorm:"size:255" json:"avatar"` //头像 + Platform string `gorm:"type:text" json:"platform"` //平台及地址逗号隔开 eg:(ins:https://baidu.com/user/1,qq:12345678) + Appid string `json:"appid" form:"appid" gorm:"size:255"` //用户所属应用 + Organization string `json:"organization" form:"organization" gorm:"size:255"` //用户所属组织 + Type string `json:"type" form:"type" gorm:"size:255"` //用户类型(随用户所属而定) + Phone string `json:"phone" form:"phone" gorm:"size:255"` //用户手机号 + CountryCode string `json:"country_code" form:"country_code" gorm:"size:255"` //用户手机号国家代码 + Email string `json:"email" form:"email" gorm:"size:255"` //用户邮箱 + Password string `json:"password" form:"password" gorm:"size:255"` //用户密码 + PasswordSalt string `json:"password_salt" form:"password_salt" gorm:"size:255"` //用户密码盐 + Tags string `gorm:"type:text" json:"tags"` //个人标签 + Facebook string `gorm:"size:255" json:"facebook"` //facebook + Douyin string `gorm:"size:255" json:"douyin"` //抖音 + Instagram string `gorm:"size:255" json:"instagram"` //instagram + IsAuth bool `gorm:"default:0" json:"is_auth"` //是否认证 0未认证 1已认证 + IDForbidden bool `json:"id_forbidden"` //是否禁用 + ForbiddenTime *time.Time `json:"forbidden_time"` //禁用时间 + ForbiddenReason string `json:"forbidden_reason"` //禁用原因 + ForbiddenOperation string `json:"forbidden_operation"` //禁用操作人 + AuthorityID uint `json:"authority_id" gorm:"default:888;comment:用户角色ID"` // 用户角色ID + Authority SysAuthority `json:"authority" gorm:"-"` // + Authorities []SysAuthority `json:"authorities" gorm:"-"` // + Source string `json:"source" gorm:"size:255"` //用户来源 +} + +type UserSimple struct { + global.MG_MODEL + UUID uuid.UUID `gorm:"unique;size:64" json:"uuid"` //用户uuid编码 + Username string `gorm:"size:128" json:"username"` //用户登录名 + NickName string `gorm:"size:20" json:"nick_name" form:"nick_name"` //昵称 + Avatar string `gorm:"size:255" json:"avatar"` //头像 + Phone string `json:"phone" form:"phone"` //用户手机号 + Email string `json:"email" form:"email"` //用户邮箱 + Platform string `gorm:"size:500" json:"-"` //json格式的平台信息 + Tags string `gorm:"type:text" json:"tags"` //个人标签 + Platforms []Platform `gorm:"-" json:"platform"` //平台 + IsAuth bool `json:"is_auth"` //是否认证 0未认证 1已认证 + CreatedAt *time.Time `json:"-"` //创建时间 + CreatedStr string `json:"created_at" gorm:"-"` //创建时间字符串 + Source string `json:"source" gorm:"size:255"` //用户来源 + OrderCount int64 `json:"order_count" gorm:"-"` //订单数量 + RefundCount int64 `json:"refund_count" gorm:"-"` //退款数量 + IDForbidden bool `json:"id_forbidden"` //是否禁用 + Wallet Wallet `gorm:"-" json:"wallet"` + Account []Account `gorm:"-" json:"account"` + AuthorityID uint `json:"authority_id" gorm:"default:888;comment:用户角色ID"` // 用户角色ID + Authority SysAuthority `json:"authority" gorm:"-"` // + Authorities []SysAuthority `json:"authorities" gorm:"-"` // +} +type UserView struct { + UUID uuid.UUID `json:"uuid"` // uuid + Email string `json:"email"` // 邮箱 +} + +func (User) TableName() string { + return "user" +} + +func (UserSimple) TableName() string { + return "user" +} + +func (UserView) TableName() string { + return "user" +} diff --git a/model/wallet.go b/model/wallet.go new file mode 100644 index 0000000..5343a35 --- /dev/null +++ b/model/wallet.go @@ -0,0 +1,20 @@ +package model + +import "pure-admin/global" + +type Wallet struct { + global.MG_MODEL + UserID string `gorm:"size:50" json:"userId"` + Platform string `gorm:"size:50" json:"platform"` //平台 seller / customer / influencer + Balance float64 `gorm:"type:decimal(10,2)" json:"balance"` //可用余额 + TransitBalance float64 `gorm:"type:decimal(10,2)" json:"transitBalance"` //在途余额 + Fund float64 `gorm:"type:decimal(10,2)" json:"fund"` // 营销账户 + FundLock float64 `gorm:"type:decimal(10,2)" json:"fundLock"` // 营销账户-锁定金额 + AccountName string `gorm:"size:50" json:"accountName"` //户名 + IDCard string `gorm:"size:30" json:"idCard"` //身份证 + State int `gorm:"type:tinyint(1)" json:"state"` // 状态 0:正常 1:限制提现 2:禁止提现 +} + +func (Wallet) TableName() string { + return "wallet" +} diff --git a/model/withdrawal.go b/model/withdrawal.go new file mode 100644 index 0000000..da3c0e7 --- /dev/null +++ b/model/withdrawal.go @@ -0,0 +1,28 @@ +package model + +import ( + "pure-admin/global" + "time" +) + +type Withdrawal struct { // 提现记录 + global.MG_MODEL + Platform string `gorm:"size:10" json:"platform"` // 平台 1:网红 2:商家 + WalletType int `gorm:"type:tinyint(1)" json:"wallet_type"` // 钱包类型 1:余额钱包 2:营销账户钱包 + FlowNo string `gorm:"size:50;unique" json:"flow_no"` // 流水号 + BillNo string `gorm:"size:50" json:"bill_no"` // 账单号 + Title string `gorm:"size:255" json:"title"` // 标题 + AccountType int `gorm:"type:int(1)" json:"account_type"` // 账户类型 1:paypal 2:银行卡 + BankCard + CreateBy string `gorm:"size:50" json:"create_by"` // 创建人/店铺 + Amount float64 `gorm:"type:decimal(10,2)" json:"amount"` // 金额 + CheckStatus string `gorm:"size:1" json:"check_status"` // 审核状态 0:待审核 1:审核通过 2:审核未通过 + CheckTime *time.Time `gorm:"" json:"check_time"` // 审核时间 + PayId string `gorm:"size:50" json:"pay_id"` // 支付id + Status string `gorm:"size:1" json:"status"` // 提现状态 0:进行中 1:成功 2:失败 + Remark string `gorm:"size:255" json:"remark"` // 备注 +} + +func (Withdrawal) TableName() string { + return "withdrawal" +} diff --git a/packfile/notUsePackFile.go b/packfile/notUsePackFile.go new file mode 100644 index 0000000..e54aad3 --- /dev/null +++ b/packfile/notUsePackFile.go @@ -0,0 +1,3 @@ +// +build !packfile + +package packfile diff --git a/packfile/usePackFile.go b/packfile/usePackFile.go new file mode 100644 index 0000000..055f03d --- /dev/null +++ b/packfile/usePackFile.go @@ -0,0 +1,45 @@ +// +build packfile + +package packfile + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings" +) + +//go:generate go-bindata -o=staticFile.go -pkg=packfile -tags=packfile ../resource/... ../config.yaml + +func writeFile(path string, data []byte) { + // 如果文件夹不存在,预先创建文件夹 + if lastSeparator := strings.LastIndex(path, "/"); lastSeparator != -1 { + dirPath := path[:lastSeparator] + if _, err := os.Stat(dirPath); err != nil && os.IsNotExist(err) { + os.MkdirAll(dirPath, os.ModePerm) + } + } + + // 已存在的文件,不应该覆盖重写,可能在前端更改了配置文件等 + if _, err := os.Stat(path); os.IsNotExist(err) { + if err2 := ioutil.WriteFile(path, data, os.ModePerm); err2 != nil { + fmt.Printf("Write file failed: %s\n", path) + } + } else { + fmt.Printf("File exist, skip: %s\n", path) + } +} + +func init() { + for key := range _bindata { + filePath, _ := filepath.Abs(strings.TrimPrefix(key, ".")) + data, err := Asset(key) + if err != nil { + // Asset was not found. + fmt.Printf("Fail to find: %s\n", filePath) + } else { + writeFile(filePath, data) + } + } +} diff --git a/resource/excel/ExcelExport.xlsx b/resource/excel/ExcelExport.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..e911c30f08c4b64f44cbe5502dc11e6db49bbd1f GIT binary patch literal 6555 zcmaJ_1yodP*QOh3>5}eLT5zaA=|(z+F6k16l#-V2ZfTHi=?($u&OutKf4Khl)6ezY zyU$wZtU2qv@2qz}&yHs+zJf=_MvvdneKTfz;;43w$SUei2lZDy(c_WIhboJVe$0m+Z{pdjtkWDMBqwm{3PXJR8uJsq z;uyuoQ-R17FU9{eG)5x?DjMmEH+fgK;awUDl zMrOnw8(SJ%5!s6;l9EK+s%URBYdU3y*Fmm?5=1DEQZOs(8+*(8F- zTAV4lmzsUF79s_sgm_iowgec^6I+xRS#`24aKkc4JH?}eosP!u?8-~HXSrS6z2W92 zX%o~uDZ(1QRFx!YHiY`?q#&9y1tfSP5jxsn7@|o(tFwQavQh99AW46SYL>+8kbCsh zTa3-LO5L}X$N*y6IRkrP3zqcgB(2zlN!iDNw|?3_q<-DJT@y1H`9&)+$W>5pTJk9>S52F?Kn%Z1vlN>y?SiA30o^R|B)uSlg|I49p_ z)IQ^ksL!|rFxMF80y%Zy?v3EEp?77N(rb^jk6D=$n8%ywS7->VIW#4;Dt_m*S7mp^lK8V6Hs877e&NLaEtAv5V~TRcxKEBQ0r5^K6!Z^jR)U z6a(-2e~gO9gN|2OofA&Cmve`#n8J}X>pJmK4+uczK42OnNw_rTY0&|)SM&s&$el8? zoaf2hgu$`p-;ld^E6*~7mU4WvfT zCuKD;HHtRq-!As$52^Sp${5qS!e97#8ppzYdLgxzG>_gm#ASF;BEWUh(n_>EBUW>R z$Cpv^q#t+XVwF|7*Q2t_NpwKCwszqRr*eJyJyKnI1kSN{MHr6XV}1^n7|}(XL`U&EQklqg4*JCwoV{h zCw*0Sdyu2#14Yog!XCRHx0s4$C+Sxkr~p(QyLt|7)@Vj@>J8^UNZLA z`JH6NU*PJmUAo`&CT)4Ytel5^)Bd$ss6~mupW>m^nqEV%mFpX8jHVT(ApX(AFL*k$<*vDl6QG+}YV1?@)^- z3peNg5#10r#@>)JOgIJf=}!LU^$^#+aE>v@BUE+`_dDvd=4+q%m2uoF4gfV4Ut6K5 z*}d%RuRCz^pST2Y`;dzTz>1w4W{)#I`)`ICw*~6aF zfK9Fp@vyvDOY3AhAs(Qu0>C|i=^yX!q3+-Bjz4|eQB`SJJ7O_+pJHc9)TSRYMJyhn z(+_TT5m^I=s}5~4QY|B82ttDWllv3%UIN7E!MT*JCpfh#A*x1VxMkH8c|>$nM2*bw zS|Mjm1BjD5#aH2$GwY|_ zd3kBFn)&RNSjF1N`-;3Ata9oB0z$|iqq8ppQLATo;4P83x=ac+DN+oEvT{9NehSZW z_$;|kp=lD;w#;gPYl@yyhrI2!jNzc_@;1yR(zyWD5*t2Gxn@-KcpY7=MfL|o0hWDa`)7+To14Ta!mK)t#~`S=D3nJN6gL52V# zDxwYeC)00ta3hC|`(XqMZ!0OrRJD$IffBGV+y90VS zE~pFsnXyDa8S852VC85I0y#Ny{Po~^a6@?fE4v(F{GiL_j}^`L1Gnn1YVepmP2*oL z5K<8c4*Fc!Pa)FXs8wu{J&(>;o417<-bJ-7=HuvKgWx+5&-8Rqu#bSEE8?&|w_oov z0PSvJ*Dka~1jkrL$7MGhZMZ-BBT(Mhr$`N?eUiiWfy@sHUf@qNG=29*~~Zs zD9Bv03lAZZlRH=Cq(Uk}28_6RyU7?;%UI;aGOp>^TTcSAD>vag4){}vSWmqZvD4qe zNM6IWdR7djZAOB;GgdCa<+6=P&5O5UG<*De=zY7yFF1vcP`;;rpKS#nk=3a7&5q_C zzMZneKQmuWm%dBWY0F%--#|Re&imm$n^S1(uDunf1Iw0)+_7#umPX7lS$+3hImz`@ z4nl#@46Z)Nb8_5P-jcsGAWd>-E-~3EDUH|4tinnPWL_9xRo0@Zb~AiLH!Jx?pY9+m zx;BZgH7>)v{INQE9gj#G)+hF9owq8IG#VzRg9aZ!27)zmRFs7?O;sI&73N5f<<`mG zPYm#Q29*elPm0db$DP*3mg5(y&1CiP)VPsso5!hV&GEe6Bu;9yeIlU0kT`&}4?LNY z-=?W@lgjV0iBrG-GUE2ZtW=bRnq(03?7XH!u#U{!8i&At$BsHr&GNCFdIc5eZ z#U?Tg&o6@mi`2bGr_HRuJ<3qY=C0xCV7e=xd#aA$x7&UX= zQ6q)N7xalJDU0yP>^55`8T$Fc5lbOO080avGF8w`^JF{3l~D7Y@+W}wXb7ay6z;Dg4S*y%qeRV8`|>}-{K#=R5viLqD& z?`1Q|m-#taqGQ*}i&Xh#B#xM1CvDsi%zMuG<&NPcPIXTxrZ(_& z>)Bz&STMu8n)>aJjhLqu246Cz1=^aRM6ksZVSgeZC?mySEy_PP2JtC!zDaiFQa&gB z+jCr#QC25Vznnw8_s?Pc&=x?&k&`*d2K4j(R|FpC^?kt2@Mko(km-=&7RE@jEcG+X8F9xwLT*^HhY4T^kkht8Q@KmP|cdvU`FvPBYt(e0|E?fL` z@3HCgVZjbkf1&N@LkFWIaU~npkK~!wqQ_~BS=i`wbyVy5KDmeVj+EubR?&;CwQ?ne z#j9;uw|fj+JlKvC>(a7Nb7jy`uYOh6wqRAq)*7HJ_1!J-!e2ed^Z9}RH|{|Y9t2_7 zyXkosVVqfM`9S)R@FETo-j1v%g5`t zZL70`cGb-%6h(7l`JGDMg zYa(sOn>?Dv(!V`l+};`0Z}mCfu;TkDd$*~e-+Xg;Is0igzSJ(g)$8J{r(XZ=+d3X{ zD~qA|8hkQNplvjslZHvVE__s$mr&RXw5ckvs>uq>rL(1PeSW*nSBgq;H+^M_ruO~V zckwehs`9+fV7|#AIIKVePk>;7V>QuW>PP^?QO9QY#t|G@Q|}QwotsZg0c{R@!eX2z zH-vMA1h+Fpsz-#2zT5ButjtpWjyDDn5-o+rI1j&v(GPx9yRd^a4DOhsvybv4Na?yZ zSKv&zrVyx;SwZDYc-2|TsrN1%);i&5P(`kiI=DItbTJU z#uJaox!^WRjwdB9IYM^>7R4||gzG3jYEynVu7LhJgao|j3cU8wZ zM1x#hdiau)_{T> z@NCvd@zT&nRMu7Mh%?r)``oGxLu>U_A7vP+0wG6^9xgkHQFe&%%XK_n6FhgqHEiU=*EsEo%p#GdvU!ya zgi1Qh8r5aywl$dqXKWw9|a_-u#O}(uikI?0vC8Ij5 zRXbQDKM5)h(pFn3bxteeOT|qP#m2DEwza^luW>f}j6{hNzWUl~P2J}($th&gze$F#Nq7!LUpL8E#Yj9p^v(huSIQt$1h2exBWNW+F zoguoZ=Q4l<$F{QKTp=fBHbCUvnl)**iU1oxSiLB+P<9Wyx_Ub1)Oi!%JrQN$idf2A zd*X_1rz2|=k2YH^$xng&+#+A#mN-@A8}AvGV1ph=Fe=ZBJgYr*=_um4gmVSs>JtjH z6G>rjF`)^r+_9~|M@Mh_u&&YcP`S#!PO)iuB`KQ~LwuMt8Z`~n^KKRurDzN>hk|(S z%(}Dg1*4wgc3akNj7?3GmwdluzwX1Rv#j|3Nt|z%F8DkY9k!G%h3kl>h3V~wsC96l z^L0y6SSxn=*q>F9ho(oE7){|C&Lw0FNgEZpnsA#yp z?`<#zd53Sh3ZNV0)U%|(hiP-;u8jnDlCo6i=g$o6y)}{Sy&l|D4ks+=TtpaN{tv1K zro_WZ&@LJFUxflX^!uNk$zR<_+*rrUZcc2Zl_mw8t=8cqv?o=&dJ)-rJWhh48(cb5N|Xs-t2wfA$OmExqa8Fk7$=Cy^5wup^0^ zY@wtJPk=REoWf=(+k>#muQJY!0W?G7K7=WaHrOIF=Yl(I)2d_=Y@TK4r)eNtp!Lm`Vb?p1N1A9Zy|2u+^R zE*>q1(z(GTDJo+-2hc+Ymm95Mb;^nH4gx7aX=QMD%?JU+P(1UPH>iks zzZhOtXZnqj)%8u=EpR@ceBWjz);p5Iq)3l`5~NQA6k4dLT45DuNtQiXA7Rb|6(7^-dJaQr#(jn> zW{ob7s7{To|9;!$(KB!OLZEGMuqXM{(u>l6U;19sJavNf7I|H3Z02~s^U(D_B#d7} zd`b=_A=_WRg@wb1`85XreKhni2LEsSuc5f&tN&j5``qH8N&IC<&^-1(CP{y8@VknB z7;pTtT%?}^`9Fspf9~+R5PeYFzf1!<<^NNA|GD~i|7Xq$oA~ literal 0 HcmV?d00001 diff --git a/resource/excel/ExcelImport.xlsx b/resource/excel/ExcelImport.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..6a6156dd8d3446defea0922dd7e30f107f5d5c46 GIT binary patch literal 9005 zcmeHNg;yJU(+&>Bg1buzuEpJN+ZS%v=r|oea5O)GL|0!_iZ$FOVL}IG@S;Gn2*Fri>8hJrl7&#XY|D*6-?@G6l~h zWtkdT*YXiBCbq?U+6)j?K^~+QLf%icILKAz9yc^-^7831eoli>>2kh2ivtmsYSdO- z(kO5Bju2*;l-iMr$kIsJ7b4_3^U`4PMPL9+c?iGL+6JR?G0fKW*6`kIpYrxM+g2p4 zd$(L%;~(`&qzT-7elSC8P*(1LN>mPmtt*gjX>gOz7+ zE90^mDQ27RQv!9!pCTy+H3t6Zot_no+k(-ZF7X$};1h~6RCyIeBwxCFps_N8Un{s5 zE_UE~j-8C1zEM>1VexEy&RS5Do2l9}&!F)2P_7g>$oZHYgWw}&1hM#=5W_AtgE@=y zVuUdn?cJh?l4`+>trvr7LF2D;HnAn22|wH!c|!z)SlCV$`@@{*PA%$`SH(r2Nk=SGERaFEBFul-uZM0Vzd{)4thdkXmaP^ z73<$Y!hYx>A_fnTQ)B=D7w#EvCoV5nu%m^mtK-i)_CZI}b&4Ap_`c#6cp=WHPAess z+lx*<@_^36k%n!V)FN>r(U~@PD`;LANVW16u7u0Av!pq|ok6|71U)k|kPZ zfymC5r($82|1G_kkm1b$8K3ncN)wF_(;^}jo`nZ)gmICOwYG9K6TupKmcBIB(75nt zXpG*7--1fkgX!LnWrYBX9!wV;Y!a`c37+C8nEkBulGNf+7`&1p7q>&lPyacoottM!V} zaKE2JYI!)CWamP^4ks`F$%l$JtO?pc=aE>7*G##%+O@XHC>kHD#;p1~B>f{xa#?bcoYVr7EHep4D>2UPE|s^wg0rMu3+bhkJ2yYU~MZcrFjf>t>0h(r};|n~Vr(mr! z(f_8(h2$FHv;U>r^GpC|35npOl`S_KAK90{Xf%I=1sx`BU`o4L@wudrK7x{vuT7su$Ee{hhtp&xtgWFCu0IYuKa*6Uo(Vij5eC4Ml-Wh&3X+QIOO47Q&wv#EIOqK? z_h(}rr%p)LUvI983DD`THRPp%Z{MEJ_&wim^z=W`A-3zRSkz(^+PEO)k+$ybq;HiB znt5kpVa1LI0(~&UnB#u>x$C`Tr(+(C+CYkY3+=;Dh@bzB-sgFHdet&4cQP9`(~5)b;Fyz z5c)Xw1YeqDrb1+lNGkc@`op59YI7|)0uO?eSEo-KV&ds5DNOLD_&A>sBdDw`(;qwH ziKx#4&I;%oLew00tnsFf6sYhV1Vu2s=hF|P(KXb%V*sxjiuiK#w1==B$s)Z9yyrU8 zF$HA{V{e+U;R0 zPrSo6jLC_`s;^h+tPe8r@@z)4WP9bfMv|ZovCov>-vbMM&H zPN?~C@SKJlCrkBCNUa9NFL9djMAmR$?hDBA2hHySBzv1XXa(McdXoKY zME?j7sGYU5HP;{Sf5gU)L7xkSAmJ>@h9s8Fyi(aoNh~a+NO7i19nnZRkx4-I3-=Nh z8l$yhJ-va4c7~K8R6C=dGdc@_JVRRWniL6R>X^Z|C(%YJDw?1hG(t~oW+$|6NO4V&WsaXRWxu{W$et2yd>d+W_L3mrGMF~pG+3N+{=$O%Y!8cpLhL#4C_{K zSiUvG-O(_y!5p$O~v#dIzyri;7?{Ue32!@Pjb8+(1 z4xR*TU8cpOPj$gc^csSr^zF6$#qivcdg5=%yic%UN4A3l)Dq%;=hKtfinh2xZ_bKL z3_Pz`;vUu~O9oz_ojvgmy1s1h>z-dR;aU!l3OYPW<_f%B*4;Djux3dQx?1V{dVjF_ zYHRR4wP?dWn4fo1Hpy&pw&T+ro~l_e&W(4+e7^-LgM~o`slTZ4nY9yw>j2PW@w9}h zt)5b+3#CD#(bZi%{z3;|aZqrn1Cg3n;f&M^bs=J_@7aM{s>0sD#b^f=9dv1{K1PeJ z_1YfwyNWSqJx`V0Tn@`CmNwAqbl+}fQc(r3=RmgNNXCVSC8fuEc&@m3wn`CJRzzC% z6_4;?ef{!4E$7a)gW~G$T*pyye+ve4L)tA`$&S%`%O3o%SlnwVv%*plB&B#g6UEXG zTRKj{!yYQ8@P4MTpfi3@EfhPhbcwA&>NSPC$zGahoD|i!j$qL*cRKNbBAXEcX0~^- zkR&2t(Oj9e89|Y>I>pi)Oh9{CtafG+S_FO1h3q9|tfpcek}Iga2V3>%-?4a84tSz<+SQ!B;}X||tmY*eNFgx4+9CYuG@0L@YELqEMx0;G)iQ;>fNdOY z@rHKh=GL@k{L5-z^0ro{bVFZb-CXT`N5MTyna$F-n*OxMb0#fygg6=Fh`B7z}1REDR%d{Y!In?IG1T?{pgPacYGkvC_ zCy0FthuEn1nqD`Coj4QVAg^b(ywd7fuq?QBAr7F-19oQiY6mivz=~A{KHB)2aOW8y zl*H)kNWIytTB`H(c7XciH7ewA;49QlGRE@8YCc;Zvp0QfY*RdKt-|5UN*FV#F=FT3 z7-P(aXE1`AnyMnLygo=Jz^u}Jngvv!(^ z12oc$kRrFHu{9DjHq{5=P@3+=Ji#pOz_5%C@}ksxW=hD$x1-K_3sA`jRD~$rlsj5-|t4Nh~D;@O|6Y# zewLnEbxKpc{G6FCXBKgRaotI&^h?8WQ#&fce8?*y+p&N+l-3MAPa93`*vHoT_NNVF zIi67zhz$5&1l-xaq1!TY)_s3E3m(fyu_*mK8vZ%xoI5DZEc=R#|J!fc~^eyOrG(4IGfQ($QylvSXMPTg&IQsHY3Bu<@1a3k`W_y zu5T|Lkbzmz2Zq~Vn`zy;9F)9xD`k|oD_TTy?RrH!`8qGHUb(Z@>evH{u;Qu4-+|RkF2Zqa!i^XBgH?C~NM?A+JZSpr1}hneCq=!y@TwLw3Erz@NuLl$we*1o*x$3iW>+B2rmZ*g$_CoC|8* zQGt2U^C)Jxd9mRXoNc7KmDEhcx9foO5>PiYz;W^kp;dzF=(ehz{grPCV_l8PZLz8_ zCQM=+oRr7eg14O^XiWPxygue)kYL<>o z`B$s=0cZOuM0YKE516xyEYHII$=vKRYR!t zs5UKk%%gaQezpzCt`mL0V^=iD=52W(Pti&LV-b2|Q75D(=D5^<|FvXRhyeB)CfmWI zwHSF`53%)?WwV9r?i$B6KJ=Z-^5}LA9g{MuiDk@^_nwbeAcm93@c$dn^jbOtIO5lstqL2~q^$hVGaH&s6s@qybf+WLZ>W^Jg3879qKme)+zc_5)&?#1 z4GUg0#baAU_RVc$_X=wXGv+>&=W6uG`7d|9=cu)f5t$M>0lRZ1D)$m>!#4`UiLnD1 zWNF&>G6%VjC(8^$Cs&1aL85CaKOXr~zF@xaN#*EGo?kBuY;Z2y0-HWj%kSy#8fx!6 z8~4{Vef)Kt*+{~9XFPitMy2Ey5$@()$XJu8_r>Njs3d1-Y9atqeQx|NmFb)BOHHo( z0oW69MdmLTgvxz__w4l76(^^dZQ3zzf9qmVXI|A-_!$|viy8iO@y`zbucqzKmj74l z_D91X_PjN^jhj&Z4CzMJ+waA}9L>_DLR&M07#v~==3hCRQjyfvRie5R^ocM_!!;SN zN!tTECQIWn@)9K0CY7UnxO*;QD25929h|>EL95_WuiR%}33&WeL|n_@W+y&?M$9F< zc|hs=V3@LSf|*2?k}ynu_j|B~^tRV&x?=zia*lI<-_a?&G5vSj8g%@4Pab~fGw}WX zpB`|7vkPhs*0zR1f6|QW&SxG@3wsv}vkWZmGVbzO1oGCxL0Ai{rH4CaI*b7Ywq*Ov z%mQ%)?_s~xNMdW4j9)?}pNueVD#kPE;~-kMGc1KtRQT`w`%30~b`+%G&p{Jj4)EYJ z7b{mw4X~>lgv-(uZ2hwwz~|uq8@0e)=bxmh+RjZFK96!M+vAt^;p?W%bVzSHCAuEr zybQRSD2<LE$X_-xP1*RW;G9~1 z0K(xjYX=)fpfn^NfBc5~AwRLHlV!{0J!3+pDIRlh#nBvh?7NAOB~A<+stz?vqO(PZ z>It{Q&gx)onKk{8^(4P|Q8On6dJ+1Mq={?O-^8WvVF|Dd&6%fa{8&FRdsRO%#76Kb z|3_<>Al0(^q!!lF#$3Gvf0c7uMY)6m?9pNOQa<<>BiJqjZ$Z(od< zg4(0)l4UiN?~A}=Oaahk4HB{yAz}&Lp0dw-afw%KI#AKr9{QZ4B;dFAgDxuuK_qr8 zxyuVdQJ^@CxUcm|b7g5L44Yxzh*-6QlG2BmzoXsCLEUB=oOVP=008jsv@>^e`ycDz zbo*<2o7Czu$_=kHN)56re&ds&tQBD6OyW_bXRjXY2DmX(V0Opv*jMzGyDbKHP`E8Q zOD*xFFmAb2t#&xu+zjszHWzVv74`YX_Mkp_wn|Sz=1ai3T^(M-F`wRuZ$N)QRI^YD z^n19ZB^i|SjR#8FW6?X&_DP0cZdRq&irk5gL;tjJl&(r@rmG0c!x`HY4Kkl~-zR;Y z1m7#HscoxJlr*}>eeCOPs$MIW|7P)w7gnJz8M?8((P(W_w?gBdh%Gj7-n6-zIfBrk zcWwtuglRp?VhcO<%FbTWyWgmiXW<|kcT}JzOobY43)LJQg8hKG$k*`1j-`Wra*%Sp z7A7InhENU^m%~ga_0msEE%h|X$_=_bKiytWmVDC8)^o{E(RZ=cP{nluHeOhQx^t%p z=?gKja|l1A*%FYuL^}ZEi19wGAsEP!{;=6EJnwBOv6*-#x-I!}x)^I*>Kr(`so_li zOy7Mf(he8NqdiYvFvVD4p;}*jM~o;UvMDXF*3^{!JBe`fqEpVwq2%^2*?@q^0hb8B zU-JLY1N_hNH-7-oQ2i&sKNlnaWBBv<2_7YXTbjIUcz1#3muWvd>EBtdxoiB-q5CgW z06+j(eS4n0_p_h9*Lr5J{jT+U-?g;V(a^~Nm;h`50Kf>46AK)2LID8KF#rHk z05+N=9T;-aQQ5NrsL1F4xBVAKphU0Vse>Qb@^C}uUaLVw zPFPV9Hf8*Tkc>~>adhar>Ohmw?~ledlJWtSXy&y60i zSmM2jDRtYIx>U(h4185$5c4)ZN+g?-V0Rbua}Ab8{Un&zj_I0-^_ECAuFz`x!Tojl z;&2%S))vlhMX2AuZc6oc7@?|jxKo0~J%e<3sMTg4HaBYv3K_7JXTa$6d7queaFA7M zHB_I2R5u1j$g<5Up;UJjK(e+aCSm&$70Eq+J@4#!99XFnLLLNwSd$Kf5O!49{C`(Bqu@C+D3w(g(eTzOJLe2$&D zUma2e46QL_3dHYwwFG0sLV>n3fZ4`v;v-sEDe4-|{*i$g#U91QGs4(Waq+kplYkV& zBZ`EwyT|zG0r*=AZqTnM(X`)-rwC_W=E{NQllKW}u8?_leT@dt`bV19=<_olA+e`{ zyo-lSQwukU1B{RN=kb5(`Cpuqe|z}}DnG*dPRC~Af%57IIh7_xJ-?@_ z(?m5fc`P(DZEUnaJ?bDdW&akx9|Kb}k}(^7j3Ih9`-3mNy2Nlgi~IKa1EW9% zv&a?e-$^p%x@9GUOpp_F0DuS?8BYg3gtMDH*xA|s=Q{REZ_as=ALy4=ecgWGoh~l> zG+b+V#7<>Xuh8Vekg6A0TuC>98CZ0+E5SxkvV!4m0PbxaM9f|8Y4X||excp#;@4%U$) zBj;3(st4hVSKlDI7#f4P49U4Ij%Dq>$epgrEv;y7P^ZyxJVA|0c)T1#$nArpU`_qqa7%`L-2%{ z@J*Oos~EN=o!F_81IJY7%e}?PS7yPxFXi@HQm@guh~Rjl?QegyuuuTho(x5%J(FxB zR9Y&&`eAbmKaU>gT`QZj?J{fC`w&-f*~YEM5+a5oFbXZTVi0wD^_uk3Z05^FG`;i@IPx`$$iBYN98D^L*1R)H^$NxOJ)nvTapuAN+s` zfgye;S~+_p^Ku?+23Q&vN0I6)XG>ln3jW5EV?r5_B@M*Ael!Zlw)|3}B4XsbXBH&O zbzo0w)d${iOjVq}NuQ92{qNpNbTrkwkn{oXDvTeI;XzJ30q0}d(%&S)?yu&Uy3Hu$ zcQi-C*=T0?MV$}LIn-2W((K_m(K6HBK(nOfvCrXY8z0VR`vX_l_DyLWS)<^1BP#!9LLqAnVg$_43p6 zVBM|K!0Ng>hI9^_mFotDsT0hsKrhhnAr+3QB!L%Tcx{xC>#SYz1pA=*hmEG!NBj1? zbNm(BVs-i=5h)}+6?0GGcQ;AopV;2u2MwOQ`(9h*ab>3>5; zuvhQR01_^%Najt6eB!V21cO2#a2VeoCxM@JswCMAS*OTCciFaO3|slWKOG@qEu5_K z7!$TNuA8A*4K~yS4~c4tZny1<2LLCXirBFOlf=9}hQ-B^T1XnO8U>2Vf59QZlxEd} zrA0i+{IomgbpIoVK=K$B7lZ)EEGUO!{Q|MCwt=M!FboWyWT~z&P|SSni9#-fR+z2C zn$ifq_276~NDXZ;J*;R1&)0uTUt_eI_1?J%e%fkar`~}gMvWsQwVKVazb-bUwmPy6 z^P#|Hg%+Es0WPtSHg1zs_A@=n#*A^Dw?+}JGMLOg{dqmk;cW|FG+>u$uhm?5V%~29 z`pq{F5BJz+yR4d-rQ)vjQ!STm4ROT+B=kH})!S`*aS;^@0Tr%Tu=SB)d25`@ZD(n= zGf;g{n}kD+jBt!lfY4Sh6ZJu`Ip(k

U}n1NEHI67s|fJh4TuHh=4riflyjP}(!1 zogRtiW#$oKF>#h91MUUt0l}Osp!)lvo=BQJobtEBAm{BFVUbJ4Bz(78_U(ra=h$F# zLt#nkXnuo-+}gF7feVJOp+5Xul39X-BZhE`2INl0sSqbK_?n9vKfjs8GM^L zm8#>4=)Qnb<>{XLs3xijtRe~@_!sf9SRl$xOh)dy*|NrP-Rvgb$XpcaY&o$@N;I6w zBjzXl2{tMbk)*vGBTTm}q2jCN^t0YxXP?IGiAXkHTJmD6OZaW8jh(tsSH!>4?rjsI z^{HC%md_Qw_w053(on@-`L@rGVf|_zs~46;Te_7ocm22_wPuCkfb@j=4#5{4O#(|e ziFzecu8i1WaG4WOA3y5bl zYQZ9Ju60)gLN=EYmrsF%^pojK0bx7}K-&!#5wlphoMr=6CX8F^f=$7nRA$oO5Jo?3YNU!Hdk_RcMv@hyc! z`0pR4@cCUY>F+%1g0N@$Uo3ZjW*cg|*ci&9muTK~6Bb-hNVHs->3TCutZw;~@XE7m z?md{28ElkI=_6r!3UNSj{s?qmIH{oPXrk5Y!DyCladwr8{jNu%JS4W*g-S1|bV`Z9 zoDba?4BvA}SK9gbeYA^?5x%(56s5z}erbz&pk~V3Bv1>T&1Zkk-ocTa`K0$YrGye9 z4#-s&#xk!_QF*jO>`X-bSS8fjnq0@W`TpPQw{0E3GUTM}+RHOGBN#H)C-~Y!@mSBwG*8U}OW|33 z=m=R;O*KeBftc=2--`SDt?%M_R>3s`Pftt|Gvkj;eJylOdfM`~oMKwhH4zeiG$L~= zU3cD`qzL=a?Z^~NO9^W_TcvUrbB$vyTro^vU7OdBe^?nz+0@CAYaVQAoNZvU7u&It zU$1g~sNEM&$|9u#^|A*M_-TR^m<14Y zIDA&9Czp*zpz!@fXWu8Ox5K#K4;9y>-_7{8$QaK(RUDH`_mNsqSG%IK}~`* z7aunJlo;b9xJ}Ymcs!Jcnh~#@DM#6ZgL{(jmdU^+lYSKUtsH=zqJiboa=STQ-S4;zmu8iI)U0&~M)|Tz!fe{VLsw4Yjdr@}TgY^cVQ13#aSgx*LaCR4U zX*#Z@3cBg_=m9hoeMbn7k!#c0_EGv^nO9DMJ-f5AaMZAmqCmG~m_0Gi+S(f?%%0Ca z?}4AjfU!(9?^=(GysvahnI4DRG}ssy#Fgs{_G1>_#)F_4x3MA&aAo;u zNV)$Rzkh~h-US1_R6Rzf4hNibAq6Ye@^i`@GeuR7CgSS1nr)}&z0*e|DT>Dg00{nE z6ku>K2MFvB#r9m&`7=Ld@2-ju*5D~OpQD-yYuZ|)N>XTWHKVIL>6@BwDFYtrxQjh8 z%%DJ;RkJfujYX?HanjIvX&D?w9jtJlq6HSgQE4=3AoKGSgZB(b~)$x*wV!r=#d z>1`Dq&057`s+zt?Cvqn2eZ?){(YrntsS^cY)Qo)irR+_sb0j%=*NXy?=M_2}JmDdQ z=I1u092_wcEcGCa_CAVW)oGIa+%r%(!@14d6I|9WT~!!M?{}zgDdnb`bH5(3ZkMy8 zBUBC8aCyb7x7m`^bN(*QGQ>bh{{+3hwTRQ;QPG?{J$Ao_~Nj(ttJ)*P;4;JQWN-s$r_B7fEizTc{W zl=Zf9ATlK~kvrL6z=u9^gIMdr-E5s6|ABvp_;$4}elo?=z-wTY^JiB^CR>{vY^Sae zKUt_14bAt%JjiOdmcqAx$kV=esWB04=C7uvFHeJf@3vVx%^}Tx#C<`vLNU-NT z79~zNoSPA6f1y3LE+CRuiHjepBFB&m z$!)P)x|DT_`ucuM?KICjmMRnHm5q-(TUyAw zl@*tv714|f$wC?%!UXQoM%0jHD+*}Ep7$hAn_Q*%#xxlYk7WF#&%CYaX!q}{MfAoS zlH*l|XtP{WcKUTqRL0^I#!G*jP>t~7@Bbb}^QolB&hfwktD5hA%`W${@57+GQaVOg zTd}?%NvFKFk17X4!K!!SEv0i+?(`{cA3O!iZ6Z!G?R^Q+^Bvz09-iR*E&~2X4|f!i zZ$6FO+5U`x3lcnVh?_114*!WFz8lv9ykJ`=uw^zre-;1R85HXFlA*qLeee4Dqo#tH zG5QuChg*VCM~F4v%Z?<0O3i1fcM2r_g&iQ4L&{A3|>7}pB@-Wjht1r(+N1~O@} z4anx?-Nwl?gjt52u4k)f?64I2)OYTjHnF8xZwA@rf-1_K++(5gTIj~rRbTXDX9qN! zjvIIT z)=%Qn@V0tlh_hNpkbCkrtkz@o*f8ai>O|t$wmJ#{UcLMD6m^>}AE(>joXDV|m>@_H zRx}CH^!&`R^Ma?F{r*l+F`L!6yJ{UJIQR#dzeAQq*qff39Rw?YJdI4laK5!hF?2Ph zqCQljjX+{{i~$rY*QS#M4wsOZRbm9tEM-1F?OxJtkW*~yOr7q98 zj}EQ@2zTXA z6*m-T<>tAg0oo9`caF8^Mkpz$QBV3YU+&fV`#W=BSFZnebNr^Cn?2HBp6v1d@1OWr$MmL`o1Lb=c_I95-|41NcY5vdB{de;g+P|6qRmio}F@Ew606y|}8wulB(9f&? E12%USdH?_b literal 0 HcmV?d00001 diff --git a/resource/gorm_settings.yaml b/resource/gorm_settings.yaml new file mode 100644 index 0000000..329cb43 --- /dev/null +++ b/resource/gorm_settings.yaml @@ -0,0 +1,25 @@ +gorm: + settings: + - dsn-name: dsn1 + bind-tables: + - authority_menu + - casbin_rule + - exa_customers + - exa_file_chunks + - exa_file_upload_and_downloads + - exa_files + - exa_simple_uploaders + - jwt_blacklists + - sys_apis + - sys_authorities + - sys_authority_menus + - sys_base_menu_parameters + - sys_base_menus + - sys_data_authority_id + - sys_dictionaries + - sys_dictionary_details + - sys_operation_records + - sys_users + - dsn-name: dsn2 + bind-tables: + - bs_channel diff --git a/resource/rbac_model.conf b/resource/rbac_model.conf new file mode 100644 index 0000000..08d47f6 --- /dev/null +++ b/resource/rbac_model.conf @@ -0,0 +1,14 @@ +[request_definition] +r = type, app, sub, obj, act, model + +[policy_definition] +p = type, app, sub, obj, act, model + +[role_definition] +g = _, _, _ + +[policy_effect] +e = some(where (p.eft == allow)) + +[matchers] +m = g(r.sub, p.sub, r.app) && (r.type == p.type && r.app == p.app && ParamsMatch(r.obj,p.obj) && r.act == p.act && r.model == p.model) || r.sub == "1" \ No newline at end of file diff --git a/resource/template/readme.txt.tpl b/resource/template/readme.txt.tpl new file mode 100644 index 0000000..517311f --- /dev/null +++ b/resource/template/readme.txt.tpl @@ -0,0 +1,9 @@ +代码解压后把fe的api文件内容粘贴进前端api文件夹下并修改为自己想要的名字即可 + +后端代码解压后同理,放到自己想要的 mvc对应路径 并且到 initRouter中注册自动生成的路由 到registerTable中注册自动生成的model + +项目github:"https://github.com/piexlmax/pure-admin" + +希望大家给个star多多鼓励 + +暂时不保存大家生成的结构体 只为方便一次性使用 \ No newline at end of file diff --git a/resource/template/server/api.go.tpl b/resource/template/server/api.go.tpl new file mode 100644 index 0000000..086656d --- /dev/null +++ b/resource/template/server/api.go.tpl @@ -0,0 +1,130 @@ +package v1 + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/service" + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +// @Tags {{.StructName}} +// @Summary 创建{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "创建{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /{{.Abbreviation}}/create{{.StructName}} [post] +func Create{{.StructName}}(c *gin.Context) { + var {{.Abbreviation}} model.{{.StructName}} + _ = c.ShouldBindJSON(&{{.Abbreviation}}) + if err := service.Create{{.StructName}}({{.Abbreviation}}); err != nil { + global.MG_LOG.Error("创建失败!", zap.Any("err", err)) + response.FailWithMessage("创建失败", c) + } else { + response.OkWithMessage("创建成功", c) + } +} + +// @Tags {{.StructName}} +// @Summary 删除{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "删除{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /{{.Abbreviation}}/delete{{.StructName}} [delete] +func Delete{{.StructName}}(c *gin.Context) { + var {{.Abbreviation}} model.{{.StructName}} + _ = c.ShouldBindJSON(&{{.Abbreviation}}) + if err := service.Delete{{.StructName}}({{.Abbreviation}}); err != nil { + global.MG_LOG.Error("删除失败!", zap.Any("err", err)) + response.FailWithMessage("删除失败", c) + } else { + response.OkWithMessage("删除成功", c) + } +} + +// @Tags {{.StructName}} +// @Summary 批量删除{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}" +// @Router /{{.Abbreviation}}/delete{{.StructName}}ByIds [delete] +func Delete{{.StructName}}ByIds(c *gin.Context) { + var IDS request.IdsReq + _ = c.ShouldBindJSON(&IDS) + if err := service.Delete{{.StructName}}ByIds(IDS); err != nil { + global.MG_LOG.Error("批量删除失败!", zap.Any("err", err)) + response.FailWithMessage("批量删除失败", c) + } else { + response.OkWithMessage("批量删除成功", c) + } +} + +// @Tags {{.StructName}} +// @Summary 更新{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "更新{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /{{.Abbreviation}}/update{{.StructName}} [put] +func Update{{.StructName}}(c *gin.Context) { + var {{.Abbreviation}} model.{{.StructName}} + _ = c.ShouldBindJSON(&{{.Abbreviation}}) + if err := service.Update{{.StructName}}({{.Abbreviation}}); err != nil { + global.MG_LOG.Error("更新失败!", zap.Any("err", err)) + response.FailWithMessage("更新失败", c) + } else { + response.OkWithMessage("更新成功", c) + } +} + +// @Tags {{.StructName}} +// @Summary 用id查询{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "用id查询{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /{{.Abbreviation}}/find{{.StructName}} [get] +func Find{{.StructName}}(c *gin.Context) { + var {{.Abbreviation}} model.{{.StructName}} + _ = c.ShouldBindQuery(&{{.Abbreviation}}) + if err, re{{.Abbreviation}} := service.Get{{.StructName}}({{.Abbreviation}}.ID); err != nil { + global.MG_LOG.Error("查询失败!", zap.Any("err", err)) + response.FailWithMessage("查询失败", c) + } else { + response.OkWithData(gin.H{"re{{.Abbreviation}}": re{{.Abbreviation}}}, c) + } +} + +// @Tags {{.StructName}} +// @Summary 分页获取{{.StructName}}列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.{{.StructName}}Search true "分页获取{{.StructName}}列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /{{.Abbreviation}}/get{{.StructName}}List [get] +func Get{{.StructName}}List(c *gin.Context) { + var pageInfo request.{{.StructName}}Search + _ = c.ShouldBindQuery(&pageInfo) + if err, list, total := service.Get{{.StructName}}InfoList(pageInfo); err != nil { + global.MG_LOG.Error("获取失败!", zap.Any("err", err)) + response.FailWithMessage("获取失败", c) + } else { + response.OkWithDetailed(response.PageResult{ + List: list, + Total: total, + Page: pageInfo.Page, + PageSize: pageInfo.PageSize, + }, "获取成功", c) + } +} diff --git a/resource/template/server/model.go.tpl b/resource/template/server/model.go.tpl new file mode 100644 index 0000000..f4eaff4 --- /dev/null +++ b/resource/template/server/model.go.tpl @@ -0,0 +1,22 @@ +// 自动生成模板{{.StructName}} +package model + +import ( + "pure-admin/global" +) + +// 如果含有time.Time 请自行import time包 +type {{.StructName}} struct { + global.GVA_MODEL {{- range .Fields}} + {{- if eq .FieldType "bool" }} + {{.FieldName}} *{{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- end }}"` + {{- else }} + {{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}" form:"{{.FieldJson}}" gorm:"column:{{.ColumnName}};comment:{{.Comment}}{{- if .DataType -}};type:{{.DataType}}{{- if eq .FieldType "string" -}}{{- if .DataTypeLong -}}({{.DataTypeLong}}){{- end -}}{{- end -}};{{- if ne .FieldType "string" -}}{{- if .DataTypeLong -}}size:{{.DataTypeLong}};{{- end -}}{{- end -}}{{- end -}}"` + {{- end }} {{- end }} +} + +{{ if .TableName }} +func ({{.StructName}}) TableName() string { + return "{{.TableName}}" +} +{{ end }} diff --git a/resource/template/server/request.go.tpl b/resource/template/server/request.go.tpl new file mode 100644 index 0000000..ed58881 --- /dev/null +++ b/resource/template/server/request.go.tpl @@ -0,0 +1,8 @@ +package request + +import "pure-admin/model" + +type {{.StructName}}Search struct{ + model.{{.StructName}} + PageInfo +} \ No newline at end of file diff --git a/resource/template/server/router.go.tpl b/resource/template/server/router.go.tpl new file mode 100644 index 0000000..5a32cce --- /dev/null +++ b/resource/template/server/router.go.tpl @@ -0,0 +1,19 @@ +package router + +import ( + "pure-admin/api/v1" + "pure-admin/middleware" + "github.com/gin-gonic/gin" +) + +func Init{{.StructName}}Router(Router *gin.RouterGroup) { + {{.StructName}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.OperationRecord()) + { + {{.StructName}}Router.POST("create{{.StructName}}", v1.Create{{.StructName}}) // 新建{{.StructName}} + {{.StructName}}Router.DELETE("delete{{.StructName}}", v1.Delete{{.StructName}}) // 删除{{.StructName}} + {{.StructName}}Router.DELETE("delete{{.StructName}}ByIds", v1.Delete{{.StructName}}ByIds) // 批量删除{{.StructName}} + {{.StructName}}Router.PUT("update{{.StructName}}", v1.Update{{.StructName}}) // 更新{{.StructName}} + {{.StructName}}Router.GET("find{{.StructName}}", v1.Find{{.StructName}}) // 根据ID获取{{.StructName}} + {{.StructName}}Router.GET("get{{.StructName}}List", v1.Get{{.StructName}}List) // 获取{{.StructName}}列表 + } +} diff --git a/resource/template/server/service.go.tpl b/resource/template/server/service.go.tpl new file mode 100644 index 0000000..2d6ebeb --- /dev/null +++ b/resource/template/server/service.go.tpl @@ -0,0 +1,105 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: Create{{.StructName}} +//@description: 创建{{.StructName}}记录 +//@param: {{.Abbreviation}} model.{{.StructName}} +//@return: err error + +func Create{{.StructName}}({{.Abbreviation}} model.{{.StructName}}) (err error) { + err = global.MG_DB.Create(&{{.Abbreviation}}).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: Delete{{.StructName}} +//@description: 删除{{.StructName}}记录 +//@param: {{.Abbreviation}} model.{{.StructName}} +//@return: err error + +func Delete{{.StructName}}({{.Abbreviation}} model.{{.StructName}}) (err error) { + err = global.MG_DB.Delete(&{{.Abbreviation}}).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: Delete{{.StructName}}ByIds +//@description: 批量删除{{.StructName}}记录 +//@param: ids request.IdsReq +//@return: err error + +func Delete{{.StructName}}ByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Delete(&[]model.{{.StructName}}{},"id in (?)",ids.Ids).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: Update{{.StructName}} +//@description: 更新{{.StructName}}记录 +//@param: {{.Abbreviation}} *model.{{.StructName}} +//@return: err error + +func Update{{.StructName}}({{.Abbreviation}} model.{{.StructName}}) (err error) { + err = global.MG_DB.Updates(&{{.Abbreviation}}).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: Get{{.StructName}} +//@description: 根据id获取{{.StructName}}记录 +//@param: id uint +//@return: err error, {{.Abbreviation}} model.{{.StructName}} + +func Get{{.StructName}}(id uint) (err error, {{.Abbreviation}} model.{{.StructName}}) { + err = global.MG_DB.Where("id = ?", id).First(&{{.Abbreviation}}).Error + return +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: Get{{.StructName}}InfoList +//@description: 分页获取{{.StructName}}记录 +//@param: info request.{{.StructName}}Search +//@return: err error, list interface{}, total int64 + +func Get{{.StructName}}InfoList(info request.{{.StructName}}Search) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.{{.StructName}}{}) + var {{.Abbreviation}}s []model.{{.StructName}} + // 如果有条件搜索 下方会自动创建搜索语句 + {{- range .Fields}} + {{- if .FieldSearchType}} + {{- if eq .FieldType "string" }} + if info.{{.FieldName}} != "" { + db = db.Where("`{{.ColumnName}}` {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+ {{ end }}info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }}) + } + {{- else if eq .FieldType "bool" }} + if info.{{.FieldName}} != nil { + db = db.Where("`{{.ColumnName}}` {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+{{ end }}info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }}) + } + {{- else if eq .FieldType "int" }} + if info.{{.FieldName}} != 0 { + db = db.Where("`{{.ColumnName}}` {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+{{ end }}info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }}) + } + {{- else if eq .FieldType "float64" }} + if info.{{.FieldName}} != 0 { + db = db.Where("`{{.ColumnName}}` {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+{{ end }}info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }}) + } + {{- else if eq .FieldType "time.Time" }} + if !info.{{.FieldName}}.IsZero() { + db = db.Where("`{{.ColumnName}}` {{.FieldSearchType}} ?",{{if eq .FieldSearchType "LIKE"}}"%"+{{ end }}info.{{.FieldName}}{{if eq .FieldSearchType "LIKE"}}+"%"{{ end }}) + } + {{- end }} + {{- end }} + {{- end }} + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&{{.Abbreviation}}s).Error + return err, {{.Abbreviation}}s, total +} \ No newline at end of file diff --git a/resource/template/web/api.js.tpl b/resource/template/web/api.js.tpl new file mode 100644 index 0000000..58ab2e0 --- /dev/null +++ b/resource/template/web/api.js.tpl @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags {{.StructName}} +// @Summary 创建{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "创建{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /{{.Abbreviation}}/create{{.StructName}} [post] +export const create{{.StructName}} = (data) => { + return service({ + url: '/{{.Abbreviation}}/create{{.StructName}}', + method: 'post', + data + }) +} + +// @Tags {{.StructName}} +// @Summary 删除{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "删除{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /{{.Abbreviation}}/delete{{.StructName}} [delete] +export const delete{{.StructName}} = (data) => { + return service({ + url: '/{{.Abbreviation}}/delete{{.StructName}}', + method: 'delete', + data + }) +} + +// @Tags {{.StructName}} +// @Summary 删除{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /{{.Abbreviation}}/delete{{.StructName}} [delete] +export const delete{{.StructName}}ByIds = (data) => { + return service({ + url: '/{{.Abbreviation}}/delete{{.StructName}}ByIds', + method: 'delete', + data + }) +} + +// @Tags {{.StructName}} +// @Summary 更新{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "更新{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /{{.Abbreviation}}/update{{.StructName}} [put] +export const update{{.StructName}} = (data) => { + return service({ + url: '/{{.Abbreviation}}/update{{.StructName}}', + method: 'put', + data + }) +} + +// @Tags {{.StructName}} +// @Summary 用id查询{{.StructName}} +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.{{.StructName}} true "用id查询{{.StructName}}" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /{{.Abbreviation}}/find{{.StructName}} [get] +export const find{{.StructName}} = (params) => { + return service({ + url: '/{{.Abbreviation}}/find{{.StructName}}', + method: 'get', + params + }) +} + +// @Tags {{.StructName}} +// @Summary 分页获取{{.StructName}}列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.PageInfo true "分页获取{{.StructName}}列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /{{.Abbreviation}}/get{{.StructName}}List [get] +export const get{{.StructName}}List = (params) => { + return service({ + url: '/{{.Abbreviation}}/get{{.StructName}}List', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/resource/template/web/form.vue.tpl b/resource/template/web/form.vue.tpl new file mode 100644 index 0000000..e18285c --- /dev/null +++ b/resource/template/web/form.vue.tpl @@ -0,0 +1,122 @@ + + + + + \ No newline at end of file diff --git a/resource/template/web/table.vue.tpl b/resource/template/web/table.vue.tpl new file mode 100644 index 0000000..7a371c3 --- /dev/null +++ b/resource/template/web/table.vue.tpl @@ -0,0 +1,316 @@ + + + + + diff --git a/router/application.go b/router/application.go new file mode 100755 index 0000000..d410291 --- /dev/null +++ b/router/application.go @@ -0,0 +1,59 @@ +package router + +import ( + "fmt" + v1 "pure-admin/api/admin" + "pure-admin/middleware" + "pure-admin/service" + "time" + + "github.com/gin-gonic/gin" +) + +func InitApplicationRouter(Router *gin.RouterGroup) { + ApplicationRouter := Router.Group("application").Use(middleware.OperationRecord()) + { + ApplicationRouter.POST("createApplication", v1.CreateApplication) // 新建Application + ApplicationRouter.DELETE("deleteApplication", v1.DeleteApplication) // 删除Application + ApplicationRouter.DELETE("deleteApplicationByIds", v1.DeleteApplicationByIds) // 批量删除Application + ApplicationRouter.PUT("updateApplication", v1.UpdateApplication) // 更新Application + ApplicationRouter.GET("findApplication", v1.FindApplication) // 根据ID获取Application + ApplicationRouter.GET("getApplicationList", v1.GetApplicationList) // 获取Application列表 + } + go func() { + time.Sleep(1 * time.Second) + e := service.Casbin() + // e.AddPolicy("api", "admin", "/api/v1/application/getApplicationList", "*", "*", "*") + // e.AddRoleForUser("user1", "admin") + // e.AddRoleForUserInDomain("18162715654", "1", "51") + //接口 + // e.AddPolicy("api", "domain1", "admin", "/api/v1/application/getApplicationList", "GET", "*") + //路由 + // e.AddPolicy("menu", "appid", "1", "/sys", "*", "*") + // e.AddPolicy("menu", "appid", "1", "/sys/account", "*", "*") + // e.AddPolicy("menu", "appid", "1", "/sys/role", "*", "*") + // e.AddPolicy("menu", "appid", "1", "/sys/api", "*", "*") + // e.AddPolicy("menu", "appid", "1", "/sys/menu", "*", "*") + // e.AddPolicy("menu", "appid", "1", "/sys/sysLog", "*", "*") + // e.AddPolicy("menu", "appid", "1", "/", "*", "*") + // e.AddPolicy("menu", "appid", "1", "/login", "*", "*") + // r, err := e.Enforce("api", "domain1", "user1", "/api/v1/application/getApplicationList", "GET", "*") + // if err != nil { + // fmt.Println(err) + // } + // fmt.Println(r) + // e.RemoveFilteredGroupingPolicy(0, "menu", "domain2", "admin") + e.RemoveFilteredPolicy(0, "menu", "*", "admin") + //获取应用内用户的角色 + res := e.GetRolesForUserInDomain("user1", "domain1") + fmt.Println(res) + //获取应用内角色的权限 + res1 := e.GetFilteredPolicy(0, "menu", "domain1") + fmt.Println(res1) + for _, v := range res1 { + fmt.Println(v) + } + // source.Api.Init() + // source.Casbin.InitData() + }() +} diff --git a/router/banner.go b/router/banner.go new file mode 100644 index 0000000..6e86fd3 --- /dev/null +++ b/router/banner.go @@ -0,0 +1,20 @@ +package router + +import ( + "github.com/gin-gonic/gin" + + v1 "pure-admin/api/admin" + "pure-admin/middleware" +) + +func InitBanner(Router *gin.RouterGroup) { + bannerRouter := Router.Group("banner").Use(middleware.OperationRecord()) + { + bannerRouter.GET("list", v1.GetBannerList) // banner列表 + bannerRouter.DELETE("batchDelBanner", v1.DelBannerByIds) + bannerRouter.POST("", v1.CreateBanner) + bannerRouter.PUT("", v1.UpdateBanner) + bannerRouter.PUT("up-data", v1.BannerUpData) + bannerRouter.PUT("down-data", v1.BannerDownData) + } +} diff --git a/router/bill.go b/router/bill.go new file mode 100644 index 0000000..935410e --- /dev/null +++ b/router/bill.go @@ -0,0 +1,45 @@ +package router + +import ( + "github.com/gin-gonic/gin" + v1 "pure-admin/api/admin" +) + +func InitBillRouter(Router *gin.RouterGroup) { + InRouter := Router.Group("bill") + { + InRouter.GET("customer-data", v1.GetUserBillData) // 用户账单数据 + InRouter.GET("customer-list", v1.GetUserBillList) // 用户账单列表 + InRouter.GET("influence-data", v1.GetInfluenceBillData) // 网红账单数据 + InRouter.GET("influence-list", v1.GetInfluenceBillList) // 网红账单列表 + InRouter.GET("seller-data", v1.GetSellerBillData) // 商家账单数据 + InRouter.GET("seller-list", v1.GetSellerBillList) // 商家账单列表 + + InRouter.GET("seller-fund-data", v1.GetSellerFundData) // 商家营销账户数据 + InRouter.GET("seller-fund-list", v1.GetSellerFundList) // 商家营销账户列表 + + InRouter.GET("admin-data", v1.GetAdminBillData) // 平台账单数据 + InRouter.GET("admin-list", v1.GetAdminBillList) // 平台账单列表 + InRouter.GET("admin-fund-data", v1.GetAdminFundData) // 平台奖励账户数据 + InRouter.GET("admin-fund-list", v1.GetAdminFundList) // 平台奖励账户列表 + } +} + +func InitWithdrawalRouter(Router *gin.RouterGroup) { + InRouter := Router.Group("withdrawal") + { + InRouter.GET("influence-data", v1.GetInfluenceWithdrawalData) // 网红提现数据 + InRouter.GET("influence-list", v1.GetInfluenceWithdrawalList) // 网红提现列表 + InRouter.POST("influence-examine", v1.ExamineInfluenceWithdrawal) // 网红提现审核 + + InRouter.PUT("status", v1.UpdateWithdrawalStatus) // 手动确认打款状态 + InRouter.POST("retry", v1.TransferWithdrawalRetry) // 提现打款重试 + + InRouter.GET("seller-data", v1.GetSellerWithdrawalData) // 商家提现数据 + InRouter.GET("seller-list", v1.GetSellerWithdrawalList) // 商家提现列表 + InRouter.POST("seller-examine", v1.ExamineSellerWithdrawal) // 商家提现审核 + + InRouter.GET("admin-data", v1.GetAdminWithdrawalData) // 平台提现数据 + InRouter.GET("admin-list", v1.GetAdminWithdrawalList) // 平台提现列表 + } +} diff --git a/router/business.go b/router/business.go new file mode 100755 index 0000000..75d6988 --- /dev/null +++ b/router/business.go @@ -0,0 +1,29 @@ +package router + +import ( + "github.com/gin-gonic/gin" + + v1 "pure-admin/api/admin" + "pure-admin/middleware" +) + +func InitBusinessRouter(Router *gin.RouterGroup) { + BusinessRouter := Router.Group("business").Use(middleware.OperationRecord()) + { + BusinessRouter.POST("", v1.CreateBusiness) // 新建Business + BusinessRouter.DELETE("", v1.DeleteBusiness) // 删除Business + // BusinessRouter.DELETE("", v1.DeleteBusinessByIds) // 批量删除Business + BusinessRouter.PUT("", v1.UpdateBusiness) // 更新Business + BusinessRouter.GET("", v1.GetBusiness) // 根据ID获取Business + BusinessRouter.GET("list", v1.ListBusiness) // 获取Business列表 + BusinessRouter.GET("search", v1.SearchBusiness) // 获取Business列表 + } +} +func InitGoodsRouter(Router *gin.RouterGroup) { + BusinessRouter := Router.Group("goods").Use(middleware.OperationRecord()) + { + + BusinessRouter.GET("list", v1.ListGoods) // 获取Business列表 + BusinessRouter.GET("search", v1.SearchGoods) // 获取Business列表 + } +} diff --git a/router/dict.go b/router/dict.go new file mode 100644 index 0000000..840b107 --- /dev/null +++ b/router/dict.go @@ -0,0 +1,13 @@ +package router + +import ( + "github.com/gin-gonic/gin" + "pure-admin/api/admin" +) + +func InitDictRouter(Router *gin.RouterGroup) { + DictRouter := Router.Group("/dict") + { + DictRouter.GET("getDictDataList", v1.GetSysDictDataList) + } +} diff --git a/router/mission.go b/router/mission.go new file mode 100644 index 0000000..ea5ddb4 --- /dev/null +++ b/router/mission.go @@ -0,0 +1,51 @@ +package router + +import ( + "github.com/gin-gonic/gin" + + v1 "pure-admin/api/admin" + "pure-admin/middleware" +) + +func InitMissionRouter(Router *gin.RouterGroup) { // 任务 + missionRouter := Router.Group("mission").Use(middleware.OperationRecord()) + { + missionRouter.GET("mission", v1.GetMissionDetail) // 商家任务详情 + missionRouter.GET("mission-list", v1.GetMissionList) // 商家任务列表 + missionRouter.GET("claim-list", v1.GetMissionClaimList) // 任务领取列表 + missionRouter.GET("video-list", v1.GetMissionVideoList) // 视频任务列表 + missionRouter.POST("add-video", v1.AddMissionVideo) // 添加任务视频 + missionRouter.PUT("edit-video", v1.EditMissionVideo) // 编辑任务视频 + missionRouter.GET("claim-video-detail", v1.GetMissionClaimVideoDetail) // 任务视频详情 + // 任务推荐模块 + missionRouter.GET("recommend/list", v1.GetMissionRecommendList) // 获取任务推荐列表 + missionRouter.POST("recommend/add-data", v1.AddMissionRecommend) // 添加任务推荐 + missionRouter.DELETE("recommend/batch-del-data", v1.BatchDelMissionRecommendByIds) // 批量删除任务推荐 + missionRouter.PUT("recommend/up-data", v1.MissionRecommendUpData) // 任务推荐上移 + missionRouter.PUT("recommend/down-data", v1.MissionRecommendDownData) // 任务推荐下移 + missionRouter.PUT("recommend/update-sort", v1.UpdateMissionRecommendSort) // 任务推荐修改排序 + + missionRouter.GET("stop-detail", v1.GetMissionStopDetail) // 商家任务详情 + missionRouter.GET("stop-list", v1.GetMissionStopList) // 商家任务详情 + missionRouter.PUT("stop", v1.StopMission) // 商家任务详情 + missionRouter.GET("sys-reward-list", v1.GetSysRewardList) // 获取平台奖励列表 + missionRouter.POST("send-sys-reward", v1.SendSysReward) // 发送系统任务奖励 + missionRouter.POST("tag-relation", v1.MissionTagRelation) // 打标签 + missionRouter.GET("influencer-summary-list", v1.GetInfluencerMissionSummaryList) // 网红统计列表 + + missionRouter.GET("claim-order", v1.GetMissionClaimOrder) //任务订单详情 + missionRouter.GET("claim-order-list", v1.GetMissionClaimOrderList) //任务订单列表 + } +} + +func InitCategory(Router *gin.RouterGroup) { + categoryRouter := Router.Group("category").Use(middleware.OperationRecord()) + { + categoryRouter.GET("list", v1.ListCategoryPage) // 列表 + categoryRouter.DELETE("", v1.DeleteCategory) + categoryRouter.POST("", v1.CreateCategory) + categoryRouter.PUT("", v1.UpdateCategory) + categoryRouter.GET("children", v1.ListCategoryChildren) // 查询下级 + categoryRouter.GET("", v1.GetCategoryItem) + } +} diff --git a/router/order.go b/router/order.go new file mode 100644 index 0000000..a8fc73f --- /dev/null +++ b/router/order.go @@ -0,0 +1,15 @@ +package router + +import ( + "github.com/gin-gonic/gin" + v1 "pure-admin/api/admin" +) + +func InitOrderRouter(Router *gin.RouterGroup) { + InRouter := Router.Group("order") + { + InRouter.GET("list", v1.GetOrderList) //订单列表 + InRouter.GET("detail", v1.GetOrderDetail) //订单详情 + InRouter.GET("statistic", v1.GetStatisticData) // 数据统计 + } +} diff --git a/router/organization.go b/router/organization.go new file mode 100755 index 0000000..d566063 --- /dev/null +++ b/router/organization.go @@ -0,0 +1,20 @@ +package router + +import ( + v1 "pure-admin/api/admin" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitOrganizationRouter(Router *gin.RouterGroup) { + OrganizationRouter := Router.Group("organization").Use(middleware.OperationRecord()) + { + OrganizationRouter.POST("createOrganization", v1.CreateOrganization) // 新建Organization + OrganizationRouter.DELETE("deleteOrganization", v1.DeleteOrganization) // 删除Organization + OrganizationRouter.DELETE("deleteOrganizationByIds", v1.DeleteOrganizationByIds) // 批量删除Organization + OrganizationRouter.PUT("updateOrganization", v1.UpdateOrganization) // 更新Organization + OrganizationRouter.GET("findOrganization", v1.FindOrganization) // 根据ID获取Organization + OrganizationRouter.GET("getOrganizationList", v1.GetOrganizationList) // 获取Organization列表 + } +} diff --git a/router/provider.go b/router/provider.go new file mode 100755 index 0000000..9686b9b --- /dev/null +++ b/router/provider.go @@ -0,0 +1,20 @@ +package router + +import ( + v1 "pure-admin/api/admin" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitProviderRouter(Router *gin.RouterGroup) { + ProviderRouter := Router.Group("provider").Use(middleware.OperationRecord()) + { + ProviderRouter.POST("createProvider", v1.CreateProvider) // 新建Provider + ProviderRouter.DELETE("deleteProvider", v1.DeleteProvider) // 删除Provider + ProviderRouter.DELETE("deleteProviderByIds", v1.DeleteProviderByIds) // 批量删除Provider + ProviderRouter.PUT("updateProvider", v1.UpdateProvider) // 更新Provider + ProviderRouter.GET("findProvider", v1.FindProvider) // 根据ID获取Provider + ProviderRouter.GET("getProviderList", v1.GetProviderList) // 获取Provider列表 + } +} diff --git a/router/sys_api.go b/router/sys_api.go new file mode 100644 index 0000000..82a3392 --- /dev/null +++ b/router/sys_api.go @@ -0,0 +1,21 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitApiRouter(Router *gin.RouterGroup) { + ApiRouter := Router.Group("api").Use(middleware.OperationRecord()) + { + ApiRouter.POST("createApi", sys.CreateApi) // 创建Api + ApiRouter.POST("deleteApi", sys.DeleteApi) // 删除Api + ApiRouter.POST("getApiList", sys.GetApiList) // 获取Api列表 + ApiRouter.POST("getApiById", sys.GetApiById) // 获取单条Api消息 + ApiRouter.POST("updateApi", sys.UpdateApi) // 更新api + ApiRouter.POST("getAllApis", sys.GetAllApis) // 获取所有api + ApiRouter.DELETE("deleteApisByIds", sys.DeleteApisByIds) // 删除选中api + } +} diff --git a/router/sys_authority.go b/router/sys_authority.go new file mode 100644 index 0000000..16df085 --- /dev/null +++ b/router/sys_authority.go @@ -0,0 +1,19 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitAuthorityRouter(Router *gin.RouterGroup) { + AuthorityRouter := Router.Group("authority").Use(middleware.OperationRecord()) + { + AuthorityRouter.POST("createAuthority", sys.CreateAuthority) // 创建角色 + AuthorityRouter.POST("deleteAuthority", sys.DeleteAuthority) // 删除角色 + AuthorityRouter.PUT("updateAuthority", sys.UpdateAuthority) // 更新角色 + AuthorityRouter.POST("copyAuthority", sys.CopyAuthority) // 更新角色 + AuthorityRouter.POST("getAuthorityList", sys.GetAuthorityList) // 获取角色列表 + } +} diff --git a/router/sys_auto_code.go b/router/sys_auto_code.go new file mode 100644 index 0000000..c51928b --- /dev/null +++ b/router/sys_auto_code.go @@ -0,0 +1,18 @@ +package router + +import ( + "pure-admin/api/sys" + + "github.com/gin-gonic/gin" +) + +func InitAutoCodeRouter(Router *gin.RouterGroup) { + AutoCodeRouter := Router.Group("autoCode") + { + AutoCodeRouter.POST("preview", sys.PreviewTemp) // 获取自动创建代码预览 + AutoCodeRouter.POST("createTemp", sys.CreateTemp) // 创建自动化代码 + AutoCodeRouter.GET("getTables", sys.GetTables) // 获取对应数据库的表 + AutoCodeRouter.GET("getDB", sys.GetDB) // 获取数据库 + AutoCodeRouter.GET("getColumn", sys.GetColumn) // 获取指定表所有字段信息 + } +} diff --git a/router/sys_base.go b/router/sys_base.go new file mode 100644 index 0000000..322d831 --- /dev/null +++ b/router/sys_base.go @@ -0,0 +1,19 @@ +package router + +import ( + v1 "pure-admin/api/admin" + "pure-admin/api/sys" + + "github.com/gin-gonic/gin" +) + +func InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) { + BaseRouter := Router.Group("base") + { + BaseRouter.POST("login", sys.Login) + BaseRouter.POST("captcha", sys.Captcha) + BaseRouter.GET("chain", v1.GetChainInfo) // 获取区块链信息 + BaseRouter.POST("payment/payback", v1.PaymentPayback) // 支付结果回调接口 + } + return BaseRouter +} diff --git a/router/sys_casbin.go b/router/sys_casbin.go new file mode 100644 index 0000000..118edf5 --- /dev/null +++ b/router/sys_casbin.go @@ -0,0 +1,16 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitCasbinRouter(Router *gin.RouterGroup) { + CasbinRouter := Router.Group("casbin").Use(middleware.OperationRecord()) + { + CasbinRouter.POST("updateCasbin", sys.UpdateCasbin) + CasbinRouter.POST("getPolicyPathByAuthorityId", sys.GetPolicyPathByAuthorityId) + } +} diff --git a/router/sys_dictionary.go b/router/sys_dictionary.go new file mode 100644 index 0000000..720284b --- /dev/null +++ b/router/sys_dictionary.go @@ -0,0 +1,19 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitSysDictionaryRouter(Router *gin.RouterGroup) { + SysDictionaryRouter := Router.Group("sysDictionary").Use(middleware.OperationRecord()) + { + SysDictionaryRouter.POST("createSysDictionary", sys.CreateSysDictionary) // 新建SysDictionary + SysDictionaryRouter.DELETE("deleteSysDictionary", sys.DeleteSysDictionary) // 删除SysDictionary + SysDictionaryRouter.PUT("updateSysDictionary", sys.UpdateSysDictionary) // 更新SysDictionary + SysDictionaryRouter.GET("findSysDictionary", sys.FindSysDictionary) // 根据ID获取SysDictionary + SysDictionaryRouter.GET("getSysDictionaryList", sys.GetSysDictionaryList) // 获取SysDictionary列表 + } +} diff --git a/router/sys_dictionary_detail.go b/router/sys_dictionary_detail.go new file mode 100644 index 0000000..442bd0f --- /dev/null +++ b/router/sys_dictionary_detail.go @@ -0,0 +1,19 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitSysDictionaryDetailRouter(Router *gin.RouterGroup) { + SysDictionaryDetailRouter := Router.Group("sysDictionaryDetail").Use(middleware.OperationRecord()) + { + SysDictionaryDetailRouter.POST("createSysDictionaryDetail", sys.CreateSysDictionaryDetail) // 新建SysDictionaryDetail + SysDictionaryDetailRouter.DELETE("deleteSysDictionaryDetail", sys.DeleteSysDictionaryDetail) // 删除SysDictionaryDetail + SysDictionaryDetailRouter.PUT("updateSysDictionaryDetail", sys.UpdateSysDictionaryDetail) // 更新SysDictionaryDetail + SysDictionaryDetailRouter.GET("findSysDictionaryDetail", sys.FindSysDictionaryDetail) // 根据ID获取SysDictionaryDetail + SysDictionaryDetailRouter.GET("getSysDictionaryDetailList", sys.GetSysDictionaryDetailList) // 获取SysDictionaryDetail列表 + } +} diff --git a/router/sys_email.go b/router/sys_email.go new file mode 100644 index 0000000..89db973 --- /dev/null +++ b/router/sys_email.go @@ -0,0 +1,15 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitEmailRouter(Router *gin.RouterGroup) { + EmailRouter := Router.Group("email").Use(middleware.OperationRecord()) + { + EmailRouter.POST("emailTest", sys.EmailTest) // 发送测试邮件 + } +} diff --git a/router/sys_jwt.go b/router/sys_jwt.go new file mode 100644 index 0000000..29763c9 --- /dev/null +++ b/router/sys_jwt.go @@ -0,0 +1,15 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitJwtRouter(Router *gin.RouterGroup) { + JwtRouter := Router.Group("jwt").Use(middleware.OperationRecord()) + { + JwtRouter.POST("jsonInBlacklist", sys.JsonInBlacklist) // jwt加入黑名单 + } +} diff --git a/router/sys_menu.go b/router/sys_menu.go new file mode 100644 index 0000000..0609c8c --- /dev/null +++ b/router/sys_menu.go @@ -0,0 +1,25 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) { + MenuRouter := Router.Group("menu").Use(middleware.OperationRecord()) + { + MenuRouter.POST("getMenu", sys.GetMenu) // 获取用户菜单树 + MenuRouter.POST("getMenuForList", sys.GetMenuForList) // 获取用户菜单列表 + MenuRouter.POST("getMenuList", sys.GetMenuList) // 分页获取基础menu列表 + MenuRouter.POST("addBaseMenu", sys.AddBaseMenu) // 新增菜单 + MenuRouter.POST("getBaseMenuTree", sys.GetBaseMenuTree) // 获取用户动态路由 + MenuRouter.POST("addMenuAuthority", sys.AddMenuAuthority) // 增加menu和角色关联关系 + MenuRouter.POST("getMenuAuthority", sys.GetMenuAuthority) // 获取指定角色menu + MenuRouter.POST("deleteBaseMenu", sys.DeleteBaseMenu) // 删除菜单 + MenuRouter.POST("updateBaseMenu", sys.UpdateBaseMenu) // 更新菜单 + MenuRouter.POST("getBaseMenuById", sys.GetBaseMenuById) // 根据id获取菜单 + } + return MenuRouter +} diff --git a/router/sys_operation_record.go b/router/sys_operation_record.go new file mode 100644 index 0000000..8783ed9 --- /dev/null +++ b/router/sys_operation_record.go @@ -0,0 +1,23 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitSysOperationRecordRouter(Router *gin.RouterGroup) { + SysOperationRecordRouter := Router.Group("sysOperationRecord") + { + SysOperationRecordRouter.GET("findSysOperationRecord", sys.FindSysOperationRecord) // 根据ID获取SysOperationRecord + SysOperationRecordRouter.GET("getSysOperationRecordList", sys.GetSysOperationRecordList) // 获取SysOperationRecord列表 + } + SysOperationRecordRouter.Use(middleware.OperationRecord()) + { + SysOperationRecordRouter.POST("createSysOperationRecord", sys.CreateSysOperationRecord) // 新建SysOperationRecord + SysOperationRecordRouter.DELETE("deleteSysOperationRecord", sys.DeleteSysOperationRecord) // 删除SysOperationRecord + SysOperationRecordRouter.DELETE("deleteSysOperationRecordByIds", sys.DeleteSysOperationRecordByIds) // 批量删除SysOperationRecord + + } +} diff --git a/router/sys_system.go b/router/sys_system.go new file mode 100644 index 0000000..d0ced83 --- /dev/null +++ b/router/sys_system.go @@ -0,0 +1,17 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitSystemRouter(Router *gin.RouterGroup) { + SystemRouter := Router.Group("system").Use(middleware.OperationRecord()) + { + SystemRouter.POST("getSystemConfig", sys.GetSystemConfig) // 获取配置文件内容 + SystemRouter.POST("setSystemConfig", sys.SetSystemConfig) // 设置配置文件内容 + SystemRouter.POST("reloadSystem", sys.ReloadSystem) // 重启服务 + } +} diff --git a/router/sys_user.go b/router/sys_user.go new file mode 100644 index 0000000..bf86e85 --- /dev/null +++ b/router/sys_user.go @@ -0,0 +1,21 @@ +package router + +import ( + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitUser1Router(Router *gin.RouterGroup) { + UserRouter := Router.Group("suser").Use(middleware.OperationRecord()) + { + UserRouter.POST("getUserList", sys.GetUserList) // 分页获取用户列表 + UserRouter.GET("getUserSelectList", sys.GetUserSelectList) // 获取用户选择器列表 + UserRouter.POST("setUserAuthority", sys.SetUserAuthority) // 设置用户权限 + UserRouter.POST("setUserAuthorities", sys.SetUserAuthorities) // 设置用户权限组 + UserRouter.DELETE("deleteUser", sys.DeleteUser) // 删除用户 + UserRouter.PUT("setUserInfo", sys.SetUserInfo) // 设置用户信息 + UserRouter.GET("getUserInfo", sys.GetUserInfo) // 获取自身信息 + } +} diff --git a/router/tags.go b/router/tags.go new file mode 100644 index 0000000..f9b91a5 --- /dev/null +++ b/router/tags.go @@ -0,0 +1,20 @@ +package router + +import ( + v1 "pure-admin/api/admin" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitTagRouter(Router *gin.RouterGroup) { + TagRouter := Router.Group("tags").Use(middleware.OperationRecord()) + { + TagRouter.GET("list", v1.GetTagsList) // 标签列表 + TagRouter.POST("", v1.CreateTags) // 创建Tag + TagRouter.PUT("", v1.UpdateTags) // 更新Tag + TagRouter.DELETE("batchDelTags", v1.DelTagsByIds) // 删除Tag + TagRouter.GET("relationTags", v1.GetRelationTags) // 获取关联tag + TagRouter.POST("relationTags", v1.TagRelation) // 关联tag + } +} diff --git a/router/user.go b/router/user.go new file mode 100755 index 0000000..5b671d9 --- /dev/null +++ b/router/user.go @@ -0,0 +1,27 @@ +package router + +import ( + v1 "pure-admin/api/admin" + "pure-admin/api/sys" + "pure-admin/middleware" + + "github.com/gin-gonic/gin" +) + +func InitUserRouter(Router *gin.RouterGroup) { + UserRouter := Router.Group("user").Use(middleware.OperationRecord()) + { + UserRouter.POST("register", sys.Register) // 用户注册账号 + UserRouter.POST("createUser", v1.CreateUser) // 新建User + UserRouter.DELETE("deleteUser", v1.DeleteUser) // 删除User + UserRouter.DELETE("deleteUserByIds", v1.DeleteUserByIds) // 批量删除User + UserRouter.PUT("updateUser", v1.UpdateUser) // 更新User + UserRouter.GET("findUser", v1.FindUser) // 根据ID获取User + UserRouter.GET("getUserList", v1.GetUserList) // 获取User列表 + UserRouter.POST("getUserList", v1.GetSysUserList) // 获取系统User列表 + UserRouter.GET("platformAuth", v1.PlatformAuth) // 获取用户平台认证 + UserRouter.PUT("platformAuth", v1.CheckPlatformAuth) // 用户平台认证 + UserRouter.PUT("userStatus", v1.UpdateUserStatus) // 用户禁用启用 + UserRouter.PUT("changePassword", sys.ChangePassword) // 用户修改密码 + } +} diff --git a/router/wallet.go b/router/wallet.go new file mode 100644 index 0000000..d0ab01a --- /dev/null +++ b/router/wallet.go @@ -0,0 +1,13 @@ +package router + +import ( + "github.com/gin-gonic/gin" + v1 "pure-admin/api/admin" +) + +func InitWalletRouter(Router *gin.RouterGroup) { + InRouter := Router.Group("wallet") + { + InRouter.POST("/fund/recharge", v1.FundRecharge) // 营销账户充值 + } +} diff --git a/service/application.go b/service/application.go new file mode 100755 index 0000000..2d66b63 --- /dev/null +++ b/service/application.go @@ -0,0 +1,80 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: CreateApplication +//@description: 创建Application记录 +//@param: application model.Application +//@return: err error + +func CreateApplication(application model.Application) (err error) { + err = global.MG_DB.Create(&application).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteApplication +//@description: 删除Application记录 +//@param: application model.Application +//@return: err error + +func DeleteApplication(application model.Application) (err error) { + err = global.MG_DB.Delete(&application).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteApplicationByIds +//@description: 批量删除Application记录 +//@param: ids request.IdsReq +//@return: err error + +func DeleteApplicationByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Delete(&[]model.Application{},"id in (?)",ids.Ids).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: UpdateApplication +//@description: 更新Application记录 +//@param: application *model.Application +//@return: err error + +func UpdateApplication(application model.Application) (err error) { + err = global.MG_DB.Updates(&application).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetApplication +//@description: 根据id获取Application记录 +//@param: id uint +//@return: err error, application model.Application + +func GetApplication(id uint) (err error, application model.Application) { + err = global.MG_DB.Where("id = ?", id).First(&application).Error + return +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetApplicationInfoList +//@description: 分页获取Application记录 +//@param: info request.ApplicationSearch +//@return: err error, list interface{}, total int64 + +func GetApplicationInfoList(info request.ApplicationSearch) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.Application{}) + var applications []model.Application + // 如果有条件搜索 下方会自动创建搜索语句 + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&applications).Error + return err, applications, total +} \ No newline at end of file diff --git a/service/banner.go b/service/banner.go new file mode 100644 index 0000000..b08d7f6 --- /dev/null +++ b/service/banner.go @@ -0,0 +1,244 @@ +package service + +import ( + "errors" + "fmt" + "github.com/gin-gonic/gin" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "strconv" +) + +func AddBanner(q request.CreateBanner, userId string) error { + + var ( + err error + data *model.Banner + total int64 + ) + + //查询数量限制 + global.MG_DB.Model(&model.Banner{}).Where("status = ?", "1").Count(&total) + + if total >= model.MAX_BANNER_LIMIT { + return errors.New(fmt.Sprintf("最多可新建%d条banner", model.MAX_BANNER_LIMIT)) + } + + data = &model.Banner{ + Title: q.Title, + CoverUrl: q.CoverUrl, + LinkType: q.LinkType, + Status: q.Status, + CreateBy: userId, + UpdateBy: userId, + } + if q.LinkType == "1" { + data.Link = q.Link + } else { + data.Type = q.Type + if q.Type == "0101" { + //查询任务 + data.RelationId = q.RelationId + data.RelationType = q.RelationType + } + } + _, maxSort := GetBannerMaxSort() + data.Sort = int(maxSort) + 1 + data.ID = 0 + + err = data.New() + if err != nil { + return errors.New("创建banner失败") + } + + return nil +} + +func UpdateBanner(q request.UpdateBanner, uuid string) error { + var ( + err error + check model.Banner + updateMap map[string]interface{} + ) + err = global.MG_DB.Model(&model.Banner{}).Where("id = ?", q.ID).First(&check).Error + if err != nil { + return errors.New("数据不存在") + } + updateMap = map[string]interface{}{ + "title": q.Title, + "relation_id": q.RelationId, + "relation_type": q.RelationType, + "cover_url": q.CoverUrl, + "link_type": q.LinkType, + "link": q.Link, + "status": q.Status, + "type": q.Type, + "update_by": uuid, + } + + err = global.MG_DB.Model(&model.Banner{}).Where("id = ?", q.ID).Updates(updateMap).Error + if err != nil { + return errors.New("修改失败") + } + + return nil +} + +func GetBannerMaxSort() (err error, total int64) { + db := global.MG_DB.Model(&model.Banner{}).Select("IFNULL(MAX(sort),0)") + err = db.Scan(&(total)).Error + return +} + +func DeleteBannerByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Model(model.Banner{}).Where("id in (?)", ids.Ids).Unscoped().Delete(&model.Banner{}).Error + if err != nil { + return errors.New("删除失败") + } + + return err +} + +func BannerUpData(info request.IdReq, c *gin.Context) error { + var ( + err error + idList []global.BASE_ID_SORT + ) + + err, idList = GetBannerSortList() + if err != nil { + return err + } + for i := 1; i < len(idList); i++ { + if idList[i].ID == info.ID { + sort := idList[i].Sort + idList[i].Sort = idList[i-1].Sort + var tmp = make([]global.BASE_ID_SORT, 0) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i].ID, Sort: idList[i].Sort}) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i-1].ID, Sort: sort}) + err = updateBannerSort(tmp) + if err != nil { + return err + } + break + } + } + + return err +} + +func BannerDownData(info request.IdReq, c *gin.Context) error { + var ( + err error + idList []global.BASE_ID_SORT + ) + + err, idList = GetBannerSortList() + if err != nil { + return err + } + for i := 0; i < len(idList); i++ { + if idList[i].ID == info.ID && i < len(idList)-1 { + sort := idList[i].Sort + idList[i].Sort = idList[i+1].Sort + var tmp = make([]global.BASE_ID_SORT, 0) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i].ID, Sort: idList[i].Sort}) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i+1].ID, Sort: sort}) + err = updateBannerSort(tmp) + if err != nil { + return err + } + break + } + } + return err +} + +func GetBannerSortList() (err error, list []global.BASE_ID_SORT) { + db := global.MG_DB.Model(&model.Banner{}) + + var idList []global.BASE_ID_SORT + err = db.Select("id,sort").Order("sort desc").Find(&idList).Error + return err, idList +} + +func updateBannerSort(idList []global.BASE_ID_SORT) error { + var err error + for _, val := range idList { + _ = UpdateBannerSort(val) + //_ = global.MG_DB.Model(&model.MissionRecommend{}).Where("id=?", val.ID).Update("sort", val.Sort).Error + } + return err +} + +func UpdateBannerSort(val global.BASE_ID_SORT) error { + var err error + _ = global.MG_DB.Model(&model.Banner{}).Where("id=?", val.ID).Update("sort", val.Sort).Error + return err +} + +func GetBannerList(info request.SearchBanner) (err error, list []response.BannerListResponse, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.Banner{}) + + if info.Title != "" { + db = db.Where("title LIKE ?", "%"+info.Title+"%") + } + if info.Status != "" { + db = db.Where("status = ?", info.Status) + } + + err = db.Count(&total).Error + var res []model.Banner + var relationIds []int + var relationMission []model.Mission + + err = db.Select("id,title,cover_url,relation_id,relation_type,link_type,link,type,status,sort"). + Order("sort DESC").Limit(limit).Offset(offset).Find(&res).Error + + if err != nil { + return err, nil, 0 + } + for i := 0; i < len(res); i++ { + if res[i].LinkType == "0" && res[i].Type == "0101" && res[i].RelationId != "" { + rid, _ := strconv.Atoi(res[i].RelationId) + relationIds = append(relationIds, rid) + } + } + + if len(relationIds) > 0 { + global.MG_DB.Model(&model.Mission{}).Select("id,title").Where("id in (?)", relationIds).Find(&relationMission) + } + + for i := 0; i < len(res); i++ { + //精简字段赋值 + vRes := response.BannerListResponse{ + RelationId: res[i].RelationId, + RelationType: res[i].RelationType, + Title: res[i].Title, + CoverUrl: res[i].CoverUrl, + LinkType: res[i].LinkType, + Link: res[i].Link, + Type: res[i].Type, + Status: res[i].Status, + } + + if len(relationMission) > 0 { + for _, r := range relationMission { + mid := strconv.Itoa(int(r.ID)) + if mid == res[i].RelationId { + vRes.RelationTitle = r.Title + } + } + } + + vRes.ID = res[i].ID + vRes.SortIndex = offset + i + 1 + list = append(list, vRes) + } + + return err, list, total +} diff --git a/service/bill.go b/service/bill.go new file mode 100644 index 0000000..59a7577 --- /dev/null +++ b/service/bill.go @@ -0,0 +1,564 @@ +package service + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "gorm.io/gorm" + "pure-admin/global" + "pure-admin/initialize/api" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/utils" + "time" +) + +func GetBillData(platform string, info *request.BillSearch) (error, response.BillData) { + var ( + err error + money float64 + total int64 + result response.BillData + ) + info.Status = 1 + _, money, total = getBillAmount(platform, info) + result.Income = money + result.IncomeCount = total + + info.Status = 2 + _, money, total = getBillAmount(platform, info) + result.Expend = money + result.ExpendCount = total + return err, result +} + +func getBillAmount(platform string, info *request.BillSearch) (error, float64, int64) { + var ( + err error + result float64 + total int64 + ) + db := global.MG_DB.Model(&model.Bill{}) + if platform != "" { + db = db.Where("platform = ?", platform) + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + if len(info.EndTime) == 10 { + tmp, _ := time.ParseInLocation(utils.DateFormat, info.EndTime, time.Local) + info.EndTime = tmp.AddDate(0, 0, 1).Format(utils.DateFormat) + } + db = db.Where("created_at < ?", info.EndTime) + } + if info.Status != 0 { + db = db.Where("`status` = ?", info.Status) + } + if info.Receipt != 0 { + db = db.Where("receipt = ?", info.Receipt) + } + _ = db.Count(&total).Error + err = db.Select("IFNULL(SUM(`price`),0)").Scan(&result).Error + if err != nil { + return errors.New("获取失败"), result, total + } + return nil, result, total +} + +func GetBillList(platform string, info *request.BillSearch) (error, []model.BillList, int64) { + var ( + err error + total int64 + result []model.BillList + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.Bill{}) + if platform != "" { + db = db.Where("platform = ?", platform) + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + if len(info.EndTime) == 10 { + tmp, _ := time.ParseInLocation(utils.DateFormat, info.EndTime, time.Local) + info.EndTime = tmp.AddDate(0, 0, 1).Format(utils.DateFormat) + } + db = db.Where("created_at < ?", info.EndTime) + } + if info.Status != 0 { + db = db.Where("`status` = ?", info.Status) + } + if info.Receipt != 0 { + db = db.Where("receipt = ?", info.Receipt) + } + _ = db.Count(&total).Error + err = db.Select("id,user_id,title,order_id,price,`status`,remark,platform,transaction_id,created_at,updated_at").Order("id desc").Offset(offset).Limit(limit).Find(&result).Error + if err != nil { + return errors.New("获取失败"), result, total + } + var ( + uuids []string + userMap map[string]model.UserView + ) + for _, bill := range result { + uuids = append(uuids, bill.UserID) + } + userMap, err = getUserViewMap(uuids...) + if err != nil { + return errors.New("get user info fail"), result, total + } + for i := 0; i < len(result); i++ { + if val, ok := userMap[result[i].UserID]; ok { + result[i].User = val + } + } + return err, result, total +} + +func GetInfluenceWithdrawalData(info *request.WithdrawalSearch) (error, response.InfluenceWithdrawalData) { + var ( + err error + money float64 + total int64 + result response.InfluenceWithdrawalData + ) + // 网红账户总额 + _ = global.MG_DB.Model(&model.Wallet{}).Where("platform = 'influencer'").Select("IFNULL(SUM(`balance`),0)").Scan(&result.Balance).Error + _, money, total = getWithdrawalAmount("1", info) + result.Unexamined = money + result.UnexaminedCount = total + return err, result +} +func getWithdrawalAmount(platform string, info *request.WithdrawalSearch) (error, float64, int64) { + var ( + err error + result float64 + total int64 + ) + db := global.MG_DB.Model(&model.Withdrawal{}) + if platform != "" { + db = db.Where("platform = ?", platform) + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + if len(info.EndTime) == 10 { + tmp, _ := time.ParseInLocation(utils.DateFormat, info.EndTime, time.Local) + info.EndTime = tmp.AddDate(0, 0, 1).Format(utils.DateFormat) + } + db = db.Where("created_at < ?", info.EndTime) + } + if info.CheckStatus != "" { + db = db.Where("check_status = ?", info.CheckStatus) + } + _ = db.Count(&total).Error + err = db.Select("IFNULL(SUM(`amount`),0)").Scan(&result).Error + if err != nil { + return errors.New("获取失败"), result, total + } + return nil, result, total +} +func GetWithdrawalList(platform string, info *request.WithdrawalSearch) (error, []model.Withdrawal, int64) { + var ( + err error + total int64 + result []model.Withdrawal + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.Withdrawal{}) + if platform != "" { + db = db.Where("platform = ?", platform) + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + if len(info.EndTime) == 10 { + tmp, _ := time.ParseInLocation(utils.DateFormat, info.EndTime, time.Local) + info.EndTime = tmp.AddDate(0, 0, 1).Format(utils.DateFormat) + } + db = db.Where("created_at < ?", info.EndTime) + } + if info.CheckStatus != "" { + db = db.Where("check_status = ?", info.CheckStatus) + } + _ = db.Count(&total).Error + err = db.Order("id desc").Offset(offset).Limit(limit).Find(&result).Error + if err != nil { + return errors.New("获取失败"), result, total + } + return err, result, total +} +func ExamineWithdrawal(platform string, info *request.ExamineWithdrawal) error { + var ( + err error + withdrawal model.Withdrawal + notifyContent string + ) + err = global.MG_DB.Model(&model.Withdrawal{}).Where("platform = ? AND flow_no = ?", platform, info.FlowNo).First(&withdrawal).Error + if err != nil { + return err + } + if withdrawal.CheckStatus != "0" || withdrawal.Status != "0" { + return errors.New("withdrawal reply status error") + } + + tx := global.MG_DB.Begin() + if info.CheckStatus == "1" { // 审核通过 + err = tx.Model(&model.Withdrawal{}).Where("id = ?", withdrawal.ID).Updates(map[string]interface{}{"check_status": info.CheckStatus, "check_time": time.Now()}).Error + if err != nil { + tx.Rollback() + return err + } + notifyContent = "您的提现申请已通过!" + } else if info.CheckStatus == "2" { // 审核不通过 + err = tx.Model(&model.Withdrawal{}).Where("id = ?", withdrawal.ID).Updates(map[string]interface{}{"check_status": info.CheckStatus, "remark": info.Remark, "check_time": time.Now()}).Error + if err != nil { + tx.Rollback() + return err + } + notifyContent = "您的提现申请未通过!" + } else { + tx.Rollback() + return errors.New("check status error") + } + // 更改申请账号钱包状态 + err = tx.Model(&model.Wallet{}).Where("user_id = ?", withdrawal.CreateBy).UpdateColumn("state", "0").Error + if err != nil { + tx.Rollback() + return errors.New("update wallet state error") + } + tx.Commit() + if platform == "influencer" { + // 发送消息 + _ = createOrUpdateNotify(request.CreateNotify{ + UserId: withdrawal.CreateBy, + RelationType: "1", + RelationId: withdrawal.FlowNo, + Title: notifyContent, + }) + } + return err +} + +func UpdateWithdrawalStatus(info *request.TransferResult) error { + // 开始交易 + for { + ok, err := global.MG_REDIS.SetNX("withdrawal-"+info.FlowNo, "used", 10*time.Second).Result() + if ok && err == nil { + // 获取成功 + break + } + } + defer func() { + // 释放锁 + _, _ = utils.RedisDel("withdrawal-" + info.FlowNo) + }() + var ( + err error + notifyContent string + withdrawal model.Withdrawal + ) + err = global.MG_DB.Model(&model.Withdrawal{}).Where("flow_no = ?", info.FlowNo).First(&withdrawal).Error + if err != nil { + return err + } + if withdrawal.Status != "0" { + err = errors.New("repeat operation") + return err + } + tx := global.MG_DB.Begin() + err = tx.Model(&model.Withdrawal{}).Where("id = ?", withdrawal.ID).UpdateColumns(map[string]interface{}{"status": info.Status, "remark": info.Remark}).Error + if err != nil { + tx.Rollback() + return err + } + // 恢复网红用户钱包状态 + if withdrawal.Platform == "1" { + err = tx.Model(&model.Wallet{}).Where("user_id = ?", withdrawal.CreateBy).UpdateColumn("state", "0").Error + if err != nil { + tx.Rollback() + return err + } + } + if info.Status == "1" { + notifyContent = "您的提现申请已通过!" + } else { // 审核不通过,将金额返还至用户余额 + notifyContent = "您的提现申请未通过!" + err = tx.Model(&model.Wallet{}).Where("user_id = ?", withdrawal.CreateBy).UpdateColumn("balance", gorm.Expr("balance + ?", withdrawal.Amount)).Error + if err != nil { + tx.Rollback() + return err + } + } + tx.Commit() + if withdrawal.Platform == "1" { + // 发送消息 + _ = createOrUpdateNotify(request.CreateNotify{ + UserId: withdrawal.CreateBy, + RelationType: "1", + RelationId: withdrawal.FlowNo, + Title: notifyContent, + }) + } + return err +} + +//func TransferWithdrawalRetry(platform string, info *request.RetryWithdrawal) error { +// var ( +// err error +// transfer request.TransferWithdrawal +// withdrawal model.Withdrawal +// ) +// err = global.MG_DB.Model(&model.Withdrawal{}).Where("platform = ? AND flow_no = ?", platform, info.FlowNo).First(&withdrawal).Error +// if err != nil { +// return err +// } +// if withdrawal.CheckStatus != "1" || withdrawal.Status != "2" { +// return errors.New("withdrawal reply status error") +// } +// transfer.AccountType = withdrawal.AccountType +// transfer.AccountName = withdrawal.Account +// transfer.Account = withdrawal.Account +// transfer.Amount = withdrawal.Amount +// transfer.FlowNo = withdrawal.FlowNo +// err, payout := transferWithdrawal(&transfer) +// err = global.MG_DB.Model(&model.Withdrawal{}).Where("id = ?", withdrawal.ID).UpdateColumn("pay_id", payout.PayId).Error +// if err != nil { +// return err +// } +// return err +//} + +func transferWithdrawal(info *request.TransferWithdrawal) (error, *api.PayUrlResponse) { + var err error + attach, _ := json.Marshal(map[string]string{"transactionId": info.FlowNo}) + params := api.PayoutRequest{ + Appid: "bkb5918273465092837", + Mchid: "11000001", + OutTradeNo: info.FlowNo, + Attach: string(attach), + NotifyUrl: global.MG_CONFIG.Paypal.NotifyUrl + "/base/payment/payback", + Amount: info.Amount, + Currency: "USD", + PayChannel: info.AccountType, + PaypalName: info.AccountName, + } + payoutOrder, err := global.PAY_CLIENT.PayoutsAppUrl(context.Background(), ¶ms) + if err != nil { + fmt.Println(err.Error()) + return errors.New("open " + info.AccountType + " failed"), nil + } + return err, payoutOrder +} + +func GetSellerWithdrawalData(info *request.WithdrawalSearch) (error, response.SellerWithdrawalData) { + var ( + err error + money float64 + total int64 + result response.SellerWithdrawalData + ) + _ = global.MG_DB.Model(&model.Wallet{}).Where("platform = 'seller'").Select("IFNULL(SUM(`balance`),0)").Scan(&result.Balance).Error + _ = global.MG_DB.Model(&model.Wallet{}).Where("platform = 'seller'").Select("IFNULL(SUM(`fund`),0)").Scan(&result.Fund).Error + + _, money, total = getWithdrawalAmount("2", info) + result.Unexamined = money + result.UnexaminedCount = total + return err, result +} + +func getBillFundAmount(platform string, info *request.BillFundSearch) (error, float64, int64) { + var ( + err error + result float64 + total int64 + ) + db := global.MG_DB.Model(&model.BillFund{}) + if platform != "" { + db = db.Where("platform = ?", platform) + } + if info.UserID != "" { + db = db.Where("user_id = ?", info.UserID) + } + if info.TransactionType != 0 { + db = db.Where("transaction_type = ?", info.TransactionType) + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + if len(info.EndTime) == 10 { + tmp, _ := time.ParseInLocation(utils.DateFormat, info.EndTime, time.Local) + info.EndTime = tmp.AddDate(0, 0, 1).Format(utils.DateFormat) + } + db = db.Where("created_at < ?", info.EndTime) + } + if info.Status != 0 { + db = db.Where("`status` = ?", info.Status) + } + _ = db.Count(&total).Error + err = db.Select("SUM(`price`)").Scan(&result).Error + if err != nil { + return errors.New("获取失败"), result, total + } + return nil, result, total +} + +func GetSellerFundData(info *request.BillFundSearch) (error, response.SellerFundData) { + var ( + err error + money float64 + total int64 + result response.SellerFundData + ) + _, money, total = getBillFundAmount("seller", info) + result.Expend = money + result.ExpendCount = total + + _, money, total = getMissionFundLockAmount(&request.SearchMissionFund{}) + result.Lock = money + result.LockCount = total + return err, result +} + +func GetSellerFundList(platform string, info *request.BillFundSearch) (error, []model.SellerBillFund, int64) { + var ( + err error + total int64 + billFundList []model.BillFund + result []model.SellerBillFund + ) + err, billFundList, total = getBillFundList(platform, info) + if err != nil { + return err, result, 0 + } + var ( + sellerIds []string + claimNos []string + ) + for i := 0; i < len(billFundList); i++ { + sellerIds = append(sellerIds, billFundList[i].UserID) + claimNos = append(claimNos, billFundList[i].RelatedId) + result = append(result, model.SellerBillFund{ + UserID: billFundList[i].UserID, + TransactionType: billFundList[i].TransactionType, + TransactionId: billFundList[i].TransactionId, + Price: billFundList[i].Price, + Remark: billFundList[i].Remark, + RelatedId: billFundList[i].RelatedId, + Status: billFundList[i].Status, + MG_MODEL: billFundList[i].MG_MODEL, + }) + } + storeMap, _ := getSellerStoreMap(sellerIds) + claimMap, _ := getMissionClaimViewMap(claimNos) + for i := 0; i < len(result); i++ { + if val, ok := storeMap[result[i].UserID]; ok { + result[i].Seller = val + } + if val, ok := claimMap[result[i].RelatedId]; ok { + result[i].Mission = val + } + } + return err, result, total +} + +func getBillFundList(platform string, info *request.BillFundSearch) (error, []model.BillFund, int64) { + var ( + err error + total int64 + result []model.BillFund + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.BillFund{}) + if platform != "" { + db = db.Where("platform = ?", platform) + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + if len(info.EndTime) == 10 { + tmp, _ := time.ParseInLocation(utils.DateFormat, info.EndTime, time.Local) + info.EndTime = tmp.AddDate(0, 0, 1).Format(utils.DateFormat) + } + db = db.Where("created_at < ?", info.EndTime) + } + if info.Status != 0 { + db = db.Where("`status` = ?", info.Status) + } + _ = db.Count(&total).Error + err = db.Order("id desc").Offset(offset).Limit(limit).Find(&result).Error + if err != nil { + return errors.New("获取失败"), result, total + } + return err, result, total +} + +func GetBkbWithdrawalData(info *request.WithdrawalSearch) (error, response.BkbData) { + var ( + err error + money float64 + total int64 + result response.BkbData + ) + + _, money, total = getWithdrawalAmount("", info) + result.Unexamined = money + result.UnexaminedCount = total + return err, result +} + +func GetBkbFundData(info *request.BillFundSearch) (error, response.AdminFundData) { + var ( + err error + money float64 + total int64 + result response.AdminFundData + ) + info.TransactionType = 1 + _, money, total = getBillFundAmount("bkb", info) + result.Expend = money + result.ExpendCount = total + + info.TransactionType = 2 + _, money, total = getBillFundAmount("bkb", info) + result.Recharge = money + result.RechargeCount = total + return err, result +} + +func GetBkbFundList(platform string, info *request.BillFundSearch) (error, []model.AdminBillFund, int64) { + var ( + err error + total int64 + billFundList []model.BillFund + result []model.AdminBillFund + ) + err, billFundList, total = getBillFundList(platform, info) + if err != nil { + return err, result, 0 + } + for i := 0; i < len(billFundList); i++ { + result = append(result, model.AdminBillFund{ + UserID: billFundList[i].UserID, + TransactionType: billFundList[i].TransactionType, + TransactionId: billFundList[i].TransactionId, + Price: billFundList[i].Price, + Remark: billFundList[i].Remark, + RelatedId: billFundList[i].RelatedId, + Status: billFundList[i].Status, + MG_MODEL: billFundList[i].MG_MODEL, + }) + } + return err, result, total +} diff --git a/service/business.go b/service/business.go new file mode 100755 index 0000000..e1722fe --- /dev/null +++ b/service/business.go @@ -0,0 +1,144 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" +) + +// @function: CreateBusiness +// @description: 创建Business记录 +// @param: business model.Business +// @return: err error +func CreateBusiness(business model.SellerStore) (err error) { + err = global.MG_DB.Create(&business).Error + return err +} + +func DeleteBusiness(business model.SellerStore) (err error) { + err = global.MG_DB.Delete(&business).Error + return err +} + +func DeleteBusinessByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Delete(&[]model.SellerStore{}, "id in (?)", ids.Ids).Error + return err +} + +func UpdateBusiness(business model.SellerStore) (err error) { + err = global.MG_DB.Updates(&business).Error + return err +} + +func GetBusiness(id uint) (v response.StoreInfoItem, err error) { + var business model.SellerStore + err = global.MG_DB.Where("id = ?", id).First(&business).Error + if err != nil { + return + } + var ( + wallet model.Wallet + account model.Account + ) + err = global.MG_DB.Model(&model.Wallet{}).Where("user_id=?", business.StoreNo).Find(&wallet).Error + if err != nil { + return v, err + } + err = global.MG_DB.Model(&model.Account{}).Where("user_id=?", business.StoreNo).Find(&account).Error + if err != nil { + return v, err + } + return response.StoreInfoItem{ + ID: business.ID, + StoreNo: business.StoreNo, + Type: business.Type, + Email: business.Email, + Phone: account.Phone, + PapaylName: account.AccountName, + ValidMissionNum: 0, + GoodsNum: 0, + Balance: wallet.Balance, + TransitBalance: wallet.TransitBalance, + }, nil +} + +func GetBusinessInfoList(info request.PageInfo) (list any, total int64, err error) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.SellerStore{}) + var businesss []model.SellerStoreInfo + // 如果有条件搜索 下方会自动创建搜索语句 + err = db.Count(&total).Error + if err != nil { + return + } + err = db.Limit(limit).Offset(offset).Find(&businesss).Error + if err != nil { + return + } + return businesss, total, nil +} + +func SearchBusiness(info request.SearchStore) (list any, total int64, err error) { + var ( + bIds = make([]string, 0) + cIds = make([]string, 0) + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.SellerStore{}) + if info.Email != "" { + db = db.Where("email = ?", info.Email) + } + if info.StoreNo != "" { + db = db.Where("store_no = ?", info.StoreNo) + } + if info.StartAt != "" && info.EndAt != "" { + db = db.Where("created_at between ? and ?", info.StartAt, info.EndAt) + } + var businesss []model.SellerStoreInfo + // 如果有条件搜索 下方会自动创建搜索语句 + err = db.Count(&total).Error + if err != nil { + return + } + err = db.Limit(limit).Offset(offset).Find(&businesss).Error + if err != nil { + return + } + for _, v := range businesss { + bIds = append(bIds, v.StoreNo) + cIds = append(cIds, v.CreateBy) + } + + var users []model.User + err = global.MG_DB.Model(&model.User{}).Where("uuid in (?)", cIds).Find(&users).Error + if err != nil { + return + } + + //上架商品数 + missionCount, err := model.GetMissionCount(bIds) + if err != nil { + return + } + //发布任务数 + goodsCount, err := model.GetGoodsCount(bIds) + if err != nil { + return + } + for k, v := range businesss { + // businesss[k].ReleaseMissionNum = missionCount[v.StoreNo] + businesss[k].ValidMissionNum = missionCount[v.StoreNo] + businesss[k].GoodsNum = goodsCount[v.StoreNo] + for i, _ := range users { + if businesss[k].CreateBy == users[i].UUID.String() { + businesss[k].Phone = users[i].Phone + } + } + } + return businesss, total, err +} diff --git a/service/category.go b/service/category.go new file mode 100644 index 0000000..31e69e1 --- /dev/null +++ b/service/category.go @@ -0,0 +1,233 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +func UpdateCategory(id uint, name string) error { + err := global.MG_DB.Model(&model.TbCategory{}).Where("id = ?", id).Update("name", name).Error + + if err != nil { + return err + } + return nil +} + +type CategoryValue struct { + Id int64 `json:"id"` + Name string `json:"name"` +} + +type CategoryItem struct { + Id int64 `json:"id"` + One CategoryValue `json:"one"` + Two CategoryValue `json:"two"` + Three CategoryValue `json:"three"` + Four CategoryValue `json:"four"` + Five CategoryValue `json:"five"` +} + +func ListCategoryMap() (m map[int64]*model.CategoryParentTree, err error) { + var all []model.TbCategory + m = make(map[int64]*model.CategoryParentTree) + err = global.MG_DB.Model(&model.TbCategory{}).Where("`status` = 1").Order("layer DESC").Find(&all).Error + + if err != nil { + return nil, err + } + + for _, v := range all { + m[int64(v.ID)] = &model.CategoryParentTree{v, nil} + } + return m, nil +} + +func GetCategoryTree(id int64) (vos CategoryItem, err error) { + var v model.TbCategory + db := global.MG_DB.Model(&model.TbCategory{}).Where("`status` = 1").Order("layer DESC") + + err = db.Order("layer DESC").First(&v).Error + if err != nil { + return + } + m, err := ListCategoryMap() + if err != nil { + return + } + + tmps := make([]model.CategoryParentTree, 0) + var cp = model.CategoryParentTree{v, nil} + _ = getCategoryParent(&cp, m) + var item = CategoryItem{ + Id: int64(v.ID), + } + if cp.Parent != nil { + transferCategoryParents(&cp, &tmps) + } else { + item.One = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + } + for _, v := range tmps { + switch v.Layer { + case 5: + item.Five = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 4: + item.Four = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 3: + item.Three = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 2: + item.Two = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 1: + item.One = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + } + } + + return item, nil +} + +func ListCategoryTree(req request.ListCategoryPage) (vos []CategoryItem, total int64, err error) { + offset := req.PageSize * (req.Page - 1) + var list []model.TbCategory + db := global.MG_DB.Model(&model.TbCategory{}).Where("`status` = 1") + + if req.One != ""{ + db = db.Where("name LIKE ? AND layer=1", "%"+req.One+"%") + } + if req.Two != ""{ + db = db.Where("name LIKE ? AND layer=2", "%"+req.Two+"%") + } + if req.Three != ""{ + db = db.Where("name LIKE ? AND layer=3", "%"+req.Three+"%") + } + if req.Four != ""{ + db = db.Where("name LIKE ? AND layer=4", "%"+req.Four+"%") + } + if req.Five != ""{ + db = db.Where("name LIKE ? AND layer=5", "%"+req.Five+"%") + } + err = db.Count(&total).Error + if err != nil { + return nil, 0, err + } + err = db.Offset(offset).Order("id DESC").Limit(req.PageSize).Find(&list).Error + if err != nil { + return nil, 0, err + } + m, err := ListCategoryMap() + if err != nil { + return nil, 0, err + } + + vos = make([]CategoryItem, 0) + + for _, v := range list { + + tmps := make([]model.CategoryParentTree, 0) + var cp = model.CategoryParentTree{v, nil} + _ = getCategoryParent(&cp, m) + var item = CategoryItem{ + Id: int64(v.ID), + } + if cp.Parent != nil { + transferCategoryParents(&cp, &tmps) + } else { + item.One = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + } + for _, v := range tmps { + switch v.Layer { + case 5: + item.Five = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 4: + item.Four = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 3: + item.Three = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 2: + item.Two = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + case 1: + item.One = CategoryValue{ + Id: int64(v.ID), + Name: v.Name, + } + } + } + vos = append(vos, item) + } + + return vos, total, nil +} + +func getCategoryParent(v *model.CategoryParentTree, m map[int64]*model.CategoryParentTree) (err error) { + if v==nil || v.Pid == 0 { + return nil + } + v.Parent = m[int64(v.Pid)] + + err = getCategoryParent(v.Parent, m) + return err +} + +func transferCategoryParents(info *model.CategoryParentTree, list *[]model.CategoryParentTree) { + if info.ID != 0 { + *list = append(*list, *info) + if info.Parent != nil { + transferCategoryParents(info.Parent, list) + } + } +} + +func DeleteCategory(ids []int) error { + var category model.TbCategory + err := global.MG_DB.Where(" id IN (?)", ids).Delete(&category).Error + return err +} + +func CreateCategory(name string, pid, layer int) error { + global.MG_DB.Model(&model.TbCategory{}).Where("id = ?", pid).Update("is_leaf", false) + err := global.MG_DB.Create(&model.TbCategory{ + Name: name, + Layer: layer, + Pid: uint(pid), + IsLeaf: true, + Status: 1, + }).Error + return err +} + +func ListCategoryChildren(pid int) (list []model.TbCategory, err error) { + err = global.MG_DB.Model(&model.TbCategory{}).Where("pid = ?", pid).Find(&list).Error + return list, err +} diff --git a/service/chain.go b/service/chain.go new file mode 100644 index 0000000..3f11d24 --- /dev/null +++ b/service/chain.go @@ -0,0 +1,28 @@ +package service + +import ( + "math/rand" + "pure-admin/model/response" + "pure-admin/utils" + "time" +) + +func GetChainInfo(address string) (error, []response.ChainResp) { + var ( + err error + result []response.ChainResp + ) + now := time.Now() + r := rand.New(rand.NewSource(time.Now().UnixNano())) + for i := 0; i < 3; i++ { + intn := r.Intn(1000) + tmp := response.ChainResp{ + Time: &now, + BlockHeight: 28741283 + int64(intn), + BlockAddress: utils.GetInvitationLowerLen(64), + Hash: utils.GetInvitationLowerLen(64), + } + result = append(result, tmp) + } + return err, result +} diff --git a/service/dict.go b/service/dict.go new file mode 100644 index 0000000..37d4441 --- /dev/null +++ b/service/dict.go @@ -0,0 +1,40 @@ +package service + +import ( + "fmt" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +func GetSysDictDataLabel(typeCode, value string) string { + var res string + + cacheKey := "bkb-admin_sys_dict_labels" + labelKey := fmt.Sprintf("%s_%s", typeCode, value) + res = RedisHashGet(cacheKey, labelKey) + if res == "" { + _ = global.MG_DB.Model(&model.SysDictData{}).Select("label").Where("type_code=? AND `value`=?", typeCode, value).Scan(&res).Error + go RedisHashSet(cacheKey, labelKey, res) + } + return res +} + +func GetSysDictDataList(params request.SearchDictDataParams) (err error, list interface{}) { + var lists []model.SysDictDataView + err = global.MG_DB.Model(&model.SysDictData{}).Where("type_code=? AND `status`='1'", params.TypeCode).Order("sort asc").Find(&lists).Error + return err, lists +} + +func GetSysDictDataListByTypeCode(typeCode string) (list []model.SysDictDataView, err error) { + var lists []model.SysDictDataView + err = global.MG_DB.Model(&model.SysDictData{}).Where("type_code=? AND `status`='1'", typeCode).Order("sort asc").Find(&lists).Error + return lists, err +} + +func checkSysDictData(typeCode, value string) bool { + if GetSysDictDataLabel(typeCode, value) != "" { + return true + } + return false +} diff --git a/service/exa_breakpoint_continue.go b/service/exa_breakpoint_continue.go new file mode 100644 index 0000000..59aeb6f --- /dev/null +++ b/service/exa_breakpoint_continue.go @@ -0,0 +1,57 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + + "gorm.io/gorm" +) + +//@function: FindOrCreateFile +//@description: 上传文件时检测当前文件属性,如果没有文件则创建,有则返回文件的当前切片 +//@param: fileMd5 string, fileName string, chunkTotal int +//@return: err error, file model.ExaFile + +func FindOrCreateFile(fileMd5 string, fileName string, chunkTotal int) (err error, file model.ExaFile) { + var cfile model.ExaFile + cfile.FileMd5 = fileMd5 + cfile.FileName = fileName + cfile.ChunkTotal = chunkTotal + + if errors.Is(global.MG_DB.Where("file_md5 = ? AND is_finish = ?", fileMd5, true).First(&file).Error, gorm.ErrRecordNotFound) { + err = global.MG_DB.Where("file_md5 = ? AND file_name = ?", fileMd5, fileName).Preload("ExaFileChunk").FirstOrCreate(&file, cfile).Error + return err, file + } + cfile.IsFinish = true + cfile.FilePath = file.FilePath + err = global.MG_DB.Create(&cfile).Error + return err, cfile +} + +//@function: CreateFileChunk +//@description: 创建文件切片记录 +//@param: id uint, fileChunkPath string, fileChunkNumber int +//@return: error + +func CreateFileChunk(id uint, fileChunkPath string, fileChunkNumber int) error { + var chunk model.ExaFileChunk + chunk.FileChunkPath = fileChunkPath + chunk.ExaFileID = id + chunk.FileChunkNumber = fileChunkNumber + err := global.MG_DB.Create(&chunk).Error + return err +} + +//@function: DeleteFileChunk +//@description: 删除文件切片记录 +//@param: fileMd5 string, fileName string, filePath string +//@return: error + +func DeleteFileChunk(fileMd5 string, fileName string, filePath string) error { + var chunks []model.ExaFileChunk + var file model.ExaFile + err := global.MG_DB.Where("file_md5 = ? AND file_name = ?", fileMd5, fileName).First(&file).Update("IsFinish", true).Update("file_path", filePath).Error + err = global.MG_DB.Where("exa_file_id = ?", file.ID).Delete(&chunks).Unscoped().Error + return err +} diff --git a/service/exa_excel_parse.go b/service/exa_excel_parse.go new file mode 100644 index 0000000..de499bd --- /dev/null +++ b/service/exa_excel_parse.go @@ -0,0 +1,92 @@ +package service + +import ( + "errors" + "fmt" + "pure-admin/global" + "pure-admin/model" + "strconv" + + "github.com/xuri/excelize/v2" +) + +func ParseInfoList2Excel(infoList []model.SysBaseMenu, filePath string) error { + excel := excelize.NewFile() + excel.SetSheetRow("Sheet1", "A1", &[]string{"ID", "路由Name", "路由Path", "是否隐藏", "父节点", "排序", "文件名称"}) + for i, menu := range infoList { + axis := fmt.Sprintf("A%d", i+2) + excel.SetSheetRow("Sheet1", axis, &[]interface{}{ + menu.ID, + menu.Name, + menu.Path, + menu.Hidden, + menu.ParentId, + menu.Sort, + menu.Component, + }) + } + err := excel.SaveAs(filePath) + return err +} + +func ParseExcel2InfoList() ([]model.SysBaseMenu, error) { + skipHeader := true + fixedHeader := []string{"ID", "路由Name", "路由Path", "是否隐藏", "父节点", "排序", "文件名称"} + file, err := excelize.OpenFile(global.MG_CONFIG.Excel.Dir + "ExcelImport.xlsx") + if err != nil { + return nil, err + } + menus := make([]model.SysBaseMenu, 0) + rows, err := file.Rows("Sheet1") + if err != nil { + return nil, err + } + for rows.Next() { + row, err := rows.Columns() + if err != nil { + return nil, err + } + if skipHeader { + if compareStrSlice(row, fixedHeader) { + skipHeader = false + continue + } else { + return nil, errors.New("Excel格式错误") + } + } + if len(row) != len(fixedHeader) { + continue + } + id, _ := strconv.Atoi(row[0]) + hidden, _ := strconv.ParseBool(row[3]) + sort, _ := strconv.Atoi(row[5]) + menu := model.SysBaseMenu{ + MG_MODEL: global.MG_MODEL{ + ID: uint(id), + }, + Name: row[1], + Path: row[2], + Hidden: hidden, + ParentId: row[4], + Sort: sort, + Component: row[6], + } + menus = append(menus, menu) + } + return menus, nil +} + +func compareStrSlice(a, b []string) bool { + if len(a) != len(b) { + return false + } + if (b == nil) != (a == nil) { + return false + } + for key, value := range a { + if value != b[key] { + return false + } + } + return true +} diff --git a/service/goods.go b/service/goods.go new file mode 100644 index 0000000..2ca7fdc --- /dev/null +++ b/service/goods.go @@ -0,0 +1,111 @@ +package service + +import ( + "time" + + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" +) + +func ListGoods(info request.PageInfo) (list any, total int64, err error) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.TbGoods{}) + + err = db.Count(&total).Error + if err != nil { + return nil, 0, err + } + var res []model.TbGoods4List + err = db.Select("id,title,tags,retail_price,price_min,price_max,stock,sales,online,created_at").Order("id DESC").Limit(limit).Offset(offset).Find(&res).Error + + if err != nil { + return nil, 0, err + } + return res, total, nil +} + +func SearchGoods(info request.SearchGoods) (res any, total int64, err error) { + var ( + bIds = make([]string, 0) + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.TbGoods{}) + if info.Id != 0 { + db = db.Where("id = ?", info.Id) + } + if info.Title != "" { + db = db.Where("title like ?", "%"+info.Title+"%") + } + + //取消账号,使用邮箱搜索 + if info.StoreNo != "" { + //db = db.Where("store_no = ?", info.StoreNo) + db = db.Joins("join seller_store on seller_store.store_no = tb_goods.store_no").Where("seller_store.email like ?", "%"+info.StoreNo+"%") + + } + if info.Status == 1 { // on/off + db = db.Where("online = ?", "on") + } + if info.Status == 2 { // on/off + db = db.Where("stock = 0") + } + if info.Status == 3 { // on/off + db = db.Where("online = ?", "off") + } + err = db.Count(&total).Error + if err != nil { + return nil, 0, err + } + var list []model.TbGoods + err = db.Select("tb_goods.id,title,retail_price,cover,tags,tb_goods.stock,tb_goods.sales,tb_goods.store_no,tb_goods.created_at,tb_goods.price_min,tb_goods.price_max").Order("id DESC").Limit(limit).Offset(offset).Find(&list).Error + + if err != nil { + return nil, 0, err + } + resp := make([]response.Goods, 0) + for _, v := range list { + bIds = append(bIds, v.StoreNo) + resp = append(resp, response.Goods{ + Id: v.ID, + Cover: v.Cover, + Title: v.Title, + RetailPrice: v.RetailPrice, + Tags: v.Tags, + Stock: v.Stock, + Sales: v.Sales, + StoreNo: v.StoreNo, + CreatedAt: v.CreatedAt, + PriceMax: v.PriceMax, + PriceMin: v.PriceMin, + }) + } + // 获取商家信息 + business, err := model.GetBusinessEmail(bIds) + if err != nil { + return nil, 0, err + } + for k, v := range resp { + resp[k].StoreNo = business[v.StoreNo] + } + return resp, total, nil +} + +func GetGoodsVisitCount() (total, yesterday int64) { + global.MG_DB.Model(&model.GoodsVisit{}).Count(&total) + day := time.Now().AddDate(0, 0, -1) + now := time.Now() + global.MG_DB.Model(&model.GoodsVisit{}).Where("created_at BETWEEN ? AND ?", day.Format("2006-01-02 00:00:00"), now.Format("2006-01-02 00:00:00")).Count(&yesterday) + return +} + +func GetGoodsCount() (total, yesterday int64) { + global.MG_DB.Model(&model.TbGoods{}).Count(&total) + day := time.Now().AddDate(0, 0, -1) + now := time.Now() + global.MG_DB.Model(&model.TbGoods{}).Where("created_at BETWEEN ? AND ?", day.Format("2006-01-02 00:00:00"), now.Format("2006-01-02 00:00:00")).Count(&yesterday) + return +} diff --git a/service/influencer_user.go b/service/influencer_user.go new file mode 100644 index 0000000..6d842c0 --- /dev/null +++ b/service/influencer_user.go @@ -0,0 +1,41 @@ +package service + +import ( + "encoding/json" + "errors" + "fmt" + "pure-admin/global" + "pure-admin/model" +) + +func GetInfluencerUserDetail(userID string) (err error, userInfo *model.InfluencerUserDesc) { + var ( + user model.InfluencerUserDesc + platform []model.Platform + dictData []model.SysDictData + ) + err = global.MG_DB.Model(&model.SysDictData{}).Where("type_code=?", "release_channel").Find(&dictData).Error + if err != nil { + return errors.New("获取用户失败"), nil + } + err = global.MG_DB.Model(&model.User{}).Where("uuid=?", userID).Find(&user).Error + if err != nil { + return errors.New("获取用户失败"), nil + } + err = json.Unmarshal([]byte(user.Platform), &platform) + if err != nil { + fmt.Println(err) + } + for j := 0; j < len(platform); j++ { + for k := 0; k < len(dictData); k++ { + if platform[j].Platform == dictData[k].Value { + platform[j].PlatformName = dictData[k].Label + } + + } + } + + user.PlatformStr = platform + //user.TagsStr = tags + return nil, &user +} diff --git a/service/jwt_black_list.go b/service/jwt_black_list.go new file mode 100644 index 0000000..734d610 --- /dev/null +++ b/service/jwt_black_list.go @@ -0,0 +1,53 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "time" + + "gorm.io/gorm" +) + +//@function: JsonInBlacklist +//@description: 拉黑jwt +//@param: jwtList model.JwtBlacklist +//@return: err error + +func JsonInBlacklist(jwtList model.JwtBlacklist) (err error) { + err = global.MG_DB.Create(&jwtList).Error + return +} + +//@function: IsBlacklist +//@description: 判断JWT是否在黑名单内部 +//@param: jwt string +//@return: bool + +func IsBlacklist(jwt string) bool { + err := global.MG_DB.Where("jwt = ?", jwt).First(&model.JwtBlacklist{}).Error + isNotFound := errors.Is(err, gorm.ErrRecordNotFound) + return !isNotFound +} + +//@function: GetRedisJWT +//@description: 从redis取jwt +//@param: userName string +//@return: err error, redisJWT string + +func GetRedisJWT(userName string) (err error, redisJWT string) { + redisJWT, err = global.MG_REDIS.Get(userName).Result() + return err, redisJWT +} + +//@function: SetRedisJWT +//@description: jwt存入redis并设置过期时间 +//@param: jwt string, userName string +//@return: err error + +func SetRedisJWT(jwt string, userName string) (err error) { + // 此处过期时间等于jwt过期时间 + timer := time.Duration(global.MG_CONFIG.JWT.ExpiresTime) * time.Second + err = global.MG_REDIS.Set(userName, jwt, timer).Err() + return err +} diff --git a/service/mission.go b/service/mission.go new file mode 100644 index 0000000..1c45d6d --- /dev/null +++ b/service/mission.go @@ -0,0 +1,1309 @@ +package service + +import ( + "encoding/json" + "errors" + "fmt" + "gorm.io/gorm/clause" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/utils" + "strconv" + "strings" + "time" + + "github.com/gin-gonic/gin" + "gorm.io/gorm" +) + +func GetMissionDetail(id uint) (error, model.MissionDetail) { + var ( + err error + result model.MissionDetail + ) + //err = global.MG_DB.Model(&model.Mission{}). + err = global.MG_DB.Model(&model.MissionDetail{}). + Select("id,title,goods_id,goods_status,num,hire_type,hire_money,hire_ratio,claim_num,start_time,end_time,`status`"). + Where("id = ?", id). + Preload("Goods", func(db *gorm.DB) *gorm.DB { + return db.Select("id,spu_no,title,title_eng,images,retail_price,price_min,price_max,stock,sales,online,created_at,updated_at") + }).Preload("Seller").First(&result).Error + if err != nil { + return err, result + } + switch result.HireType { + case 1: + result.HireMoneyExpect = fmt.Sprintf("%.f", result.HireMoney) + case 2: + result.HireMoneyExpect = fmt.Sprintf("%.f", result.HireRatio) + } + //视频素材 + if result.HasVideo == 1 { + result.ReleaseCountry = GetSysDictDataLabel(model.ReleaseCountryCode, result.VideoCountryId) + var channelNames []string + for _, cid := range strings.Split(result.VideoChannelIds, ",") { + vLabel := GetSysDictDataLabel(model.ReleaseChannelCode, cid) + channelNames = append(channelNames, vLabel) + } + result.ReleaseChannels = strings.Join(channelNames, "/") + } + //任务数 + missionCountParam := request.SearchMission{SellerId: result.CreateBy} + err, result.Seller.ReleaseMissionNum = GetMissionCount(missionCountParam) + missionCountParam.Status = 2 + err, result.Seller.ValidMissionNum = GetMissionCount(missionCountParam) + //任务视频数量 + err, result.VideoClaimNum = GetValidMissionVideoCount(result.ID) + + //todo 结束任务 + + return nil, result +} + +func GetMissionList(info request.SearchMission) (err error, list []model.MissionDetail, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.Mission{}) + if info.SellerId != "" { + db = db.Where("create_by = ?", info.SellerId) + } + + if info.SellerEmail != "" { + db = db.Joins("join seller_store on seller_store.create_by = mission.create_by").Where("seller_store.email like ?", "%"+info.SellerEmail+"%") + } + + if info.HireType > 0 { + db = db.Where("mission.hire_type = ?", info.HireType) + } + + if info.VideoChannelId != "" { + db = db.Where(fmt.Sprintf("find_in_set(%s,video_channel_ids)", info.VideoChannelId)) + } + + if info.Title != "" { + db = db.Where("mission.title LIKE ?", "%"+info.Title+"%") + } + if info.Status != 0 { + db = db.Where("mission.status = ?", info.Status) + } + if info.MissionTime != "" { + var tmpT time.Time + tmpT, err = time.ParseInLocation(utils.DateFormat, info.MissionTime, time.UTC) + if err != nil { + err = errors.New("search mission time format error") + return err, nil, 0 + } + db = db.Where("DATE_FORMAT(start_time,'%Y-%m-%d') <= ? AND end_time >= ?", tmpT, tmpT) + } + + //是否有视频 + switch info.HasVideo { + case 1: + db = db.Where("has_video = 1") + case 2: + db = db.Where("has_video = 0") + } + + err = db.Count(&total).Error + var res []model.MissionDetail + err = db.Select("mission.id,title,goods_id,goods_status,num,hire_type,hire_money,hire_ratio,claim_num,start_time,end_time,mission.`status`,has_video,video_channel_ids,video_country_id,claim_days,mission.create_by,claim_stock,video_url,description,has_sample,sample_num"). + Preload("Goods", func(db *gorm.DB) *gorm.DB { + return db.Select("id,spu_no,title,title_eng,images,retail_price,price_min,price_max,stock,sales,online,created_at,updated_at") + }).Preload("Seller").Order("id DESC").Limit(limit).Offset(offset).Find(&res).Error + if err != nil { + return err, nil, 0 + } + for i := 0; i < len(res); i++ { + //查询订单数 + switch res[i].HireType { + case 1: + res[i].HireMoneyExpect = fmt.Sprintf("视频拍摄%.f美元/单,总共%d笔", res[i].HireMoney, res[i].ClaimStock) + case 2: + res[i].HireMoneyExpect = fmt.Sprintf("订单金额%.f%%", res[i].HireRatio) + } + //发布国家 + if res[i].HasVideo == 1 { + res[i].ReleaseCountry = GetSysDictDataLabel(model.ReleaseCountryCode, res[i].VideoCountryId) + var channelNames []string + for _, cid := range strings.Split(res[i].VideoChannelIds, ",") { + vLabel := GetSysDictDataLabel(model.ReleaseChannelCode, cid) + channelNames = append(channelNames, vLabel) + } + res[i].ReleaseChannels = strings.Join(channelNames, "/") + } + //任务视频数量 + _, res[i].VideoClaimNum = GetValidMissionVideoCount(res[i].ID) + res[i].Tags = GetTagNamesByRelation(strconv.Itoa(int(res[i].ID)), "01") + } + return err, res, total +} + +func GetMissionCount(info request.SearchMission) (err error, total int64) { + db := global.MG_DB.Model(&model.Mission{}) + if info.SellerId != "" { + db = db.Where("create_by = ?", info.SellerId) + } + if info.Status != 0 { + db = db.Where("status = ?", info.Status) + } + err = db.Count(&total).Error + + return err, total +} + +func GetValidMissionVideoCount(missionId uint) (err error, total int64) { + db := global.MG_DB.Model(&model.MissionClaimVideo{}) + db = db.Where("mission_id = ?", missionId) + err = db.Count(&total).Error + + return err, total +} + +func GetMissionVideoList(info request.SearchMissionVideo) (err error, list []response.MissionVideoResponse, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.MissionClaimVideo{}). + Joins("inner join mission on mission.id = mission_claim_video.mission_id") + //Where("mission_claim_video.status = 2")//审核通过状态 + if info.VideoStatus != 0 { + db = db.Where("mission_claim_video.status = ?", info.VideoStatus) + } + + if info.SellerId != "" { + db = db.Where("mission.create_by = ?", info.SellerId) + } + + if info.SellerEmail != "" { + db = db.Joins("join seller_store on seller_store.create_by = mission.create_by").Where("seller_store.email like ?", "%"+info.SellerEmail+"%") + } + + if info.MissionClaimBy != "" { + db = db.Where("mission_claim_video.create_by = ?", info.MissionClaimBy) + } + + if info.SourceType != 0 { + db = db.Where("mission_claim_video.source_type = ?", info.SourceType) + } + + if info.HireType > 0 { + db = db.Where("mission.hire_type = ?", info.HireType) + } + + if info.Title != "" { + db = db.Where("mission.title LIKE ?", "%"+info.Title+"%") + } + if info.Status != 0 { + db = db.Where("mission.status = ?", info.Status) + } + if info.MissionId != 0 { + db = db.Where("mission.id = ?", info.MissionId) + } + + err = db.Count(&total).Error + var res []model.MissionClaimVideoDetail + + err = db.Preload("Mission", func(db *gorm.DB) *gorm.DB { + return db.Select("id,title,goods_id,goods_status,num,hire_type,hire_money,hire_ratio,claim_num,start_time,end_time,`status`,has_video,video_channel_ids,video_country_id,claim_days,create_by,claim_stock"). + Preload("Goods", func(db *gorm.DB) *gorm.DB { + return db.Select("id,spu_no,title,title_eng,images,retail_price,price_min,price_max,stock,sales,online,created_at,updated_at") + }).Preload("Seller") + }).Preload("Influencer", func(db *gorm.DB) *gorm.DB { + return db.Select("uuid,nick_name,phone") + }).Order("id DESC").Limit(limit).Offset(offset).Find(&res).Error + + if err != nil { + return err, nil, 0 + } + for i := 0; i < len(res); i++ { + //查询订单数 + switch res[i].Mission.HireType { + case 1: + res[i].Mission.HireMoneyExpect = fmt.Sprintf("视频拍摄%.f美元/单,总共%d笔", res[i].Mission.HireMoney, res[i].Mission.ClaimStock) + case 2: + res[i].Mission.HireMoneyExpect = fmt.Sprintf("订单金额%.f%%", res[i].Mission.HireRatio) + } + //发布国家 + if res[i].Mission.HasVideo == 1 { + res[i].Mission.ReleaseCountry = GetSysDictDataLabel(model.ReleaseCountryCode, res[i].Mission.VideoCountryId) + var channelNames []string + for _, cid := range strings.Split(res[i].Mission.VideoChannelIds, ",") { + vLabel := GetSysDictDataLabel(model.ReleaseChannelCode, cid) + channelNames = append(channelNames, vLabel) + } + res[i].Mission.ReleaseChannels = strings.Join(channelNames, "/") + } + + //精简字段赋值 + vRes := response.MissionVideoResponse{ + ID: res[i].ID, + SourceType: res[i].SourceType, + MissionVideoCommonData: response.MissionVideoCommonData{ + MissionId: res[i].MissionId, + VideoUrl: res[i].VideoUrl, + Cover: res[i].Cover, + Title: res[i].Mission.Title, + GoodsTitle: res[i].Mission.Goods.Title, + Influencer: res[i].Influencer, + Tag: "", + MissionStatus: res[i].Mission.Status, + StartTime: res[i].Mission.StartTime, + EndTime: res[i].Mission.EndTime, + HireType: res[i].Mission.HireType, + HireMoney: res[i].Mission.HireMoney, + HireRatio: res[i].Mission.HireRatio, + HireMoneyExpect: res[i].Mission.HireMoneyExpect, + ReleaseCountry: res[i].Mission.ReleaseCountry, + ReleaseChannels: res[i].Mission.ReleaseChannels, + Seller: res[i].Mission.Seller, + }, + } + vRes.MissionVideoCommonData.Tag = GetTagNamesByRelation(strconv.Itoa(int(vRes.ID)), "02") + list = append(list, vRes) + } + return err, list, total +} + +func AddMissionVideo(uuid string, info request.AddMissionVideo) (err error) { + var ( + mission model.Mission + claimVideo model.MissionClaimVideo + tagCheck model.Tags + tagRelation model.TagRelation + ) + err = global.MG_DB.Model(&model.Mission{}).Where("id = ?", info.MissionId).First(&mission).Error + if err != nil { + err = errors.New("not found mission record") + return err + } + + claimVideo.MissionClaimId = 0 + claimVideo.VideoUrl = info.VideoUrl + claimVideo.Cover = info.Cover + claimVideo.Status = 2 //审核已通过 + claimVideo.SourceType = 3 //后台上传 + claimVideo.MissionId = info.MissionId //任务ID + claimVideo.CreateBy = uuid //创建者ID + + tx := global.MG_DB.Begin() + err = tx.Model(&model.MissionClaimVideo{}).Create(&claimVideo).Error + if err != nil { + tx.Rollback() + return err + } + //打标签 + if info.TagId != 0 { + err = global.MG_DB.Model(&model.Tags{}).Where("id = ?", info.TagId).First(&tagCheck).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + tx.Rollback() + return err + } + + tagRelation = model.TagRelation{ + TagId: info.TagId, + RelationId: strconv.Itoa(int(claimVideo.ID)), + RelationType: "02", + CreateBy: uuid, + UpdateBy: uuid, + } + err = tx.Model(&model.TagRelation{}).Create(&tagRelation).Error + if err != nil { + tx.Rollback() + return errors.New("绑定标签失败") + } + + } + tx.Commit() + + return err +} + +func EditMissionVideo(uuid string, info request.EditMissionVideo) (err error) { + var ( + check model.MissionClaimVideo + claimVideo model.MissionClaimVideo + tagCheck model.Tags + tagRelation model.TagRelation + ) + err = global.MG_DB.Model(&model.MissionClaimVideo{}).Where("id = ?", info.ID).First(&check).Error + if err != nil { + err = errors.New("not found record") + return err + } + + tx := global.MG_DB.Begin() + claimVideo.MissionClaimId = 0 + claimVideo.VideoUrl = info.VideoUrl + claimVideo.Cover = info.Cover + claimVideo.Status = 2 //2 + claimVideo.SourceType = 3 //后台上传 + claimVideo.UpdateBy = uuid //创建者ID + err = tx.Model(&model.MissionClaimVideo{}).Where("id = ?", info.ID).Updates(claimVideo).Error + if err != nil { + tx.Rollback() + return err + } + //打标签 + if info.TagId != 0 { + err = global.MG_DB.Model(&model.Tags{}).Where("id = ?", info.TagId).First(&tagCheck).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + tx.Rollback() + return err + } + err = tx.Model(&model.TagRelation{}).Where("relation_type= ? and relation_id = ?", "02", info.ID).Delete(&model.TagRelation{}).Error + if err != nil { + tx.Rollback() + return err + } + tagRelation = model.TagRelation{ + TagId: info.TagId, + RelationId: strconv.Itoa(int(info.ID)), + RelationType: "02", + CreateBy: uuid, + UpdateBy: uuid, + } + + err = tx.Model(&model.TagRelation{}).Create(&tagRelation).Error + if err != nil { + tx.Rollback() + return errors.New("绑定标签失败") + } + + } + tx.Commit() + + return err +} + +func AddMissionRecommend(q *request.AddMissionRecommend, userID string) error { + //添加任务推荐,倒序排序 + var ( + err error + repeat model.MissionRecommend + maxSort int64 + ) + + for _, y := range q.List { + repeat = model.MissionRecommend{} + global.MG_DB.Model(&model.MissionRecommend{}).Where("relation_id=?", y.RelationId).Find(&repeat) + if repeat.ID != 0 { + break + } + } + if repeat.ID != 0 { + return errors.New("已添加该任务") + } + err, maxSort = GetMissionRecommendMaxSort() + + //global.MG_DB.Model(&model.BsXzPageTemp{}).Where("date_id=?", q.List[0].DateId).Order("sort desc").Limit(1).Find(&data) + for x, _ := range q.List { + q.List[x].ID = 0 + q.List[x].Sort = int(maxSort) + len(q.List) - x + q.List[x].CreateBy = userID + q.List[x].UpdateBy = userID + } + tx := global.MG_DB.Begin() + + err = tx.Model(&model.MissionRecommend{}).Create(&(q.List)).Error + if err != nil { + tx.Rollback() + return errors.New("添加关联关系失败") + } + tx.Commit() + + return nil +} + +func GetMissionRecommendMaxSort() (err error, total int64) { + db := global.MG_DB.Model(&model.MissionRecommend{}).Select("IFNULL(MAX(sort),0)") + err = db.Scan(&(total)).Error + return +} + +func DeleteMissionRecommendByIds(ids request.IdsUReq) (err error) { + err = global.MG_DB.Model(model.MissionRecommend{}).Where("id in (?)", ids.Ids).Unscoped().Delete(&model.MissionRecommend{}).Error + if err != nil { + return errors.New("删除失败") + } + + return err +} + +func MissionRecommendUpData(info request.IdReq, c *gin.Context) error { + var ( + err error + idList []global.BASE_ID_SORT + ) + + err, idList = GetMissionRecommendSortList() + if err != nil { + return err + } + for i := 1; i < len(idList); i++ { + if idList[i].ID == info.ID { + sort := idList[i].Sort + if idList[i-1].Sort == idList[i].Sort { + idList[i].Sort += 1 + } else { + idList[i].Sort = idList[i-1].Sort + } + + var tmp = make([]global.BASE_ID_SORT, 0) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i].ID, Sort: idList[i].Sort}) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i-1].ID, Sort: sort}) + err = updateMissionRecommendSort(tmp) + if err != nil { + return err + } + break + } + } + + return err +} + +func MissionRecommendDownData(info request.IdReq, c *gin.Context) error { + var ( + err error + idList []global.BASE_ID_SORT + ) + + err, idList = GetMissionRecommendSortList() + if err != nil { + return err + } + for i := 0; i < len(idList); i++ { + if idList[i].ID == info.ID && i < len(idList)-1 { + sort := idList[i].Sort + if idList[i+1].Sort == idList[i].Sort { + idList[i].Sort -= 1 + } else { + idList[i].Sort = idList[i+1].Sort + } + + var tmp = make([]global.BASE_ID_SORT, 0) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i].ID, Sort: idList[i].Sort}) + tmp = append(tmp, global.BASE_ID_SORT{ID: idList[i+1].ID, Sort: sort}) + err = updateMissionRecommendSort(tmp) + if err != nil { + return err + } + break + } + } + return err +} + +func GetMissionRecommendSortList() (err error, list []global.BASE_ID_SORT) { + db := global.MG_DB.Model(&model.MissionRecommend{}) + + var idList []global.BASE_ID_SORT + err = db.Select("id,sort").Order("sort desc").Order("id desc").Find(&idList).Error + return err, idList +} + +func updateMissionRecommendSort(idList []global.BASE_ID_SORT) error { + var err error + for _, val := range idList { + //_ = UpdateMissionRecommendSort(val) + _ = global.MG_DB.Model(&model.MissionRecommend{}).Where("id=?", val.ID).Update("sort", val.Sort).Error + } + return err +} + +func UpdateMissionRecommendSort(val global.BASE_ID_SORT) error { + var err error + _ = global.MG_DB.Model(&model.MissionRecommend{}).Where("id=?", val.ID).Update("sort", val.Sort).Error + return err +} + +func GetMissionRecommendList(info request.SearchMission) (err error, list []response.MissionRecommendResponse, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.MissionRecommendDetail{}). + Joins("inner join mission_claim_video on mission_recommend.relation_id = mission_claim_video.id"). + Joins("inner join mission on mission.id = mission_claim_video.mission_id"). + Where("mission_claim_video.status = 2"). //审核通过状态 + Order("mission_recommend.sort desc") + + if info.SellerId != "" { + db = db.Where("mission.create_by = ?", info.SellerId) + } + + if info.SellerEmail != "" { + db = db.Joins("join seller_store on seller_store.create_by = mission.create_by").Where("seller_store.email like ?", "%"+info.SellerEmail+"%") + } + + if info.HireType > 0 { + db = db.Where("mission.hire_type = ?", info.HireType) + } + + if info.Title != "" { + db = db.Where("mission.title LIKE ?", "%"+info.Title+"%") + } + if info.Status != 0 { + db = db.Where("mission.status = ?", info.Status) + } + if info.MissionId != 0 { + db = db.Where("mission.id = ?", info.MissionId) + } + + err = db.Count(&total).Error + var res []model.MissionRecommendDetail + + err = db.Preload("MissionVideo", func(db *gorm.DB) *gorm.DB { + return db.Preload("Mission", func(db *gorm.DB) *gorm.DB { + return db.Select("id,title,goods_id,goods_status,num,hire_type,hire_money,hire_ratio,claim_num,start_time,end_time,`status`,has_video,video_channel_ids,video_country_id,claim_days,create_by,claim_stock"). + Preload("Goods", func(db *gorm.DB) *gorm.DB { + return db.Select("id,spu_no,title,title_eng,images,retail_price,price_min,price_max,stock,sales,online,created_at,updated_at") + }).Preload("Seller") + }).Preload("Influencer", func(db *gorm.DB) *gorm.DB { + return db.Select("uuid,nick_name,phone") + }) + }).Order("id DESC").Limit(limit).Offset(offset).Find(&res).Error + + if err != nil { + return err, nil, 0 + } + for i := 0; i < len(res); i++ { + //查询订单数 + switch res[i].MissionVideo.Mission.HireType { + case 1: + res[i].MissionVideo.Mission.HireMoneyExpect = fmt.Sprintf("视频拍摄%.f美元/单,总共%d笔", res[i].MissionVideo.Mission.HireMoney, res[i].MissionVideo.Mission.ClaimStock) + case 2: + res[i].MissionVideo.Mission.HireMoneyExpect = fmt.Sprintf("订单金额%.f%%", res[i].MissionVideo.Mission.HireRatio) + } + //发布国家 + if res[i].MissionVideo.Mission.HasVideo == 1 { + res[i].MissionVideo.Mission.ReleaseCountry = GetSysDictDataLabel(model.ReleaseCountryCode, res[i].MissionVideo.Mission.VideoCountryId) + var channelNames []string + for _, cid := range strings.Split(res[i].MissionVideo.Mission.VideoChannelIds, ",") { + vLabel := GetSysDictDataLabel(model.ReleaseChannelCode, cid) + channelNames = append(channelNames, vLabel) + } + res[i].MissionVideo.Mission.ReleaseChannels = strings.Join(channelNames, "/") + } + //精简字段赋值 + vRes := response.MissionRecommendResponse{ + SortIndex: offset + 1 + i, + MissionRecommend: res[i].MissionRecommend, + MissionVideoCommonData: response.MissionVideoCommonData{ + MissionId: res[i].MissionVideo.MissionId, + VideoUrl: res[i].MissionVideo.VideoUrl, + Cover: res[i].MissionVideo.Cover, + Title: res[i].MissionVideo.Mission.Title, + GoodsTitle: res[i].MissionVideo.Mission.Goods.Title, + Influencer: res[i].MissionVideo.Influencer, + Tag: "", + MissionStatus: res[i].MissionVideo.Mission.Status, + StartTime: res[i].MissionVideo.Mission.StartTime, + EndTime: res[i].MissionVideo.Mission.EndTime, + HireType: res[i].MissionVideo.Mission.HireType, + HireMoney: res[i].MissionVideo.Mission.HireMoney, + HireRatio: res[i].MissionVideo.Mission.HireRatio, + HireMoneyExpect: res[i].MissionVideo.Mission.HireMoneyExpect, + ReleaseCountry: res[i].MissionVideo.Mission.ReleaseCountry, + ReleaseChannels: res[i].MissionVideo.Mission.ReleaseChannels, + Seller: res[i].MissionVideo.Mission.Seller, + }, + } + vRes.Status = res[i].MissionVideo.Mission.Status + vRes.MissionVideoCommonData.Tag = GetTagNamesByRelation(strconv.Itoa(int(vRes.MissionRecommend.RelationId)), "02") + list = append(list, vRes) + } + + return err, list, total +} + +// 任务视频审核详情 +func GetMissionClaimVideoDetail(id uint) (err error, data response.MissionClaimVideoDetail) { + var ( + claimVideo model.MissionClaimVideo + missionClaimDetail model.MissionClaimDetail + influencerUser *model.InfluencerUserDesc + ) + + err = global.MG_DB.Model(&model.MissionClaimVideo{}).Where("id = ?", id).First(&claimVideo).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return gorm.ErrRecordNotFound, data + } + + db := global.MG_DB.Model(&model.MissionClaim{}). + Joins("INNER JOIN mission ON mission.id = mission_claim.mission_id"). + Where("mission_claim.id = ?", claimVideo.MissionClaimId) + + err = db.Select("mission_claim.id,mission_id,mission_claim.claim_no,mission_claim.achieve_num,mission_claim.`status`,mission_claim.created_at,mission_claim.updated_at,mission_claim.expire_at,mission_claim.create_by"). + Preload("Order", func(db *gorm.DB) *gorm.DB { + return db.Select("order_id,mission_claim_id,`status`,courier,courier_url,courier_number,send_time"). + Preload("OrderGoods", func(db *gorm.DB) *gorm.DB { + return db.Select("order_id,price,sku_no,title,image,specs,id") + }) + }). + Preload("Mission", func(db *gorm.DB) *gorm.DB { + return db. + Select("id,title,goods_id,goods_status,num,hire_type,hire_money,hire_ratio,start_time,end_time,`status`,create_by,claim_days,claim_num,claim_stock,has_video,video_url,video_channel_ids,video_country_id,claim_days,create_by,claim_stock"). + Preload("Goods", func(db *gorm.DB) *gorm.DB { + return db.Select("id,spu_no,title,title_eng,images,tags,retail_price,price_min,price_max,status").Unscoped() + }) + }).First(&missionClaimDetail).Error + + if err != nil { + return err, data + } + + err, influencerUser = GetInfluencerUserDetail(missionClaimDetail.CreateBy) + data.InfluencerUser = *influencerUser + data.ClaimVideo = claimVideo + data.MissionClaim = response.MissionClaimInfo{ + MissionId: missionClaimDetail.MissionId, + Title: missionClaimDetail.Mission.Title, + ClaimAt: missionClaimDetail.CreatedAt, + HireType: missionClaimDetail.Mission.HireType, + HireMoney: missionClaimDetail.Mission.HireMoney, + HireRatio: missionClaimDetail.Mission.HireRatio, + HireMoneyExpect: utils.FormatFloatToString(missionClaimDetail.Order.OrderGoods.Price), + StartTime: missionClaimDetail.Mission.StartTime, + EndTime: missionClaimDetail.Mission.EndTime, + Status: missionClaimDetail.Status, + ClaimNum: missionClaimDetail.Mission.ClaimNum, + ClaimStock: missionClaimDetail.Mission.ClaimStock, + OrderNum: missionClaimDetail.Mission.OrderNum, + ClaimDays: missionClaimDetail.Mission.ClaimDays, + ClaimDemands: missionClaimDetail.Mission.ClaimDemands, + Description: missionClaimDetail.Mission.Description, + Sample: missionClaimDetail.Mission.Sample, + VideoMaterial: missionClaimDetail.Mission.VideoMaterial, + ReleaseCountry: "", + ReleaseChannels: "", + } + + //发布国家 + if data.MissionClaim.HasVideo == 1 { + data.MissionClaim.ReleaseCountry = GetSysDictDataLabel(model.ReleaseCountryCode, data.MissionClaim.VideoCountryId) + var channelNames []string + for _, cid := range strings.Split(data.MissionClaim.VideoChannelIds, ",") { + vLabel := GetSysDictDataLabel(model.ReleaseChannelCode, cid) + channelNames = append(channelNames, vLabel) + } + data.MissionClaim.ReleaseChannels = strings.Join(channelNames, "/") + } + + data.ClaimGoods = response.MissionClaimGoods{ + GoodsId: missionClaimDetail.Mission.GoodsId, + OrderId: missionClaimDetail.Order.OrderID, + SpuNo: missionClaimDetail.Mission.Goods.SpuNo, + Title: missionClaimDetail.Mission.Goods.Title, + TitleEng: missionClaimDetail.Mission.Goods.TitleEng, + Sales: 0.0, + Sales30: 0.0, + Status: missionClaimDetail.Mission.Goods.Status, + Specs: missionClaimDetail.Order.OrderGoods.Specs, + SkuNo: missionClaimDetail.Order.OrderGoods.SkuNo, + Stock: missionClaimDetail.Mission.Goods.Stock, + Price: missionClaimDetail.Order.OrderGoods.Price, + Image: missionClaimDetail.Order.OrderGoods.Image, + Tags: missionClaimDetail.Mission.Goods.Tags, + } + + //查询销量 + totalSales := GetMissionClaimSales(missionClaimDetail.ClaimNo, nil, nil) + + endTime, _ := time.Parse(utils.DateFormat, time.Now().Format(utils.DateFormat)) + startTime := endTime.AddDate(0, 0, -29) + sales30 := GetMissionClaimSales(missionClaimDetail.ClaimNo, &startTime, &endTime) + data.ClaimGoods.Sales = totalSales.Sales + data.ClaimGoods.Sales30 = sales30.Sales + + return err, data +} + +func GetMissionClaimSales(claimNo string, startTime, endTime *time.Time) (result model.OrderSummary) { + var ( + err error + ) + db := global.MG_DB.Model(&model.Order{}).Joins("INNER JOIN mission_claim ON mission_claim.claim_no = `order`.code"). + Where("`order`.`status` IN (2,3,4) ").Where("`order`.code = ?", claimNo) + if startTime != nil && !startTime.IsZero() { + db = db.Where("`order`.pay_time >= ?", startTime) + } + if endTime != nil && !endTime.IsZero() { + db = db.Where("`order`.pay_time >= ?", startTime) + } + err = db.Select("`order`.code,COUNT(1) as count,sum(paid_price) as sales").Find(&result).Error + fmt.Println(result) + if err != nil { + return + } + + return +} + +func StopMission(uuid string, info request.IdReq) (err error) { + var ( + checkStop, missionStop model.MissionStop + ) + + err = global.MG_DB.Model(&model.MissionStop{}).Where("id = ? and status = 1", info.ID).First(&checkStop).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return err + } + + tx := global.MG_DB.Begin() + err = global.MG_DB.Model(&model.Mission{}).Where("id = ? AND create_by = ?", checkStop.MissionId, checkStop.CreateBy).Update("status", 3).Update("end_time", time.Now()).Error + if err != nil { + tx.Rollback() + return err + } + missionStop = model.MissionStop{ + Status: 2, + AuditBy: uuid, + } + err = global.MG_DB.Model(&model.MissionStop{}). + Where("id = ?", info.ID).Updates(missionStop).Error + if err != nil { + tx.Rollback() + return err + } + + //清除任务定时 + _, _ = global.MG_REDIS.Del(fmt.Sprintf("mission_start_%v", info.ID), fmt.Sprintf("mission_stop_%v", info.ID)).Result() + tx.Commit() + + return err +} + +func GetMissionStopList(info request.SearchStopMission) (err error, list []response.MissionStopData, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.MissionStopDetail{}). + Joins("inner join mission on mission.id = mission_stop.mission_id") + + if info.AuditStatus != 0 { + if info.AuditStatus == 4 { + //已审核=审核通过+审核不通过 + db = db.Where("mission_stop.status in (2,3)") + } else { + db = db.Where("mission_stop.status = ?", info.AuditStatus) + } + } + + if info.SellerId != "" { + db = db.Where("mission.create_by = ?", info.SellerId) + } + + if info.SellerEmail != "" { + db = db.Joins("join seller_store on seller_store.create_by = mission.create_by").Where("seller_store.email like ?", "%"+info.SellerEmail+"%") + } + + if info.HireType > 0 { + db = db.Where("mission.hire_type = ?", info.HireType) + } + + if info.Title != "" { + db = db.Where("mission.title LIKE ?", "%"+info.Title+"%") + } + if info.Status != 0 { + db = db.Where("mission.status = ?", info.Status) + } + if info.MissionId != 0 { + db = db.Where("mission.id = ?", info.MissionId) + } + + if info.VideoChannelId != "" { + db = db.Where("find_in_set(?,mission.video_channel_ids)", info.VideoChannelId) + } + + err = db.Count(&total).Error + var res []model.MissionStopDetail + + err = db.Preload("Mission", func(db *gorm.DB) *gorm.DB { + return db.Select("id,title,goods_id,goods_status,num,hire_type,hire_money,hire_ratio,claim_num,start_time,end_time,`status`,has_video,video_channel_ids,video_country_id,claim_days,create_by,claim_stock,has_sample,description,sample_num"). + Preload("Goods", func(db *gorm.DB) *gorm.DB { + return db.Select("id,spu_no,title,title_eng,images,retail_price,price_min,price_max,stock,sales,online,created_at,updated_at") + }).Preload("Seller") + }).Order("mission_stop.id DESC").Limit(limit).Offset(offset).Find(&res).Error + + if err != nil { + return err, nil, 0 + } + for i := 0; i < len(res); i++ { + //精简字段赋值 + vCommon := formatMissionCommonData(res[i].Mission) + vRes := response.MissionStopData{ + Remark: res[i].Remark, + ID: res[i].ID, + MissionCommonData: vCommon, + Goods: res[i].Mission.Goods, + } + list = append(list, vRes) + } + + return err, list, total +} + +func GetMissionStopDetail(info request.IdReq) (err error, data response.MissionStopData) { + var ( + missionStop model.MissionStop + ) + err = global.MG_DB.Model(&model.MissionStopDetail{}). + Where("id = ?", info.ID).First(&missionStop).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return err, data + } + + var res model.MissionDetail + + err = global.MG_DB.Select("id,title,goods_id,goods_status,num,hire_type,hire_money,hire_ratio,claim_num,start_time,end_time,`status`,has_video,video_channel_ids,video_country_id,claim_days,create_by,claim_stock"). + Preload("Goods", func(db *gorm.DB) *gorm.DB { + return db.Select("id,spu_no,title,title_eng,images,retail_price,price_min,price_max,stock,sales,online,created_at,updated_at") + }).Preload("Seller").First(&res).Error + + if err != nil { + return err, data + } + //精简字段赋值 + vCommon := formatMissionCommonData(res) + data = response.MissionStopData{ + Remark: missionStop.Remark, + ID: missionStop.ID, + MissionCommonData: vCommon, + } + + return err, data +} + +func formatMissionCommonData(mission model.MissionDetail) response.MissionCommonData { + //查询订单数 + switch mission.HireType { + case 1: + mission.HireMoneyExpect = fmt.Sprintf("视频拍摄%.f美元/单,总共%d笔", mission.HireMoney, mission.ClaimStock) + case 2: + mission.HireMoneyExpect = fmt.Sprintf("订单金额%.f%%", mission.HireRatio) + } + //发布国家 + mission.ReleaseCountry = GetSysDictDataLabel(model.ReleaseCountryCode, mission.VideoCountryId) + var channelNames []string + for _, cid := range strings.Split(mission.VideoChannelIds, ",") { + vLabel := GetSysDictDataLabel(model.ReleaseChannelCode, cid) + channelNames = append(channelNames, vLabel) + } + + mission.ReleaseChannels = strings.Join(channelNames, "/") + //精简字段赋值 + vCommon := response.MissionCommonData{ + MissionId: mission.ID, + Title: mission.Title, + GoodsTitle: mission.Goods.Title, + Tag: "", + MissionStatus: mission.Status, + StartTime: mission.StartTime, + EndTime: mission.EndTime, + HireType: mission.HireType, + HireMoney: mission.HireMoney, + HireRatio: mission.HireRatio, + HireMoneyExpect: mission.HireMoneyExpect, + ReleaseCountry: mission.ReleaseCountry, + ReleaseChannels: mission.ReleaseChannels, + ClaimNum: mission.ClaimNum, + Seller: mission.Seller, + HasVideo: mission.HasVideo, + HasSample: mission.HasSample, + Description: mission.Description, + SampleNum: mission.SampleNum, + } + return vCommon +} + +func getMissionClaim(claimNo string) (model.MissionClaim, error) { + var ( + err error + result model.MissionClaim + ) + err = global.MG_DB.Model(&model.MissionClaim{}).Where("claim_no = ?", claimNo).First(&result).Error + return result, err +} + +func GetMissionClaimList(info request.SearchMissionClaim) (err error, list []response.MissionClaimSimpleData, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.MissionClaim{}). + Joins("INNER JOIN mission ON mission.id = mission_claim.mission_id") + if info.MissionId != 0 { + db = db.Where("mission.id = ?", info.MissionId) + } + if info.Status != 0 { + db = db.Where("mission_claim.`status` = ?", info.Status) + } + if info.Uuid != "" { + db = db.Where("mission_claim.create_by = ?", info.Uuid) + } + + if info.Title != "" { + db = db.Where("mission.title LIKE ?", "%"+info.Title+"%") + } + + err = db.Count(&total).Error + var res []model.MissionClaimDetail + err = db.Select("mission_claim.id,mission_claim.mission_id,mission_claim.claim_no,mission_claim.achieve_num,mission_claim.`status`,mission_claim.create_by,mission_claim.created_at,mission_claim.updated_at"). + Preload("Mission", func(db *gorm.DB) *gorm.DB { + return db.Select("title,id,video_url,has_video,hire_type,hire_ratio,hire_money,start_time,end_time") + }).Preload("Video").Limit(limit).Offset(offset).Find(&res).Error + if err != nil { + return err, nil, 0 + } + + for i := 0; i < len(res); i++ { + vClaim := response.MissionClaimSimpleData{ + Video: res[i].Video, + MissionId: res[i].MissionId, + MissionTitle: res[i].Mission.Title, + ClaimAt: res[i].CreatedAt, + ClaimDays: res[i].Mission.ClaimDays, + HireType: res[i].Mission.HireType, + VideoUrl: res[i].Mission.VideoUrl, + HasVideo: res[i].Mission.HasVideo, + SignUrl: "", + } + vClaim.ClaimNo = res[i].ClaimNo + vClaim.MissionClaim.ID = res[i].ID + list = append(list, vClaim) + } + + return err, list, total +} + +func getMissionClaimList(info *request.SearchMissionClaim) (error, []model.MissionClaim) { + var ( + err error + result []model.MissionClaim + ) + db := global.MG_DB.Model(&model.MissionClaim{}) + if info.CreateBy != "" { + db = db.Where("create_by = ?", info.CreateBy) + } + if info.MissionId != 0 { + db = db.Where("mission_id = ?", info.MissionId) + } + if info.Status != 0 { + db = db.Where("`status` = ?", info.Status) + } + err = db.Find(&result).Error + return err, result +} + +func CreateMissionTagRelation(params request.CreateMissionTagRelation, uuid string) (err error) { + var ( + data []model.TagRelation + check []model.Tags + ) + err = global.MG_DB.Model(&model.Tags{}).Where("id in (?)", params.TagId).Find(&check).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return err + } + if len(check) != len(params.TagId) { + return errors.New("标签不存在") + } + tx := global.MG_DB.Begin() + err = tx.Model(&model.TagRelation{}).Where("tag_id in (?) and relation_id = ? and relation_type = ?", params.TagId, params.RelationId, params.RelationType).Delete(&model.TagRelation{}).Error + if err != nil { + tx.Rollback() + return err + } + for _, v := range params.TagId { + data = append(data, model.TagRelation{ + TagId: v, + RelationId: params.RelationId, + RelationType: params.RelationType, + CreateBy: uuid, + UpdateBy: uuid, + }) + } + err = tx.Model(&model.TagRelation{}).Create(&data).Error + if err != nil { + return errors.New("提交失败") + } + tx.Commit() + return err +} + +func GetInfluencerSummaryList(params request.InfluencerSummaryListParam) (err error, list []model.MissionClaimSummary, total int64) { + var ( + res []model.MissionClaimSummary + uids []string + influencerMap map[string]model.UserSimple + summary model.Sum + ) + limit := params.PageSize + offset := params.PageSize * (params.Page - 1) + db := global.MG_DB.Model(&model.MissionClaim{}) + + if params.Uuid != "" { + db = db.Where("create_by = ?", params.Uuid) + } + err = db.Select("count(distinct create_by) as total_count").First(&summary).Error + total = summary.TotalCount + + db = db.Group("create_by") + err = db.Select("count(1) as count,min(created_at) as first_claim_at,create_by").Limit(limit).Offset(offset).Find(&res).Error + + for i := 0; i < len(res); i++ { + uids = append(uids, res[i].CreateBy) + } + if len(uids) > 0 { + var influencerList []model.UserSimple + influencerMap = map[string]model.UserSimple{} + influencerList, err = getUserSimpleList("influencer", uids) + if err != nil { + return errors.New("获取网红信息失败"), list, total + } + for i, user := range influencerList { + if user.Platform != "" { + var vPlatform []model.Platform + json.Unmarshal([]byte(user.Platform), &vPlatform) + influencerList[i].Platforms = vPlatform + } + + influencerMap[user.UUID.String()] = influencerList[i] + } + } + for i := 0; i < len(res); i++ { + if _, ok := influencerMap[res[i].CreateBy]; ok { + res[i].Influencer = model.InfluencerUserView{ + UUID: influencerMap[res[i].CreateBy].UUID.String(), + NickName: influencerMap[res[i].CreateBy].NickName, + Phone: influencerMap[res[i].CreateBy].Phone, + } + var vPlatforms []string + for _, vp := range influencerMap[res[i].CreateBy].Platforms { + vPlatforms = append(vPlatforms, vp.Platform) + } + res[i].Platform = strings.Join(vPlatforms, "/") + } + _, claims := getMissionClaimList(&request.SearchMissionClaim{CreateBy: res[i].CreateBy}) + if len(claims) != 0 { + var claimNos = make([]string, 0) + for _, claim := range claims { + claimNos = append(claimNos, claim.ClaimNo) + res[i].Bonus += claim.RewardFinished + res[i].TransitBonus += 0 + } + statistic, _ := getStatisticsOrderByValuesRelationIds([]string{}, "", "2", claimNos) + res[i].OrderNum = statistic.OrderNum + } + } + //todo 订单、佣金、在途佣金统计 + + list = res + return +} + +func GetMissionClaimOrder(orderId string) (error, model.MissionClaimOrderDetail) { + var ( + err error + result model.MissionClaimOrderDetail + ) + err = global.MG_DB.Model(&model.MissionClaimOrder{}). + Joins("INNER JOIN mission_claim ON mission_claim.id = mission_claim_order.mission_claim_id"). + Joins("INNER JOIN mission ON mission.id = mission_claim.mission_id"). + Where("mission_claim_order.order_id = ?", orderId). + Select("mission_claim_order.*").Preload("Goods").Preload("Address"). + Preload("MissionClaim", func(db *gorm.DB) *gorm.DB { + return db.Select("id,mission_id,claim_no,achieve_num,`status`,create_by,created_at,updated_at") + }).Preload("MissionClaim.Influencer", func(db *gorm.DB) *gorm.DB { + return db.Select("uuid,nick_name,phone") + }).First(&result).Error + if err != nil { + return err, result + } + return nil, result +} + +func GetMissionClaimOrderList(info request.SearchMissionClaimOrder) (err error, list []model.MissionClaimOrderDetail, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.MissionClaimOrder{}).Joins("INNER JOIN mission_claim ON mission_claim.id = mission_claim_order.mission_claim_id"). + Joins("INNER JOIN mission ON mission.id = mission_claim.mission_id") + if info.SellerId != "" { + db = db.Where("mission.create_by = ?", info.SellerId) + } + if info.Uuid != "" { + db = db.Where("mission_claim.create_by = ?", info.Uuid) + } + if info.OrderID != "" { + db = db.Where("mission_claim_order.order_id = ?", info.OrderID) + } + if info.Status != 0 { + db = db.Where("mission_claim_order.`status` = ?", info.Status) + } + if info.SpuNo != "" { + db = db.Where("mission_claim_order.spu_no = ?", info.SpuNo) + } + if info.MissionTitle != "" { + db = db.Where("`mission`.`title` like ?", "%"+info.MissionTitle+"%") + } + if info.AddressName != "" || info.AddressPhone != "" { + db = db.Joins("INNER JOIN mission_claim_address ON mission_claim_address.mission_claim_id = mission_claim.id") + if info.AddressName != "" { + name := "%" + info.AddressName + "%" + db = db.Where("CONCAT(mission_claim_address.first_name,mission_claim_address.last_name) LIKE ? OR CONCAT(mission_claim_address.first_name,' ',mission_claim_address.last_name) LIKE ?", name, name) + } + if info.AddressPhone != "" { + db = db.Where("mission_claim_address.phone LIKE ?", "%"+info.AddressPhone+"%") + } + } + if info.OrderTimeStart != "" { + var tmpT time.Time + tmpT, err = time.ParseInLocation(utils.DateTimeFormat, info.OrderTimeStart, time.UTC) + if err != nil { + err = errors.New("search mission time format error") + return err, nil, 0 + } + db = db.Where("mission_claim_order.created_at >= ?", tmpT) + } + if info.OrderTimeEnd != "" { + var tmpT time.Time + tmpT, err = time.ParseInLocation(utils.DateTimeFormat, info.OrderTimeEnd, time.UTC) + if err != nil { + err = errors.New("search mission time format error") + return err, nil, 0 + } + //tmpT = tmpT.AddDate(0, 0, 1) + db = db.Where("mission_claim_order.created_at <= ?", tmpT) + } + err = db.Count(&total).Error + var res []model.MissionClaimOrderDetail + err = db.Select("mission_claim_order.*").Preload("Goods").Preload("Address"). + Preload("MissionClaim", func(db *gorm.DB) *gorm.DB { + return db.Select("id,mission_id,claim_no,achieve_num,`status`,create_by,created_at,updated_at").Preload("Influencer", func(db *gorm.DB) *gorm.DB { + return db.Select("uuid,nick_name,phone") + }) + }).Order("mission_claim_order.id DESC").Limit(limit).Offset(offset).Find(&res).Error + if err != nil { + return err, nil, 0 + } + return err, res, total +} + +func getMissionFundLockAmount(info *request.SearchMissionFund) (error, float64, int64) { + var ( + err error + result float64 + total int64 + ) + db := global.MG_DB.Model(&model.Mission{}).Where("hire_type = 1") + if info.CreateBy != "" { + db = db.Where("create_by = ?", info.CreateBy) + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + db = db.Where("created_at < ?", info.EndTime) + } + _ = db.Count(&total).Error + err = db.Select("SUM(`fund_lock`)").Scan(&result).Error + if err != nil { + return errors.New("获取失败"), result, total + } + return nil, result, total +} + +func getMissionClaimViewMap(claimNos []string) (map[string]model.MissionClaimView, error) { + var ( + err error + list []model.MissionClaimView + result = make(map[string]model.MissionClaimView) + ) + err = global.MG_DB.Model(&model.MissionClaim{}).Joins("INNER JOIN mission ON mission.id = mission_claim.mission_id"). + Where("mission_claim.claim_no IN (?)", claimNos).Select("mission_claim.mission_id,mission_claim.claim_no,mission_claim.create_by,mission.title as mission_title"). + Find(&list).Error + if err != nil { + return nil, err + } + var uuids []string + for _, claim := range list { + uuids = append(uuids, claim.CreateBy) + } + userMap, _ := getUserViewMap(uuids...) + for i := 0; i < len(list); i++ { + if val, ok := userMap[list[i].CreateBy]; ok { + list[i].User = val + } + } + for _, claim := range list { + result[claim.ClaimNo] = claim + } + return result, nil +} + +// date eg:2023-12-21 +func MissionStatisticCountDaily(date string) error { + var ( + dailySum model.StatisticMissionDaily + claimNum, releaseNum, worksNum int64 + err error + ) + global.MG_DB.Model(&model.Mission{}). + Where("created_at between ? and ?", fmt.Sprintf("%s 00:00:00", date), fmt.Sprintf("%s 23:59:59", date)).Count(&releaseNum) + global.MG_DB.Model(&model.MissionClaim{}). + Where("created_at between ? and ?", fmt.Sprintf("%s 00:00:00", date), fmt.Sprintf("%s 23:59:59", date)).Count(&claimNum) + global.MG_DB.Model(&model.MissionClaimWorks{}). + Where("created_at between ? and ?", fmt.Sprintf("%s 00:00:00", date), fmt.Sprintf("%s 23:59:59", date)).Count(&worksNum) + dailySum = model.StatisticMissionDaily{ + Type: "daily", + Date: date, + ReleaseNum: releaseNum, + ClaimNum: claimNum, + WorksNum: worksNum, + } + err = global.MG_DB.Model(&model.StatisticMissionDaily{}).Clauses(clause.OnConflict{ + Columns: []clause.Column{{Name: "type"}, {Name: "daily"}}, + UpdateAll: true, // 主键或唯一索引冲突时, 更新除主键的所有字段 + }).Create(&dailySum).Error + return err +} + +// date eg:2023-12-21 +func MissionStatisticCountTotal() error { + var ( + dailySum model.StatisticMissionDaily + claimNum, releaseNum, worksNum int64 + err error + ) + + global.MG_DB.Model(&model.Mission{}).Count(&releaseNum) + global.MG_DB.Model(&model.MissionClaim{}).Count(&claimNum) + global.MG_DB.Model(&model.MissionClaimWorks{}).Count(&worksNum) + dailySum = model.StatisticMissionDaily{ + Type: "total", + Date: time.Now().Format(utils.DateFormat), + ReleaseNum: releaseNum, + ClaimNum: claimNum, + WorksNum: worksNum, + } + err = global.MG_DB.Model(&model.StatisticMissionDaily{}).Clauses(clause.OnConflict{ + Columns: []clause.Column{{Name: "type"}, {Name: "daily"}}, + UpdateAll: true, // 主键或唯一索引冲突时, 更新除主键的所有字段 + }).Create(&dailySum).Error + return err +} + +// @date 日期 eg:2023-10-20 +// @sumType 类型 total:累计数据 daily:单日数据 +func GetMissionStatisticData(date string, sumType string) (error, model.StatisticMissionDaily) { + var ( + err error + data model.StatisticMissionDaily + ) + db := global.MG_DB.Model(&model.StatisticMissionDaily{}).Where("type = ?", sumType) + if sumType == "daily" && date != "" { + db = db.Where("date = ?", date) + } + err = db.Order("date desc").First(&data).Error + if err != nil { + return err, data + } + return err, data + +} diff --git a/service/notify.go b/service/notify.go new file mode 100644 index 0000000..d5113f0 --- /dev/null +++ b/service/notify.go @@ -0,0 +1,34 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +func createOrUpdateNotify(info request.CreateNotify) error { + var ( + err error + notify model.Notify + ) + err = global.MG_DB.Model(&model.Notify{}).Where("user_id = ? AND relation_type = ? AND relation_id = ?", info.UserId, info.RelationType, info.RelationId).Find(¬ify).Error + if err != nil { + return err + } + if notify.ID != 0 { + err = global.MG_DB.Model(&model.Notify{}).Where("id = ?", notify.ID).Update("title", info.Title).Error + if err != nil { + return err + } + } else { + notify.UserId = info.UserId + notify.RelationType = info.RelationType + notify.RelationId = info.RelationId + notify.Title = info.Title + err = global.MG_DB.Model(&model.Notify{}).Create(¬ify).Error + if err != nil { + return err + } + } + return err +} diff --git a/service/order.go b/service/order.go new file mode 100644 index 0000000..bf9e3f3 --- /dev/null +++ b/service/order.go @@ -0,0 +1,451 @@ +package service + +import ( + "errors" + "fmt" + "os" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/utils" + "sync/atomic" + "time" +) + +func GetOrderList(info *request.SearchOrderList) (error, interface{}, int64) { + var ( + err error + result []model.OrderList + total int64 + orderIds []string + customers []string + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.Order{}) + if info.Status != 0 { + db = db.Where("`order`.status = ?", info.Status) + } + if info.OrderID != "" { + db = db.Where("`order`.order_id = ?", info.OrderID) + } + if info.GoodsID != 0 { + db = db.Where("`order`.commod_id=?", info.GoodsID) + } + if info.SpuNo != "" { + db = db.Joins("LEFT JOIN order_goods ON order_goods.order_id = `order`.order_id").Where("order_goods.spu_no = ?", info.SpuNo) + } + if info.Name != "" { + db = db.Joins("INNER JOIN order_address on order_address.order_id=`order`.order_id").Where("CONCAT(order_address.first_name,order_address.last_name) LIKE ? OR CONCAT(order_address.first_name,' ',order_address.last_name) LIKE ?", "%"+info.Name+"%", "%"+info.Name+"%") + } + if info.Phone != "" { + db = db.Joins("inner join order_address b on b.phone=? and b.order_id=`order`.order_id", info.Phone) + } + if info.CreatedAtStart != "" { + db.Where("`order`.created_at >= ?", info.CreatedAtStart) + } + if info.CreatedAtEnd != "" { + db.Where("`order`.created_at < ?", info.CreatedAtEnd) + } + if info.Code != "" { + db = db.Where("`order`.code=?", info.Code) + } + if info.CreatedAt != "" { + db = db.Where("`order`.created_at>=?", info.CreatedAt) + } + if info.UserId != "" { + db = db.Where("`order`.user_id = ?", info.UserId) + } + if info.InfluenceId != "" || info.MissionTitle != "" { + db = db.Joins("INNER JOIN mission_claim ON mission_claim.claim_no = `order`.`code`") + if info.InfluenceId != "" { + db = db.Where("mission_claim.create_by = ?", info.InfluenceId) + } + if info.MissionTitle != "" { + db = db.Joins("INNER JOIN mission ON mission.id = mission_claim.mission_id").Where("mission.title LIKE ?", "%"+info.MissionTitle+"%") + } + } + if info.StoreNo != "" { + db = db.Where("`order`.store_no = ?", info.StoreNo) + } + _ = db.Count(&total).Error + err = db.Order("`order`.id desc").Offset(offset).Limit(limit).Find(&result).Error + if err != nil { + return errors.New("获取订单失败"), result, total + } + if len(result) == 0 { + return nil, result, total + } + for v := range result { + orderIds = append(orderIds, result[v].OrderID) + } + var ( + orderGoodsList []model.OrderGoodsDetail + goodsMap = make(map[string]model.OrderGoodsDetail) + ) + err = global.MG_DB.Model(&model.OrderGoods{}).Where("order_id IN (?)", orderIds).Find(&orderGoodsList).Error + if err != nil { + return errors.New("获取订单商品信息失败"), result, total + } + for _, goods := range orderGoodsList { + goodsMap[goods.OrderID] = goods + } + var ( + addressList []model.OrderAddress + addressMap = make(map[string]model.OrderAddress) + ) + err = global.MG_DB.Model(&model.OrderAddress{}).Where("order_id in (?)", orderIds).Find(&addressList).Error + if err != nil { + return errors.New("获取订单地址信息失败"), result, total + } + for _, address := range addressList { + addressMap[address.OrderID] = address + } + var ( + delivers []model.OrderDeliver + deliverMap = make(map[string]model.OrderDeliver) + ) + err = global.MG_DB.Model(&model.OrderDeliver{}).Where("order_id in (?)", orderIds).Find(&delivers).Error + if err != nil { + return errors.New("获取订单发货信息失败"), result, total + } + for _, deliver := range delivers { + deliverMap[deliver.OrderID] = deliver + } + var codes []string + for v := range result { + if val, ok := goodsMap[result[v].OrderID]; ok { + result[v].Goods = val + } + if val, ok := addressMap[result[v].OrderID]; ok { + result[v].Address = val + } + + if val, ok := deliverMap[result[v].OrderID]; ok { + result[v].Deliver = val + } + if result[v].Code != "" { + codes = append(codes, result[v].Code) + } + customers = append(customers, result[v].UserID) + } + var ( + missionMap = make(map[string]model.MissionClaimInfo) + influencerMap = make(map[string]model.InfluencerUserClaimView) + ) + if len(codes) > 0 { + var ( + missions []model.MissionClaimInfo + influencerList []model.InfluencerUserClaimView + ) + err = global.MG_DB.Select("mission_claim.claim_no,mission_claim.mission_id,b.hire_type,b.hire_money,b.hire_ratio").Model(&model.MissionClaim{}).Joins("inner join mission b on mission_claim.mission_id=b.id").Where("claim_no in (?)", codes).Scan(&missions).Error + if err != nil { + return errors.New("获取任务详情失败"), result, total + } + for _, mission := range missions { + missionMap[mission.ClaimNo] = mission + } + err = global.MG_DB.Select("`user`.uuid,`user`.nick_name,`user`.phone,mission_claim.claim_no").Model(&model.MissionClaim{}).Joins("inner join `user` on mission_claim.create_by=`user`.uuid").Where("mission_claim.claim_no in (?)", codes).Scan(&influencerList).Error + if err != nil { + return errors.New("获取任务网红失败"), result, total + } + for _, influencer := range influencerList { + influencerMap[influencer.ClaimNo] = influencer + } + } + var customerMap = make(map[string]model.UserSimple) + if len(customers) > 0 { + var customerList []model.UserSimple + customerList, err = getUserSimpleList("customer", customers) + if err != nil { + return errors.New("获取买家详情失败"), result, total + } + for _, user := range customerList { + customerMap[user.UUID.String()] = user + } + } + for v := range result { + if result[v].Code != "" { + if val, ok := missionMap[result[v].Code]; ok { + if val.HireType == 1 { + amount := val.HireMoney * float64(result[v].Number) + result[v].InfluencerAmount = utils.FormatFloatToString(amount) + result[v].SellerAmount = utils.FormatFloatToString(result[v].PaidPrice - amount) + } else { + amount := result[v].PaidPrice * val.HireRatio / 100 + result[v].InfluencerAmount = utils.FormatFloatToString(amount) + result[v].SellerAmount = utils.FormatFloatToString(result[v].PaidPrice - amount) + } + } + if val, ok := influencerMap[result[v].Code]; ok { + result[v].InfluencerUser = val + } + } else { + result[v].SellerAmount = utils.FormatFloatToString(result[v].PaidPrice) + } + if val, ok := customerMap[result[v].UserID]; ok { + result[v].CustomerPhone = utils.HideStar(val.Phone) + } + } + return nil, result, total +} + +func GetOrderDetail(info *request.SearchOrderDetail) (error, interface{}) { + var ( + err error + result model.OrderDetail + missions model.MissionClaimInfo + ) + db := global.MG_DB.Model(&model.Order{}).Where("`order`.order_id = ?", info.OrderID) + err = db.Find(&result).Error + if err != nil { + return errors.New("获取订单失败"), result + } + err = global.MG_DB.Model(&model.OrderAddress{}).Where("order_id = ?", info.OrderID).Find(&result.Address).Error + if err != nil { + return errors.New("获取订单地址失败"), result + } + err = global.MG_DB.Model(&model.OrderGoods{}).Where("order_id = ?", info.OrderID).Find(&result.Goods).Error + if err != nil { + return errors.New("获取订单商品信息失败"), result + } + err = global.MG_DB.Model(&model.OrderDeliver{}).Where("order_id = ?", info.OrderID).Find(&result.Deliver).Error + if err != nil { + return errors.New("获取发货信息失败"), result + } + if result.Code != "" { + err = global.MG_DB.Select("mission_claim.claim_no,mission_claim.mission_id,b.hire_type,b.hire_money,b.hire_ratio").Model(&model.MissionClaim{}).Joins("inner join mission b on mission_claim.mission_id=b.id").Where("claim_no=?", result.Code).Scan(&missions).Error + if err != nil { + fmt.Println(err) + return errors.New("获取任务详情失败"), result + } + if missions.HireType == 1 { + amount := missions.HireMoney * float64(result.Number) + result.InfluencerAmount = utils.FormatFloatToString(amount) + result.SellerAmount = utils.FormatFloatToString((result.PaidPrice - amount)) + } else { + amount := result.PaidPrice * missions.HireRatio / 100 + result.InfluencerAmount = utils.FormatFloatToString(amount) + result.SellerAmount = utils.FormatFloatToString(result.PaidPrice - amount) + } + } + result.Chain = model.Chain{Address: "b714e5508531a7b50d0696abdc83d2333bd896db24f68eb1470bb9529390ef3e"} + return nil, result +} + +func getStatisticsOrderList(values []string, unit, relationId string) ([]model.DtStatisticOrder, error) { + var ( + err error + result []model.DtStatisticOrder + ) + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("`value` IN (?) AND `unit` = ?", values, unit) + if relationId != "" { + db = db.Where("`relation_id` = ?", relationId) + } + err = db.Find(&result).Error + return result, err +} + +func getStatisticsOrderByValues(values []string, unit, t, relationId string) (model.DtStatisticOrder, error) { + var ( + err error + result model.DtStatisticOrder + ) + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("`unit` = ?", unit). + Select("SUM(order_num) as order_num,SUM(order_done_num) as order_done_num,SUM(order_money) as order_money,SUM(sale_volume) as sale_volume,SUM(settle_reward) as settle_reward,SUM(order_cancel_num) as order_cancel_num,SUM(order_cancel_money) as order_cancel_money") + if len(values) != 0 { + db = db.Where("`value` IN (?) ", values) + } + if t != "" { + db = db.Where("`type` = ?", t) + } + if relationId != "" { + db = db.Where("`relation_id` = ?", relationId) + } + err = db.First(&result).Error + return result, err +} + +func getStatisticsOrderByValuesRelationIds(values []string, unit, t string, relationIds []string) (model.DtStatisticOrder, error) { + var ( + err error + result model.DtStatisticOrder + ) + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("`unit` = ?", unit). + Select("SUM(order_num) as order_num,SUM(order_done_num) as order_done_num,SUM(order_money) as order_money,SUM(sale_volume) as sale_volume,SUM(settle_reward) as settle_reward,SUM(order_cancel_num) as order_cancel_num,SUM(order_cancel_money) as order_cancel_money") + if len(values) != 0 { + db = db.Where("`value` IN (?) ", values) + } + if t != "" { + db = db.Where("`type` = ?", t) + } + if len(relationIds) != 0 { + db = db.Where("`relation_id` IN (?)", relationIds) + } + err = db.First(&result).Error + return result, err +} + +// 获取退款数据 +func getOrderPostSaleCount(info *request.SearchOrderPostSale) (int64, error) { + var ( + err error + result int64 + ) + db := global.MG_DB.Model(&model.OrderPostSale{}).Where("`status` != 4") + if info.OrderId != "" { + db = db.Where("order_id = ?", info.OrderId) + } + if info.Status != 0 { + db = db.Where("`status` = ?", info.Status) + } + if info.UserId != "" { + db = db.Where("user_id = ?", info.UserId) + } + if info.CreatedAtStart != "" { + db = db.Where("created_at >= ?", info.CreatedAtStart) + } + if info.CreatedAtEnd != "" { + db = db.Where("created_at < ?", info.CreatedAtEnd) + } + err = db.Count(&result).Error + return result, err +} + +func getOrderPostSaleCountList(info *request.SearchOrderPostSale) (map[string]int64, error) { + var ( + err error + list []model.CountMap + result = make(map[string]int64) + ) + db := global.MG_DB.Model(&model.OrderPostSale{}).Where("`status` != 4") + if info.OrderId != "" { + db = db.Where("order_id = ?", info.OrderId) + } + if info.Status != 0 { + db = db.Where("`status` = ?", info.Status) + } + if len(info.UserIds) != 0 { + db = db.Where("user_id IN (?)", info.UserIds) + } + if info.CreatedAtStart != "" { + db = db.Where("created_at >= ?", info.CreatedAtStart) + } + if info.CreatedAtEnd != "" { + db = db.Where("created_at < ?", info.CreatedAtEnd) + } + err = db.Group("user_id").Select("user_id as `key`,COUNT(1) as value").Scan(&list).Error + if err != nil { + return result, err + } + for _, countMap := range list { + result[countMap.Key] = countMap.Value + } + return result, err +} + +func GetStatisticData() (response.DataStatistics, error) { + var ( + err error + result response.DataStatistics + ) + now := time.Now() + { + // 用户数据 + statistic, _ := getStatisticOrderSum(&request.Statistic{T: 0, RelationId: "bkb"}, "order_num", "order_money", "new_order_num") + // 总销售额 + result.User.Money.Value1 = fmt.Sprintf("%.2f", statistic.OrderMoney) + // 人均支付金额 + result.User.Money.Value2 = fmt.Sprintf("%.2f", statistic.OrderMoney/float64(statistic.OrderNum)) + // 访问量 + goods, yesterdayGoods := GetGoodsVisitCount() + result.User.Visit.Value1 = fmt.Sprintf("%v", goods) + // 昨天访问量 + result.User.Visit.Value2 = fmt.Sprintf("%v", yesterdayGoods) + // 支付笔数 + result.User.PayNum.Value1 = fmt.Sprintf("%v", statistic.OrderNum) + // 昨日支付笔数 + yesterday, _ := getStatisticOrderSum(&request.Statistic{Values: []string{now.AddDate(0, 0, -1).Format("060102") + "0000"}, Unit: "", T: 0, RelationId: "bkb"}, "order_num", "new_order_num") + result.User.PayNum.Value2 = fmt.Sprintf("%v", yesterday.OrderNum) + // 订单数 + result.User.OrderNum.Value1 = fmt.Sprintf("%v", statistic.NewOrderNum) + // 昨日订单数 + result.User.OrderNum.Value2 = fmt.Sprintf("%v", yesterday.NewOrderNum) + } + _, missionData := GetMissionStatisticData("", "total") + _, yesterdayMissionData := GetMissionStatisticData(now.AddDate(0, 0, -1).Format(utils.DateFormat), "daily") + { + // 网红数据 + // 接任务数 + result.Influence.MissionNum.Value1 = fmt.Sprintf("%v", missionData.ClaimNum) + // 昨日接任务数 + result.Influence.MissionNum.Value2 = fmt.Sprintf("%v", yesterdayMissionData.ClaimNum) + // 发布第三方平台数 + result.Influence.PlatformNum.Value1 = fmt.Sprintf("%v", missionData.WorksNum) + // 昨日发布数 + result.Influence.PlatformNum.Value2 = fmt.Sprintf("%v", yesterdayMissionData.WorksNum) + // 在途佣金额 + statistic, _ := getStatisticOrderSum(&request.Statistic{T: 2}, "transit_reward") + result.Influence.TransitReward.Value1 = fmt.Sprintf("%.2f", statistic.TransitReward) + // 昨日在途佣金 + yesterday, _ := getStatisticOrderSum(&request.Statistic{Values: []string{now.AddDate(0, 0, -1).Format("060102") + "0000"}, Unit: "", T: 2}, "transit_reward") + result.Influence.TransitReward.Value2 = fmt.Sprintf("%.2f", yesterday.TransitReward) + // 可用佣金额 + result.Influence.UsedReward.Value1 = "" + // 昨天可用佣金数 + result.Influence.UsedReward.Value2 = "" + } + { + // 商家数据 + + // 发布任务数 + result.Store.MissionNum.Value1 = fmt.Sprintf("%v", missionData.ReleaseNum) + // 昨日发布任务数 + result.Store.MissionNum.Value2 = fmt.Sprintf("%v", yesterdayMissionData.ReleaseNum) + + goods, yesterdayGoods := GetGoodsCount() + // 发布商品数 + result.Store.GoodsNum.Value1 = fmt.Sprintf("%v", goods) + // 昨日发布商品数 + result.Store.GoodsNum.Value2 = fmt.Sprintf("%v", yesterdayGoods) + // 在途金额 + statistic, _ := getStatisticOrderSum(&request.Statistic{T: 3}, "transit_reward") + result.Store.TransitReward.Value1 = fmt.Sprintf("%.2f", statistic.TransitReward) + // 昨日在订单金额 + yesterday, _ := getStatisticOrderSum(&request.Statistic{Values: []string{now.AddDate(0, 0, -1).Format("060102") + "0000"}, Unit: "", T: 3}, "transit_reward") + result.Store.TransitReward.Value2 = fmt.Sprintf("%.2f", yesterday.TransitReward) + // 可提金额 + result.Store.UsedCash.Value1 = "" + // 昨天可用佣金额 + result.Store.UsedCash.Value2 = "" + } + return result, err +} + +// 生成24位订单号 +// 前面17位代表时间精确到毫秒,中间3位代表进程id,最后4位代表序号 +var num int64 + +func generate() string { + t := time.Now() + s := t.Format(utils.Continuity) + m := t.UnixNano()/1e6 - t.UnixNano()/1e9*1e3 + ms := sup(m, 3) + p := os.Getpid() % 1000 + ps := sup(int64(p), 3) + i := atomic.AddInt64(&num, 1) + r := i % 10000 + rs := sup(r, 4) + n := fmt.Sprintf("%s%s%s%s", s, ms, ps, rs) + return n +} + +// 对长度不足n的数字前面补0 +func sup(i int64, n int) string { + m := fmt.Sprintf("%d", i) + for len(m) < n { + m = fmt.Sprintf("0%s", m) + } + return m +} diff --git a/service/organization.go b/service/organization.go new file mode 100755 index 0000000..d0c3e7c --- /dev/null +++ b/service/organization.go @@ -0,0 +1,80 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: CreateOrganization +//@description: 创建Organization记录 +//@param: organization model.Organization +//@return: err error + +func CreateOrganization(organization model.Organization) (err error) { + err = global.MG_DB.Create(&organization).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteOrganization +//@description: 删除Organization记录 +//@param: organization model.Organization +//@return: err error + +func DeleteOrganization(organization model.Organization) (err error) { + err = global.MG_DB.Delete(&organization).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteOrganizationByIds +//@description: 批量删除Organization记录 +//@param: ids request.IdsReq +//@return: err error + +func DeleteOrganizationByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Delete(&[]model.Organization{},"id in (?)",ids.Ids).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: UpdateOrganization +//@description: 更新Organization记录 +//@param: organization *model.Organization +//@return: err error + +func UpdateOrganization(organization model.Organization) (err error) { + err = global.MG_DB.Updates(&organization).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetOrganization +//@description: 根据id获取Organization记录 +//@param: id uint +//@return: err error, organization model.Organization + +func GetOrganization(id uint) (err error, organization model.Organization) { + err = global.MG_DB.Where("id = ?", id).First(&organization).Error + return +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetOrganizationInfoList +//@description: 分页获取Organization记录 +//@param: info request.OrganizationSearch +//@return: err error, list interface{}, total int64 + +func GetOrganizationInfoList(info request.OrganizationSearch) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.Organization{}) + var organizations []model.Organization + // 如果有条件搜索 下方会自动创建搜索语句 + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&organizations).Error + return err, organizations, total +} \ No newline at end of file diff --git a/service/provider.go b/service/provider.go new file mode 100755 index 0000000..bdf69d7 --- /dev/null +++ b/service/provider.go @@ -0,0 +1,80 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: CreateProvider +//@description: 创建Provider记录 +//@param: provider model.Provider +//@return: err error + +func CreateProvider(provider model.Provider) (err error) { + err = global.MG_DB.Create(&provider).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteProvider +//@description: 删除Provider记录 +//@param: provider model.Provider +//@return: err error + +func DeleteProvider(provider model.Provider) (err error) { + err = global.MG_DB.Delete(&provider).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteProviderByIds +//@description: 批量删除Provider记录 +//@param: ids request.IdsReq +//@return: err error + +func DeleteProviderByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Delete(&[]model.Provider{},"id in (?)",ids.Ids).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: UpdateProvider +//@description: 更新Provider记录 +//@param: provider *model.Provider +//@return: err error + +func UpdateProvider(provider model.Provider) (err error) { + err = global.MG_DB.Updates(&provider).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetProvider +//@description: 根据id获取Provider记录 +//@param: id uint +//@return: err error, provider model.Provider + +func GetProvider(id uint) (err error, provider model.Provider) { + err = global.MG_DB.Where("id = ?", id).First(&provider).Error + return +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetProviderInfoList +//@description: 分页获取Provider记录 +//@param: info request.ProviderSearch +//@return: err error, list interface{}, total int64 + +func GetProviderInfoList(info request.ProviderSearch) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.Provider{}) + var providers []model.Provider + // 如果有条件搜索 下方会自动创建搜索语句 + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&providers).Error + return err, providers, total +} \ No newline at end of file diff --git a/service/redis_tools.go b/service/redis_tools.go new file mode 100644 index 0000000..c1d4f6a --- /dev/null +++ b/service/redis_tools.go @@ -0,0 +1,255 @@ +package service + +import ( + "fmt" + "pure-admin/global" + "time" + + "github.com/go-redis/redis" + "go.uber.org/zap" +) + +// RedisGet ... +func RedisGet(key string) string { + result, err := global.MG_REDIS.Get(key).Result() + if err != nil { + return "" + } + return result +} + +func RedisSet(key string, value interface{}, expiration time.Duration) string { + result, err := global.MG_REDIS.Set(key, value, expiration).Result() + if err != nil { + global.MG_LOG.Error("Redis Set Error:", zap.Any("err", err)) + return "" + } + return result +} + +func RedisDel(key ...string) (int64, error) { + result, err := global.MG_REDIS.Del(key...).Result() + if err != nil { + global.MG_LOG.Error("Redis Del Error:", zap.Any("err", err)) + return -1, err + } + return result, err +} + +// RedisHashSet 向key的hash中添加元素field的值 +func RedisHashSet(key, field string, data interface{}) error { + err := global.MG_REDIS.HSet(key, field, data).Err() + if err != nil { + global.MG_LOG.Error("Redis HSet Error:", zap.Any("err", err)) + return err + } + return nil +} + +// RedisBatchHashSet 批量向key的hash添加对应元素field的值 +func RedisBatchHashSet(key string, fields map[string]interface{}) (error, string) { + val, err := global.MG_REDIS.HMSet(key, fields).Result() + if err != nil { + global.MG_LOG.Error("Redis HMSet Error:", zap.Any("err", err)) + return err, "" + } + return nil, val +} + +func RedisHDel(key string, fields ...string) (error, int64) { + result, err := global.MG_REDIS.HDel(key, fields...).Result() + if err != nil { + global.MG_LOG.Error("Redis HMSet Error:", zap.Any("err", err)) + return err, 0 + } + return nil, result +} + +func RedisHSet(key, field string, value interface{}) (error, bool) { + val, err := global.MG_REDIS.HSet(key, field, value).Result() + if err != nil { + global.MG_LOG.Error("Redis HSet Error:", zap.Any("err", err)) + return err, false + } + return nil, val +} + +// RedisHashGet 通过key获取hash的元素值 +func RedisHashGet(key, field string) string { + val, err := global.MG_REDIS.HGet(key, field).Result() + if err != nil { + return "" + } + return val +} + +func RedisHashMGet(key string, fields ...string) []interface{} { + val, err := global.MG_REDIS.HMGet(key, fields...).Result() + if err != nil { + return nil + } + return val +} + +// HGetAll +func RedisHashGetAll(key string) map[string]string { + val, err := global.MG_REDIS.HGetAll(key).Result() + if err != nil { + return nil + } + return val +} + +// RedisBatchHashGet 批量获取key的hash中对应多元素值 +func RedisBatchHashGet(key string, fields ...string) map[string]interface{} { + resMap := make(map[string]interface{}) + for _, field := range fields { + val, err := global.MG_REDIS.HGet(key, fmt.Sprintf("%s", field)).Result() + if err == nil && val != "" { + resMap[field] = val + } + } + return resMap +} + +func RedisLPush(key string, values ...interface{}) (int64, error) { + result, err := global.MG_REDIS.LPush(key, values...).Result() + if err != nil { + global.MG_LOG.Error("Redis LPush Error:", zap.Any("err", err)) + return 0, err + } + return result, nil +} + +func RedisLPop(key string) (error, string) { + result, err := global.MG_REDIS.LPop(key).Result() + if err != nil { + return err, "" + } + return err, result +} + +// RedisSAdd 无序集合添加 +func RedisSAdd(key string, values ...interface{}) (int64, error) { + result, err := global.MG_REDIS.SAdd(key, values...).Result() + if err != nil { + global.MG_LOG.Error("Redis LPush Error:", zap.Any("err", err)) + return 0, err + } + return result, nil +} + +func RedisSIsMember(key string, value interface{}) (bool, error) { + result, err := global.MG_REDIS.SIsMember(key, value).Result() + if err != nil { + global.MG_LOG.Error("Redis LPush Error:", zap.Any("err", err)) + return false, err + } + return result, nil +} + +func RedisSRem(key string, values ...interface{}) (int64, error) { + result, err := global.MG_REDIS.SRem(key, values...).Result() + if err != nil { + return 0, err + } + return result, err +} + +// RedisSMembers 从无序集合中获取数据 +func RedisSMembers(key string) ([]string, error) { + val, err := global.MG_REDIS.SMembers(key).Result() + if err != nil { + global.MG_LOG.Error("Redis SMembers Error:", zap.Any("err", err)) + return nil, err + } + return val, nil +} + +// RedisZAdd 有序集合添加 +func RedisZAdd(key string, values map[float64]interface{}) (int64, error) { + var members []redis.Z + for scale, value := range values { + members = append(members, redis.Z{ + Score: scale, + Member: value, + }) + } + result, err := global.MG_REDIS.ZAdd(key, members...).Result() + if err != nil { + global.MG_LOG.Error("Redis ZAdd Error:", zap.Any("err", err)) + return 0, err + } + return result, nil +} + +func RedisZRem(key string, values ...interface{}) (int64, error) { + result, err := global.MG_REDIS.ZRem(key, values...).Result() + if err != nil { + return 0, err + } + return result, err +} + +func RedisZCard(key string) (int64, error) { + result, err := global.MG_REDIS.ZCard(key).Result() + if err != nil { + global.MG_LOG.Error("Redis ZAdd Error:", zap.Any("err", err)) + return 0, err + } + return result, nil +} + +func RedisZRange(key string, start, stop int64, sort string) ([]interface{}, error) { + var val = make([]interface{}, 0) + if sort == "asc" { //scale 正序 + result, err := global.MG_REDIS.ZRangeWithScores(key, start, stop).Result() + if err != nil { + global.MG_LOG.Error("Redis ZPopMax Error:", zap.Any("err", err)) + return val, err + } + for _, z := range result { + val = append(val, z.Member) + } + } else { //scale 倒序 + result, err := global.MG_REDIS.ZRevRange(key, start, stop).Result() + if err != nil { + global.MG_LOG.Error("Redis ZPopMax Error:", zap.Any("err", err)) + return val, err + } + for _, z := range result { + val = append(val, z) + } + return val, nil + } + + return val, nil +} + +// RedisIncr 获取自增唯一ID +func RedisIncr(key string) int { + val, err := global.MG_REDIS.Incr(key).Result() + if err != nil { + global.MG_LOG.Error("Redis RedisIncr Error:", zap.Any("err", err)) + } + return int(val) +} + +func RedisTest(key string, values ...interface{}) { + result, err := global.MG_REDIS.SRem(key, values...).Result() + if err != nil { + fmt.Println(err) + } + fmt.Println(result) +} + +func RedisSetNX(key string, value interface{}, expiration time.Duration) (error, bool) { + val, err := global.MG_REDIS.SetNX(key, value, expiration).Result() + if err != nil { + if err != nil { + fmt.Println("Redis SetNX Error:", err.Error()) + } + return err, false + } + return nil, val +} diff --git a/service/seller.go b/service/seller.go new file mode 100644 index 0000000..fc2b4e2 --- /dev/null +++ b/service/seller.go @@ -0,0 +1,22 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" +) + +func getSellerStoreMap(stores []string) (map[string]model.StoreInfo, error) { + var ( + err error + list []model.StoreInfo + result = make(map[string]model.StoreInfo) + ) + err = global.MG_DB.Model(&model.BillFund{}).Where("store_no IN (?)").Select("store_no,email").Find(&list).Error + if err != nil { + return nil, err + } + for _, store := range list { + result[store.StoreNo] = store + } + return result, nil +} diff --git a/service/statistic.go b/service/statistic.go new file mode 100644 index 0000000..d2dd10e --- /dev/null +++ b/service/statistic.go @@ -0,0 +1,181 @@ +package service + +import ( + "errors" + "gorm.io/gorm" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "strings" +) + +func getDtStatisticsOrderDB(info *request.Statistic) *gorm.DB { + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("`type` = ?", info.T) + if len(info.Values) != 0 { + db = db.Where("`value` IN (?)", info.Values) + } + if info.Unit != "" { + db = db.Where("`unit` = ?", info.Unit) + } + if info.RelationId != "" { + db = db.Where("`relation_id` = ?", info.RelationId) + } + return db +} + +func getStatisticsOrder(info request.Statistic) (model.DtStatisticOrder, error) { + var ( + err error + result model.DtStatisticOrder + ) + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("`type` = ?", info.T) + if len(info.Values) != 0 { + db = db.Where("`value` IN (?)", info.Values) + } + if info.Unit != "" { + db = db.Where("`unit` = ?", info.Unit) + } + if info.RelationId != "" { + db = db.Where("`relation_id` = ?", info.RelationId) + } + err = db.First(&result).Error + return result, err +} + +// 获取订单统计数据-买家维度 +func getStatisticsOrderUser(uuid, unit string, timeArea []string) (model.DtStatisticOrder, error) { + var ( + err error + result model.DtStatisticOrder + ) + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("dt_statistic_order.`type` = 1 AND dt_statistic_order.relation_id = ? AND dt_statistic_order.`unit` = ?", uuid, unit) + if len(timeArea) == 2 { + db = db.Where("dt_statistic_order.created_at >= ? AND dt_statistic_order.created_at < ?", timeArea[0], timeArea[1]) + } + err = db.Select("SUM(order_num) as order_num,SUM(order_done_num) as order_done_num,SUM(order_money) as order_money,SUM(sale_volume) as sale_volume,SUM(settle_reward) as settle_reward,SUM(order_cancel_num) as order_cancel_num,SUM(order_cancel_money) as order_cancel_money").First(&result).Error + return result, err +} + +func getStatisticsOrderUsers(uuids []string, unit string, timeArea []string) (map[string]model.DtStatisticOrder, error) { + var ( + err error + list []model.DtStatisticOrder + result = make(map[string]model.DtStatisticOrder) + ) + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("dt_statistic_order.`type` = 1 AND dt_statistic_order.relation_id IN (?) AND dt_statistic_order.`unit` = ?", uuids, unit) + if len(timeArea) == 2 { + db = db.Where("dt_statistic_order.created_at >= ? AND dt_statistic_order.created_at < ?", timeArea[0], timeArea[1]) + } + err = db.Select("dt_statistic_order.relation_id,SUM(order_num) as order_num,SUM(order_done_num) as order_done_num,SUM(order_money) as order_money,SUM(sale_volume) as sale_volume,SUM(settle_reward) as settle_reward,SUM(order_cancel_num) as order_cancel_num,SUM(order_cancel_money) as order_cancel_money").Group("dt_statistic_order.relation_id").Find(&list).Error + if err != nil { + return result, err + } + for _, statisticOrder := range list { + result[statisticOrder.RelationId] = statisticOrder + } + return result, nil +} + +func getStatisticOrderSum(info *request.Statistic, fields ...string) (model.Statistic, error) { + var ( + err error + selectSql string + result model.Statistic + ) + db := getDtStatisticsOrderDB(info) + for _, field := range fields { + switch field { + case "value": + if len(info.Values) == 1 { + selectSql += "`value`," + } + case "relation_id": + selectSql += "relation_id," + case "new_order_num": + selectSql += "SUM(new_order_num) as new_order_num," + case "new_order_money": + selectSql += "SUM(new_order_money) as new_order_money," + case "order_num": + selectSql += "SUM(order_num) as order_num," + case "order_done_num": + selectSql += "SUM(order_done_num) as order_done_num," + case "order_money": + selectSql += "SUM(order_money) as order_money," + case "settle_reward": + selectSql += "SUM(settle_reward) as settle_reward," + case "transit_reward": + selectSql += "SUM(transit_reward) as transit_reward," + case "order_cancel_num": + selectSql += "SUM(order_cancel_num) as order_cancel_num," + case "order_cancel_money": + selectSql += "SUM(order_cancel_money) as order_cancel_money," + case "sale_volume": + selectSql += "SUM(sale_volume) as sale_volume," + default: + selectSql = "" + break + } + } + if selectSql == "" { + return result, errors.New("fields is error") + } else { + if strings.HasSuffix(selectSql, ",") { + selectSql = strings.TrimRight(selectSql, ",") + } + } + err = db.Select(selectSql).Scan(&result).Error + if err != nil { + return result, err + } + //for _, field := range fields { + // switch field { + // case "value": + // if len(info.Values) == 1 { + // result["value"] = statistic.Value + // } + // case "relation_id": + // result["relation_id"] = statistic.RelationId + // case "new_order_num": + // result["new_order_num"] = fmt.Sprintf("%v", statistic.NewOrderNum) + // case "new_order_money": + // result["new_order_money"] = fmt.Sprintf("%.2f", statistic.NewOrderMoney) + // case "order_num": + // result["order_num"] = fmt.Sprintf("%v", statistic.OrderNum) + // case "order_done_num": + // result["order_done_num"] = fmt.Sprintf("%v", statistic.OrderDoneNum) + // case "order_money": + // result["order_money"] = fmt.Sprintf("%.2f", statistic.OrderMoney) + // case "settle_reward": + // result["settle_reward"] = fmt.Sprintf("%.2f", statistic.SettleReward) + // case "transit_reward": + // result["transit_reward"] = fmt.Sprintf("%.2f", statistic.TransitReward) + // case "order_cancel_num": + // result["order_cancel_num"] = fmt.Sprintf("%v", statistic.NewOrderNum) + // case "order_cancel_money": + // result["order_cancel_money"] = fmt.Sprintf("%.2f", statistic.OrderCancelMoney) + // case "sale_volume": + // result["sale_volume"] = fmt.Sprintf("%v", statistic.SaleVolume) + // } + //} + return result, err +} + +func getStatisticsOrderSkus(skuNos []string, unit string, timeArea []string) (map[string]model.DtStatisticOrder, error) { + var ( + err error + list []model.DtStatisticOrder + result = make(map[string]model.DtStatisticOrder) + ) + db := global.MG_DB.Model(&model.DtStatisticOrder{}).Where("dt_statistic_order.`type` = 4 AND dt_statistic_order.relation_id IN (?) AND dt_statistic_order.`unit` = ?", skuNos, unit) + if len(timeArea) == 2 { + db = db.Where("dt_statistic_order.created_at >= ? AND dt_statistic_order.created_at < ?", timeArea[0], timeArea[1]) + } + err = db.Select("dt_statistic_order.relation_id,SUM(order_num) as order_num,SUM(order_done_num) as order_done_num,SUM(order_money) as order_money,SUM(sale_volume) as sale_volume,SUM(settle_reward) as settle_reward,SUM(order_cancel_num) as order_cancel_num,SUM(order_cancel_money) as order_cancel_money").Group("dt_statistic_order.relation_id").Find(&list).Error + if err != nil { + return result, err + } + for _, statisticOrder := range list { + result[statisticOrder.RelationId] = statisticOrder + } + return result, nil +} diff --git a/service/sys_api.go b/service/sys_api.go new file mode 100644 index 0000000..5f749d2 --- /dev/null +++ b/service/sys_api.go @@ -0,0 +1,148 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + + "gorm.io/gorm" +) + +//@function: CreateApi +//@description: 新增基础api +//@param: api model.SysApi +//@return: err error + +func CreateApi(api model.SysApi) (err error) { + if !errors.Is(global.MG_DB.Where("path = ? AND method = ? and appid=?", api.Path, api.Method, api.Appid).First(&model.SysApi{}).Error, gorm.ErrRecordNotFound) { + return errors.New("存在相同api") + } + return global.MG_DB.Create(&api).Error +} + +//@function: DeleteApi +//@description: 删除基础api +//@param: api model.SysApi +//@return: err error + +func DeleteApi(api model.SysApi, appid string) (err error) { + var e model.SysApi + if errors.Is(global.MG_DB.Where("id = ? and appid=? and type=?", api.ID, appid, "admin").First(&e).Error, gorm.ErrRecordNotFound) { + return errors.New("未找到api") + } + err = global.MG_DB.Delete(&api).Error + if err != nil { + return err + } + err = global.MG_DB.Table("casbin_rule").Model(&model.CasbinModel{}).Where("v1=? and v3 = ? AND v4 = ? AND v5=? ", appid, e.Path, e.Method, "admin").Delete(&model.CasbinModel{}).Error + return err +} + +//@function: GetAPIInfoList +//@description: 分页获取数据, +//@param: api model.SysApi, info request.PageInfo, order string, desc bool +//@return: err error + +func GetAPIInfoList(api model.SysApi, info request.PageInfo, order string, desc bool) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.SysApi{}) + var apiList []model.SysApi + db = db.Where("appid=? and type=?", api.Appid, "admin") + if api.Path != "" { + db = db.Where("path LIKE ?", "%"+api.Path+"%") + } + + if api.Description != "" { + db = db.Where("description LIKE ?", "%"+api.Description+"%") + } + + if api.Method != "" { + db = db.Where("method = ?", api.Method) + } + + if api.ApiGroup != "" { + db = db.Where("api_group = ?", api.ApiGroup) + } + + err = db.Count(&total).Error + + if err != nil { + return err, apiList, total + } else { + db = db.Limit(limit).Offset(offset) + if order != "" { + var OrderStr string + if desc { + OrderStr = order + " desc" + } else { + OrderStr = order + } + err = db.Order(OrderStr).Find(&apiList).Error + } else { + err = db.Order("api_group").Find(&apiList).Error + } + } + return err, apiList, total +} + +//@function: GetAllApis +//@description: 获取所有的api +//@return: err error, apis []model.SysApi + +func GetAllApis(appid string) (err error, apis []model.SysApi) { + err = global.MG_DB.Where("appid=? and type=?", appid, "admin").Find(&apis).Error + return +} + +//@function: GetApiById +//@description: 根据id获取api +//@param: id float64 +//@return: err error, api model.SysApi + +func GetApiById(id float64) (err error, api model.SysApi) { + err = global.MG_DB.Where("id = ?", id).First(&api).Error + return +} + +func GetApiByPathMethod(path, method, appid string) (err error, api model.SysApi) { + err = global.MG_DB.Where("appid=? and path = ? AND method=? and type=?", appid, path, method, "admin").First(&api).Error + return +} + +//@function: UpdateApi +//@description: 根据id更新api +//@param: api model.SysApi +//@return: err error + +func UpdateApi(api model.SysApi) (err error) { + var oldA model.SysApi + err = global.MG_DB.Where("id = ?", api.ID).First(&oldA).Error + if oldA.Path != api.Path || oldA.Method != api.Method { + if !errors.Is(global.MG_DB.Where("path = ? AND method = ? and appid=? and type=?", api.Path, api.Method, api.Appid, "admin").First(&model.SysApi{}).Error, gorm.ErrRecordNotFound) { + return errors.New("存在相同api路径") + } + } + if err != nil { + return err + } else { + err = UpdateCasbinApi(oldA.Path, api.Path, oldA.Method, api.Method, api.Appid, "admin") + if err != nil { + return err + } else { + err = global.MG_DB.Save(&api).Error + } + } + return err +} + +//@function: DeleteApis +//@description: 删除选中API +//@param: apis []model.SysApi +//@return: err error + +func DeleteApisByIds(ids request.IdsReq, appid string) (err error) { + err = global.MG_DB.Delete(&[]model.SysApi{}, "id in (?) and appid=?", ids.Ids, appid).Error + return err +} diff --git a/service/sys_authority.go b/service/sys_authority.go new file mode 100644 index 0000000..0394dfd --- /dev/null +++ b/service/sys_authority.go @@ -0,0 +1,152 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "strconv" + + "gorm.io/gorm" +) + +//@function: CreateAuthority +//@description: 创建一个角色 +//@param: auth model.SysAuthority +//@return: err error, authority model.SysAuthority + +func CreateAuthority(auth model.SysAuthority) (err error, authority model.SysAuthority) { + err = global.MG_DB.Create(&auth).Error + return err, auth +} + +//@function: CopyAuthority +//@description: 复制一个角色 +//@param: copyInfo response.SysAuthorityCopyResponse +//@return: err error, authority model.SysAuthority + +func CopyAuthority(copyInfo response.SysAuthorityCopyResponse) (err error, authority model.SysAuthority) { + var authorityBox model.SysAuthority + if !errors.Is(global.MG_DB.Where("authority_id = ?", copyInfo.Authority.AuthorityId).First(&authorityBox).Error, gorm.ErrRecordNotFound) { + return errors.New("存在相同角色id"), authority + } + copyInfo.Authority.Children = []model.SysAuthority{} + err, menus := GetMenuAuthority(copyInfo.OldAuthorityId, copyInfo.Appid) + var baseMenu []model.SysBaseMenu + for _, v := range menus { + //intNum, _ := strconv.Atoi(v.ID) + intNum := int(v.ID) + v.SysBaseMenu.ID = uint(intNum) + baseMenu = append(baseMenu, v.SysBaseMenu) + } + copyInfo.Authority.SysBaseMenus = baseMenu + err = global.MG_DB.Create(©Info.Authority).Error + + paths := GetPolicyPathByAuthorityId(copyInfo.OldAuthorityId, copyInfo.Appid) + err = UpdateCasbin(copyInfo.Authority.AuthorityId, copyInfo.Appid, paths) + if err != nil { + _ = DeleteAuthority(©Info.Authority) + } + return err, copyInfo.Authority +} + +//@function: UpdateAuthority +//@description: 更改一个角色 +//@param: auth model.SysAuthority +//@return: err error, authority model.SysAuthority + +func UpdateAuthority(auth model.SysAuthority) (err error, authority model.SysAuthority) { + err = global.MG_DB.Where("authority_id = ?", auth.AuthorityId).First(&model.SysAuthority{}).Updates(&auth).Error + return err, auth +} + +//@function: DeleteAuthority +//@description: 删除角色 +//@param: auth *model.SysAuthority +//@return: err error + +func DeleteAuthority(auth *model.SysAuthority) (err error) { + // if !errors.Is(global.MG_DB.Where("sys_authority_id = ?", auth.AuthorityId).First(&model.SysUserAuthority{}).Error, gorm.ErrRecordNotFound) { + // return errors.New("此角色有用户正在使用禁止删除") + // } + if !errors.Is(global.MG_DB.Where("parent_id = ?", auth.AuthorityId).First(&model.SysAuthority{}).Error, gorm.ErrRecordNotFound) { + return errors.New("此角色存在子角色不允许删除") + } + db := global.MG_DB.Preload("SysBaseMenus").Where("authority_id = ?", auth.AuthorityId).First(auth) + err = db.Unscoped().Delete(auth).Error + if len(auth.SysBaseMenus) > 0 { + err = global.MG_DB.Model(auth).Association("SysBaseMenus").Delete(auth.SysBaseMenus) + //err = db.Association("SysBaseMenus").Delete(&auth) + } else { + err = db.Error + } + ClearCasbin(1, auth.Appid, strconv.Itoa(int(auth.AuthorityId))) + return err +} + +//@function: GetAuthorityInfoList +//@description: 分页获取数据 +//@param: info request.PageInfo +//@return: err error, list interface{}, total int64 + +func GetAuthorityInfoList(info request.PageInfo, appid string) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB + var authority []model.SysAuthority + err = db.Limit(limit).Offset(offset).Where("parent_id = 0 and appid=? and type=?", appid, "admin").Find(&authority).Error + if len(authority) > 0 { + for k := range authority { + err = findChildrenAuthority(&authority[k]) + } + } + return err, authority, total +} + +//@function: GetAuthorityInfo +//@description: 获取所有角色信息 +//@param: auth model.SysAuthority +//@return: err error, sa model.SysAuthority + +func GetAuthorityInfo(auth model.SysAuthority) (err error, sa model.SysAuthority) { + err = global.MG_DB.Preload("DataAuthorityId").Where("authority_id = ?", auth.AuthorityId).First(&sa).Error + return err, sa +} + +//@function: SetMenuAuthority +//@description: 菜单与角色绑定 +//@param: auth *model.SysAuthority +//@return: error + +func SetMenuAuthority(auth *model.SysAuthority) error { + //清除原有角色与菜单 + //ClearCasbin(0, "menu", auth.Appid, strconv.Itoa(int(auth.AuthorityId))) + global.MG_DB.Table("casbin_rule").Model(&model.CasbinModel{}).Where("ptype=? and v0=? and v1=? and v2 = ? AND v5=? ", "p", "menu", auth.Appid, strconv.Itoa(int(auth.AuthorityId)), "admin").Delete(&model.CasbinModel{}) + //更新casbin + rules := [][]string{} + for _, v := range auth.SysBaseMenus { + rules = append(rules, []string{"menu", auth.Appid, strconv.Itoa(int(auth.AuthorityId)), v.Path, "*", "admin"}) + } + e := Casbin() + success, _ := e.AddPolicies(rules) + if success == false { + return errors.New("存在相同menu,添加失败,请联系管理员") + } + return nil +} + +//@function: findChildrenAuthority +//@description: 查询子角色 +//@param: authority *model.SysAuthority +//@return: err error + +func findChildrenAuthority(authority *model.SysAuthority) (err error) { + err = global.MG_DB.Where("parent_id = ?", authority.AuthorityId).Find(&authority.Children).Error + if len(authority.Children) > 0 { + for k := range authority.Children { + err = findChildrenAuthority(&authority.Children[k]) + } + } + return err +} diff --git a/service/sys_auto_code.go b/service/sys_auto_code.go new file mode 100644 index 0000000..3e889b4 --- /dev/null +++ b/service/sys_auto_code.go @@ -0,0 +1,373 @@ +package service + +import ( + "errors" + "io/ioutil" + "os" + "path/filepath" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/utils" + "strings" + "text/template" + + "gorm.io/gorm" +) + +const ( + autoPath = "autoCode/" + basePath = "resource/template" +) + +type tplData struct { + template *template.Template + locationPath string + autoCodePath string + autoMoveFilePath string +} + +//@function: PreviewTemp +//@description: 预览创建代码 +//@param: model.AutoCodeStruct +//@return: map[string]string, error + +func PreviewTemp(autoCode model.AutoCodeStruct) (map[string]string, error) { + dataList, _, needMkdir, err := getNeedList(&autoCode) + if err != nil { + return nil, err + } + + // 写入文件前,先创建文件夹 + if err = utils.CreateDir(needMkdir...); err != nil { + return nil, err + } + + // 创建map + ret := make(map[string]string) + + // 生成map + for _, value := range dataList { + ext := "" + if ext = filepath.Ext(value.autoCodePath); ext == ".txt" { + continue + } + f, err := os.OpenFile(value.autoCodePath, os.O_CREATE|os.O_WRONLY, 0755) + if err != nil { + return nil, err + } + if err = value.template.Execute(f, autoCode); err != nil { + return nil, err + } + _ = f.Close() + f, err = os.OpenFile(value.autoCodePath, os.O_CREATE|os.O_RDONLY, 0755) + if err != nil { + return nil, err + } + builder := strings.Builder{} + builder.WriteString("```") + + if ext != "" && strings.Contains(ext, ".") { + builder.WriteString(strings.Replace(ext, ".", "", -1)) + } + builder.WriteString("\n\n") + data, err := ioutil.ReadAll(f) + if err != nil { + return nil, err + } + builder.Write(data) + builder.WriteString("\n\n```") + + pathArr := strings.Split(value.autoCodePath, string(os.PathSeparator)) + ret[pathArr[1]+"-"+pathArr[3]] = builder.String() + _ = f.Close() + + } + defer func() { // 移除中间文件 + if err := os.RemoveAll(autoPath); err != nil { + return + } + }() + return ret, nil +} + +//@function: CreateTemp +//@description: 创建代码 +//@param: model.AutoCodeStruct +//@return: err error + +func CreateTemp(autoCode model.AutoCodeStruct) (err error) { + dataList, fileList, needMkdir, err := getNeedList(&autoCode) + if err != nil { + return err + } + // 写入文件前,先创建文件夹 + if err = utils.CreateDir(needMkdir...); err != nil { + return err + } + + // 生成文件 + for _, value := range dataList { + f, err := os.OpenFile(value.autoCodePath, os.O_CREATE|os.O_WRONLY, 0755) + if err != nil { + return err + } + if err = value.template.Execute(f, autoCode); err != nil { + return err + } + _ = f.Close() + } + + defer func() { // 移除中间文件 + if err := os.RemoveAll(autoPath); err != nil { + return + } + }() + if autoCode.AutoMoveFile { // 判断是否需要自动转移 + for index, _ := range dataList { + addAutoMoveFile(&dataList[index]) + } + for _, value := range dataList { // 移动文件 + if err := utils.FileMove(value.autoCodePath, value.autoMoveFilePath); err != nil { + return err + } + } + initializeGormFilePath := filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Server, global.MG_CONFIG.AutoCode.SInitialize, "gorm.go") + initializeRouterFilePath := filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Server, global.MG_CONFIG.AutoCode.SInitialize, "router.go") + err = utils.AutoInjectionCode(initializeGormFilePath, "MysqlTables", "model."+autoCode.StructName+"{},") + if err != nil { + return err + } + err = utils.AutoInjectionCode(initializeRouterFilePath, "Routers", "router.Init"+autoCode.StructName+"Router(PrivateGroup)") + if err != nil { + return err + } + if global.MG_CONFIG.AutoCode.TransferRestart { + go func() { + _ = utils.Reload() + }() + } + return errors.New("创建代码成功并移动文件成功") + } else { // 打包 + if err := utils.ZipFiles("./ginvueadmin.zip", fileList, ".", "."); err != nil { + return err + } + } + return nil +} + +//@function: GetAllTplFile +//@description: 获取 pathName 文件夹下所有 tpl 文件 +//@param: pathName string, fileList []string +//@return: []string, error + +func GetAllTplFile(pathName string, fileList []string) ([]string, error) { + files, err := ioutil.ReadDir(pathName) + for _, fi := range files { + if fi.IsDir() { + fileList, err = GetAllTplFile(pathName+"/"+fi.Name(), fileList) + if err != nil { + return nil, err + } + } else { + if strings.HasSuffix(fi.Name(), ".tpl") { + fileList = append(fileList, pathName+"/"+fi.Name()) + } + } + } + return fileList, err +} + +//@function: GetTables +//@description: 获取数据库的所有表名 +//@param: dbName string +//@return: err error, TableNames []request.TableReq + +func GetTables(dbName string) (err error, TableNames []request.TableReq) { + err = global.MG_DB.Raw("select table_name as table_name from information_schema.tables where table_schema = ?", dbName).Scan(&TableNames).Error + return err, TableNames +} + +//@function: GetDB +//@description: 获取数据库的所有数据库名 +//@return: err error, DBNames []request.DBReq + +func GetDB() (err error, DBNames []request.DBReq) { + err = global.MG_DB.Raw("SELECT SCHEMA_NAME AS `database` FROM INFORMATION_SCHEMA.SCHEMATA;").Scan(&DBNames).Error + return err, DBNames +} + +//@function: GetDB +//@description: 获取指定数据库和指定数据表的所有字段名,类型值等 +//@param: tableName string, dbName string +//@return: err error, Columns []request.ColumnReq + +func GetColumn(tableName string, dbName string) (err error, Columns []request.ColumnReq) { + err = global.MG_DB.Raw("SELECT COLUMN_NAME column_name,DATA_TYPE data_type,CASE DATA_TYPE WHEN 'longtext' THEN c.CHARACTER_MAXIMUM_LENGTH WHEN 'varchar' THEN c.CHARACTER_MAXIMUM_LENGTH WHEN 'double' THEN CONCAT_WS( ',', c.NUMERIC_PRECISION, c.NUMERIC_SCALE ) WHEN 'decimal' THEN CONCAT_WS( ',', c.NUMERIC_PRECISION, c.NUMERIC_SCALE ) WHEN 'int' THEN c.NUMERIC_PRECISION WHEN 'bigint' THEN c.NUMERIC_PRECISION ELSE '' END AS data_type_long,COLUMN_COMMENT column_comment FROM INFORMATION_SCHEMA.COLUMNS c WHERE table_name = ? AND table_schema = ?", tableName, dbName).Scan(&Columns).Error + return err, Columns +} + +//@function: addAutoMoveFile +//@description: 生成对应的迁移文件路径 +//@param: *tplData +//@return: null + +func addAutoMoveFile(data *tplData) { + base := filepath.Base(data.autoCodePath) + fileSlice := strings.Split(data.autoCodePath, string(os.PathSeparator)) + n := len(fileSlice) + if n <= 2 { + return + } + if strings.Contains(fileSlice[1], "server") { + if strings.Contains(fileSlice[n-2], "router") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, global.MG_CONFIG.AutoCode.Server, + global.MG_CONFIG.AutoCode.SRouter, base) + } else if strings.Contains(fileSlice[n-2], "api") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Server, global.MG_CONFIG.AutoCode.SApi, base) + } else if strings.Contains(fileSlice[n-2], "service") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Server, global.MG_CONFIG.AutoCode.SService, base) + } else if strings.Contains(fileSlice[n-2], "model") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Server, global.MG_CONFIG.AutoCode.SModel, base) + } else if strings.Contains(fileSlice[n-2], "request") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Server, global.MG_CONFIG.AutoCode.SRequest, base) + } + } else if strings.Contains(fileSlice[1], "web") { + if strings.Contains(fileSlice[n-1], "js") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Web, global.MG_CONFIG.AutoCode.WApi, base) + } else if strings.Contains(fileSlice[n-2], "form") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Web, global.MG_CONFIG.AutoCode.WForm, filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), strings.TrimSuffix(base, filepath.Ext(base))+"Form.vue") + } else if strings.Contains(fileSlice[n-2], "table") { + data.autoMoveFilePath = filepath.Join(global.MG_CONFIG.AutoCode.Root, + global.MG_CONFIG.AutoCode.Web, global.MG_CONFIG.AutoCode.WTable, filepath.Base(filepath.Dir(filepath.Dir(data.autoCodePath))), base) + } + } +} + +//@function: CreateApi +//@description: 自动创建api数据, +//@param: a *model.AutoCodeStruct +//@return: err error + +func AutoCreateApi(a *model.AutoCodeStruct) (err error) { + var apiList = []model.SysApi{ + { + Path: "/" + a.Abbreviation + "/" + "create" + a.StructName, + Description: "新增" + a.Description, + ApiGroup: a.Abbreviation, + Method: "POST", + }, + { + Path: "/" + a.Abbreviation + "/" + "delete" + a.StructName, + Description: "删除" + a.Description, + ApiGroup: a.Abbreviation, + Method: "DELETE", + }, + { + Path: "/" + a.Abbreviation + "/" + "delete" + a.StructName + "ByIds", + Description: "批量删除" + a.Description, + ApiGroup: a.Abbreviation, + Method: "DELETE", + }, + { + Path: "/" + a.Abbreviation + "/" + "update" + a.StructName, + Description: "更新" + a.Description, + ApiGroup: a.Abbreviation, + Method: "PUT", + }, + { + Path: "/" + a.Abbreviation + "/" + "find" + a.StructName, + Description: "根据ID获取" + a.Description, + ApiGroup: a.Abbreviation, + Method: "GET", + }, + { + Path: "/" + a.Abbreviation + "/" + "get" + a.StructName + "List", + Description: "获取" + a.Description + "列表", + ApiGroup: a.Abbreviation, + Method: "GET", + }, + } + err = global.MG_DB.Transaction(func(tx *gorm.DB) error { + for _, v := range apiList { + var api model.SysApi + if errors.Is(tx.Where("path = ? AND method = ?", v.Path, v.Method).First(&api).Error, gorm.ErrRecordNotFound) { + if err := tx.Create(&v).Error; err != nil { // 遇到错误时回滚事务 + return err + } + } + } + return nil + }) + return err +} + +func getNeedList(autoCode *model.AutoCodeStruct) (dataList []tplData, fileList []string, needMkdir []string, err error) { + // 去除所有空格 + utils.TrimSpace(autoCode) + for _, field := range autoCode.Fields { + utils.TrimSpace(field) + } + // 获取 basePath 文件夹下所有tpl文件 + tplFileList, err := GetAllTplFile(basePath, nil) + if err != nil { + return nil, nil, nil, err + } + dataList = make([]tplData, 0, len(tplFileList)) + fileList = make([]string, 0, len(tplFileList)) + needMkdir = make([]string, 0, len(tplFileList)) // 当文件夹下存在多个tpl文件时,改为map更合理 + // 根据文件路径生成 tplData 结构体,待填充数据 + for _, value := range tplFileList { + dataList = append(dataList, tplData{locationPath: value}) + } + // 生成 *Template, 填充 template 字段 + for index, value := range dataList { + dataList[index].template, err = template.ParseFiles(value.locationPath) + if err != nil { + return nil, nil, nil, err + } + } + // 生成文件路径,填充 autoCodePath 字段,readme.txt.tpl不符合规则,需要特殊处理 + // resource/template/web/api.js.tpl -> autoCode/web/autoCode.PackageName/api/autoCode.PackageName.js + // resource/template/readme.txt.tpl -> autoCode/readme.txt + autoPath := "autoCode/" + for index, value := range dataList { + trimBase := strings.TrimPrefix(value.locationPath, basePath+"/") + if trimBase == "readme.txt.tpl" { + dataList[index].autoCodePath = autoPath + "readme.txt" + continue + } + + if lastSeparator := strings.LastIndex(trimBase, "/"); lastSeparator != -1 { + origFileName := strings.TrimSuffix(trimBase[lastSeparator+1:], ".tpl") + firstDot := strings.Index(origFileName, ".") + if firstDot != -1 { + var fileName string + if origFileName[firstDot:] != ".go" { + fileName = autoCode.PackageName + origFileName[firstDot:] + } else { + fileName = autoCode.HumpPackageName + origFileName[firstDot:] + } + + dataList[index].autoCodePath = filepath.Join(autoPath, trimBase[:lastSeparator], autoCode.PackageName, + origFileName[:firstDot], fileName) + } + } + + if lastSeparator := strings.LastIndex(dataList[index].autoCodePath, string(os.PathSeparator)); lastSeparator != -1 { + needMkdir = append(needMkdir, dataList[index].autoCodePath[:lastSeparator]) + } + } + for _, value := range dataList { + fileList = append(fileList, value.autoCodePath) + } + return dataList, fileList, needMkdir, err +} diff --git a/service/sys_base_menu.go b/service/sys_base_menu.go new file mode 100644 index 0000000..731b957 --- /dev/null +++ b/service/sys_base_menu.go @@ -0,0 +1,90 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + + "gorm.io/gorm" +) + +//@function: DeleteBaseMenu +//@description: 删除基础路由 +//@param: id float64 +//@return: err error + +func DeleteBaseMenu(id float64, appid string) (err error) { + err = global.MG_DB.Where("parent_id = ? and appid=?", id, appid).First(&model.SysBaseMenu{}).Error + if err != nil { + var menu model.SysBaseMenu + db := global.MG_DB.Where("id = ? and appid=?", id, appid).First(&menu).Delete(&menu) + //删除路由权限 + err = db.Error + } else { + return errors.New("此菜单存在子菜单不可删除") + } + return err +} + +//@function: UpdateBaseMenu +//@description: 更新路由 +//@param: menu model.SysBaseMenu +//@return: err error + +func UpdateBaseMenu(menu model.SysBaseMenu) (err error) { + var oldMenu model.SysBaseMenu + upDateMap := make(map[string]interface{}) + upDateMap["keep_alive"] = menu.KeepAlive + upDateMap["default_menu"] = menu.DefaultMenu + upDateMap["parent_id"] = menu.ParentId + upDateMap["path"] = menu.Path + upDateMap["name"] = menu.Name + upDateMap["hidden"] = menu.Hidden + upDateMap["component"] = menu.Component + upDateMap["title"] = menu.Title + upDateMap["icon"] = menu.Icon + upDateMap["sort"] = menu.Sort + + err = global.MG_DB.Transaction(func(tx *gorm.DB) error { + db := tx.Where("id = ?", menu.ID).Find(&oldMenu) + if oldMenu.Name != menu.Name { + if !errors.Is(tx.Where("id <> ? AND name = ?", menu.ID, menu.Name).First(&model.SysBaseMenu{}).Error, gorm.ErrRecordNotFound) { + global.MG_LOG.Debug("存在相同name修改失败") + return errors.New("存在相同name修改失败") + } + } + txErr := tx.Unscoped().Delete(&model.SysBaseMenuParameter{}, "sys_base_menu_id = ?", menu.ID).Error + if txErr != nil { + global.MG_LOG.Debug(txErr.Error()) + return txErr + } + if len(menu.Parameters) > 0 { + for k, _ := range menu.Parameters { + menu.Parameters[k].SysBaseMenuID = menu.ID + } + txErr = tx.Create(&menu.Parameters).Error + if txErr != nil { + global.MG_LOG.Debug(txErr.Error()) + return txErr + } + } + + txErr = db.Updates(upDateMap).Error + if txErr != nil { + global.MG_LOG.Debug(txErr.Error()) + return txErr + } + return nil + }) + return err +} + +//@function: GetBaseMenuById +//@description: 返回当前选中menu +//@param: id float64 +//@return: err error, menu model.SysBaseMenu + +func GetBaseMenuById(id float64) (err error, menu model.SysBaseMenu) { + err = global.MG_DB.Preload("Parameters").Where("id = ?", id).First(&menu).Error + return +} diff --git a/service/sys_casbin.go b/service/sys_casbin.go new file mode 100644 index 0000000..35f2273 --- /dev/null +++ b/service/sys_casbin.go @@ -0,0 +1,137 @@ +package service + +import ( + "errors" + "fmt" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "strconv" + "strings" + "sync" + + "github.com/casbin/casbin/v2" + "github.com/casbin/casbin/v2/util" + gormadapter "github.com/casbin/gorm-adapter/v3" + _ "github.com/go-sql-driver/mysql" +) + +//@function: UpdateCasbin +//@description: 更新casbin权限 +//@param: authorityId string, casbinInfos []request.CasbinInfo +//@return: error + +func UpdateCasbin(authorityId uint, appid string, casbinInfos []request.CasbinInfo) error { + //ClearCasbin(0, "api", appid, strconv.Itoa(int(authorityId))) + global.MG_DB.Table("casbin_rule").Model(&model.CasbinModel{}).Where("ptype=? and v0=? and v1=? and v2 = ? AND v5=? ", "p", "api", appid, strconv.Itoa(int(authorityId)), "admin").Delete(&model.CasbinModel{}) + rules := [][]string{} + for _, v := range casbinInfos { + cm := model.CasbinModel{ + Ptype: "p", + AuthorityId: authorityId, + Path: v.Path, + Method: v.Method, + } + rules = append(rules, []string{"api", appid, strconv.Itoa(int(cm.AuthorityId)), cm.Path, cm.Method, "admin"}) + } + e := Casbin() + success, _ := e.AddPolicies(rules) + if success == false { + return errors.New("存在相同api,添加失败,请联系管理员") + } + return nil +} + +//@function: UpdateCasbinApi +//@description: API更新随动 +//@param: oldPath string, newPath string, oldMethod string, newMethod string +//@return: error + +func UpdateCasbinApi(oldPath string, newPath string, oldMethod string, newMethod, appid, types string) error { + err := global.MG_DB.Table("casbin_rule").Model(&model.CasbinModel{}).Where("v1=? and v3 = ? AND v4 = ? and v5=?", appid, oldPath, oldMethod, types).Updates(map[string]interface{}{ + "v3": newPath, + "v4": newMethod, + }).Error + return err +} + +//@function: GetPolicyPathByAuthorityId +//@description: 获取权限列表 +//@param: authorityId string +//@return: pathMaps []request.CasbinInfo + +func GetPolicyPathByAuthorityId(authorityId uint, appid string) (pathMaps []request.CasbinInfo) { + e := Casbin() + list := e.GetFilteredPolicy(0, "api", appid, strconv.Itoa(int(authorityId))) + for _, v := range list { + pathMaps = append(pathMaps, request.CasbinInfo{ + Path: v[3], + Method: v[4], + }) + } + return pathMaps +} + +//@function: ClearCasbin +//@description: 清除匹配的权限 +//@param: v int, p ...string +//@return: bool + +func ClearCasbin(v int, p ...string) bool { + e := Casbin() + success, _ := e.RemoveFilteredPolicy(v, p...) + return success + +} + +//@function: Casbin +//@description: 持久化到数据库 引入自定义规则 +//@return: *casbin.Enforcer + +var ( + syncedEnforcer *casbin.SyncedEnforcer + once sync.Once +) + +func Casbin() *casbin.SyncedEnforcer { + once.Do(func() { + var err error + a, _ := gormadapter.NewAdapterByDB(global.MG_DB) + syncedEnforcer, err = casbin.NewSyncedEnforcer(global.MG_CONFIG.Casbin.ModelPath, a) + if err != nil { + fmt.Println(err) + } + syncedEnforcer.AddFunction("ParamsMatch", ParamsMatchFunc) + }) + _ = syncedEnforcer.LoadPolicy() + return syncedEnforcer +} + +//@function: ParamsMatch +//@description: 自定义规则函数 +//@param: fullNameKey1 string, key2 string +//@return: bool + +func ParamsMatch(fullNameKey1 string, key2 string) bool { + key1 := strings.Split(fullNameKey1, "?")[0] + // 剥离路径后再使用casbin的keyMatch2 + return util.KeyMatch2(key1, key2) +} + +//@function: ParamsMatchFunc +//@description: 自定义规则函数 +//@param: args ...interface{} +//@return: interface{}, error + +func ParamsMatchFunc(args ...interface{}) (interface{}, error) { + name1 := args[0].(string) + name2 := args[1].(string) + + return ParamsMatch(name1, name2), nil +} + +// 初始化角色 +func InitRole(userID, roleID, Appid string) { + e := Casbin() + e.AddRoleForUserInDomain(userID, roleID, Appid) +} diff --git a/service/sys_dictionary.go b/service/sys_dictionary.go new file mode 100644 index 0000000..481e956 --- /dev/null +++ b/service/sys_dictionary.go @@ -0,0 +1,98 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + + "gorm.io/gorm" +) + +//@function: DeleteSysDictionary +//@description: 创建字典数据 +//@param: sysDictionary model.SysDictionary +//@return: err error + +func CreateSysDictionary(sysDictionary model.SysDictionary) (err error) { + if (!errors.Is(global.MG_DB.First(&model.SysDictionary{}, "type = ?", sysDictionary.Type).Error, gorm.ErrRecordNotFound)) { + return errors.New("存在相同的type,不允许创建") + } + err = global.MG_DB.Create(&sysDictionary).Error + return err +} + +//@function: DeleteSysDictionary +//@description: 删除字典数据 +//@param: sysDictionary model.SysDictionary +//@return: err error + +func DeleteSysDictionary(sysDictionary model.SysDictionary) (err error) { + err = global.MG_DB.Delete(&sysDictionary).Delete(&sysDictionary.SysDictionaryDetails).Error + return err +} + +//@function: UpdateSysDictionary +//@description: 更新字典数据 +//@param: sysDictionary *model.SysDictionary +//@return: err error + +func UpdateSysDictionary(sysDictionary *model.SysDictionary) (err error) { + var dict model.SysDictionary + sysDictionaryMap := map[string]interface{}{ + "Name": sysDictionary.Name, + "Type": sysDictionary.Type, + "Status": sysDictionary.Status, + "Desc": sysDictionary.Desc, + } + db := global.MG_DB.Where("id = ?", sysDictionary.ID).First(&dict) + if dict.Type == sysDictionary.Type { + err = db.Updates(sysDictionaryMap).Error + } else { + if (!errors.Is(global.MG_DB.First(&model.SysDictionary{}, "type = ?", sysDictionary.Type).Error, gorm.ErrRecordNotFound)) { + return errors.New("存在相同的type,不允许创建") + } + err = db.Updates(sysDictionaryMap).Error + + } + return err +} + +//@function: GetSysDictionary +//@description: 根据id或者type获取字典单条数据 +//@param: Type string, Id uint +//@return: err error, sysDictionary model.SysDictionary + +func GetSysDictionary(Type string, Id uint) (err error, sysDictionary model.SysDictionary) { + err = global.MG_DB.Where("type = ? OR id = ?", Type, Id).Preload("SysDictionaryDetails").First(&sysDictionary).Error + return +} + +//@function: GetSysDictionaryInfoList +//@description: 分页获取字典列表 +//@param: info request.SysDictionarySearch +//@return: err error, list interface{}, total int64 + +func GetSysDictionaryInfoList(info request.SysDictionarySearch) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.SysDictionary{}) + var sysDictionarys []model.SysDictionary + // 如果有条件搜索 下方会自动创建搜索语句 + if info.Name != "" { + db = db.Where("`name` LIKE ?", "%"+info.Name+"%") + } + if info.Type != "" { + db = db.Where("`type` LIKE ?", "%"+info.Type+"%") + } + if info.Status != nil { + db = db.Where("`status` = ?", info.Status) + } + if info.Desc != "" { + db = db.Where("`desc` LIKE ?", "%"+info.Desc+"%") + } + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&sysDictionarys).Error + return err, sysDictionarys, total +} diff --git a/service/sys_dictionary_detail.go b/service/sys_dictionary_detail.go new file mode 100644 index 0000000..f69ab23 --- /dev/null +++ b/service/sys_dictionary_detail.go @@ -0,0 +1,76 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +//@function: CreateSysDictionaryDetail +//@description: 创建字典详情数据 +//@param: sysDictionaryDetail model.SysDictionaryDetail +//@return: err error + +func CreateSysDictionaryDetail(sysDictionaryDetail model.SysDictionaryDetail) (err error) { + err = global.MG_DB.Create(&sysDictionaryDetail).Error + return err +} + +//@function: DeleteSysDictionaryDetail +//@description: 删除字典详情数据 +//@param: sysDictionaryDetail model.SysDictionaryDetail +//@return: err error + +func DeleteSysDictionaryDetail(sysDictionaryDetail model.SysDictionaryDetail) (err error) { + err = global.MG_DB.Delete(&sysDictionaryDetail).Error + return err +} + +//@function: UpdateSysDictionaryDetail +//@description: 更新字典详情数据 +//@param: sysDictionaryDetail *model.SysDictionaryDetail +//@return: err error + +func UpdateSysDictionaryDetail(sysDictionaryDetail *model.SysDictionaryDetail) (err error) { + err = global.MG_DB.Save(sysDictionaryDetail).Error + return err +} + +//@function: GetSysDictionaryDetail +//@description: 根据id获取字典详情单条数据 +//@param: id uint +//@return: err error, sysDictionaryDetail model.SysDictionaryDetail + +func GetSysDictionaryDetail(id uint) (err error, sysDictionaryDetail model.SysDictionaryDetail) { + err = global.MG_DB.Where("id = ?", id).First(&sysDictionaryDetail).Error + return +} + +//@function: GetSysDictionaryDetailInfoList +//@description: 分页获取字典详情列表 +//@param: info request.SysDictionaryDetailSearch +//@return: err error, list interface{}, total int64 + +func GetSysDictionaryDetailInfoList(info request.SysDictionaryDetailSearch) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.SysDictionaryDetail{}) + var sysDictionaryDetails []model.SysDictionaryDetail + // 如果有条件搜索 下方会自动创建搜索语句 + if info.Label != "" { + db = db.Where("label LIKE ?", "%"+info.Label+"%") + } + if info.Value != 0 { + db = db.Where("value = ?", info.Value) + } + if info.Status != nil { + db = db.Where("status = ?", info.Status) + } + if info.SysDictionaryID != 0 { + db = db.Where("sys_dictionary_id = ?", info.SysDictionaryID) + } + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&sysDictionaryDetails).Error + return err, sysDictionaryDetails, total +} diff --git a/service/sys_email.go b/service/sys_email.go new file mode 100644 index 0000000..6e8db45 --- /dev/null +++ b/service/sys_email.go @@ -0,0 +1,16 @@ +package service + +import ( + "pure-admin/utils" +) + +//@function: EmailTest +//@description: 发送邮件测试 +//@return: err error + +func EmailTest() (err error) { + subject := "test" + body := "test" + err = utils.EmailTest(subject, body) + return err +} diff --git a/service/sys_menu.go b/service/sys_menu.go new file mode 100644 index 0000000..7d3da57 --- /dev/null +++ b/service/sys_menu.go @@ -0,0 +1,168 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "strconv" + + "gorm.io/gorm" +) + +//@function: getMenuTreeMap +//@description: 获取路由总树map +//@param: authorityId string +//@return: err error, treeMap map[string][]model.SysMenu + +func getMenuTreeMap(authorityId uint, appid string) (err error, treeMap map[string][]model.SysMenu) { + var ( + allMenus []model.SysMenu + paths []string + ) + e := Casbin() + res := e.GetFilteredPolicy(0, "menu", appid, strconv.Itoa(int(authorityId))) + for _, v := range res { + if len(v) > 3 { + paths = append(paths, v[3]) + } + } + treeMap = make(map[string][]model.SysMenu) + err = global.MG_DB.Model(&model.SysMenu{}). + Where("path in (?) and appid=?", paths, appid).Order("sys_base_menus.sort,sys_base_menus.id").Find(&allMenus).Error + for _, v := range allMenus { + treeMap[v.ParentId] = append(treeMap[v.ParentId], v) + } + return err, treeMap +} + +//@function: GetMenuTree +//@description: 获取动态菜单树 +//@param: authorityId string +//@return: err error, menus []model.SysMenu + +func GetMenuTree(authorityId uint, appid string) (err error, menus []model.SysMenu) { + err, menuTree := getMenuTreeMap(authorityId, appid) + menus = menuTree["0"] + for i := 0; i < len(menus); i++ { + err = getChildrenList(&menus[i], menuTree) + } + return err, menus +} + +//@function: getChildrenList +//@description: 获取子菜单 +//@param: menu *model.SysMenu, treeMap map[string][]model.SysMenu +//@return: err error + +func getChildrenList(menu *model.SysMenu, treeMap map[string][]model.SysMenu) (err error) { + menu.Children = treeMap[strconv.Itoa(int(menu.ID))] + for i := 0; i < len(menu.Children); i++ { + err = getChildrenList(&menu.Children[i], treeMap) + } + return err +} + +//@function: GetInfoList +//@description: 获取路由分页 +//@return: err error, list interface{}, total int64 + +func GetInfoList() (err error, list interface{}, total int64) { + var menuList []model.SysBaseMenu + err, treeMap := getBaseMenuTreeMap() + menuList = treeMap["0"] + for i := 0; i < len(menuList); i++ { + err = getBaseChildrenList(&menuList[i], treeMap) + } + return err, menuList, total +} + +//@function: getBaseChildrenList +//@description: 获取菜单的子菜单 +//@param: menu *model.SysBaseMenu, treeMap map[string][]model.SysBaseMenu +//@return: err error + +func getBaseChildrenList(menu *model.SysBaseMenu, treeMap map[string][]model.SysBaseMenu) (err error) { + menu.Children = treeMap[strconv.Itoa(int(menu.ID))] + for i := 0; i < len(menu.Children); i++ { + err = getBaseChildrenList(&menu.Children[i], treeMap) + } + return err +} + +//@function: AddBaseMenu +//@description: 添加基础路由 +//@param: menu model.SysBaseMenu +//@return: error + +func AddBaseMenu(menu model.SysBaseMenu, appid string) error { + if !errors.Is(global.MG_DB.Where("name = ? and appid=?", menu.Name, appid).First(&model.SysBaseMenu{}).Error, gorm.ErrRecordNotFound) { + return errors.New("存在重复name,请修改name") + } + menu.Appid = appid + menu.Type = "admin" + return global.MG_DB.Create(&menu).Error +} + +//@function: getBaseMenuTreeMap +//@description: 获取路由总树map +//@return: err error, treeMap map[string][]model.SysBaseMenu + +func getBaseMenuTreeMap() (err error, treeMap map[string][]model.SysBaseMenu) { + var allMenus []model.SysBaseMenu + treeMap = make(map[string][]model.SysBaseMenu) + err = global.MG_DB.Order("sort").Preload("Parameters").Find(&allMenus).Error + for _, v := range allMenus { + treeMap[v.ParentId] = append(treeMap[v.ParentId], v) + } + return err, treeMap +} + +//@function: GetBaseMenuTree +//@description: 获取基础路由树 +//@return: err error, menus []model.SysBaseMenu + +func GetBaseMenuTree() (err error, menus []model.SysBaseMenu) { + err, treeMap := getBaseMenuTreeMap() + menus = treeMap["0"] + for i := 0; i < len(menus); i++ { + err = getBaseChildrenList(&menus[i], treeMap) + } + return err, menus +} + +//@function: AddMenuAuthority +//@description: 为角色增加menu树 +//@param: menus []model.SysBaseMenu, authorityId string +//@return: err error + +func AddMenuAuthority(menus []model.SysBaseMenu, authorityId uint, appid string) (err error) { + var auth model.SysAuthority + auth.AuthorityId = authorityId + auth.SysBaseMenus = menus + auth.Appid = appid + err = SetMenuAuthority(&auth) + return err +} + +//@function: GetMenuAuthority +//@description: 查看当前角色树 +//@param: info *request.GetAuthorityId +//@return: err error, menus []model.SysMenu + +func GetMenuAuthority(authorityId uint, appid string) (err error, menus []model.SysMenu) { + var ( + paths []string + ) + e := Casbin() + res := e.GetFilteredPolicy(0, "menu", appid, strconv.Itoa(int(authorityId))) + for _, v := range res { + if len(v) > 3 { + paths = append(paths, v[3]) + } + } + err = global.MG_DB.Model(&model.SysMenu{}). + Where("path in (?) and appid=? and type=?", paths, appid, "admin").Order("sys_base_menus.sort").Find(&menus).Error + //sql := "SELECT authority_menu.keep_alive,authority_menu.default_menu,authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM authority_menu WHERE authority_menu.authority_id = ? ORDER BY authority_menu.sort ASC" + //err = global.MG_DB.Raw(sql, authorityId).Scan(&menus).Error + return err, menus +} diff --git a/service/sys_mission_reward.go b/service/sys_mission_reward.go new file mode 100644 index 0000000..b97b226 --- /dev/null +++ b/service/sys_mission_reward.go @@ -0,0 +1,107 @@ +package service + +import ( + "errors" + "gorm.io/gorm" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "strconv" +) + +func GetSysMissionRewardList(params request.SearchSysReward) (err error, list []model.SysMissionReward, total int64) { + limit := params.PageSize + offset := params.PageSize * (params.Page - 1) + db := global.MG_DB.Model(&model.SysMissionReward{}) + db.Count(&total) + var res []model.SysMissionReward + err = db.Order("id desc").Offset(offset).Limit(limit).Find(&res).Error + if err != nil { + return err, nil, 0 + } + + return err, res, total +} + +func SendSysMissionReward(uuid string, info request.IdReq) (err error) { + var ( + checkReward model.SysMissionReward + checkMission model.MissionClaim + checkVideo model.MissionClaimVideo + ) + err = global.MG_DB.Model(&model.SysMissionReward{}).Where("id = ?", info.ID).First(&checkReward).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return err + } + err = global.MG_DB.Model(&model.MissionClaimVideo{}).Where("id = ?", checkReward.RelationId).First(&checkVideo).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return err + } + err = global.MG_DB.Model(&model.MissionClaim{}).Where("id = ?", checkVideo.MissionClaimId).First(&checkMission).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return err + } + var bkbWallet model.Wallet + err = global.MG_DB.Model(&model.Wallet{}).Where("platform = 'bkb' AND user_id = 'bkb'").First(&bkbWallet).Error + if err != nil { + return + } + tx := global.MG_DB.Begin() + //修改任务状态 + err = global.MG_DB.Model(&model.SysMissionReward{}).Where("id = ?", info.ID).Update("status", 3).Error + if err != nil { + tx.Rollback() + err = errors.New("update mission reward status failed") + return + } + + // 扣除商家锁定营销账户 + err = tx.Model(&model.Wallet{}).Where("id = ?", bkbWallet.ID).UpdateColumn("fund", gorm.Expr("fund - ?", checkReward.Bonus)).Error + if err != nil { + tx.Rollback() + err = errors.New("settle seller wallet failed") + return + } + var billFund model.BillFund + billFund.UserID = "bkb" + billFund.TransactionType = 1 + billFund.TransactionId = "MB" + generate() // mission-bill + billFund.Title = "" + billFund.Price = checkReward.Bonus + billFund.Balance = bkbWallet.Fund + billFund.Platform = "seller" + billFund.RelatedId = strconv.Itoa(int(checkReward.ID)) + billFund.Status = 2 + err = tx.Model(&model.BillFund{}).Create(&billFund).Error + if err != nil { + tx.Rollback() + return + } + // 结算至网红钱包-余额 + var influenceWallet model.Wallet + err = tx.Model(&model.Wallet{}).Where("platform = 'influencer' AND user_id = ?", checkVideo.CreateBy). + Updates(map[string]interface{}{"balance": gorm.Expr("balance + ?", checkReward.Bonus), "transit_balance": gorm.Expr("transit_balance - ?", checkReward.Bonus)}).First(&influenceWallet).Error + if err != nil { + tx.Rollback() + err = errors.New("settle influencer wallet failed") + return + } + // 创建任务结算账单 + var bill model.Bill + bill.UserID = checkVideo.CreateBy + bill.Type = "1" + bill.Title = "平台奖励发放-" + checkReward.Title + bill.Price = checkReward.Bonus + bill.Balance = influenceWallet.Balance + bill.Status = 2 + bill.Receipt = 1 + bill.Platform = "influencer" + err = tx.Model(&model.Bill{}).Create(&bill).Error + if err != nil { + tx.Rollback() + err = errors.New("create influencer mission settle bill failed") + return + } + tx.Commit() + return err +} diff --git a/service/sys_operation_record.go b/service/sys_operation_record.go new file mode 100644 index 0000000..fddf92b --- /dev/null +++ b/service/sys_operation_record.go @@ -0,0 +1,91 @@ +package service + +import ( + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" +) + +//@function: CreateSysOperationRecord +//@description: 创建记录 +//@param: sysOperationRecord model.SysOperationRecord +//@return: err error + +func CreateSysOperationRecord(sysOperationRecord model.SysOperationRecord) (err error) { + err = global.MG_DB.Create(&sysOperationRecord).Error + return err +} + +//@function: DeleteSysOperationRecordByIds +//@description: 批量删除记录 +//@param: ids request.IdsReq +//@return: err error + +func DeleteSysOperationRecordByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Delete(&[]model.SysOperationRecord{}, "id in (?)", ids.Ids).Error + return err +} + +//@function: DeleteSysOperationRecord +//@description: 删除操作记录 +//@param: sysOperationRecord model.SysOperationRecord +//@return: err error + +func DeleteSysOperationRecord(sysOperationRecord model.SysOperationRecord) (err error) { + err = global.MG_DB.Delete(&sysOperationRecord).Error + return err +} + +//@function: DeleteSysOperationRecord +//@description: 根据id获取单条操作记录 +//@param: id uint +//@return: err error, sysOperationRecord model.SysOperationRecord + +func GetSysOperationRecord(id uint) (err error, sysOperationRecord model.SysOperationRecord) { + err = global.MG_DB.Where("id = ?", id).First(&sysOperationRecord).Error + return +} + +//@function: GetSysOperationRecordInfoList +//@description: 分页获取操作记录列表 +//@param: info request.SysOperationRecordSearch +//@return: err error, list interface{}, total int64 + +func GetSysOperationRecordInfoList(info request.SysOperationRecordSearch, appid string) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.SysOperationRecord{}).Where("sys_operation_records.appid=?", appid). + Joins("LEFT JOIN user as u ON u.id=sys_operation_records.user_id") + var sysOperationRecords []model.SysOperationRecord + // 如果有条件搜索 下方会自动创建搜索语句 + if info.Method != "" { + db = db.Where("sys_operation_records.method = ?", info.Method) + } + if info.Path != "" { + db = db.Where("sys_operation_records.path LIKE ?", "%"+info.Path+"%") + } + if info.UserID != 0 { + db = db.Where("sys_operation_records.user_id = ?", info.UserID) + } + if info.NickName != "" { + db = db.Where("u.nick_name = ?", info.NickName) + } + if info.CreatedAtStart != "" { + db = db.Where("sys_operation_records.created_at >= ?", info.CreatedAtStart) + } + if info.CreatedAtEnd != "" { + db = db.Where("sys_operation_records.created_at < ?", info.CreatedAtEnd) + } + if info.Status != 0 { + db = db.Where("sys_operation_records.status = ?", info.Status) + } + err = db.Count(&total).Error + err = db.Select("sys_operation_records.id,sys_operation_records.ip,sys_operation_records.method,sys_operation_records.path,sys_operation_records.status,sys_operation_records.agent,sys_operation_records.user_id,sys_operation_records.created_at,sys_operation_records.updated_at").Order("sys_operation_records.id desc").Limit(limit).Offset(offset).Preload("User").Find(&sysOperationRecords).Error + for i := 0; i < len(sysOperationRecords); i++ { + var api model.SysApi + _, api = GetApiByPathMethod(sysOperationRecords[i].Path, sysOperationRecords[i].Method, appid) + sysOperationRecords[i].ApiDescription = api.Description + } + return err, sysOperationRecords, total +} diff --git a/service/sys_system.go b/service/sys_system.go new file mode 100644 index 0000000..8c33782 --- /dev/null +++ b/service/sys_system.go @@ -0,0 +1,30 @@ +package service + +import ( + "pure-admin/config" + "pure-admin/global" + "pure-admin/model" + "pure-admin/utils" +) + +// @function: GetSystemConfig +// @description: 读取配置文件 +// @return: err error, conf config.Server +func GetSystemConfig() (err error, conf config.Server) { + return nil, global.MG_CONFIG +} + +// @description set system config, + +// @function: SetSystemConfig +// @description: 设置配置文件 +// @param: system model.System +// @return: err error +func SetSystemConfig(system model.System) (err error) { + cs := utils.StructToMap(system.Config) + for k, v := range cs { + global.MG_VP.Set(k, v) + } + err = global.MG_VP.WriteConfig() + return err +} diff --git a/service/sys_user.go b/service/sys_user.go new file mode 100644 index 0000000..dc86d9b --- /dev/null +++ b/service/sys_user.go @@ -0,0 +1,284 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/utils" + "strconv" + + uuid "github.com/satori/go.uuid" + "gorm.io/gorm" +) + +//@function: Register +//@description: 用户注册 +//@param: u model.SysUser +//@return: err error, userInter model.SysUser + +func Register(u model.User) (err error, userInter model.User) { + var user model.SysUser + if !errors.Is(global.MG_DB.Where("username = ?", u.Username).First(&user).Error, gorm.ErrRecordNotFound) { // 判断用户名是否注册 + return errors.New("用户名已注册"), userInter + } + // 否则 附加uuid 密码md5简单加密 注册 + u.Password = utils.MD5V([]byte(u.Password)) + u.UUID = uuid.NewV4() + u.Appid = "appid" + u.Avatar = "http://qmplusimg.henrongyi.top/head.png" + u.Type = "admin" + err = global.MG_DB.Create(&u).Error + if err != nil { + err = errors.New("注册失败") + } + go InitRole(u.UUID.String(), strconv.Itoa(int(u.AuthorityID)), u.Appid) + return err, u +} + +//@function: Login +//@description: 用户登录 +//@param: u *model.SysUser +//@return: err error, userInter *model.SysUser + +func Login(u *model.User) (err error, userInter *model.User) { + var ( + user model.User + authorities []model.SysAuthority + ) + u.Password = utils.MD5V([]byte(u.Password)) + err = global.MG_DB.Where("username = ? AND password = ? and type=?", u.Username, u.Password, "admin").First(&user).Error + if err != nil { + return errors.New("用户名不存在或者密码错误"), nil + } + e := Casbin() + res := e.GetRolesForUserInDomain(user.UUID.String(), u.Appid) + if len(res) > 0 { + err = global.MG_DB.Where("authority_id IN ?", res).Find(&authorities).Error + } else { + err = errors.New("该用户未分配角色") + } + for _, v := range authorities { + if user.AuthorityID == v.AuthorityId { + user.Authority = v + break + } + } + user.Authorities = authorities + return err, &user +} + +//@function: ChangePassword +//@description: 修改用户密码 +//@param: u *model.SysUser, newPassword string +//@return: err error, userInter *model.SysUser + +func ChangePassword(u *model.SysUser, newPassword string) (err error, userInter *model.SysUser) { + var user model.SysUser + u.Password = utils.MD5V([]byte(u.Password)) + err = global.MG_DB.Where("username = ? AND password = ?", u.Username, u.Password).First(&user).Update("password", utils.MD5V([]byte(newPassword))).Error + return err, u +} + +//@function: GetUserInfoList +//@description: 分页获取数据 +//@param: info request.PageInfo +//@return: err error, list interface{}, total int64 + +func GetUserInfoList1(info request.SearchSysUserParams, appid string) (err error, list interface{}, total int64) { + var ( + authorityIds = make([]string, 0) + authorities []model.SysAuthority + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.User{}) + db = db.Where("appid=? and type=?", appid, "admin") + if info.SysUser.NickName != "" { + db = db.Where("nick_name LIKE ?", "%"+info.SysUser.NickName+"%") + } + if info.SysUser.Username != "" { + db = db.Where("username LIKE ?", "%"+info.SysUser.Username+"%") + } + if info.SysUser.Phone != "" { + db = db.Where("phone LIKE ?", "%"+info.SysUser.Phone+"%") + } + if info.SysUser.Status != "" { + db = db.Where("status = ?", info.SysUser.Status) + } + var userList []model.User + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&userList).Error + if err != nil { + return err, nil, 0 + } + for k, _ := range userList { + e := Casbin() + res := e.GetRolesForUserInDomain(userList[k].UUID.String(), appid) + if len(res) > 0 { + authorityIds = append(authorityIds, res...) + } + } + if len(authorityIds) > 0 { + err = global.MG_DB.Where("authority_id IN ?", authorityIds).Find(&authorities).Error + } + for k, _ := range userList { + authorities1 := make([]model.SysAuthority, 0) + for _, v := range authorities { + if userList[k].AuthorityID == v.AuthorityId { + authorities1 = append(authorities1, v) + } + } + userList[k].Authorities = authorities1 + } + return err, userList, total +} + +func GetUserSelectList(nickName, appid string) (list []model.SysUserSimple, err error) { + db := global.MG_DB.Model(&model.User{}) + if nickName != "" { + db = db.Where("nick_name LIKE ?", "%"+nickName+"%") + } + err = db.Select("uuid,nick_name").Where("appid=?", appid).Find(&list).Error + return +} + +//@function: SetUserAuthority +//@description: 设置一个用户的权限 +//@param: uuid uuid.UUID, authorityId string +//@return: err error + +func SetUserAuthority(uuid string, authorityId string) (err error) { + err = global.MG_DB.Where("uuid = ?", uuid).First(&model.User{}).Update("authority_id", authorityId).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: SetUserAuthorities +//@description: 设置一个用户的权限 +//@param: id uint, authorityIds []string +//@return: err error + +func SetUserAuthorities(uuid string, authorityIds []string) (err error) { + if len(authorityIds) != 0 { + err = global.MG_DB.Model(&model.SysUser{}).Where("uuid = ?", uuid).Update("authority_id", authorityIds[0]).Error + if err != nil { + return err + } + } + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + // TxErr := tx.Delete(&[]model.SysUserAuthority{}, "sys_user_id = ?", uuid).Error + // if TxErr != nil { + // return TxErr + // } + // useAuthority := []model.SysUserAuthority{} + // for _, v := range authorityIds { + // useAuthority = append(useAuthority, model.SysUserAuthority{ + // uuid, v, + // }) + // } + // TxErr = tx.Create(&useAuthority).Error + // if TxErr != nil { + // return TxErr + // } + // 返回 nil 提交事务 + return nil + }) +} + +//@function: DeleteUser +//@description: 删除用户 +//@param: id float64 +//@return: err error + +func DeleteUser1(id float64) (err error) { + var user model.User + err = global.MG_DB.Where("id = ?", id).Delete(&user).Error + // err = global.MG_DB.Delete(&[]model.SysUserAuthority{}, "sys_user_id = ?", id).Error + return err +} + +//@function: SetUserInfo +//@description: 设置用户信息 +//@param: reqUser model.SysUser +//@return: err error, user model.SysUser + +func SetUserInfo(reqUser model.SysUser) (err error, user model.SysUser) { + err = global.MG_DB.Model(&model.SysUser{}).Where("uuid = ?", reqUser.UUID).Updates(&reqUser).Scan(&user).Error + return err, user +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetUserInfo +//@description: 获取用户信息 +//@param: uuid string +//@return: err error, user system.SysUser + +func GetUserInfo1(uuid string) (err error, user model.SysUser) { + var reqUser model.SysUser + err = global.MG_DB.Preload("Authority").Preload("Authorities").Preload("SysUserAuthors").First(&reqUser, "uuid = ?", uuid).Error + if err != nil { + return err, reqUser + } + return err, reqUser +} + +//@function: FindUserById +//@description: 通过id获取用户信息 +//@param: id int +//@return: err error, user *model.SysUser + +func FindUserById(id int) (err error, user *model.SysUser) { + var u model.SysUser + err = global.MG_DB.Where("`id` = ?", id).First(&u).Error + return err, &u +} + +//@function: FindUserByUuid +//@description: 通过uuid获取用户信息 +//@param: uuid string +//@return: err error, user *model.SysUser + +func FindUserByUuid(uuid string) (err error, user *model.User) { + var u model.User + if err = global.MG_DB.Where("`uuid` = ?", uuid).First(&u).Error; err != nil { + return errors.New("用户不存在"), &u + } + return nil, &u +} + +func FindUserByAuthorityID(authority_id string) (err error, user *model.SysUser) { + var u model.SysUser + if err = global.MG_DB.Where("`authority_id` = ?", authority_id).First(&u).Error; err != nil { + return errors.New("用户不存在"), &u + } + return nil, &u +} + +func FindUserSimpleByUuid(uuid string) (err error, user *model.SysUserSimple) { + var u model.SysUserSimple + if err = global.MG_DB.Select("id,uuid,nick_name,username").Where("`uuid` = ?", uuid).First(&u).Error; err != nil { + return errors.New("用户不存在"), &u + } + return nil, &u +} + +func FindAuthorityByAuthorityID(id string) (err error, user *model.SysAuthoritySimple) { + var u model.SysAuthoritySimple + if err = global.MG_DB.Where("`authority_id` = ?", id).First(&u).Error; err != nil { + return errors.New("角色不存在"), &u + } + return nil, &u +} + +func GetSysUserAuthority(userId, authorityId string) (err error, list []global.BASE_ID_STR) { + db := global.MG_DB.Table("sys_user_authority").Select("sys_user_id as id") + if userId != "" { + db = db.Where("sys_user_id = ?", userId) + } + if authorityId != "" { + db = db.Where("sys_authority_id = ?", authorityId) + } + err = db.Find(&list).Error + return err, list +} diff --git a/service/tags.go b/service/tags.go new file mode 100644 index 0000000..4a93c1e --- /dev/null +++ b/service/tags.go @@ -0,0 +1,171 @@ +package service + +import ( + "errors" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "strings" + + "gorm.io/gorm" +) + +func GetTagsList(info request.SearchTags) (err error, list []model.Tags, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.Tags{}) + + //词库类型 + if info.Value != "" { + db = db.Where("value = ?", info.Value) + } + + //敏感词类型 + if info.Type != "" { + db = db.Where("type = ?", info.Type) + } + + var Tags []model.Tags + + err = db.Count(&total).Error + err = db.Preload("User").Order("created_at desc").Limit(limit).Offset(offset).Find(&Tags).Error + if err != nil { + return + } + + return err, Tags, total +} + +func CreateTags(tags request.TagsCommon, uuid string) (model.Tags, error) { + var doc, data model.Tags + if !errors.Is(global.MG_DB.Model(&model.Tags{}).Where("value = ? and type = ?", tags.Value, tags.Type).First(&model.Tags{}).Error, gorm.ErrRecordNotFound) { + return doc, errors.New("该标签已存在") + } + data = model.Tags{ + Value: tags.Value, + CreateBy: uuid, + UpdateBy: uuid, + Type: tags.Type, + } + if err := global.MG_DB.Model(&model.Tags{}).Create(&data).Error; err != nil { + return doc, err + } + doc = data + return doc, nil +} + +func UpdateTags(tags request.TagsCommon, uuid string) error { + var err error + if tags.Value != "" { + if !errors.Is(global.MG_DB.Model(&model.Tags{}).Where("value = ? and type = ? AND id!=?", tags.Value, tags.Type, tags.ID).First(&model.Tags{}).Error, gorm.ErrRecordNotFound) { + return errors.New(",存在相同标签") + } + } + + err = global.MG_DB.Model(&model.Tags{}).Where("id = ?", tags.ID).Updates(model.Tags{Type: tags.Type, Value: tags.Value, UpdateBy: uuid}).Error + + return err +} + +func DeleteTagsByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Model(&model.Tags{}).Where("id in (?)", ids.Ids).Unscoped().Delete(&model.Tags{}).Error + + return err +} + +func GetTagsNameByIds(ids []uint) (tags string) { + var ( + tagList []model.Tags + names []string + ) + global.MG_DB.Model(&model.Tags{}).Where("id in (?)", ids).Find(&tagList) + for _, vTag := range tagList { + names = append(names, vTag.Value) + } + + return strings.Join(names, ",") +} + +func GetTagsByIds(ids []uint) (tags []model.TagsDesc) { + var ( + tagList []model.TagsDesc + ) + global.MG_DB.Model(&model.Tags{}).Where("id in (?)", ids).Find(&tagList) + + return tagList +} + +func GetTagNamesByRelation(relationId, relationType string) string { + //params:relationType 标签类型 01-任务 02-任务视频 03-网红 + var ( + relationList []model.TagRelation + tagIds []uint + tagNames string + ) + global.MG_DB.Model(&model.TagRelation{}). + Where("relation_type = ? and relation_id = ?", relationType, relationId).Find(&relationList) + if len(relationList) == 0 { + return tagNames + } + for _, v := range relationList { + tagIds = append(tagIds, v.TagId) + } + tagNames = GetTagsNameByIds(tagIds) + + return tagNames +} + +func GetTagsByRelation(info *request.RaletionTags) (interface{}, error) { + //params:relationType 标签类型 01-任务 02-任务视频 03-网红 + var ( + relationList []model.TagRelation + tagIds []uint + tags []model.TagsDesc + ) + global.MG_DB.Model(&model.TagRelation{}). + Where("relation_type = ? and relation_id = ?", info.RelationType, info.RelationID).Find(&relationList) + if len(relationList) == 0 { + return tags, errors.New("标签不存在") + } + for _, v := range relationList { + tagIds = append(tagIds, v.TagId) + } + tags = GetTagsByIds(tagIds) + + return tags, nil +} + +func CreateTagRelation(params request.CreateTagRelation, uuid string) (err error) { + var ( + data []model.TagRelation + check []model.Tags + ) + err = global.MG_DB.Model(&model.Tags{}).Where("id in (?)", params.TagId).Find(&check).Error + if errors.Is(err, gorm.ErrRecordNotFound) { + return err + } + if len(check) != len(params.TagId) { + return errors.New("标签不存在") + } + tx := global.MG_DB.Begin() + err = tx.Model(&model.TagRelation{}).Where("tag_id in (?) and relation_id = ? and relation_type = ?", params.TagId, params.RelationId, params.RelationType).Delete(&model.TagRelation{}).Error + if err != nil { + tx.Rollback() + return err + } + for _, v := range params.TagId { + data = append(data, model.TagRelation{ + TagId: v, + RelationId: params.RelationId, + RelationType: params.RelationType, + CreateBy: uuid, + UpdateBy: uuid, + }) + } + err = tx.Model(&model.TagRelation{}).Create(&data).Error + if err != nil { + return errors.New("提交失败") + } + tx.Commit() + return err +} diff --git a/service/task.go b/service/task.go new file mode 100644 index 0000000..582ccfa --- /dev/null +++ b/service/task.go @@ -0,0 +1,61 @@ +package service + +import ( + "fmt" + "pure-admin/global" + "pure-admin/utils" + "time" + + "github.com/robfig/cron/v3" +) + +func newWithSecond() *cron.Cron { + secondParser := cron.NewParser(cron.Second | cron.Minute | + cron.Hour | cron.Dom | cron.Month | cron.DowOptional | cron.Descriptor) + return cron.New(cron.WithParser(secondParser), cron.WithChain()) +} + +type MissionStatisticTask struct { +} + +func (t MissionStatisticTask) Run() { + err, result := RedisSetNX("mission_statistic_task", "used", 10*time.Minute) + result = true + if err == nil && result { + fmt.Println("任务执行") + _ = MissionStatisticCountTotal() + fmt.Println("任务执行完成") + } +} + +type MissionStatisticTaskDaily struct { +} + +func (t MissionStatisticTaskDaily) Run() { + + err, result := RedisSetNX("mission_statistic_task_daily", "used", 10*time.Minute) + result = true + if err == nil && result { + fmt.Println("任务执行") + _ = MissionStatisticCountDaily(time.Now().AddDate(0, 0, -1).Format(utils.DateFormat)) + fmt.Println("任务执行完成") + } + +} + +func TimingTask() { + c := newWithSecond() + var err error + _, err = c.AddJob("1 */30 * * * *", MissionStatisticTask{}) + if err != nil { + global.MG_LOG.Error("MissionStatisticCron " + err.Error()) + return + } + _, err = c.AddJob("1 0 * * * *", MissionStatisticTaskDaily{}) + if err != nil { + global.MG_LOG.Error("MissionStatisticDailyCron " + err.Error()) + return + } + c.Start() + fmt.Println("定时任务开启成功") +} diff --git a/service/ueditor.go b/service/ueditor.go new file mode 100644 index 0000000..0d1d091 --- /dev/null +++ b/service/ueditor.go @@ -0,0 +1,132 @@ +package service + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "pure-admin/global" + "pure-admin/utils/upload" + "regexp" + "time" + + "github.com/gin-gonic/gin" +) + +func UeditorAction(c *gin.Context) { + action := c.Query("action") + + switch action { + //自动读入配置文件,只要初始化UEditor即会发生 + case "config": + callback := c.Query("callback") + jsonByte, _ := ioutil.ReadFile("ueditor-config.json") + re, _ := regexp.Compile("\\/\\*[\\S\\s]+?\\*\\/") + jsonByte = re.ReplaceAll(jsonByte, []byte("")) + c.Writer.Write([]byte(callback + "(" + string(jsonByte) + ")")) + + case "uploadimage": + { + var qiniu upload.Qiniu + //保存上传的图片 + //获取上传的文件,直接可以获取表单名称对应的文件名,不用另外提取 + _, fileHeader, err := c.Request.FormFile("upfile") + if err != nil { + data, _ := json.Marshal(map[string]string{ + "state": fmt.Sprintf("获取文件错误: %s", err.Error()), + }) + c.Writer.Write(data) + return + } + fileKey := "ue-img/" + time.Now().Format("20060102") + "/" + fileHeader.Filename + //go func(fileKey string, fileHeader *multipart.FileHeader) { + _, _, err = qiniu.UploadFile2(fileKey, fileHeader) + if err != nil { + data, _ := json.Marshal(map[string]string{ + "state": fmt.Sprintf("上传文件错误: %s", err.Error()), + }) + c.Writer.Write(data) + return + } + //}(fileKey, fileHeader) + data, err := json.Marshal(map[string]string{ + "url": fmt.Sprintf("%s", global.MG_CONFIG.Qiniu.ImgPath+"/"+fileKey), //保存后的文件路径 + "title": "", //文件描述,对图片来说在前端会添加到title属性上 + "original": fileHeader.Filename, //原始文件名 + "state": "SUCCESS", //上传状态,成功时返回SUCCESS,其他任何值将原样返回至图片上传框中 + }) + if err != nil { + panic(err) + } + c.Writer.Write(data) + return + } + + case "uploadvideo": + var qiniu upload.Qiniu + _, fileHeader, err := c.Request.FormFile("upfile") + if err != nil { + data, _ := json.Marshal(map[string]string{ + "state": fmt.Sprintf("获取文件错误: %s", err.Error()), + }) + c.Writer.Write(data) + return + } + + fileKey := "ue-video/" + time.Now().Format("20060102") + "/" + fileHeader.Filename + //go func(fileKey string, fileHeader *multipart.FileHeader) { + _, _, err = qiniu.UploadFile2(fileKey, fileHeader) + if err != nil { + data, _ := json.Marshal(map[string]string{ + "state": fmt.Sprintf("上传文件错误: %s", err.Error()), + }) + c.Writer.Write(data) + return + } + //}(fileKey, fileHeader) + + data, err := json.Marshal(map[string]string{ + "url": fmt.Sprintf("%s", global.MG_CONFIG.Qiniu.ImgPath+"/"+fileKey), //保存后的文件路径 + "title": "", //文件描述,对图片来说在前端会添加到title属性上 + "original": fileHeader.Filename, //原始文件名 + "state": "SUCCESS", //上传状态,成功时返回SUCCESS,其他任何值将原样返回至图片上传框中 + }) + if err != nil { + panic(err) + } + _, err = c.Writer.Write(data) + case "uploadfile": + { + var qiniu upload.Qiniu + //保存上传的文件 + //获取上传的文件,直接可以获取表单名称对应的文件名,不用另外提取 + _, fileHeader, err := c.Request.FormFile("upfile") + if err != nil { + data, _ := json.Marshal(map[string]string{ + "state": fmt.Sprintf("获取文件错误: %s", err.Error()), + }) + c.Writer.Write(data) + return + } + fileKey := "ue-file/" + time.Now().Format("20060102") + "/" + fileHeader.Filename + //go func(fileKey string, fileHeader *multipart.FileHeader) { + _, _, err = qiniu.UploadFile2(fileKey, fileHeader) + if err != nil { + data, _ := json.Marshal(map[string]string{ + "state": fmt.Sprintf("上传文件错误: %s", err.Error()), + }) + c.Writer.Write(data) + return + } + //}(fileKey, fileHeader) + + data, err := json.Marshal(map[string]string{ + "url": fmt.Sprintf("%s", global.MG_CONFIG.Qiniu.ImgPath+"/"+fileKey), //保存后的文件路径 + "title": "", //文件描述,对图片来说在前端会添加到title属性上 + "original": fileHeader.Filename, //原始文件名 + "state": "SUCCESS", //上传状态,成功时返回SUCCESS,其他任何值将原样返回至图片上传框中 + }) + c.Writer.Write(data) + return + } + } +} diff --git a/service/user.go b/service/user.go new file mode 100755 index 0000000..bb80719 --- /dev/null +++ b/service/user.go @@ -0,0 +1,519 @@ +package service + +import ( + "encoding/json" + "errors" + "pure-admin/global" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/utils" + "time" +) + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: CreateUser +//@description: 创建User记录 +//@param: user model.User +//@return: err error + +func CreateUser(user model.User) (err error) { + err = global.MG_DB.Create(&user).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteUser +//@description: 删除User记录 +//@param: user model.User +//@return: err error + +func DeleteUser(user model.User) (err error) { + err = global.MG_DB.Delete(&user).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: DeleteUserByIds +//@description: 批量删除User记录 +//@param: ids request.IdsReq +//@return: err error + +func DeleteUserByIds(ids request.IdsReq) (err error) { + err = global.MG_DB.Delete(&[]model.User{}, "id in (?)", ids.Ids).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: UpdateUser +//@description: 更新User记录 +//@param: user *model.User +//@return: err error + +func UpdateUser(user model.User) (err error) { + if user.Password != "" { + user.Password = utils.MD5V([]byte(user.Password)) + } + err = global.MG_DB.Updates(&user).Error + return err +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetUser +//@description: 根据id获取User记录 +//@param: id uint +//@return: err error, user model.User + +func GetUser(uuid string) (err error, user model.UserSimple) { + var ( + dictData []model.SysDictData + ) + err = global.MG_DB.Where("uuid = ?", uuid).First(&user).Error + if err != nil { + return + } + err = global.MG_DB.Model(&model.SysDictData{}).Where("dict_type=?", "release_channel").Find(&dictData).Error + if err != nil { + return errors.New("获取用户失败"), user + } + platformsC := make([]model.Platform, 0) + for i := 0; i < len(dictData); i++ { + platformsC = append(platformsC, model.Platform{ + Platform: dictData[i].Value, + }) + } + if user.Platform != "" { + var platforms []model.Platform + json.Unmarshal([]byte(user.Platform), &platforms) + for i := 0; i < len(platforms); i++ { + for j := 0; j < len(platformsC); j++ { + if platforms[i].Platform == platformsC[j].Platform { + platformsC[j].IsAuth = platforms[i].IsAuth + platformsC[j].Url = platforms[i].Url + platformsC[j].Image = platforms[i].Image + } + } + } + user.Platforms = platformsC + } else { + user.Platforms = platformsC + } + return +} + +//@author: [piexlmax](https://github.com/piexlmax) +//@function: GetUserInfoList +//@description: 分页获取User记录 +//@param: info request.UserSearch +//@return: err error, list interface{}, total int64 + +func GetUserInfoList(info request.UserSimpleSearch, appid string) (err error, list interface{}, total int64) { + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.User{}) + db = db.Where("appid = ?", appid) + var users []model.UserSimple + // 如果有条件搜索 下方会自动创建搜索语句 + if info.Type != "" { + db = db.Where("type = ?", info.Type) + } else { + db = db.Where("type=?", "customer") + } + if info.StartTime != "" { + db = db.Where("created_at >= ?", info.StartTime) + } + if info.EndTime != "" { + db = db.Where("created_at < ?", info.EndTime) + } + if info.Phone != "" { + db = db.Where("phone = ?", info.Phone) + } + if info.Email != "" { + db = db.Where("email = ?", info.Email) + } + if info.NickName != "" { + db = db.Where("nick_name like ?", "%"+info.NickName+"%") + } + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&users).Error + if err != nil { + return err, nil, 0 + } + var userIds []string + for i := 0; i < len(users); i++ { + users[i].CreatedStr = users[i].CreatedAt.Format(utils.DateTimeFormat) + userIds = append(userIds, users[i].UUID.String()) + } + if info.Type == "influencer" { + var ( + dictData []model.SysDictData + ) + err = global.MG_DB.Model(&model.SysDictData{}).Where("type_code=?", "release_channel").Find(&dictData).Error + if err != nil { + return errors.New("获取用户失败"), users, total + } + for i := 0; i < len(users); i++ { + var platforms []model.Platform + err = json.Unmarshal([]byte(users[i].Platform), &platforms) + if err != nil { + for i := 0; i < len(dictData); i++ { + platforms = append(platforms, model.Platform{ + Platform: dictData[i].Value, + PlatformName: dictData[i].Label, + }) + } + // platforms = append(platforms, u.Platform) + } + for j := 0; j < len(platforms); j++ { + for k := 0; k < len(dictData); k++ { + if platforms[j].Platform == dictData[k].Value { + platforms[j].PlatformName = dictData[k].Label + } + } + } + err = nil + users[i].Platforms = platforms + } + } + // 累计订单数 + var orderNumMap map[string]model.DtStatisticOrder + orderNumMap, err = getStatisticsOrderUsers(userIds, "", nil) + for i := 0; i < len(users); i++ { + if val, ok := orderNumMap[users[i].UUID.String()]; ok { + users[i].OrderCount = val.OrderNum + } + } + // 退款数 + var postSaleNumMap map[string]int64 + now := time.Now() + start := now.AddDate(0, 0, -6).Format("20060102") + end := now.AddDate(0, 0, 1).Format("20060102") + postSaleNumMap, err = getOrderPostSaleCountList(&request.SearchOrderPostSale{UserIds: userIds, CreatedAtStart: start, CreatedAtEnd: end}) + for i := 0; i < len(users); i++ { + if val, ok := postSaleNumMap[users[i].UUID.String()]; ok { + users[i].RefundCount = val + } + } + return err, users, total +} + +func GetSysUserInfoList(info request.UserSimpleSearch, appid string) (err error, list interface{}, total int64) { + var ( + authorityIds = make([]string, 0) + authorities []model.SysAuthority + ) + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + db := global.MG_DB.Model(&model.User{}) + db = db.Where("appid=? and type=?", appid, "admin") + if info.NickName != "" { + db = db.Where("nick_name LIKE ?", "%"+info.NickName+"%") + } + if info.Username != "" { + db = db.Where("username LIKE ?", "%"+info.Username+"%") + } + if info.Phone != "" { + db = db.Where("phone LIKE ?", "%"+info.Phone+"%") + } + if info.IDForbidden != "" { + db = db.Where("id_forbidden = ?", info.IDForbidden) + } + var userList []model.UserSimple + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Find(&userList).Error + if err != nil { + return err, nil, 0 + } + for k, _ := range userList { + e := Casbin() + res := e.GetRolesForUserInDomain(userList[k].UUID.String(), appid) + if len(res) > 0 { + authorityIds = append(authorityIds, res...) + } + } + if len(authorityIds) > 0 { + err = global.MG_DB.Where("authority_id IN ?", authorityIds).Find(&authorities).Error + } + for k, _ := range userList { + authorities1 := make([]model.SysAuthority, 0) + for _, v := range authorities { + if userList[k].AuthorityID == v.AuthorityId { + authorities1 = append(authorities1, v) + } + } + userList[k].Authorities = authorities1 + } + return err, userList, total +} + +func GetUserInfo(uuid, appid string) (err error, user model.User) { + var ( + reqUser model.User + authorities []model.SysAuthority + ) + err = global.MG_DB.First(&reqUser, "uuid = ?", uuid).Error + if err != nil { + return err, reqUser + } + e := Casbin() + res := e.GetRolesForUserInDomain(uuid, appid) + if len(res) > 0 { + err = global.MG_DB.Where("authority_id IN ?", res).Find(&authorities).Error + } else { + err = errors.New("该用户未分配角色") + } + for _, v := range authorities { + if reqUser.AuthorityID == v.AuthorityId { + reqUser.Authority = v + break + } + } + reqUser.Authorities = authorities + return err, reqUser +} + +func GetPlatformAuthList(info request.PlatformAuthSearch) (err error, list interface{}, total int64) { + var ( + platformAuths []model.PlatformAuthSimple + userIds []string + checkUserIds []string + checkUsers []model.UserSimple + users []model.UserSimple + wallet []model.Wallet + account []model.Account + dictData []model.SysDictData + tag_relation []model.TagRelation + tags []model.Tags + userPlatformAuths []model.PlatformAuthSimple + ) + err = global.MG_DB.Model(&model.SysDictData{}).Where("type_code=?", "release_channel").Find(&dictData).Error + if err != nil { + return errors.New("获取用户失败"), platformAuths, total + } + limit := info.PageSize + offset := info.PageSize * (info.Page - 1) + // 创建db + db := global.MG_DB.Model(&model.PlatformAuth{}) + if info.Platform != "" { + db = db.Where("platform = ?", info.Platform) + } + if info.Status != "" { + db = db.Where("status = ?", info.Status) + } + if info.StartTime != "" && info.EndTime != "" { + db = db.Where("created_at BETWEEN ? AND ?", info.StartTime, info.EndTime) + } + if info.Phone != "" { + db = db.Joins("inner join user on user.uuid=platform_auth.user_id and user.phone = ?", info.Phone) + } + if info.Email != "" { + db = db.Joins("inner join user on user.uuid=platform_auth.user_id and user.email = ?", info.Email) + } + if info.NickName != "" { + db = db.Joins("inner join user on user.uuid=platform_auth.user_id and user.nick_name like ?", "%"+info.NickName+"%") + } + // 如果有条件搜索 下方会自动创建搜索语句 + err = db.Count(&total).Error + err = db.Limit(limit).Offset(offset).Order("id desc").Find(&platformAuths).Error + for _, v := range platformAuths { + userIds = append(userIds, v.UserID) + } + err = global.MG_DB.Where("uuid IN ?", userIds).Find(&users).Error + err = global.MG_DB.Where("user_id IN ?", userIds).Find(&userPlatformAuths).Error + err = global.MG_DB.Raw("SELECT * FROM (SELECT *,ROW_NUMBER() OVER (PARTITION BY user_id,platform ORDER BY updated_at DESC) AS rn FROM platform_auth WHERE user_id in (?) AND `status` !=0) AS subquery WHERE rn=1", userIds).Scan(&userPlatformAuths).Error + for _, v := range userPlatformAuths { + checkUserIds = append(checkUserIds, v.CheckUser) + } + err = global.MG_DB.Where("uuid IN ?", checkUserIds).Find(&checkUsers).Error + err = global.MG_DB.Where("user_id IN ?", userIds).Find(&wallet).Error + err = global.MG_DB.Where("user_id IN ?", userIds).Find(&account).Error + err = global.MG_DB.Where("relation_id IN ?", userIds).Find(&tag_relation).Error + var tagIds []uint + for _, v := range tag_relation { + tagIds = append(tagIds, v.TagId) + } + err = global.MG_DB.Where("id IN ?", tagIds).Find(&tags).Error + for i, v := range platformAuths { + for k := 0; k < len(dictData); k++ { + if platformAuths[i].Platform.Platform == dictData[k].Value { + platformAuths[i].PlatformName = dictData[k].Label + } + } + var tagDesc = make([]model.TagRelationDesc, 0) + for j := 0; j < len(tag_relation); j++ { + if v.UserID == tag_relation[j].RelationId { + for k := 0; k < len(tags); k++ { + if tag_relation[j].TagId == tags[k].ID { + tagDesc = append(tagDesc, model.TagRelationDesc{ + ID: tags[k].ID, + Name: tags[k].Value, + }) + } + } + } + } + platformAuths[i].TagRelationDesc = tagDesc + for _, u := range users { + if v.UserID == u.UUID.String() { + var platforms []model.Platform + platformAuths[i].User = u + err = json.Unmarshal([]byte(u.Platform), &platforms) + if err != nil { + for i := 0; i < len(dictData); i++ { + platforms = append(platforms, model.Platform{ + Platform: dictData[i].Value, + PlatformName: dictData[i].Label, + }) + } + // platforms = append(platforms, u.Platform) + } + for j := 0; j < len(platforms); j++ { + for k := 0; k < len(dictData); k++ { + if platforms[j].Platform == dictData[k].Value { + platforms[j].PlatformName = dictData[k].Label + } + } + for k := 0; k < len(userPlatformAuths); k++ { + if userPlatformAuths[k].UserID == u.UUID.String() && userPlatformAuths[k].Platform.Platform == platforms[j].Platform { + if platforms[j].AuthMsg == "" { + platforms[j].AuthMsg = userPlatformAuths[k].AuthMsg + } + for l := 0; l < len(checkUsers); l++ { + if userPlatformAuths[k].CheckUser == checkUsers[l].UUID.String() { + platforms[j].CheckUser = checkUsers[l].NickName + } + } + } + } + } + err = nil + platformAuths[i].User.Platforms = platforms + break + } + } + for _, w := range wallet { + if v.UserID == w.UserID { + platformAuths[i].User.Wallet = w + break + } + } + for _, a := range account { + if v.UserID == a.UserID { + platformAuths[i].User.Account = append(platformAuths[i].User.Account, a) + } + } + } + return err, platformAuths, total +} + +func CheckPlatformAuth(info *request.PlatformAuthCheck, userID string) (err error) { + var ( + platformAuth model.PlatformAuth + user model.User + platforms []model.Platform + uMap = make(map[string]interface{}) + ) + err = global.MG_DB.First(&platformAuth, "id = ?", info.ID).Error + if err != nil { + return err + } + if platformAuth.Status != "0" { + return errors.New("该认证已审核") + } + err = global.MG_DB.First(&user, "uuid = ?", platformAuth.UserID).Error + if err != nil { + return err + } + json.Unmarshal([]byte(user.Platform), &platforms) + err = global.MG_DB.Model(&platformAuth).Updates(map[string]interface{}{"status": info.Status, "check_user": userID, "auth_msg": info.AuthMsg}).Error + if err != nil { + return err + } + for i, v := range platforms { + if v.Platform == platformAuth.Platform.Platform { + if info.Status == "1" { + platforms[i].IsAuth = true + platforms[i].AuthTime = time.Now().Format(utils.DateTimeFormat) + } else { + platforms[i].IsAuth = false + platforms[i].Url = "" + platforms[i].Image = "" + } + break + } + } + uMap["is_auth"] = false + for _, v := range platforms { + if v.IsAuth { + uMap["is_auth"] = true + break + } else { + uMap["is_auth"] = false + } + } + platformsByte, _ := json.Marshal(platforms) + uMap["platform"] = string(platformsByte) + err = global.MG_DB.Model(&user).Updates(uMap).Error + return +} + +func UpdateUserStatus(info *request.UserStatus, appid, userID string) (err error) { + var ( + user model.User + uMap = make(map[string]interface{}) + ) + err = global.MG_DB.First(&user, "uuid = ? and appid=?", info.UserID, appid).Error + if err != nil { + return err + } + if user.IDForbidden == info.IDForbidden { + return errors.New("该用户已是该状态") + } + if info.IDForbidden == true { + uMap["id_forbidden"] = 1 + uMap["forbidden_reason"] = info.ForbiddenReason + uMap["forbidden_time"] = time.Now() + uMap["forbidden_operation"] = userID + _, jwtStr := GetRedisJWT(user.Username) + if jwtStr != "" { + JsonInBlacklist(model.JwtBlacklist{Jwt: jwtStr}) + } + } else { + uMap["id_forbidden"] = 0 + uMap["forbidden_reason"] = "" + uMap["forbidden_time"] = nil + uMap["forbidden_operation"] = userID + } + err = global.MG_DB.Model(&user).Where("uuid = ? and appid=?", info.UserID, appid).Updates(uMap).Error + if err != nil { + return err + } + return +} + +func getUserSimpleList(ut string, uuids []string) ([]model.UserSimple, error) { + var ( + err error + result []model.UserSimple + ) + err = global.MG_DB.Model(&model.User{}).Select("uuid,nick_name,avatar,phone,platform,tags").Where("`type` = ? AND uuid IN (?)", ut, uuids).Find(&result).Error + if err != nil { + return nil, err + } + return result, nil +} +func getUserViewMap(uuids ...string) (map[string]model.UserView, error) { + var ( + err error + list []model.UserView + result = make(map[string]model.UserView) + ) + err = global.MG_DB.Model(&model.User{}).Select("uuid,email").Where("uuid IN (?)", uuids).Find(&list).Error + if err != nil { + return nil, err + } + for _, userView := range list { + result[userView.UUID.String()] = userView + } + return result, nil +} diff --git a/service/wallet.go b/service/wallet.go new file mode 100644 index 0000000..f5bf904 --- /dev/null +++ b/service/wallet.go @@ -0,0 +1,158 @@ +package service + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "gorm.io/gorm" + "pure-admin/dto" + "pure-admin/global" + "pure-admin/initialize/api" + "pure-admin/model" + "pure-admin/model/request" + "pure-admin/model/response" + "pure-admin/utils" + "time" +) + +func getWallet(platform, uuid string) (error, model.Wallet) { + var ( + err error + result model.Wallet + ) + err = global.MG_DB.Model(&model.Wallet{}).Where("platform = ? AND user_id = ?", platform, uuid).First(&result).Error + return err, result +} + +func FundRecharge(info *request.FundRecharge) (error, response.PayResult) { + var ( + err error + wallet model.Wallet + billFund model.BillFund + result response.PayResult + ) + err = global.MG_DB.Model(&model.Wallet{}).Where("platform = 'bkb' AND user_id = 'bkb'").First(&wallet).Error + if err != nil { + return err, result + } + billFund.UserID = "bkb" + billFund.TransactionType = 2 + billFund.TransactionId = "RC" + generate() + billFund.Title = "recharge" + billFund.Price = info.Amount + billFund.Balance = wallet.Fund + info.Amount + billFund.Platform = "bkb" + billFund.Status = 1 + tx := global.MG_DB.Begin() + err = tx.Model(&model.BillFund{}).Create(&billFund).Error + if err != nil { + tx.Rollback() + return err, result + } + var payChannel string + if info.PayMode == 1 { + payChannel = "paypal" + } + attach, _ := json.Marshal(map[string]string{"transactionId": billFund.TransactionId}) + params := api.PayTransRequest{ + Appid: "bkb5918273465092837", + Mchid: "11000001", + OutTradeNo: billFund.TransactionId, + Attach: string(attach), + NotifyUrl: global.MG_CONFIG.Paypal.NotifyUrl + "/base/payment/payback", + Amount: info.Amount, + Currency: "USD", + PayChannel: payChannel, + ReturnUrl: global.MG_CONFIG.Paypal.ReturnUrl, + CancelUrl: global.MG_CONFIG.Paypal.CancelUrl, + } + payOrder, err := global.PAY_CLIENT.PayTransactionAppUrl(context.Background(), ¶ms) + if err != nil { + fmt.Println(err.Error()) + tx.Rollback() + return errors.New("open " + payChannel + " failed"), result + } + err = tx.Model(&model.BillFund{}).Where("id = ?", billFund.ID).UpdateColumn("pay_id", payOrder.PayId).Error + if err != nil { + tx.Rollback() + return err, result + } + tx.Commit() + result.PayChannel = payOrder.PayChannel + result.PayId = payOrder.PayId + result.PayReturn = payOrder.PayReturn + result.PayStatus = payOrder.PayStatus + return err, result +} + +func PaypalCallback(info *dto.PaybackBody) error { + // 开始交易 + for { + ok, err := global.MG_REDIS.SetNX("payback-"+info.TransactionId, "used", 10*time.Second).Result() + if ok && err == nil { + // 获取成功 + break + } + } + defer func() { + // 释放锁 + _, _ = utils.RedisDel("payback-" + info.TransactionId) + }() + switch info.ResourceType { + case "pay": // 支付结果 + if info.Status != "SUCCESS" { + return nil + } else { + var ( + err error + billFund model.BillFund + ) + err = global.MG_DB.Model(&model.BillFund{}).Where("transaction_id = ?", info.OutTradeNo).First(&billFund).Error + if err != nil { + return err + } + tx := global.MG_DB.Begin() + err = tx.Model(&model.BillFund{}).Where("id = ?", billFund.ID).UpdateColumn("status", 2).Error + if err != nil { + tx.Rollback() + return err + } + err = tx.Model(&model.Wallet{}).Where("platform = 'seller' AND user_id = ?", billFund.UserID).UpdateColumn("fund", gorm.Expr("fund + ?", billFund.Price)).Error + if err != nil { + tx.Rollback() + return err + } + tx.Commit() + } + case "payout": // 提现结果 + var ( + err error + status string + withdrawal model.Withdrawal + ) + err = global.MG_DB.Model(&model.Withdrawal{}).Where("flow_no = ?", info.OutTradeNo).First(&withdrawal).Error + if err != nil { + return err + } + tx := global.MG_DB.Begin() + if info.Status != "Success" { + status = "2" + } else { + status = "1" + // 将对应钱包提现状态恢复 + err = tx.Model(&model.Wallet{}).Where("id = ?", withdrawal.CreateBy).UpdateColumn("state", 0).Error + if err != nil { + tx.Rollback() + return err + } + } + err = tx.Model(&model.Withdrawal{}).Where("id = ?", withdrawal.ID).UpdateColumn("status", status).Error + if err != nil { + tx.Rollback() + return err + } + tx.Commit() + } + return nil +} diff --git a/source/admin.go b/source/admin.go new file mode 100644 index 0000000..04f11ac --- /dev/null +++ b/source/admin.go @@ -0,0 +1,36 @@ +package source + +import ( + "pure-admin/global" + "pure-admin/model" + "time" + + "github.com/gookit/color" + + uuid "github.com/satori/go.uuid" + "gorm.io/gorm" +) + +var Admin = new(admin) + +type admin struct{} + +var admins = []model.SysUser{ + {UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "http://qmplusimg.henrongyi.top/MG_header.jpg", MG_MODEL: global.MG_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "http://qmplusimg.henrongyi.top/1572075907logo.png", MG_MODEL: global.MG_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, +} + +//@description: sys_users 表数据初始化 +func (a *admin) Init() error { + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + if tx.Where("id in (?)", []int{1, 2}).Find(&[]model.SysUser{}).RowsAffected == 2 { + color.Danger.Println("\n[Mysql] --> sys_users 表的初始数据已存在!") + return nil + } + if err := tx.Create(&admins).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_users 表初始数据成功!") + return nil + }) +} diff --git a/source/api.go b/source/api.go new file mode 100644 index 0000000..ab6a382 --- /dev/null +++ b/source/api.go @@ -0,0 +1,104 @@ +package source + +import ( + "pure-admin/global" + "pure-admin/model" + "time" + + "github.com/gookit/color" + "gorm.io/gorm" +) + +var Api = new(api) + +type api struct{} + +var apis = []model.SysApi{ + {"d", "appid", "admin", "/base/login", "用户登录", "base", "POST", global.MG_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/user/register", "用户注册", "user", "POST", global.MG_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/api/createApi", "创建api", "api", "POST", global.MG_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/api/getApiList", "获取api列表", "api", "POST", global.MG_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/api/getApiById", "获取api详细信息", "api", "POST", global.MG_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/api/deleteApi", "删除Api", "api", "POST", global.MG_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/api/updateApi", "更新Api", "api", "POST", global.MG_MODEL{ID: 7, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/api/getAllApis", "获取所有api", "api", "POST", global.MG_MODEL{ID: 8, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/authority/createAuthority", "创建角色", "authority", "POST", global.MG_MODEL{ID: 9, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/authority/deleteAuthority", "删除角色", "authority", "POST", global.MG_MODEL{ID: 10, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/authority/getAuthorityList", "获取角色列表", "authority", "POST", global.MG_MODEL{ID: 11, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/getMenu", "获取菜单树", "menu", "POST", global.MG_MODEL{ID: 12, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/getMenuList", "分页获取基础menu列表", "menu", "POST", global.MG_MODEL{ID: 13, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/addBaseMenu", "新增菜单", "menu", "POST", global.MG_MODEL{ID: 14, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/getBaseMenuTree", "获取用户动态路由", "menu", "POST", global.MG_MODEL{ID: 15, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/addMenuAuthority", "增加menu和角色关联关系", "menu", "POST", global.MG_MODEL{ID: 16, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/getMenuAuthority", "获取指定角色menu", "menu", "POST", global.MG_MODEL{ID: 17, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/deleteBaseMenu", "删除菜单", "menu", "POST", global.MG_MODEL{ID: 18, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/updateBaseMenu", "更新菜单", "menu", "POST", global.MG_MODEL{ID: 19, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/menu/getBaseMenuById", "根据id获取菜单", "menu", "POST", global.MG_MODEL{ID: 20, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/user/changePassword", "修改密码", "user", "POST", global.MG_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/user/getUserList", "获取用户列表", "user", "POST", global.MG_MODEL{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/user/setUserAuthority", "修改用户角色", "user", "POST", global.MG_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/fileUploadAndDownload/upload", "文件上传示例", "fileUploadAndDownload", "POST", global.MG_MODEL{ID: 24, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/fileUploadAndDownload/getFileList", "获取上传文件列表", "fileUploadAndDownload", "POST", global.MG_MODEL{ID: 25, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/casbin/updateCasbin", "更改角色api权限", "casbin", "POST", global.MG_MODEL{ID: 26, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/casbin/getPolicyPathByAuthorityId", "获取权限列表", "casbin", "POST", global.MG_MODEL{ID: 27, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/fileUploadAndDownload/deleteFile", "删除文件", "fileUploadAndDownload", "POST", global.MG_MODEL{ID: 28, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/jwt/jsonInBlacklist", "jwt加入黑名单(退出)", "jwt", "POST", global.MG_MODEL{ID: 29, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/authority/setDataAuthority", "设置角色资源权限", "authority", "POST", global.MG_MODEL{ID: 30, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/system/getSystemConfig", "获取配置文件内容", "system", "POST", global.MG_MODEL{ID: 31, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/system/setSystemConfig", "设置配置文件内容", "system", "POST", global.MG_MODEL{ID: 32, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/customer/customer", "创建客户", "customer", "POST", global.MG_MODEL{ID: 33, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/customer/customer", "更新客户", "customer", "PUT", global.MG_MODEL{ID: 34, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/customer/customer", "删除客户", "customer", "DELETE", global.MG_MODEL{ID: 35, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/customer/customer", "获取单一客户", "customer", "GET", global.MG_MODEL{ID: 36, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/customer/customerList", "获取客户列表", "customer", "GET", global.MG_MODEL{ID: 37, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/casbin/casbinTest/:pathParam", "RESTFUL模式测试", "casbin", "GET", global.MG_MODEL{ID: 38, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/autoCode/createTemp", "自动化代码", "autoCode", "POST", global.MG_MODEL{ID: 39, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/authority/copyAuthority", "拷贝角色", "authority", "POST", global.MG_MODEL{ID: 41, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/authority/updateAuthority", "更新角色信息", "authority", "PUT", global.MG_MODEL{ID: 40, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/user/deleteUser", "删除用户", "user", "DELETE", global.MG_MODEL{ID: 42, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionaryDetail/createSysDictionaryDetail", "新增字典内容", "sysDictionaryDetail", "POST", global.MG_MODEL{ID: 43, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionaryDetail/deleteSysDictionaryDetail", "删除字典内容", "sysDictionaryDetail", "DELETE", global.MG_MODEL{ID: 44, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionaryDetail/updateSysDictionaryDetail", "更新字典内容", "sysDictionaryDetail", "PUT", global.MG_MODEL{ID: 45, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionaryDetail/findSysDictionaryDetail", "根据ID获取字典内容", "sysDictionaryDetail", "GET", global.MG_MODEL{ID: 46, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionaryDetail/getSysDictionaryDetailList", "获取字典内容列表", "sysDictionaryDetail", "GET", global.MG_MODEL{ID: 47, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionary/createSysDictionary", "新增字典", "sysDictionary", "POST", global.MG_MODEL{ID: 48, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionary/deleteSysDictionary", "删除字典", "sysDictionary", "DELETE", global.MG_MODEL{ID: 49, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionary/updateSysDictionary", "更新字典", "sysDictionary", "PUT", global.MG_MODEL{ID: 50, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionary/findSysDictionary", "根据ID获取字典", "sysDictionary", "GET", global.MG_MODEL{ID: 51, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysDictionary/getSysDictionaryList", "获取字典列表", "sysDictionary", "GET", global.MG_MODEL{ID: 52, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysOperationRecord/createSysOperationRecord", "新增操作记录", "sysOperationRecord", "POST", global.MG_MODEL{ID: 53, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysOperationRecord/deleteSysOperationRecord", "删除操作记录", "sysOperationRecord", "DELETE", global.MG_MODEL{ID: 54, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysOperationRecord/findSysOperationRecord", "根据ID获取操作记录", "sysOperationRecord", "GET", global.MG_MODEL{ID: 55, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysOperationRecord/getSysOperationRecordList", "获取操作记录列表", "sysOperationRecord", "GET", global.MG_MODEL{ID: 56, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/autoCode/getTables", "获取数据库表", "autoCode", "GET", global.MG_MODEL{ID: 57, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/autoCode/getDB", "获取所有数据库", "autoCode", "GET", global.MG_MODEL{ID: 58, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/autoCode/getColumn", "获取所选table的所有字段", "autoCode", "GET", global.MG_MODEL{ID: 59, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/sysOperationRecord/deleteSysOperationRecordByIds", "批量删除操作历史", "sysOperationRecord", "DELETE", global.MG_MODEL{ID: 60, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/simpleUploader/upload", "插件版分片上传", "simpleUploader", "POST", global.MG_MODEL{ID: 61, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/simpleUploader/checkFileMd5", "文件完整度验证", "simpleUploader", "GET", global.MG_MODEL{ID: 62, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/simpleUploader/mergeFileMd5", "上传完成合并文件", "simpleUploader", "GET", global.MG_MODEL{ID: 63, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/user/setUserInfo", "设置用户信息", "user", "PUT", global.MG_MODEL{ID: 64, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/system/getServerInfo", "获取服务器信息", "system", "POST", global.MG_MODEL{ID: 65, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/email/emailTest", "发送测试邮件", "email", "POST", global.MG_MODEL{ID: 66, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/autoCode/preview", "预览自动化代码", "autoCode", "POST", global.MG_MODEL{ID: 67, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/excel/importExcel", "导入excel", "excel", "POST", global.MG_MODEL{ID: 68, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/excel/loadExcel", "下载excel", "excel", "GET", global.MG_MODEL{ID: 69, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/excel/exportExcel", "导出excel", "excel", "POST", global.MG_MODEL{ID: 70, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/excel/downloadTemplate", "下载excel模板", "excel", "GET", global.MG_MODEL{ID: 71, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"d", "appid", "admin", "/api/deleteApisByIds", "批量删除api", "api", "DELETE", global.MG_MODEL{ID: 72, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, +} + +// @description: sys_apis 表数据初始化 +func (a *api) Init() error { + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + if tx.Where("id in (?)", []int{1, 67}).Find(&[]model.SysApi{}).RowsAffected == 2 { + color.Danger.Println("\n[Mysql] --> sys_apis 表的初始数据已存在!") + return nil + } + if err := tx.Create(&apis).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_apis 表初始数据成功!") + return nil + }) +} diff --git a/source/authorities_menus.go b/source/authorities_menus.go new file mode 100644 index 0000000..62a379c --- /dev/null +++ b/source/authorities_menus.go @@ -0,0 +1,77 @@ +package source + +import ( + "pure-admin/global" + + "github.com/gookit/color" + "gorm.io/gorm" +) + +var AuthoritiesMenus = new(authoritiesMenus) + +type authoritiesMenus struct{} + +type AuthorityMenus struct { + AuthorityId string `gorm:"column:sys_authority_authority_id"` + BaseMenuId uint `gorm:"column:sys_base_menu_id"` +} + +var authorityMenus = []AuthorityMenus{ + {"888", 1}, + {"888", 2}, + {"888", 3}, + {"888", 4}, + {"888", 5}, + {"888", 6}, + {"888", 7}, + {"888", 8}, + {"888", 9}, + {"888", 10}, + {"888", 11}, + {"888", 12}, + {"888", 13}, + {"888", 14}, + {"888", 15}, + {"888", 16}, + {"888", 17}, + {"888", 18}, + {"888", 19}, + {"888", 20}, + {"888", 21}, + {"888", 22}, + {"888", 23}, + {"8881", 1}, + {"8881", 2}, + {"8881", 8}, + {"9528", 1}, + {"9528", 2}, + {"9528", 3}, + {"9528", 4}, + {"9528", 5}, + {"9528", 6}, + {"9528", 7}, + {"9528", 8}, + {"9528", 9}, + {"9528", 10}, + {"9528", 11}, + {"9528", 12}, + {"9528", 14}, + {"9528", 15}, + {"9528", 16}, + {"9528", 17}, +} + +//@description: sys_authority_menus 表数据初始化 +func (a *authoritiesMenus) Init() error { + return global.MG_DB.Table("sys_authority_menus").Transaction(func(tx *gorm.DB) error { + if tx.Where("sys_authority_authority_id IN ('888', '8881', '9528')").Find(&[]AuthorityMenus{}).RowsAffected == 48 { + color.Danger.Println("\n[Mysql] --> sys_authority_menus 表的初始数据已存在!") + return nil + } + if err := tx.Create(&authorityMenus).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_authority_menus 表初始数据成功!") + return nil + }) +} diff --git a/source/authority.go b/source/authority.go new file mode 100644 index 0000000..1aac1a7 --- /dev/null +++ b/source/authority.go @@ -0,0 +1,35 @@ +package source + +import ( + "pure-admin/global" + "pure-admin/model" + + "github.com/gookit/color" + + "gorm.io/gorm" +) + +var Authority = new(authority) + +type authority struct{} + +var authorities = []model.SysAuthority{ + {AuthorityId: 888, AuthorityName: "普通用户", ParentId: "0", DefaultRouter: "dashboard"}, + {AuthorityId: 8881, AuthorityName: "普通用户子角色", ParentId: "888", DefaultRouter: "dashboard"}, + {AuthorityId: 9528, AuthorityName: "测试角色", ParentId: "0", DefaultRouter: "dashboard"}, +} + +// @description: sys_authorities 表数据初始化 +func (a *authority) Init() error { + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + if tx.Where("authority_id in (?) ", []string{"888", "9528"}).Find(&[]model.SysAuthority{}).RowsAffected == 2 { + color.Danger.Println("\n[Mysql] --> sys_authorities 表的初始数据已存在!") + return nil + } + if err := tx.Create(&authorities).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_authorities 表初始数据成功!") + return nil + }) +} diff --git a/source/authority_menu.go b/source/authority_menu.go new file mode 100644 index 0000000..608d6aa --- /dev/null +++ b/source/authority_menu.go @@ -0,0 +1,25 @@ +package source + +import ( + "pure-admin/global" + "pure-admin/model" + + "github.com/gookit/color" +) + +var AuthorityMenu = new(authorityMenu) + +type authorityMenu struct{} + +//@description: authority_menu 视图数据初始化 +func (a *authorityMenu) Init() error { + if global.MG_DB.Find(&[]model.SysMenu{}).RowsAffected > 0 { + color.Danger.Println("\n[Mysql] --> authority_menu 视图已存在!") + return nil + } + if err := global.MG_DB.Exec("CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `authority_menu` AS select `sys_base_menus`.`id` AS `id`,`sys_base_menus`.`created_at` AS `created_at`, `sys_base_menus`.`updated_at` AS `updated_at`, `sys_base_menus`.`deleted_at` AS `deleted_at`, `sys_base_menus`.`menu_level` AS `menu_level`,`sys_base_menus`.`parent_id` AS `parent_id`,`sys_base_menus`.`path` AS `path`,`sys_base_menus`.`name` AS `name`,`sys_base_menus`.`hidden` AS `hidden`,`sys_base_menus`.`component` AS `component`, `sys_base_menus`.`title` AS `title`,`sys_base_menus`.`icon` AS `icon`,`sys_base_menus`.`sort` AS `sort`,`sys_authority_menus`.`sys_authority_authority_id` AS `authority_id`,`sys_authority_menus`.`sys_base_menu_id` AS `menu_id`,`sys_base_menus`.`keep_alive` AS `keep_alive`,`sys_base_menus`.`default_menu` AS `default_menu` from (`sys_authority_menus` join `sys_base_menus` on ((`sys_authority_menus`.`sys_base_menu_id` = `sys_base_menus`.`id`)))").Error; err != nil { + return err + } + color.Info.Println("\n[Mysql] --> authority_menu 视图创建成功!") + return nil +} diff --git a/source/casbin.go b/source/casbin.go new file mode 100644 index 0000000..a8e4ac4 --- /dev/null +++ b/source/casbin.go @@ -0,0 +1,130 @@ +package source + +import ( + "pure-admin/global" + + gormadapter "github.com/casbin/gorm-adapter/v3" + "github.com/gookit/color" + "gorm.io/gorm" +) + +var Casbin = new(CasbinS) + +type CasbinS struct{} + +var carbines = []gormadapter.CasbinRule{ + {Ptype: "p", V2: "888", V3: "/base/login", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/user/register", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/api/createApi", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/api/getApiList", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/api/getApiById", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/api/deleteApi", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/api/updateApi", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/api/getAllApis", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/authority/createAuthority", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/authority/deleteAuthority", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/authority/getAuthorityList", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/authority/setDataAuthority", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/authority/updateAuthority", V4: "PUT"}, + {Ptype: "p", V2: "888", V3: "/authority/copyAuthority", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/getMenu", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/getMenuList", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/addBaseMenu", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/getBaseMenuTree", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/addMenuAuthority", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/getMenuAuthority", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/deleteBaseMenu", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/updateBaseMenu", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/menu/getBaseMenuById", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/user/changePassword", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/user/getUserList", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/user/setUserAuthority", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/user/deleteUser", V4: "DELETE"}, + {Ptype: "p", V2: "888", V3: "/fileUploadAndDownload/upload", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/fileUploadAndDownload/getFileList", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/fileUploadAndDownload/deleteFile", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/casbin/updateCasbin", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/casbin/getPolicyPathByAuthorityId", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/casbin/casbinTest/:pathParam", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/jwt/jsonInBlacklist", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/system/getSystemConfig", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/system/setSystemConfig", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/system/getServerInfo", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/customer/customer", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/customer/customer", V4: "PUT"}, + {Ptype: "p", V2: "888", V3: "/customer/customer", V4: "DELETE"}, + {Ptype: "p", V2: "888", V3: "/customer/customer", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/customer/customerList", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/autoCode/createTemp", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/autoCode/preview", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/autoCode/getTables", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/autoCode/getDB", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/autoCode/getColumn", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/sysDictionaryDetail/createSysDictionaryDetail", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/sysDictionaryDetail/deleteSysDictionaryDetail", V4: "DELETE"}, + {Ptype: "p", V2: "888", V3: "/sysDictionaryDetail/updateSysDictionaryDetail", V4: "PUT"}, + {Ptype: "p", V2: "888", V3: "/sysDictionaryDetail/findSysDictionaryDetail", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/sysDictionaryDetail/getSysDictionaryDetailList", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/sysDictionary/createSysDictionary", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/sysDictionary/deleteSysDictionary", V4: "DELETE"}, + {Ptype: "p", V2: "888", V3: "/sysDictionary/updateSysDictionary", V4: "PUT"}, + {Ptype: "p", V2: "888", V3: "/sysDictionary/findSysDictionary", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/sysDictionary/getSysDictionaryList", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/sysOperationRecord/createSysOperationRecord", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/sysOperationRecord/deleteSysOperationRecord", V4: "DELETE"}, + {Ptype: "p", V2: "888", V3: "/sysOperationRecord/updateSysOperationRecord", V4: "PUT"}, + {Ptype: "p", V2: "888", V3: "/sysOperationRecord/findSysOperationRecord", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/sysOperationRecord/getSysOperationRecordList", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/sysOperationRecord/deleteSysOperationRecordByIds", V4: "DELETE"}, + {Ptype: "p", V2: "888", V3: "/user/setUserInfo", V4: "PUT"}, + {Ptype: "p", V2: "888", V3: "/email/emailTest", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/simpleUploader/upload", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/simpleUploader/checkFileMd5", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/simpleUploader/mergeFileMd5", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/excel/importExcel", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/excel/loadExcel", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/excel/exportExcel", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/excel/downloadTemplate", V4: "GET"}, + {Ptype: "p", V2: "888", V3: "/api/deleteApisByIds", V4: "DELETE"}, + {Ptype: "p", V2: "888", V3: "/autoCode/getSysHistory", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/autoCode/rollback", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/autoCode/getMeta", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/autoCode/delSysHistory", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/user/setUserAuthorities", V4: "POST"}, + {Ptype: "p", V2: "888", V3: "/user/getUserInfo", V4: "GET"}, +} + +// @description: casbin_rule 表数据初始化 +func (c *CasbinS) Init() error { + global.MG_DB.AutoMigrate(gormadapter.CasbinRule{}) + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + if tx.Find(&[]gormadapter.CasbinRule{}).RowsAffected == 154 { + color.Danger.Println("\n[Mysql] --> casbin_rule 表的初始数据已存在!") + return nil + } + for k, _ := range carbines { + carbines[k].V0 = "api" + carbines[k].V1 = "appid" + } + if err := tx.Create(&carbines).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> casbin_rule 表初始数据成功!") + return nil + }) +} + +// @description: casbin_rule 表数据初始化 +func (c *CasbinS) InitData() error { + tx := global.MG_DB.Begin() + for k, _ := range carbines { + carbines[k].V0 = "api" + carbines[k].V1 = "appid" + } + if err := tx.Create(&carbines).Error; err != nil { // 遇到错误时回滚事务 + return err + } + tx.Commit() + color.Info.Println("\n[Mysql] --> casbin_rule 表初始数据成功!") + return nil +} diff --git a/source/data_authorities.go b/source/data_authorities.go new file mode 100644 index 0000000..345f0de --- /dev/null +++ b/source/data_authorities.go @@ -0,0 +1,40 @@ +package source + +import ( + "pure-admin/global" + + "github.com/gookit/color" + "gorm.io/gorm" +) + +var DataAuthorities = new(dataAuthorities) + +type dataAuthorities struct{} + +type DataAuthority struct { + AuthorityId string `gorm:"column:sys_authority_authority_id"` + DataAuthority string `gorm:"column:data_authority_id_authority_id"` +} + +var infos = []DataAuthority{ + {"888", "888"}, + {"888", "8881"}, + {"888", "9528"}, + {"9528", "8881"}, + {"9528", "9528"}, +} + +//@description: sys_data_authority_id 表数据初始化 +func (d *dataAuthorities) Init() error { + return global.MG_DB.Table("sys_data_authority_id").Transaction(func(tx *gorm.DB) error { + if tx.Where("sys_authority_authority_id IN ('888', '9528') ").Find(&[]DataAuthority{}).RowsAffected == 5 { + color.Danger.Println("\n[Mysql] --> sys_data_authority_id 表初始数据已存在!") + return nil + } + if err := tx.Create(&infos).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_data_authority_id 表初始数据成功!") + return nil + }) +} diff --git a/source/dictionary.go b/source/dictionary.go new file mode 100644 index 0000000..6b9d442 --- /dev/null +++ b/source/dictionary.go @@ -0,0 +1,41 @@ +package source + +import ( + "pure-admin/global" + "pure-admin/model" + "time" + + "github.com/gookit/color" + + "gorm.io/gorm" +) + +var Dictionary = new(dictionary) + +type dictionary struct{} + +var status = new(bool) + +//@description: sys_dictionaries 表数据初始化 +func (d *dictionary) Init() error { + *status = true + var dictionaries = []model.SysDictionary{ + {Name: "性别", Type: "sex", Status: status, Desc: "性别字典", MG_MODEL: global.MG_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {Name: "数据库int类型", Type: "int", Status: status, Desc: "int类型对应的数据库类型", MG_MODEL: global.MG_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {Name: "数据库时间日期类型", Type: "time.Time", Status: status, Desc: "数据库时间日期类型", MG_MODEL: global.MG_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {Name: "数据库浮点型", Type: "float64", Status: status, Desc: "数据库浮点型", MG_MODEL: global.MG_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {Name: "数据库字符串", Type: "string", Status: status, Desc: "数据库字符串", MG_MODEL: global.MG_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {Name: "数据库bool类型", Type: "bool", Status: status, Desc: "数据库bool类型", MG_MODEL: global.MG_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + } + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + if tx.Where("id in (?)", []int{1, 6}).Find(&[]model.SysDictionary{}).RowsAffected == 2 { + color.Danger.Println("\n[Mysql] --> sys_dictionaries 表初始数据已存在!") + return nil + } + if err := tx.Create(&dictionaries).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_dictionaries 表初始数据成功!") + return nil + }) +} diff --git a/source/dictionary_details.go b/source/dictionary_details.go new file mode 100644 index 0000000..21f5f5d --- /dev/null +++ b/source/dictionary_details.go @@ -0,0 +1,55 @@ +package source + +import ( + "pure-admin/global" + "pure-admin/model" + "time" + + "github.com/gookit/color" + + "gorm.io/gorm" +) + +var DictionaryDetail = new(dictionaryDetail) + +type dictionaryDetail struct{} + +//@description: dictionary_details 表数据初始化 +func (d *dictionaryDetail) Init() error { + var details = []model.SysDictionaryDetail{ + {"smallint", 1, status, 1, 2, global.MG_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"mediumint", 2, status, 2, 2, global.MG_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"int", 3, status, 3, 2, global.MG_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"bigint", 4, status, 4, 2, global.MG_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"date", 0, status, 0, 3, global.MG_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"time", 1, status, 1, 3, global.MG_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"year", 2, status, 2, 3, global.MG_MODEL{ID: 7, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"datetime", 3, status, 3, 3, global.MG_MODEL{ID: 8, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"timestamp", 5, status, 5, 3, global.MG_MODEL{ID: 9, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"float", 0, status, 0, 4, global.MG_MODEL{ID: 10, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"double", 1, status, 1, 4, global.MG_MODEL{ID: 11, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"decimal", 2, status, 2, 4, global.MG_MODEL{ID: 12, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"char", 0, status, 0, 5, global.MG_MODEL{ID: 13, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"varchar", 1, status, 1, 5, global.MG_MODEL{ID: 14, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"tinyblob", 2, status, 2, 5, global.MG_MODEL{ID: 15, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"tinytext", 3, status, 3, 5, global.MG_MODEL{ID: 16, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"text", 4, status, 4, 5, global.MG_MODEL{ID: 17, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"blob", 5, status, 5, 5, global.MG_MODEL{ID: 18, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"mediumblob", 6, status, 6, 5, global.MG_MODEL{ID: 19, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"mediumtext", 7, status, 7, 5, global.MG_MODEL{ID: 20, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"longblob", 8, status, 8, 5, global.MG_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"longtext", 9, status, 9, 5, global.MG_MODEL{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + {"tinyint", 0, status, 0, 6, global.MG_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}}, + } + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + if tx.Where("id in (?)", []int{1, 23}).Find(&[]model.SysDictionaryDetail{}).RowsAffected == 2 { + color.Danger.Println("\n[Mysql] --> sys_dictionary_details 表的初始数据已存在!") + return nil + } + if err := tx.Create(&details).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_dictionary_details 表初始数据成功!") + return nil + }) +} diff --git a/source/file.go b/source/file.go new file mode 100644 index 0000000..d150341 --- /dev/null +++ b/source/file.go @@ -0,0 +1 @@ +package source diff --git a/source/menu.go b/source/menu.go new file mode 100644 index 0000000..8b4ab8c --- /dev/null +++ b/source/menu.go @@ -0,0 +1,56 @@ +package source + +import ( + "pure-admin/global" + "pure-admin/model" + "time" + + "github.com/gookit/color" + + "gorm.io/gorm" +) + +var BaseMenu = new(menu) + +type menu struct{} + +var menus = []model.SysBaseMenu{ + {MG_MODEL: global.MG_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "dashboard", Name: "dashboard", Hidden: false, Component: "view/dashboard/index.vue", Sort: 1, Meta: model.Meta{Title: "仪表盘", Icon: "setting"}}, + {MG_MODEL: global.MG_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "about", Name: "about", Component: "view/about/index.vue", Sort: 7, Meta: model.Meta{Title: "关于我们", Icon: "info"}}, + {MG_MODEL: global.MG_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "admin", Name: "superAdmin", Component: "view/superAdmin/index.vue", Sort: 3, Meta: model.Meta{Title: "超级管理员", Icon: "user-solid"}}, + {MG_MODEL: global.MG_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "authority", Name: "authority", Component: "view/superAdmin/authority/authority.vue", Sort: 1, Meta: model.Meta{Title: "角色管理", Icon: "s-custom"}}, + {MG_MODEL: global.MG_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "menu", Name: "menu", Component: "view/superAdmin/menu/menu.vue", Sort: 2, Meta: model.Meta{Title: "菜单管理", Icon: "s-order", KeepAlive: true}}, + {MG_MODEL: global.MG_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "api", Name: "api", Component: "view/superAdmin/api/api.vue", Sort: 3, Meta: model.Meta{Title: "api管理", Icon: "s-platform", KeepAlive: true}}, + {MG_MODEL: global.MG_MODEL{ID: 7, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "user", Name: "user", Component: "view/superAdmin/user/user.vue", Sort: 4, Meta: model.Meta{Title: "用户管理", Icon: "coordinate"}}, + {MG_MODEL: global.MG_MODEL{ID: 8, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: true, ParentId: "0", Path: "person", Name: "person", Component: "view/person/person.vue", Sort: 4, Meta: model.Meta{Title: "个人信息", Icon: "message-solid"}}, + {MG_MODEL: global.MG_MODEL{ID: 9, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "example", Name: "example", Component: "view/example/index.vue", Sort: 6, Meta: model.Meta{Title: "示例文件", Icon: "s-management"}}, + {MG_MODEL: global.MG_MODEL{ID: 10, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "excel", Name: "excel", Component: "view/example/excel/excel.vue", Sort: 4, Meta: model.Meta{Title: "excel导入导出", Icon: "s-marketing"}}, + {MG_MODEL: global.MG_MODEL{ID: 11, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "upload", Name: "upload", Component: "view/example/upload/upload.vue", Sort: 5, Meta: model.Meta{Title: "媒体库(上传下载)", Icon: "upload"}}, + {MG_MODEL: global.MG_MODEL{ID: 12, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "breakpoint", Name: "breakpoint", Component: "view/example/breakpoint/breakpoint.vue", Sort: 6, Meta: model.Meta{Title: "断点续传", Icon: "upload"}}, + {MG_MODEL: global.MG_MODEL{ID: 13, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "customer", Name: "customer", Component: "view/example/customer/customer.vue", Sort: 7, Meta: model.Meta{Title: "客户列表(资源示例)", Icon: "s-custom"}}, + {MG_MODEL: global.MG_MODEL{ID: 14, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "systemTools", Name: "systemTools", Component: "view/systemTools/index.vue", Sort: 5, Meta: model.Meta{Title: "系统工具", Icon: "s-cooperation"}}, + {MG_MODEL: global.MG_MODEL{ID: 15, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "14", Path: "autoCode", Name: "autoCode", Component: "view/systemTools/autoCode/index.vue", Sort: 1, Meta: model.Meta{Title: "代码生成器", Icon: "cpu", KeepAlive: true}}, + {MG_MODEL: global.MG_MODEL{ID: 16, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "14", Path: "formCreate", Name: "formCreate", Component: "view/systemTools/formCreate/index.vue", Sort: 2, Meta: model.Meta{Title: "表单生成器", Icon: "magic-stick", KeepAlive: true}}, + {MG_MODEL: global.MG_MODEL{ID: 17, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "14", Path: "system", Name: "system", Component: "view/systemTools/system/system.vue", Sort: 3, Meta: model.Meta{Title: "系统配置", Icon: "s-operation"}}, + {MG_MODEL: global.MG_MODEL{ID: 18, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "dictionary", Name: "dictionary", Component: "view/superAdmin/dictionary/sysDictionary.vue", Sort: 5, Meta: model.Meta{Title: "字典管理", Icon: "notebook-2"}}, + {MG_MODEL: global.MG_MODEL{ID: 19, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: true, ParentId: "3", Path: "dictionaryDetail/:id", Name: "dictionaryDetail", Component: "view/superAdmin/dictionary/sysDictionaryDetail.vue", Sort: 1, Meta: model.Meta{Title: "字典详情", Icon: "s-order"}}, + {MG_MODEL: global.MG_MODEL{ID: 20, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "operation", Name: "operation", Component: "view/superAdmin/operation/sysOperationRecord.vue", Sort: 6, Meta: model.Meta{Title: "操作历史", Icon: "time"}}, + {MG_MODEL: global.MG_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "simpleUploader", Name: "simpleUploader", Component: "view/example/simpleUploader/simpleUploader", Sort: 6, Meta: model.Meta{Title: "断点续传(插件版)", Icon: "upload"}}, + {MG_MODEL: global.MG_MODEL{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "https://www.pure-admin.com", Name: "https://www.pure-admin.com", Hidden: false, Component: "/", Sort: 0, Meta: model.Meta{Title: "官方网站", Icon: "s-home"}}, + {MG_MODEL: global.MG_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "state", Name: "state", Hidden: false, Component: "view/system/state.vue", Sort: 6, Meta: model.Meta{Title: "服务器状态", Icon: "cloudy"}}, +} + +//@description: sys_base_menus 表数据初始化 +func (m *menu) Init() error { + return global.MG_DB.Transaction(func(tx *gorm.DB) error { + if tx.Where("id in (?)", []int{1, 29}).Find(&[]model.SysBaseMenu{}).RowsAffected == 2 { + color.Danger.Println("\n[Mysql] --> sys_base_menus 表的初始数据已存在!") + return nil + } + if err := tx.Create(&menus).Error; err != nil { // 遇到错误时回滚事务 + return err + } + color.Info.Println("\n[Mysql] --> sys_base_menus 表初始数据成功!") + return nil + }) +} diff --git a/third_party/google/api/annotations.proto b/third_party/google/api/annotations.proto new file mode 100644 index 0000000..85c361b --- /dev/null +++ b/third_party/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright (c) 2015, Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/third_party/google/api/client.proto b/third_party/google/api/client.proto new file mode 100644 index 0000000..d3d1ead --- /dev/null +++ b/third_party/google/api/client.proto @@ -0,0 +1,101 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "ClientProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +extend google.protobuf.ServiceOptions { + // The hostname for this service. + // This should be specified with no prefix or protocol. + // + // Example: + // + // service Foo { + // option (google.api.default_host) = "foo.googleapi.com"; + // ... + // } + string default_host = 1049; + + // OAuth scopes needed for the client. + // + // Example: + // + // service Foo { + // option (google.api.oauth_scopes) = \ + // "https://www.googleapis.com/auth/cloud-platform"; + // ... + // } + // + // If there is more than one scope, use a comma-separated string: + // + // Example: + // + // service Foo { + // option (google.api.oauth_scopes) = \ + // "https://www.googleapis.com/auth/cloud-platform," + // "https://www.googleapis.com/auth/monitoring"; + // ... + // } + string oauth_scopes = 1050; +} + + +extend google.protobuf.MethodOptions { + // A definition of a client library method signature. + // + // In client libraries, each proto RPC corresponds to one or more methods + // which the end user is able to call, and calls the underlying RPC. + // Normally, this method receives a single argument (a struct or instance + // corresponding to the RPC request object). Defining this field will + // add one or more overloads providing flattened or simpler method signatures + // in some languages. + // + // The fields on the method signature are provided as a comma-separated + // string. + // + // For example, the proto RPC and annotation: + // + // rpc CreateSubscription(CreateSubscriptionRequest) + // returns (Subscription) { + // option (google.api.method_signature) = "name,topic"; + // } + // + // Would add the following Java overload (in addition to the method accepting + // the request object): + // + // public final Subscription createSubscription(String name, String topic) + // + // The following backwards-compatibility guidelines apply: + // + // * Adding this annotation to an unannotated method is backwards + // compatible. + // * Adding this annotation to a method which already has existing + // method signature annotations is backwards compatible if and only if + // the new method signature annotation is last in the sequence. + // * Modifying or removing an existing method signature annotation is + // a breaking change. + // * Re-ordering existing method signature annotations is a breaking + // change. + repeated string method_signature = 1051; +} \ No newline at end of file diff --git a/third_party/google/api/field_behavior.proto b/third_party/google/api/field_behavior.proto new file mode 100644 index 0000000..e9716a2 --- /dev/null +++ b/third_party/google/api/field_behavior.proto @@ -0,0 +1,80 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "FieldBehaviorProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// An indicator of the behavior of a given field (for example, that a field +// is required in requests, or given as output but ignored as input). +// This **does not** change the behavior in protocol buffers itself; it only +// denotes the behavior and may affect how API tooling handles the field. +// +// Note: This enum **may** receive new values in the future. +enum FieldBehavior { + // Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0; + + // Specifically denotes a field as optional. + // While all fields in protocol buffers are optional, this may be specified + // for emphasis if appropriate. + OPTIONAL = 1; + + // Denotes a field as required. + // This indicates that the field **must** be provided as part of the request, + // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2; + + // Denotes a field as output only. + // This indicates that the field is provided in responses, but including the + // field in a request does nothing (the server *must* ignore it and + // *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3; + + // Denotes a field as input only. + // This indicates that the field is provided in requests, and the + // corresponding field is not included in output. + INPUT_ONLY = 4; + + // Denotes a field as immutable. + // This indicates that the field may be set once in a request to create a + // resource, but may not be changed thereafter. + IMMUTABLE = 5; +} + + +extend google.protobuf.FieldOptions { + // A designation of a specific field behavior (required, output only, etc.) + // in protobuf messages. + // + // Examples: + // + // string name = 1 [(google.api.field_behavior) = REQUIRED]; + // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + // google.protobuf.Duration ttl = 1 + // [(google.api.field_behavior) = INPUT_ONLY]; + // google.protobuf.Timestamp expire_time = 1 + // [(google.api.field_behavior) = OUTPUT_ONLY, + // (google.api.field_behavior) = IMMUTABLE]; + repeated FieldBehavior field_behavior = 1052; +} \ No newline at end of file diff --git a/third_party/google/api/http.proto b/third_party/google/api/http.proto new file mode 100644 index 0000000..69460cf --- /dev/null +++ b/third_party/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/third_party/google/api/httpbody.proto b/third_party/google/api/httpbody.proto new file mode 100644 index 0000000..1a5bb78 --- /dev/null +++ b/third_party/google/api/httpbody.proto @@ -0,0 +1,77 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/protobuf/any.proto"; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; +option java_multiple_files = true; +option java_outer_classname = "HttpBodyProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Message that represents an arbitrary HTTP body. It should only be used for +// payload formats that can't be represented as JSON, such as raw binary or +// an HTML page. +// +// +// This message can be used both in streaming and non-streaming API methods in +// the request as well as the response. +// +// It can be used as a top-level request field, which is convenient if one +// wants to extract parameters from either the URL or HTTP template into the +// request fields and also want access to the raw HTTP body. +// +// Example: +// +// message GetResourceRequest { +// // A unique request id. +// string request_id = 1; +// +// // The raw HTTP body is bound to this field. +// google.api.HttpBody http_body = 2; +// } +// +// service ResourceService { +// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); +// rpc UpdateResource(google.api.HttpBody) returns +// (google.protobuf.Empty); +// } +// +// Example with streaming methods: +// +// service CaldavService { +// rpc GetCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// rpc UpdateCalendar(stream google.api.HttpBody) +// returns (stream google.api.HttpBody); +// } +// +// Use of this type only changes how the request and response bodies are +// handled, all other features will continue to work unchanged. +message HttpBody { + // The HTTP Content-Type header value specifying the content type of the body. + string content_type = 1; + + // The HTTP request/response body as raw binary. + bytes data = 2; + + // Application specific response metadata. Must be set in the first response + // for streaming APIs. + repeated google.protobuf.Any extensions = 3; +} diff --git a/third_party/google/protobuf/any.proto b/third_party/google/protobuf/any.proto new file mode 100644 index 0000000..e2c2042 --- /dev/null +++ b/third_party/google/protobuf/any.proto @@ -0,0 +1,158 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} diff --git a/third_party/google/protobuf/api.proto b/third_party/google/protobuf/api.proto new file mode 100644 index 0000000..3d598fc --- /dev/null +++ b/third_party/google/protobuf/api.proto @@ -0,0 +1,208 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/apipb"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inheriting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} diff --git a/third_party/google/protobuf/compiler/plugin.proto b/third_party/google/protobuf/compiler/plugin.proto new file mode 100644 index 0000000..9242aac --- /dev/null +++ b/third_party/google/protobuf/compiler/plugin.proto @@ -0,0 +1,183 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// +// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to +// change. +// +// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +// just a program that reads a CodeGeneratorRequest from stdin and writes a +// CodeGeneratorResponse to stdout. +// +// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +// of dealing with the raw protocol defined here. +// +// A plugin executable needs only to be placed somewhere in the path. The +// plugin should be named "protoc-gen-$NAME", and will then be used when the +// flag "--${NAME}_out" is passed to protoc. + +syntax = "proto2"; + +package google.protobuf.compiler; +option java_package = "com.google.protobuf.compiler"; +option java_outer_classname = "PluginProtos"; + +option go_package = "google.golang.org/protobuf/types/pluginpb"; + +import "google/protobuf/descriptor.proto"; + +// The version number of protocol compiler. +message Version { + optional int32 major = 1; + optional int32 minor = 2; + optional int32 patch = 3; + // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + // be empty for mainline stable releases. + optional string suffix = 4; +} + +// An encoded CodeGeneratorRequest is written to the plugin's stdin. +message CodeGeneratorRequest { + // The .proto files that were explicitly listed on the command-line. The + // code generator should generate code only for these files. Each file's + // descriptor will be included in proto_file, below. + repeated string file_to_generate = 1; + + // The generator parameter passed on the command-line. + optional string parameter = 2; + + // FileDescriptorProtos for all files in files_to_generate and everything + // they import. The files will appear in topological order, so each file + // appears before any file that imports it. + // + // protoc guarantees that all proto_files will be written after + // the fields above, even though this is not technically guaranteed by the + // protobuf wire format. This theoretically could allow a plugin to stream + // in the FileDescriptorProtos and handle them one by one rather than read + // the entire set into memory at once. However, as of this writing, this + // is not similarly optimized on protoc's end -- it will store all fields in + // memory at once before sending them to the plugin. + // + // Type names of fields and extensions in the FileDescriptorProto are always + // fully qualified. + repeated FileDescriptorProto proto_file = 15; + + // The version number of protocol compiler. + optional Version compiler_version = 3; + +} + +// The plugin writes an encoded CodeGeneratorResponse to stdout. +message CodeGeneratorResponse { + // Error message. If non-empty, code generation failed. The plugin process + // should exit with status code zero even if it reports an error in this way. + // + // This should be used to indicate errors in .proto files which prevent the + // code generator from generating correct code. Errors which indicate a + // problem in protoc itself -- such as the input CodeGeneratorRequest being + // unparseable -- should be reported by writing a message to stderr and + // exiting with a non-zero status code. + optional string error = 1; + + // A bitmask of supported features that the code generator supports. + // This is a bitwise "or" of values from the Feature enum. + optional uint64 supported_features = 2; + + // Sync with code_generator.h. + enum Feature { + FEATURE_NONE = 0; + FEATURE_PROTO3_OPTIONAL = 1; + } + + // Represents a single generated file. + message File { + // The file name, relative to the output directory. The name must not + // contain "." or ".." components and must be relative, not be absolute (so, + // the file cannot lie outside the output directory). "/" must be used as + // the path separator, not "\". + // + // If the name is omitted, the content will be appended to the previous + // file. This allows the generator to break large files into small chunks, + // and allows the generated text to be streamed back to protoc so that large + // files need not reside completely in memory at one time. Note that as of + // this writing protoc does not optimize for this -- it will read the entire + // CodeGeneratorResponse before writing files to disk. + optional string name = 1; + + // If non-empty, indicates that the named file should already exist, and the + // content here is to be inserted into that file at a defined insertion + // point. This feature allows a code generator to extend the output + // produced by another code generator. The original generator may provide + // insertion points by placing special annotations in the file that look + // like: + // @@protoc_insertion_point(NAME) + // The annotation can have arbitrary text before and after it on the line, + // which allows it to be placed in a comment. NAME should be replaced with + // an identifier naming the point -- this is what other generators will use + // as the insertion_point. Code inserted at this point will be placed + // immediately above the line containing the insertion point (thus multiple + // insertions to the same point will come out in the order they were added). + // The double-@ is intended to make it unlikely that the generated code + // could contain things that look like insertion points by accident. + // + // For example, the C++ code generator places the following line in the + // .pb.h files that it generates: + // // @@protoc_insertion_point(namespace_scope) + // This line appears within the scope of the file's package namespace, but + // outside of any particular class. Another plugin can then specify the + // insertion_point "namespace_scope" to generate additional classes or + // other declarations that should be placed in this scope. + // + // Note that if the line containing the insertion point begins with + // whitespace, the same whitespace will be added to every line of the + // inserted text. This is useful for languages like Python, where + // indentation matters. In these languages, the insertion point comment + // should be indented the same amount as any inserted code will need to be + // in order to work correctly in that context. + // + // The code generator that generates the initial file and the one which + // inserts into it must both run as part of a single invocation of protoc. + // Code generators are executed in the order in which they appear on the + // command line. + // + // If |insertion_point| is present, |name| must also be present. + optional string insertion_point = 2; + + // The file contents. + optional string content = 15; + + // Information describing the file content being inserted. If an insertion + // point is used, this information will be appropriately offset and inserted + // into the code generation metadata for the generated files. + optional GeneratedCodeInfo generated_code_info = 16; + } + repeated File file = 15; +} diff --git a/third_party/google/protobuf/descriptor.proto b/third_party/google/protobuf/descriptor.proto new file mode 100644 index 0000000..49ec653 --- /dev/null +++ b/third_party/google/protobuf/descriptor.proto @@ -0,0 +1,921 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported in proto3. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must be belong to a oneof to + // signal to old proto3 clients that presence is tracked for this field. This + // oneof is known as a "synthetic" oneof, and this field must be its sole + // member (each proto3 optional field gets its own synthetic oneof). Synthetic + // oneofs exist in the descriptor only, and do not generate any API. Synthetic + // oneofs must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default = false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + optional bool php_generic_services = 42 [default = false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outer message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + // + // As of 2021, lazy does no correctness checks on the byte stream during + // parsing. This may lead to crashes if and when an invalid byte stream is + // finally parsed upon access. + // + // TODO(b/211906113): Enable validation on lazy fields. + optional bool lazy = 5 [default = false]; + + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition occurs. + // For example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/third_party/google/protobuf/duration.proto b/third_party/google/protobuf/duration.proto new file mode 100644 index 0000000..81c3e36 --- /dev/null +++ b/third_party/google/protobuf/duration.proto @@ -0,0 +1,116 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/third_party/google/protobuf/empty.proto b/third_party/google/protobuf/empty.proto new file mode 100644 index 0000000..5f992de --- /dev/null +++ b/third_party/google/protobuf/empty.proto @@ -0,0 +1,52 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} diff --git a/third_party/google/protobuf/field_mask.proto b/third_party/google/protobuf/field_mask.proto new file mode 100644 index 0000000..6b5104f --- /dev/null +++ b/third_party/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} diff --git a/third_party/google/protobuf/source_context.proto b/third_party/google/protobuf/source_context.proto new file mode 100644 index 0000000..06bfc43 --- /dev/null +++ b/third_party/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} diff --git a/third_party/google/protobuf/struct.proto b/third_party/google/protobuf/struct.proto new file mode 100644 index 0000000..0ac843c --- /dev/null +++ b/third_party/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of these +// variants. Absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/third_party/google/protobuf/timestamp.proto b/third_party/google/protobuf/timestamp.proto new file mode 100644 index 0000000..3b2df6d --- /dev/null +++ b/third_party/google/protobuf/timestamp.proto @@ -0,0 +1,147 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/third_party/google/protobuf/type.proto b/third_party/google/protobuf/type.proto new file mode 100644 index 0000000..d3f6a68 --- /dev/null +++ b/third_party/google/protobuf/type.proto @@ -0,0 +1,187 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option go_package = "google.golang.org/protobuf/types/known/typepb"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + } + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; +} diff --git a/third_party/google/protobuf/wrappers.proto b/third_party/google/protobuf/wrappers.proto new file mode 100644 index 0000000..d49dd53 --- /dev/null +++ b/third_party/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} diff --git a/ueditor-config.json b/ueditor-config.json new file mode 100644 index 0000000..a1484ce --- /dev/null +++ b/ueditor-config.json @@ -0,0 +1,234 @@ +/* 前后端通信相关的配置,注释只允许使用多行方式 */ +{ + /* 上传图片配置项 */ + "imageActionName": "uploadimage", + /* 执行上传图片的action名称 */ + "imageFieldName": "upfile", + /* 提交的图片表单名称 */ + "imageMaxSize": 2048000, + /* 上传大小限制,单位B */ + "imageAllowFiles": [ + ".png", + ".jpg", + ".jpeg", + ".gif", + ".bmp" + ], + /* 上传图片格式显示 */ + "imageCompressEnable": true, + /* 是否压缩图片,默认是true */ + "imageCompressBorder": 1600, + /* 图片压缩最长边限制 */ + "imageInsertAlign": "none", + /* 插入的图片浮动方式 */ + "imageUrlPrefix": "", + /* 图片访问路径前缀 */ + "imagePathFormat": "/ue-img/{yy}{mm}{dd}/{filename}", + /* 涂鸦图片上传配置项 */ + "scrawlActionName": "uploadscrawl", + /* 执行上传涂鸦的action名称 */ + "scrawlFieldName": "upfile", + /* 提交的图片表单名称 */ + /* "scrawlPathFormat": "/ueditor/php/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",*/ + /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "scrawlPathFormat": "/ue-img/{yy}{mm}{dd}/{filename}", + /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "scrawlMaxSize": 2048000, + /* 上传大小限制,单位B */ + "scrawlUrlPrefix": "", + /* 图片访问路径前缀 */ + "scrawlInsertAlign": "none", + /* 截图工具上传 */ + "snapscreenActionName": "uploadimage", + /* 执行上传截图的action名称 */ + "snapscreenPathFormat": "/ue-img/{yy}{mm}{dd}/{filename}", + /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "snapscreenUrlPrefix": "", + /* 图片访问路径前缀 */ + "snapscreenInsertAlign": "none", + /* 插入的图片浮动方式 */ + + /* 抓取远程图片配置 */ + "catcherLocalDomain": [ + "127.0.0.1", + "localhost", + "img.baidu.com" + ], + "catcherActionName": "catchimage", + /* 执行抓取远程图片的action名称 */ + "catcherFieldName": "source", + /* 提交的图片列表表单名称 */ + "catcherPathFormat": "/ue-img/{yy}{mm}{dd}/{filename}", + /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "catcherUrlPrefix": "", + /* 图片访问路径前缀 */ + "catcherMaxSize": 2048000, + /* 上传大小限制,单位B */ + "catcherAllowFiles": [ + ".png", + ".jpg", + ".jpeg", + ".gif", + ".bmp" + ], + /* 抓取图片格式显示 */ + + /* 上传视频配置 */ + "videoActionName": "uploadvideo", + /* 执行上传视频的action名称 */ + "videoFieldName": "upfile", + /* 提交的视频表单名称 */ + "videoPathFormat": "/ue-video/{yy}{mm}{dd}/{filename}", + /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "videoUrlPrefix": "", + /* 视频访问路径前缀 */ + "videoMaxSize": 102400000, + /* 上传大小限制,单位B,默认100MB */ + "videoAllowFiles": [ + ".flv", + ".swf", + ".mkv", + ".avi", + ".rm", + ".rmvb", + ".mpeg", + ".mpg", + ".ogg", + ".ogv", + ".mov", + ".wmv", + ".mp4", + ".webm", + ".mp3", + ".wav", + ".mid" + ], + /* 上传视频格式显示 */ + + /* 上传文件配置 */ + "fileActionName": "uploadfile", + /* controller里,执行上传视频的action名称 */ + "fileFieldName": "upfile", + /* 提交的文件表单名称 */ + "filePathFormat": "/ue-file/{yy}{mm}{dd}/{filename}", + /* 上传保存路径,可以自定义保存路径和文件名格式 */ + "fileUrlPrefix": "", + /* 文件访问路径前缀 */ + "fileMaxSize": 51200000, + /* 上传大小限制,单位B,默认50MB */ + "fileAllowFiles": [ + ".png", + ".jpg", + ".jpeg", + ".gif", + ".bmp", + ".flv", + ".swf", + ".mkv", + ".avi", + ".rm", + ".rmvb", + ".mpeg", + ".mpg", + ".ogg", + ".ogv", + ".mov", + ".wmv", + ".mp4", + ".webm", + ".mp3", + ".wav", + ".mid", + ".rar", + ".zip", + ".tar", + ".gz", + ".7z", + ".bz2", + ".cab", + ".iso", + ".doc", + ".docx", + ".xls", + ".xlsx", + ".ppt", + ".pptx", + ".pdf", + ".txt", + ".md", + ".xml" + ], + /* 上传文件格式显示 */ + + /* 列出指定目录下的图片 */ + "imageManagerActionName": "listimage", + /* 执行图片管理的action名称 */ + "imageManagerListPath": "/static/upload/images/", + /* 指定要列出图片的目录 */ + "imageManagerListSize": 20, + /* 每次列出文件数量 */ + "imageManagerUrlPrefix": "", + /* 图片访问路径前缀 */ + "imageManagerInsertAlign": "none", + /* 插入的图片浮动方式 */ + "imageManagerAllowFiles": [ + ".png", + ".jpg", + ".jpeg", + ".gif", + ".bmp" + ], + /* 列出的文件类型 */ + /* 列出指定目录下的文件 */ + "fileManagerActionName": "listfile", + /* 执行文件管理的action名称 */ + "fileManagerListPath": "/static/upload/files/", + /* 指定要列出文件的目录 */ + "fileManagerUrlPrefix": "", + /* 文件访问路径前缀 */ + "fileManagerListSize": 20, + /* 每次列出文件数量 */ + "fileManagerAllowFiles": [ + ".png", + ".jpg", + ".jpeg", + ".gif", + ".bmp", + ".flv", + ".swf", + ".mkv", + ".avi", + ".rm", + ".rmvb", + ".mpeg", + ".mpg", + ".ogg", + ".ogv", + ".mov", + ".wmv", + ".mp4", + ".webm", + ".mp3", + ".wav", + ".mid", + ".rar", + ".zip", + ".tar", + ".gz", + ".7z", + ".bz2", + ".cab", + ".iso", + ".doc", + ".docx", + ".xls", + ".xlsx", + ".ppt", + ".pptx", + ".pdf", + ".txt", + ".md", + ".xml" + ] + /* 列出的文件类型 */ +} diff --git a/utils/array.go b/utils/array.go new file mode 100644 index 0000000..d57e797 --- /dev/null +++ b/utils/array.go @@ -0,0 +1,19 @@ +package utils + +func ArrayStrRemove(old, loser []string) []string { + for j := 0; j < len(loser); j++ { + for i := 0; i < len(old); i++ { + if old[i] == loser[j] { //将元素剔除 + if old[i] == loser[j] { + if i == len(old)-1 { + old = old[:i] + } else { + old = append(old[:i], old[i+1:]...) + i-- + } + } + } + } + } + return old +} diff --git a/utils/breakpoint_continue.go b/utils/breakpoint_continue.go new file mode 100644 index 0000000..2dd003d --- /dev/null +++ b/utils/breakpoint_continue.go @@ -0,0 +1,102 @@ +package utils + +import ( + "io/ioutil" + "os" + "strconv" +) + +// 前端传来文件片与当前片为什么文件的第几片 +// 后端拿到以后比较次分片是否上传 或者是否为不完全片 +// 前端发送每片多大 +// 前端告知是否为最后一片且是否完成 + +const breakpointDir = "./breakpointDir/" +const finishDir = "./fileDir/" + +//@function: BreakPointContinue +//@description: 断点续传 +//@param: content []byte, fileName string, contentNumber int, contentTotal int, fileMd5 string +//@return: error, string + +func BreakPointContinue(content []byte, fileName string, contentNumber int, contentTotal int, fileMd5 string) (error, string) { + path := breakpointDir + fileMd5 + "/" + err := os.MkdirAll(path, os.ModePerm) + if err != nil { + return err, path + } + err, pathc := makeFileContent(content, fileName, path, contentNumber) + return err, pathc + +} + +//@function: CheckMd5 +//@description: 检查Md5 +//@param: content []byte, chunkMd5 string +//@return: CanUpload bool + +func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool) { + fileMd5 := MD5V(content) + if fileMd5 == chunkMd5 { + return true // 可以继续上传 + } else { + return false // 切片不完整,废弃 + } +} + +//@function: makeFileContent +//@description: 创建切片内容 +//@param: content []byte, fileName string, FileDir string, contentNumber int +//@return: error, string + +func makeFileContent(content []byte, fileName string, FileDir string, contentNumber int) (error, string) { + path := FileDir + fileName + "_" + strconv.Itoa(contentNumber) + f, err := os.Create(path) + if err != nil { + return err, path + } else { + _, err = f.Write(content) + if err != nil { + return err, path + } + } + defer f.Close() + return nil, path +} + +//@function: makeFileContent +//@description: 创建切片文件 +//@param: fileName string, FileMd5 string +//@return: error, string + +func MakeFile(fileName string, FileMd5 string) (error, string) { + rd, err := ioutil.ReadDir(breakpointDir + FileMd5) + if err != nil { + return err, finishDir + fileName + } + _ = os.MkdirAll(finishDir, os.ModePerm) + fd, err := os.OpenFile(finishDir+fileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644) + if err != nil { + return err, finishDir + fileName + } + defer fd.Close() + for k := range rd { + content, _ := ioutil.ReadFile(breakpointDir + FileMd5 + "/" + fileName + "_" + strconv.Itoa(k)) + _, err = fd.Write(content) + if err != nil { + _ = os.Remove(finishDir + fileName) + return err, finishDir + fileName + } + } + return nil, finishDir + fileName +} + +//@function: RemoveChunk +//@description: 移除切片 +//@param: FileMd5 string +//@return: error + +func RemoveChunk(FileMd5 string) error { + err := os.RemoveAll(breakpointDir + FileMd5) + return err +} diff --git a/utils/constant.go b/utils/constant.go new file mode 100644 index 0000000..a8534e2 --- /dev/null +++ b/utils/constant.go @@ -0,0 +1,6 @@ +package utils + +const ( + ConfigEnv = "MG_CONFIG" + ConfigFile = "config.yaml" +) diff --git a/utils/cors.go b/utils/cors.go new file mode 100644 index 0000000..1fcc834 --- /dev/null +++ b/utils/cors.go @@ -0,0 +1,17 @@ +package utils + +import ( + uuid "github.com/satori/go.uuid" + "github.com/taskcluster/slugid-go/slugid" +) + +// Get22UUID ... +func Get22UUID() string { + return slugid.Nice() +} + +// GetUUIDv4 ... +func GetUUIDv4() string { + uid := uuid.NewV4() + return uid.String() +} diff --git a/utils/db_automation.go b/utils/db_automation.go new file mode 100644 index 0000000..60c082a --- /dev/null +++ b/utils/db_automation.go @@ -0,0 +1,28 @@ +package utils + +import ( + "errors" + "fmt" + "time" + + "gorm.io/gorm" +) + +//@function: ClearTable +//@description: 清理数据库表数据 +//@param: db(数据库对象) *gorm.DB, tableName(表名) string, compareField(比较字段) string, interval(间隔) string +//@return: error + +func ClearTable(db *gorm.DB, tableName string, compareField string, interval string) error { + if db == nil { + return errors.New("db Cannot be empty") + } + duration, err := time.ParseDuration(interval) + if err != nil { + return err + } + if duration < 0 { + return errors.New("parse duration < 0") + } + return db.Debug().Exec(fmt.Sprintf("DELETE FROM %s WHERE %s < ?", tableName, compareField), time.Now().Add(-duration)).Error +} diff --git a/utils/directory.go b/utils/directory.go new file mode 100644 index 0000000..6a1d59d --- /dev/null +++ b/utils/directory.go @@ -0,0 +1,46 @@ +package utils + +import ( + "os" + "pure-admin/global" + + "go.uber.org/zap" +) + +//@function: PathExists +//@description: 文件目录是否存在 +//@param: path string +//@return: bool, error + +func PathExists(path string) (bool, error) { + _, err := os.Stat(path) + if err == nil { + return true, nil + } + if os.IsNotExist(err) { + return false, nil + } + return false, err +} + +//@function: CreateDir +//@description: 批量创建文件夹 +//@param: dirs ...string +//@return: err error + +func CreateDir(dirs ...string) (err error) { + for _, v := range dirs { + exist, err := PathExists(v) + if err != nil { + return err + } + if !exist { + global.MG_LOG.Debug("create directory" + v) + err = os.MkdirAll(v, os.ModePerm) + if err != nil { + global.MG_LOG.Error("create directory"+v, zap.Any(" error:", err)) + } + } + } + return err +} diff --git a/utils/email.go b/utils/email.go new file mode 100644 index 0000000..9b2f212 --- /dev/null +++ b/utils/email.go @@ -0,0 +1,78 @@ +package utils + +import ( + "crypto/tls" + "fmt" + "net/smtp" + "strings" + + "pure-admin/global" + + "github.com/jordan-wright/email" +) + +//@function: Email +//@description: Email发送方法 +//@param: subject string, body string +//@return: error + +func Email(subject string, body string) error { + to := strings.Split(global.MG_CONFIG.Email.To, ",") + return send(to, subject, body) +} + +//@function: ErrorToEmail +//@description: 给email中间件错误发送邮件到指定邮箱 +//@param: subject string, body string +//@return: error + +func ErrorToEmail(subject string, body string) error { + to := strings.Split(global.MG_CONFIG.Email.To, ",") + if to[len(to)-1] == "" { // 判断切片的最后一个元素是否为空,为空则移除 + to = to[:len(to)-1] + } + return send(to, subject, body) +} + +//@function: EmailTest +//@description: Email测试方法 +//@param: subject string, body string +//@return: error + +func EmailTest(subject string, body string) error { + to := []string{global.MG_CONFIG.Email.From} + return send(to, subject, body) +} + +//@function: send +//@description: Email发送方法 +//@param: subject string, body string +//@return: error + +func send(to []string, subject string, body string) error { + from := global.MG_CONFIG.Email.From + nickname := global.MG_CONFIG.Email.Nickname + secret := global.MG_CONFIG.Email.Secret + host := global.MG_CONFIG.Email.Host + port := global.MG_CONFIG.Email.Port + isSSL := global.MG_CONFIG.Email.IsSSL + + auth := smtp.PlainAuth("", from, secret, host) + e := email.NewEmail() + if nickname != "" { + e.From = fmt.Sprintf("%s <%s>", nickname, from) + } else { + e.From = from + } + e.To = to + e.Subject = subject + e.HTML = []byte(body) + var err error + hostAddr := fmt.Sprintf("%s:%d", host, port) + if isSSL { + err = e.SendWithTLS(hostAddr, auth, &tls.Config{ServerName: host}) + } else { + err = e.Send(hostAddr, auth) + } + return err +} diff --git a/utils/file_operations.go b/utils/file_operations.go new file mode 100644 index 0000000..9b217f0 --- /dev/null +++ b/utils/file_operations.go @@ -0,0 +1,63 @@ +package utils + +import ( + "os" + "path/filepath" + "reflect" + "strings" +) + +//@function: FileMove +//@description: 文件移动供外部调用 +//@param: src string, dst string(src: 源位置,绝对路径or相对路径, dst: 目标位置,绝对路径or相对路径,必须为文件夹) +//@return: err error + +func FileMove(src string, dst string) (err error) { + if dst == "" { + return nil + } + src, err = filepath.Abs(src) + if err != nil { + return err + } + dst, err = filepath.Abs(dst) + if err != nil { + return err + } + var revoke = false + dir := filepath.Dir(dst) +Redirect: + _, err = os.Stat(dir) + if err != nil { + err = os.MkdirAll(dir, 0755) + if err != nil { + return err + } + if !revoke { + revoke = true + goto Redirect + } + } + return os.Rename(src, dst) +} + +//@function: TrimSpace +//@description: 去除结构体空格 +//@param: target interface (target: 目标结构体,传入必须是指针类型) +//@return: null + +func TrimSpace(target interface{}) { + t := reflect.TypeOf(target) + if t.Kind() != reflect.Ptr { + return + } + t = t.Elem() + v := reflect.ValueOf(target).Elem() + for i := 0; i < t.NumField(); i++ { + switch v.Field(i).Kind() { + case reflect.String: + v.Field(i).SetString(strings.TrimSpace(v.Field(i).String())) + } + } + return +} diff --git a/utils/float.go b/utils/float.go new file mode 100644 index 0000000..57e0939 --- /dev/null +++ b/utils/float.go @@ -0,0 +1,28 @@ +package utils + +import ( + "fmt" + "math" + "strconv" +) + +func FormatFloat(num float64, decimal int) (float64, error) { + // 默认乘1 + d := float64(1) + if decimal > 0 { + // 10的N次方 + d = math.Pow10(decimal) + } + // math.trunc作用就是返回浮点数的整数部分 + // 再除回去,小数点后无效的0也就不存在了 + res := strconv.FormatFloat(math.Trunc(num*d)/d, 'f', -1, 64) + return strconv.ParseFloat(res, 64) +} + +func FormatFloatToString(num float64) string { + float, err := FormatFloat(num, 2) + if err != nil { + return "-" + } + return fmt.Sprintf("%v", float) +} diff --git a/utils/fmt_plus.go b/utils/fmt_plus.go new file mode 100644 index 0000000..e9258cc --- /dev/null +++ b/utils/fmt_plus.go @@ -0,0 +1,36 @@ +package utils + +import ( + "fmt" + "reflect" + "strings" +) + +//@function: StructToMap +//@description: 利用反射将结构体转化为map +//@param: obj interface{} +//@return: map[string]interface{} + +func StructToMap(obj interface{}) map[string]interface{} { + obj1 := reflect.TypeOf(obj) + obj2 := reflect.ValueOf(obj) + + var data = make(map[string]interface{}) + for i := 0; i < obj1.NumField(); i++ { + if obj1.Field(i).Tag.Get("mapstructure") != "" { + data[obj1.Field(i).Tag.Get("mapstructure")] = obj2.Field(i).Interface() + } else { + data[obj1.Field(i).Name] = obj2.Field(i).Interface() + } + } + return data +} + +//@function: ArrayToString +//@description: 将数组格式化为字符串 +//@param: array []interface{} +//@return: string + +func ArrayToString(array []interface{}) string { + return strings.Replace(strings.Trim(fmt.Sprint(array), "[]"), " ", ",", -1) +} diff --git a/utils/injectionCode.go b/utils/injectionCode.go new file mode 100644 index 0000000..13ea4cc --- /dev/null +++ b/utils/injectionCode.go @@ -0,0 +1,142 @@ +package utils + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "io/ioutil" + "strings" +) + +//@function: AutoInjectionCode +//@description: 向文件中固定注释位置写入代码 +//@param: filepath string, funcName string, codeData string +//@return: error + +func AutoInjectionCode(filepath string, funcName string, codeData string) error { + startComment := "Code generated by pure-admin Begin; DO NOT EDIT." + endComment := "Code generated by pure-admin End; DO NOT EDIT." + srcData, err := ioutil.ReadFile(filepath) + if err != nil { + return err + } + srcDataLen := len(srcData) + fset := token.NewFileSet() + fparser, err := parser.ParseFile(fset, filepath, srcData, parser.ParseComments) + if err != nil { + return err + } + codeData = strings.TrimSpace(codeData) + var codeStartPos = -1 + var codeEndPos = srcDataLen + var expectedFunction *ast.FuncDecl + + var startCommentPos = -1 + var endCommentPos = srcDataLen + + // 如果指定了函数名,先寻找对应函数 + if funcName != "" { + for _, decl := range fparser.Decls { + if funDecl, ok := decl.(*ast.FuncDecl); ok && funDecl.Name.Name == funcName { + expectedFunction = funDecl + codeStartPos = int(funDecl.Body.Lbrace) + codeEndPos = int(funDecl.Body.Rbrace) + break + } + } + } + + // 遍历所有注释 + for _, comment := range fparser.Comments { + if int(comment.Pos()) > codeStartPos && int(comment.End()) <= codeEndPos { + if startComment != "" && strings.Contains(comment.Text(), startComment) { + startCommentPos = int(comment.Pos()) // Note: Pos is the second '/' + } + if endComment != "" && strings.Contains(comment.Text(), endComment) { + endCommentPos = int(comment.Pos()) // Note: Pos is the second '/' + } + } + } + + if endCommentPos == srcDataLen { + return fmt.Errorf("comment:%s not found", endComment) + } + + // 在指定函数名,且函数中startComment和endComment都存在时,进行区间查重 + if (codeStartPos != -1 && codeEndPos <= srcDataLen) && (startCommentPos != -1 && endCommentPos != srcDataLen) && expectedFunction != nil { + if exist := checkExist(&srcData, startCommentPos, endCommentPos, expectedFunction.Body, codeData); exist { + fmt.Printf("文件 %s 待插入数据 %s 已存在\n", filepath, codeData) + return nil // 这里不需要返回错误? + } + } + + // 两行注释中间没有换行时,会被认为是一条Comment + if startCommentPos == endCommentPos { + endCommentPos = startCommentPos + strings.Index(string(srcData[startCommentPos:]), endComment) + for srcData[endCommentPos] != '/' { + endCommentPos-- + } + } + + // 记录"//"之前的空字符,保持写入后的格式一致 + tmpSpace := make([]byte, 0, 10) + for tmp := endCommentPos - 2; tmp >= 0; tmp-- { + if srcData[tmp] != '\n' { + tmpSpace = append(tmpSpace, srcData[tmp]) + } else { + break + } + } + + reverseSpace := make([]byte, 0, len(tmpSpace)) + for index := len(tmpSpace) - 1; index >= 0; index-- { + reverseSpace = append(reverseSpace, tmpSpace[index]) + } + + // 插入数据 + indexPos := endCommentPos - 1 + insertData := []byte(append([]byte(codeData+"\n"), reverseSpace...)) + + remainData := append([]byte{}, srcData[indexPos:]...) + srcData = append(append(srcData[:indexPos], insertData...), remainData...) + + // 写回数据 + return ioutil.WriteFile(filepath, srcData, 0600) +} + +func checkExist(srcData *[]byte, startPos int, endPos int, blockStmt *ast.BlockStmt, target string) bool { + for _, list := range blockStmt.List { + switch stmt := list.(type) { + case *ast.ExprStmt: + if callExpr, ok := stmt.X.(*ast.CallExpr); ok && + int(callExpr.Pos()) > startPos && int(callExpr.End()) < endPos { + text := string((*srcData)[int(callExpr.Pos()-1):int(callExpr.End())]) + key := strings.TrimSpace(text) + if key == target { + return true + } + } + case *ast.BlockStmt: + if checkExist(srcData, startPos, endPos, stmt, target) { + return true + } + case *ast.AssignStmt: + // 为 model 中的代码进行检查 + if len(stmt.Rhs) > 0 { + if callExpr, ok := stmt.Rhs[0].(*ast.CallExpr); ok { + for _, arg := range callExpr.Args { + if int(arg.Pos()) > startPos && int(arg.End()) < endPos { + text := string((*srcData)[int(arg.Pos()-1):int(arg.End())]) + key := strings.TrimSpace(text) + if key == target { + return true + } + } + } + } + } + } + } + return false +} diff --git a/utils/jpush/model.go b/utils/jpush/model.go new file mode 100644 index 0000000..21b0b6f --- /dev/null +++ b/utils/jpush/model.go @@ -0,0 +1,23 @@ +package jpush + +type notificationBody struct { +} + +type cidList struct { + CidList []string `json:"cidlist"` +} + +type tags struct { + Tags []string `json:"tags"` +} + +type Error struct { + Code int `json:"code"` + Message string `json:"message"` +} + +type PushResult struct { + Sendno string `json:"sendno"` + MsgId string `json:"msg_id"` + Error Error `json:"error"` +} diff --git a/utils/jpush/push.go b/utils/jpush/push.go new file mode 100644 index 0000000..c3071cb --- /dev/null +++ b/utils/jpush/push.go @@ -0,0 +1,202 @@ +package jpush + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "pure-admin/global" + "strings" +) + +func createAuthorization(req *http.Request) *http.Request { + var ( + str string + ) + str = global.MG_CONFIG.JPush.Appkey + ":" + global.MG_CONFIG.JPush.Secret + req.Header.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(str))) + return req +} + +//JiGuangPush ... +func JiGuangPush(reqParams map[string]interface{}) (result PushResult, err error) { + var ( + client *http.Client + req *http.Request + params []byte + cid string + resBody []byte + options map[string]interface{} + ) + options = make(map[string]interface{}) + options["time_to_live"] = 0 + if global.MG_CONFIG.System.Env == "mater" { + options["apns_production"] = true + } else { + options["apns_production"] = false + } + reqParams["options"] = options + cid, err = jiGuangCid() + if err != nil { + return + } + reqParams["cid"] = cid + params, err = json.Marshal(reqParams) + if err != nil { + return + } + client = &http.Client{} + req, err = http.NewRequest(http.MethodPost, "https://api.jpush.cn/v3/push", strings.NewReader(string(params))) + if err != nil { + return + } + req.Header.Add("Content-Type", "application/json") + createAuthorization(req) + resp, err := client.Do(req) + if err != nil { + return + } + defer resp.Body.Close() + resBody, err = ioutil.ReadAll(resp.Body) + if err != nil { + return + } + //fmt.Println(string(resBody)) + global.MG_LOG.Info(string(resBody)) + err = json.Unmarshal(resBody, &result) + if err != nil { + return + } + return +} + +func jiGuangCid() (string, error) { + var ( + err error + res string + client *http.Client + req *http.Request + resp *http.Response + resBody []byte + list cidList + ) + client = &http.Client{} + req, err = http.NewRequest(http.MethodGet, "https://api.jpush.cn/v3/push/cid?count=10&type=push", nil) + if err != nil { + return res, err + } + req.Header.Add("Content-Type", "application/json") + createAuthorization(req) + resp, err = client.Do(req) + if err != nil { + return res, err + } + defer resp.Body.Close() + resBody, err = ioutil.ReadAll(resp.Body) + if err != nil { + return res, err + } + err = json.Unmarshal(resBody, &list) + if err != nil || len(list.CidList) == 0 { + return "", err + } + return list.CidList[0], err +} + +func GetTagsList() (string, error) { + var ( + err error + res string + client *http.Client + req *http.Request + resp *http.Response + resBody []byte + list tags + ) + client = &http.Client{} + req, err = http.NewRequest(http.MethodGet, "https://device.jpush.cn/v3/tags/", nil) + if err != nil { + return res, err + } + req.Header.Add("Content-Type", "application/json") + createAuthorization(req) + resp, err = client.Do(req) + if err != nil { + return res, err + } + defer resp.Body.Close() + resBody, err = ioutil.ReadAll(resp.Body) + if err != nil { + return res, err + } + fmt.Println(string(resBody)) + err = json.Unmarshal(resBody, &list) + if err != nil || len(list.Tags) == 0 { + return "", err + } + return list.Tags[0], err +} + +func UpdateTags(tagValue string, registration map[string][]string) { + var ( + err error + client *http.Client + req *http.Request + params []byte + reqParams map[string]interface{} + resBody []byte + ) + reqParams = make(map[string]interface{}) + reqParams["registration_ids"] = registration + params, err = json.Marshal(reqParams) + if err != nil { + return + } + client = &http.Client{} + req, err = http.NewRequest(http.MethodPost, "https://device.jpush.cn/v3/tags/"+tagValue, strings.NewReader(string(params))) + if err != nil { + return + } + req.Header.Add("Content-Type", "application/json") + createAuthorization(req) + resp, err := client.Do(req) + if err != nil { + return + } + defer resp.Body.Close() + resBody, err = ioutil.ReadAll(resp.Body) + if err != nil { + return + } + fmt.Println(string(resBody)) + return +} + +func GetRegistrationInfo(registration string) { + var ( + err error + client *http.Client + req *http.Request + resp *http.Response + resBody []byte + ) + client = &http.Client{} + req, err = http.NewRequest(http.MethodGet, "https://device.jpush.cn/v3/tags/", nil) + if err != nil { + return + } + req.Header.Add("Content-Type", "application/json") + createAuthorization(req) + resp, err = client.Do(req) + if err != nil { + return + } + defer resp.Body.Close() + resBody, err = ioutil.ReadAll(resp.Body) + if err != nil { + return + } + fmt.Println(string(resBody)) + return +} diff --git a/utils/md5.go b/utils/md5.go new file mode 100644 index 0000000..e359dc9 --- /dev/null +++ b/utils/md5.go @@ -0,0 +1,17 @@ +package utils + +import ( + "crypto/md5" + "encoding/hex" +) + +//@function: MD5V +//@description: md5加密 +//@param: str []byte +//@return: string + +func MD5V(str []byte) string { + h := md5.New() + h.Write(str) + return hex.EncodeToString(h.Sum(nil)) +} diff --git a/utils/qiniu/model.go b/utils/qiniu/model.go new file mode 100644 index 0000000..d5fe9f2 --- /dev/null +++ b/utils/qiniu/model.go @@ -0,0 +1,83 @@ +package qiniu + +type VideoStreams struct { + Index int `json:"index"` + CodecName string `json:"codec_name"` + CodecLongName string `json:"codec_long_name"` + Profile string `json:"profile"` + CodecType string `json:"codec_type"` + CodecTimeBase string `json:"codec_time_base"` + CodecTagString string `json:"codec_tag_string"` + CodecTag string `json:"codec_tag"` + Width int `json:"width,omitempty"` + Height int `json:"height,omitempty"` + CodedWidth int `json:"coded_width,omitempty"` + CodedHeight int `json:"coded_height,omitempty"` + HasBFrames int `json:"has_b_frames,omitempty"` + SampleAspectRatio string `json:"sample_aspect_ratio,omitempty"` + DisplayAspectRatio string `json:"display_aspect_ratio,omitempty"` + PixFmt string `json:"pix_fmt,omitempty"` + Level int `json:"level,omitempty"` + ChromaLocation string `json:"chroma_location,omitempty"` + Refs int `json:"refs,omitempty"` + IsAvc string `json:"is_avc,omitempty"` + NalLengthSize string `json:"nal_length_size,omitempty"` + RFrameRate string `json:"r_frame_rate"` + AvgFrameRate string `json:"avg_frame_rate"` + TimeBase string `json:"time_base"` + StartPts int `json:"start_pts"` + StartTime string `json:"start_time"` + DurationTs int `json:"duration_ts"` + Duration string `json:"duration"` + BitRate string `json:"bit_rate"` + BitsPerRawSample string `json:"bits_per_raw_sample,omitempty"` + NbFrames string `json:"nb_frames"` + Disposition struct { + Default int `json:"default"` + Dub int `json:"dub"` + Original int `json:"original"` + Comment int `json:"comment"` + Lyrics int `json:"lyrics"` + Karaoke int `json:"karaoke"` + Forced int `json:"forced"` + HearingImpaired int `json:"hearing_impaired"` + VisualImpaired int `json:"visual_impaired"` + CleanEffects int `json:"clean_effects"` + AttachedPic int `json:"attached_pic"` + TimedThumbnails int `json:"timed_thumbnails"` + } `json:"disposition"` + Tags struct { + Language string `json:"language"` + HandlerName string `json:"handler_name"` + } `json:"tags"` + SampleFmt string `json:"sample_fmt,omitempty"` + SampleRate string `json:"sample_rate,omitempty"` + Channels int `json:"channels,omitempty"` + ChannelLayout string `json:"channel_layout,omitempty"` + BitsPerSample int `json:"bits_per_sample,omitempty"` + MaxBitRate string `json:"max_bit_rate,omitempty"` +} + +type VideoFormat struct { + NbStreams int `json:"nb_streams"` + NbPrograms int `json:"nb_programs"` + FormatName string `json:"format_name"` + FormatLongName string `json:"format_long_name"` + StartTime string `json:"start_time"` + Duration string `json:"duration"` + Size string `json:"size"` + BitRate string `json:"bit_rate"` + ProbeScore int `json:"probe_score"` + Tags struct { + MajorBrand string `json:"major_brand"` + MinorVersion string `json:"minor_version"` + CompatibleBrands string `json:"compatible_brands"` + Encoder string `json:"encoder"` + Description string `json:"description"` + } `json:"tags"` +} + +type VideoInfo struct { + Streams []VideoStreams `json:"streams"` + Format VideoFormat `json:"format"` +} diff --git a/utils/qiniu/video.go b/utils/qiniu/video.go new file mode 100644 index 0000000..a9eb8cb --- /dev/null +++ b/utils/qiniu/video.go @@ -0,0 +1,84 @@ +package qiniu + +import ( + "crypto/hmac" + "crypto/sha1" + "encoding/base64" + "encoding/json" + "io/ioutil" + "math" + "net/http" + "pure-admin/global" + "strconv" + + "github.com/pili-engineering/pili-sdk-go.v2/pili" +) + +// 计算token并加入Header +func createAuthorization(req *http.Request, reqBody []byte) *http.Request { + var ( + str string + hashed []byte + ) + + str = req.Method + " " + req.URL.Path + if req.URL.RawQuery != "" { + str += "?" + req.URL.RawQuery + } + str += "\nHost: " + req.Host + if contentType := req.Header.Get("Content-Type"); contentType != "" { + str += "\nContent-Type: " + contentType + } + str += "\n\n" + if len(reqBody) != 0 { + str += string(reqBody) + } + key := []byte(global.MG_CONFIG.Qiniu.SecretKey) + mac := hmac.New(sha1.New, key) + mac.Write([]byte(str)) + hashed = mac.Sum(nil) + req.Header.Add("Authorization", "Qiniu "+global.MG_CONFIG.Qiniu.AccessKey+":"+base64.URLEncoding.EncodeToString(hashed)) + return req +} + +func getVideoInfo(url string) (result VideoInfo, err error) { + resp, err := http.Get(url + "?avinfo") + if err != nil { + return + } + defer resp.Body.Close() + resBody, err := ioutil.ReadAll(resp.Body) + if err != nil { + return + } + //fmt.Println(string(resBody)) + global.MG_LOG.Info(string(resBody)) + err = json.Unmarshal(resBody, &result) + return +} + +func GetVideoLen(url string) int { + info, err := getVideoInfo(url) + if err != nil { + return 0 + } + f1, err := strconv.ParseFloat(info.Format.Duration, 64) + if err != nil { + return 0 + } + s1 := strconv.FormatFloat(math.Floor(f1), 'f', -1, 64) + i, _ := strconv.Atoi(s1) + return i +} + +func ReturnUrl2(key, zone, domain string, start, end int64) (string, error) { + mac := &pili.MAC{AccessKey: global.MG_CONFIG.Qiniu.AccessKey, SecretKey: []byte(global.MG_CONFIG.Qiniu.SecretKey)} + client := pili.New(mac, nil) + hub := client.Hub(zone) + stream := hub.Stream(key) + fName, err := stream.Save(start, end) + if err != nil { + return "", err + } + return "http://" + domain + "/" + fName, nil +} diff --git a/utils/redis.go b/utils/redis.go new file mode 100644 index 0000000..74cd062 --- /dev/null +++ b/utils/redis.go @@ -0,0 +1,319 @@ +package utils + +import ( + "fmt" + "github.com/go-redis/redis" + "pure-admin/global" + "time" +) + +// RedisGet ... +func RedisGet(key string) string { + result, err := global.MG_REDIS.Get(key).Result() + if err != nil { + return "" + } + return result +} + +func RedisSet(key string, value interface{}, expiration time.Duration) string { + result, err := global.MG_REDIS.Set(key, value, expiration).Result() + if err != nil { + return "" + } + return result +} + +func RedisDel(key ...string) (int64, error) { + result, err := global.MG_REDIS.Del(key...).Result() + if err != nil { + return -1, err + } + return result, err +} + +func RedisLLen(key string) (int64, error) { + result, err := global.MG_REDIS.LLen(key).Result() + if err != nil { + return -1, err + } + return result, err +} + +// RedisHashSet 向key的hash中添加元素field的值 +func RedisHashSet(key, field string, data interface{}) error { + err := global.MG_REDIS.HSet(key, field, data).Err() + if err != nil { + return err + } + return nil +} + +// RedisBatchHashSet 批量向key的hash添加对应元素field的值 +func RedisBatchHashSet(key string, fields map[string]interface{}) (error, string) { + val, err := global.MG_REDIS.HMSet(key, fields).Result() + if err != nil { + return err, "" + } + return nil, val +} + +func RedisHDel(client *redis.Client, key string, fields ...string) (int64, string) { + result, err := client.HDel(key, fields...).Result() + if err != nil { + return 0, "" + } + return result, err.Error() +} + +func RedisHSet(key, field string, value interface{}) (error, bool) { + val, err := global.MG_REDIS.HSet(key, field, value).Result() + if err != nil { + return err, false + } + return nil, val +} + +func RedisSetNX(key string, value interface{}, expiration time.Duration) (error, bool) { + val, err := global.MG_REDIS.SetNX(key, value, expiration).Result() + if err != nil { + return err, false + } + return nil, val +} + +// RedisHashGet 通过key获取hash的元素值 +func RedisHashGet(key, field string) string { + val, err := global.MG_REDIS.HGet(key, field).Result() + if err != nil { + return "" + } + return val +} + +func RedisHashMGet(key string, fields ...string) []interface{} { + val, err := global.MG_REDIS.HMGet(key, fields...).Result() + if err != nil { + return nil + } + return val +} + +// HGetAll +func RedisHashGetAll(key string) map[string]string { + val, err := global.MG_REDIS.HGetAll(key).Result() + if err != nil { + return nil + } + return val +} + +// RedisBatchHashGet 批量获取key的hash中对应多元素值 +func RedisBatchHashGet(key string, fields ...string) map[string]interface{} { + resMap := make(map[string]interface{}) + for _, field := range fields { + val, err := global.MG_REDIS.HGet(key, fmt.Sprintf("%s", field)).Result() + if err == nil && val != "" { + resMap[field] = val + } + } + return resMap +} + +func RedisLPush(key string, values ...interface{}) (int64, error) { + result, err := global.MG_REDIS.LPush(key, values...).Result() + if err != nil { + return 0, err + } + return result, nil +} + +func RedisLPop(key string) (error, string) { + result, err := global.MG_REDIS.LPop(key).Result() + if err != nil { + return err, "" + } + return err, result +} + +// RedisSAdd 无序集合添加 +func RedisSAdd(key string, values ...interface{}) (int64, error) { + result, err := global.MG_REDIS.SAdd(key, values...).Result() + if err != nil { + return 0, err + } + return result, nil +} + +// RedisSMembers 从无序集合中获取数据 +func RedisSMembers(key string) ([]string, error) { + val, err := global.MG_REDIS.SMembers(key).Result() + if err != nil { + return nil, err + } + return val, nil +} + +// RedisZAdd 有序集合添加 +func RedisZAdd(key string, values map[float64]interface{}) (int64, error) { + var members []redis.Z + for scale, value := range values { + members = append(members, redis.Z{ + Score: scale, + Member: value, + }) + } + result, err := global.MG_REDIS.ZAdd(key, members...).Result() + if err != nil { + return 0, err + } + return result, nil +} + +func RedisZCard(key string) (int64, error) { + result, err := global.MG_REDIS.ZCard(key).Result() + if err != nil { + return 0, err + } + return result, nil +} + +func RedisZCount(key string, min, max string) (int64, error) { + result, err := global.MG_REDIS.ZCount(key, min, max).Result() + if err != nil { + return 0, err + } + return result, nil +} + +func RedisZRange(key string, start, stop int64, sort string) ([]interface{}, error) { + var val = make([]interface{}, 0) + if sort == "asc" { //scale 正序 + result, err := global.MG_REDIS.ZRangeWithScores(key, start, stop).Result() + if err != nil { + return val, err + } + for _, z := range result { + val = append(val, z.Member) + } + } else { //scale 倒序 + result, err := global.MG_REDIS.ZRevRange(key, start, stop).Result() + if err != nil { + return val, err + } + for _, z := range result { + val = append(val, z) + } + return val, nil + } + + return val, nil +} + +// RedisIncr 获取自增唯一ID +func RedisIncr(key string) int { + val, err := global.MG_REDIS.Incr(key).Result() + if err != nil { + } + return int(val) +} + +// RedisSetAdd 添加集合数据 +func RedisSetAdd(key, val string) { + global.MG_REDIS.SAdd(key, val) +} + +func RedisRename(key, newKey string) (string, error) { + result, err := global.MG_REDIS.Rename(key, newKey).Result() + if err != nil { + return "", err + } + return result, nil +} + +func RedisHashGet1(client *redis.Client, key, field string) string { + val, err := client.HGet(key, field).Result() + if err != nil { + return "" + } + return val +} + +func RedisDel1(client *redis.Client, key ...string) (int64, error) { + result, err := client.Del(key...).Result() + if err != nil { + return -1, err + } + return result, err +} + +func RedisBatchHashSet1(client *redis.Client, key string, fields map[string]interface{}) (error, string) { + val, err := client.HMSet(key, fields).Result() + if err != nil { + return err, "" + } + return nil, val +} + +func RedisZAdd1(client *redis.Client, key string, values map[float64]interface{}) (int64, error) { + var members []redis.Z + for scale, value := range values { + members = append(members, redis.Z{ + Score: scale, + Member: value, + }) + } + result, err := client.ZAdd(key, members...).Result() + if err != nil { + return 0, err + } + return result, nil +} + +func RedisZRange1(client *redis.Client, key string, start, stop int64, sort string) ([]interface{}, error) { + var val = make([]interface{}, 0) + if sort == "asc" { //scale 正序 + result, err := client.ZRangeWithScores(key, start, stop).Result() + if err != nil { + return val, err + } + for _, z := range result { + val = append(val, z.Member) + } + } else { //scale 倒序 + result, err := client.ZRevRange(key, start, stop).Result() + if err != nil { + return val, err + } + for _, z := range result { + val = append(val, z) + } + return val, nil + } + + return val, nil +} + +func RedisZRemRangeByRank(client *redis.Client, key string, start, stop int64) error { + _, err := client.ZRemRangeByRank(key, start, stop).Result() + if err != nil { + return err + } + return nil +} + +func RedisZCard1(client *redis.Client, key string) (int64, error) { + result, err := client.ZCard(key).Result() + if err != nil { + return 0, err + } + return result, nil +} + +func RedisScan(client *redis.Client) ([]string, error) { + result, _, err := client.Scan(0, "", 0).Result() + if err != nil { + return nil, err + } + return result, nil +} diff --git a/utils/redis_store.go b/utils/redis_store.go new file mode 100644 index 0000000..9c2a9e8 --- /dev/null +++ b/utils/redis_store.go @@ -0,0 +1,45 @@ +package utils + +import ( + "fmt" + "pure-admin/global" + "strings" + "time" +) + +const CAPTCHA = "captcha:" + +type RedisStore struct{} + +func (e RedisStore) Set(id, value string) error { + key := CAPTCHA + id + value = strings.ToLower(value) + err := global.MG_REDIS.Set(key, value, 2*time.Minute).Err() + if err != nil { + global.MG_LOG.Info(err.Error()) + } + return nil +} + +func (e RedisStore) Get(id string, clear bool) string { + key := CAPTCHA + id + val, err := global.MG_REDIS.Get(key).Result() + if err != nil { + fmt.Println(err) + return "" + } + if clear { + err := global.MG_REDIS.Del(key).Err() + if err != nil { + fmt.Println(err) + return "" + } + } + return val +} + +func (e RedisStore) Verify(id, answer string, clear bool) bool { + v := RedisStore{}.Get(id, clear) + //fmt.Println("key:"+id+";value:"+v+";answer:"+answer) + return v == answer +} diff --git a/utils/reload.go b/utils/reload.go new file mode 100644 index 0000000..de5499b --- /dev/null +++ b/utils/reload.go @@ -0,0 +1,18 @@ +package utils + +import ( + "errors" + "os" + "os/exec" + "runtime" + "strconv" +) + +func Reload() error { + if runtime.GOOS == "windows" { + return errors.New("系统不支持") + } + pid := os.Getpid() + cmd := exec.Command("kill", "-1", strconv.Itoa(pid)) + return cmd.Run() +} diff --git a/utils/rotatelogs_unix.go b/utils/rotatelogs_unix.go new file mode 100644 index 0000000..4ca851d --- /dev/null +++ b/utils/rotatelogs_unix.go @@ -0,0 +1,30 @@ +// +build !windows + +package utils + +import ( + "os" + "path" + "pure-admin/global" + "time" + + zaprotatelogs "github.com/lestrrat-go/file-rotatelogs" + "go.uber.org/zap/zapcore" +) + +//@function: GetWriteSyncer +//@description: zap logger中加入file-rotatelogs +//@return: zapcore.WriteSyncer, error + +func GetWriteSyncer() (zapcore.WriteSyncer, error) { + fileWriter, err := zaprotatelogs.New( + path.Join(global.MG_CONFIG.Zap.Director, "%Y-%m-%d.log"), + zaprotatelogs.WithLinkName(global.MG_CONFIG.Zap.LinkName), + zaprotatelogs.WithMaxAge(7*24*time.Hour), + zaprotatelogs.WithRotationTime(24*time.Hour), + ) + if global.MG_CONFIG.Zap.LogInConsole { + return zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(fileWriter)), err + } + return zapcore.AddSync(fileWriter), err +} diff --git a/utils/rotatelogs_windows.go b/utils/rotatelogs_windows.go new file mode 100644 index 0000000..18d6e7e --- /dev/null +++ b/utils/rotatelogs_windows.go @@ -0,0 +1,26 @@ +package utils + +import ( + zaprotatelogs "github.com/lestrrat-go/file-rotatelogs" + "go.uber.org/zap/zapcore" + "os" + "path" + "pure-admin/global" + "time" +) + +//@function: GetWriteSyncer +//@description: zap logger中加入file-rotatelogs +//@return: zapcore.WriteSyncer, error + +func GetWriteSyncer() (zapcore.WriteSyncer, error) { + fileWriter, err := zaprotatelogs.New( + path.Join(global.MG_CONFIG.Zap.Director, "%Y-%m-%d.log"), + zaprotatelogs.WithMaxAge(7*24*time.Hour), + zaprotatelogs.WithRotationTime(24*time.Hour), + ) + if global.MG_CONFIG.Zap.LogInConsole { + return zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(fileWriter)), err + } + return zapcore.AddSync(fileWriter), err +} diff --git a/utils/sendSms.go b/utils/sendSms.go new file mode 100644 index 0000000..9032ade --- /dev/null +++ b/utils/sendSms.go @@ -0,0 +1,172 @@ +package utils + +import ( + "crypto/hmac" + "crypto/sha1" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "math/rand" + "net/http" + "net/url" + "strconv" + "strings" + "time" +) + +const sortQueryStringFmt string = "AccessKeyId=%s" + + "&Action=SendSms" + + "&Format=JSON" + + "&OutId=123" + + "&PhoneNumbers=%s" + + "&RegionId=cn-hangzhou" + + "&SignName=%s" + + "&SignatureMethod=HMAC-SHA1" + + "&SignatureNonce=%s" + + "&SignatureVersion=1.0" + + "&TemplateCode=%s" + + "&TemplateParam=%s" + + "&Timestamp=%s" + + "&Version=2017-05-25" + +func encodeLocal(encodeStr string) string { + urlEncode := url.QueryEscape(encodeStr) + urlEncode = strings.Replace(urlEncode, "+", "%%20", -1) + urlEncode = strings.Replace(urlEncode, "*", "%2A", -1) + urlEncode = strings.Replace(urlEncode, "%%7E", "~", -1) + urlEncode = strings.Replace(urlEncode, "/", "%%2F", -1) + return urlEncode +} + +// SendSmsReply 发送短信返回 +type SendSmsReply struct { + Code string `json:"Code,omitempty"` + Message string `json:"Message,omitempty"` +} + +func SendSms(phone string, paramStr string, signName string, templateCode string) error { + const token string = "IP2dC1XDM15A6mCt3yTRDk3ZWHri19&" // 阿里云 accessSecret 注意这个地方要添加一个 & + + AccessKeyId := "LTAI5t6oHZUFW5bqNTbDwd5n" // 自己的阿里云 accessKeyID + + SignatureNonce := strconv.Itoa(GenerateRandNumByCount(9)) + TemplateParam := url.QueryEscape(paramStr) + Timestamp := url.QueryEscape(time.Now().UTC().Format("2006-01-02T15:04:05Z")) + + sortQueryString := fmt.Sprintf(sortQueryStringFmt, + AccessKeyId, + phone, + url.QueryEscape(signName), + SignatureNonce, + templateCode, + TemplateParam, + Timestamp, + ) + + urlencode := encodeLocal(sortQueryString) + sign_str := fmt.Sprintf("GET&%%2F&%s", urlencode) + + key := []byte(token) + mac := hmac.New(sha1.New, key) + mac.Write([]byte(sign_str)) + signature := base64.StdEncoding.EncodeToString(mac.Sum(nil)) + signature = encodeLocal(signature) + resp, err := http.Get("http://dysmsapi.aliyuncs.com/?Signature=" + signature + "&" + sortQueryString) + if err != nil { + fmt.Println(err) + return err + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + fmt.Println(err) + return err + } + + ssr := &SendSmsReply{} + + if err := json.Unmarshal(body, ssr); err != nil { + return err + } + + if ssr.Code == "SignatureNonceUsed" { + return SendSms(phone, paramStr, signName, templateCode) + } else if ssr.Code != "OK" { + return errors.New(ssr.Code) + } + return nil +} + +func GenerateRandNumByCount(count int) int { + rand.Seed(time.Now().Unix()) + rnd := rand.Intn(9*int(exponent(10, uint64(count-1)))-1) + int(exponent(10, uint64(count-1))) + return rnd +} + +func exponent(a, n uint64) uint64 { + result := uint64(1) + for i := n; i > 0; i >>= 1 { + if i&1 != 0 { + result *= a + } + a *= a + } + return result +} + +func SendMessageNotice(phone string, content string, signName string, templateCode string) { + const token string = "IXvbHeyNLAWJHC08mg4quGYQtmf84h&" // 阿里云 accessSecret 注意这个地方要添加一个 & + + AccessKeyId := "LTAIZSh7LB8zkmtO" // 自己的阿里云 accessKeyID + + SignatureNonce := strconv.Itoa(GenerateRandNumByCount(9)) + //TemplateCode := "SMS_140625198" + TemplateParam := url.QueryEscape("{\"content\":\"" + content + "\"}") + Timestamp := url.QueryEscape(time.Now().UTC().Format("2006-01-02T15:04:05Z")) + + sortQueryString := fmt.Sprintf(sortQueryStringFmt, + AccessKeyId, + phone, + url.QueryEscape(signName), + SignatureNonce, + templateCode, + TemplateParam, + Timestamp, + ) + + urlEncode := encodeLocal(sortQueryString) + signStr := fmt.Sprintf("GET&%%2F&%s", urlEncode) + + key := []byte(token) + mac := hmac.New(sha1.New, key) + mac.Write([]byte(signStr)) + signature := base64.StdEncoding.EncodeToString(mac.Sum(nil)) + signature = encodeLocal(signature) + resp, err := http.Get("http://dysmsapi.aliyuncs.com/?Signature=" + signature + "&" + sortQueryString) + if err != nil { + fmt.Println(err) + return + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + fmt.Println(err) + return + } + + ssr := &SendSmsReply{} + + if err := json.Unmarshal(body, ssr); err != nil { + return + } + + if ssr.Code == "SignatureNonceUsed" { + SendMessageNotice(phone, content, signName, templateCode) + return + } else if ssr.Code != "OK" { + return + } + return +} diff --git a/utils/string.go b/utils/string.go new file mode 100644 index 0000000..4fec986 --- /dev/null +++ b/utils/string.go @@ -0,0 +1,110 @@ +package utils + +import ( + "math" + "math/rand" + "regexp" + "strconv" + "strings" + "time" +) + +func GetInvitation() string { + var bs = make([]byte, 6) + for i := 0; i < 6; i++ { + rand.Seed(time.Now().UnixNano()) + flag := rand.Intn(2) + if flag == 1 { + bs[i] = byte(rand.Float64()*10 + 48) + } else { + bs[i] = byte(rand.Float64()*26 + 65) + } + } + return string(bs) +} + +func GetInvitationLen(length int) string { + var bs = make([]byte, length) + for i := 0; i < length; i++ { + rand.Seed(time.Now().UnixNano()) + flag := rand.Intn(3) + if flag == 1 { + bs[i] = byte(rand.Float64()*10 + 48) + } else if flag == 0 { + bs[i] = byte(rand.Float64()*26 + 65) + } else { + bs[i] = byte(rand.Float64()*26 + 97) + } + } + return string(bs) +} + +func GetInvitationLowerLen(length int) string { + var bs = make([]byte, length) + for i := 0; i < length; i++ { + rand.Seed(time.Now().UnixNano()) + flag := rand.Intn(2) + if flag == 1 { + bs[i] = byte(rand.Float64()*10 + 48) + } else { + bs[i] = byte(rand.Float64()*26 + 97) + } + } + return string(bs) +} + +func StringFloat64ToInt(s string) int { + f1, err := strconv.ParseFloat(s, 64) + if err != nil { + return 0 + } + s1 := strconv.FormatFloat(math.Ceil(f1), 'f', -1, 64) + i, _ := strconv.Atoi(s1) + return i +} + +func HideStar(str string) (result string) { + if str == "" { + return "***" + } + if strings.Contains(str, "@") { + // 邮箱 + res := strings.Split(str, "@") + if len(res[0]) < 3 { + resString := "***" + result = resString + "@" + res[1] + } else { + res2 := Substr2(str, 0, 3) + resString := res2 + "***" + result = resString + "@" + res[1] + } + return result + } else { + reg := `^1[0-9]\d{9}$` + rgx := regexp.MustCompile(reg) + mobileMatch := rgx.MatchString(str) + if mobileMatch { + // 手机号 + result = Substr2(str, 0, 3) + "****" + Substr2(str, 7, 11) + } else { + nameRune := []rune(str) + lens := len(nameRune) + if lens <= 1 { + result = "***" + } else if lens == 2 { + result = string(nameRune[:1]) + "*" + } else if lens == 3 { + result = string(nameRune[:1]) + "*" + string(nameRune[2:3]) + } else if lens == 4 { + result = string(nameRune[:1]) + "**" + string(nameRune[lens-1:lens]) + } else if lens > 4 { + result = string(nameRune[:2]) + "***" + string(nameRune[lens-2:lens]) + } + } + return + } +} +func Substr2(str string, start int, end int) string { + rs := []rune(str) + return string(rs[start:end]) +} diff --git a/utils/time.go b/utils/time.go new file mode 100644 index 0000000..ed95fd7 --- /dev/null +++ b/utils/time.go @@ -0,0 +1,14 @@ +package utils + +import "time" + +const ( + DateTimeFormat string = "2006-01-02 15:04:05" + DateTimeFormat2 string = "2006-01-02 15:04" + DateFormat string = "2006-01-02" + Continuity = "20060102150405" +) + +func GetCurrentTime() time.Time { + return time.Now() +} diff --git a/utils/timer/timed_task.go b/utils/timer/timed_task.go new file mode 100644 index 0000000..881fdde --- /dev/null +++ b/utils/timer/timed_task.go @@ -0,0 +1,109 @@ +package timer + +import ( + "sync" + + "github.com/robfig/cron/v3" +) + +type Timer interface { + AddTaskByFunc(taskName string, spec string, task func()) (cron.EntryID, error) + AddTaskByJob(taskName string, spec string, job interface{ Run() }) (cron.EntryID, error) + FindCron(taskName string) (*cron.Cron, bool) + StartTask(taskName string) + StopTask(taskName string) + Remove(taskName string, id int) + Clear(taskName string) + Close() +} + +// timer 定时任务管理 +type timer struct { + taskList map[string]*cron.Cron + sync.Mutex +} + +// AddTaskByFunc 通过函数的方法添加任务 +func (t *timer) AddTaskByFunc(taskName string, spec string, task func()) (cron.EntryID, error) { + t.Lock() + defer t.Unlock() + if _, ok := t.taskList[taskName]; !ok { + t.taskList[taskName] = cron.New() + } + id, err := t.taskList[taskName].AddFunc(spec, task) + t.taskList[taskName].Start() + return id, err +} + +// AddTaskByJob 通过接口的方法添加任务 +func (t *timer) AddTaskByJob(taskName string, spec string, job interface{ Run() }) (cron.EntryID, error) { + t.Lock() + defer t.Unlock() + if _, ok := t.taskList[taskName]; !ok { + t.taskList[taskName] = cron.New() + } + id, err := t.taskList[taskName].AddJob(spec, job) + t.taskList[taskName].Start() + return id, err +} + +// FindCron 获取对应taskName的cron 可能会为空 +func (t *timer) FindCron(taskName string) (*cron.Cron, bool) { + t.Lock() + defer t.Unlock() + v, ok := t.taskList[taskName] + return v, ok +} + +// StartTask 开始任务 +func (t *timer) StartTask(taskName string) { + t.Lock() + defer t.Unlock() + if v, ok := t.taskList[taskName]; ok { + v.Start() + } + return +} + +// StopTask 停止任务 +func (t *timer) StopTask(taskName string) { + t.Lock() + defer t.Unlock() + if v, ok := t.taskList[taskName]; ok { + v.Stop() + } + return +} + +// Remove 从taskName 删除指定任务 +func (t *timer) Remove(taskName string, id int) { + t.Lock() + defer t.Unlock() + if v, ok := t.taskList[taskName]; ok { + v.Remove(cron.EntryID(id)) + } + return +} + +// Clear 清除任务 +func (t *timer) Clear(taskName string) { + t.Lock() + defer t.Unlock() + if v, ok := t.taskList[taskName]; ok { + v.Stop() + delete(t.taskList, taskName) + } +} + +// Close 释放资源 +func (t *timer) Close() { + t.Lock() + defer t.Unlock() + for _, v := range t.taskList { + v.Stop() + } +} + +func NewTimerTask() Timer { + return &timer{taskList: make(map[string]*cron.Cron)} +} diff --git a/utils/upload/aliyun_oss.go b/utils/upload/aliyun_oss.go new file mode 100644 index 0000000..011de90 --- /dev/null +++ b/utils/upload/aliyun_oss.go @@ -0,0 +1,75 @@ +package upload + +import ( + "errors" + "mime/multipart" + "path/filepath" + "pure-admin/global" + "time" + + "github.com/aliyun/aliyun-oss-go-sdk/oss" + "go.uber.org/zap" +) + +type AliyunOSS struct{} + +func (*AliyunOSS) UploadFile(file *multipart.FileHeader) (string, string, error) { + bucket, err := NewBucket() + if err != nil { + global.MG_LOG.Error("function AliyunOSS.NewBucket() Failed", zap.Any("err", err.Error())) + return "", "", errors.New("function AliyunOSS.NewBucket() Failed, err:" + err.Error()) + } + + // 读取本地文件。 + f, openError := file.Open() + if openError != nil { + global.MG_LOG.Error("function file.Open() Failed", zap.Any("err", openError.Error())) + return "", "", errors.New("function file.Open() Failed, err:" + openError.Error()) + } + defer f.Close() // 创建文件 defer 关闭 + // 上传阿里云路径 文件名格式 自己可以改 建议保证唯一性 + yunFileTmpPath := filepath.Join("uploads", time.Now().Format("2006-01-02")) + "/" + file.Filename + + // 上传文件流。 + err = bucket.PutObject(yunFileTmpPath, f) + if err != nil { + global.MG_LOG.Error("function formUploader.Put() Failed", zap.Any("err", err.Error())) + return "", "", errors.New("function formUploader.Put() Failed, err:" + err.Error()) + } + + return global.MG_CONFIG.AliyunOSS.BucketUrl + "/" + yunFileTmpPath, yunFileTmpPath, nil +} + +func (*AliyunOSS) DeleteFile(key string) error { + bucket, err := NewBucket() + if err != nil { + global.MG_LOG.Error("function AliyunOSS.NewBucket() Failed", zap.Any("err", err.Error())) + return errors.New("function AliyunOSS.NewBucket() Failed, err:" + err.Error()) + } + + // 删除单个文件。objectName表示删除OSS文件时需要指定包含文件后缀在内的完整路径,例如abc/efg/123.jpg。 + // 如需删除文件夹,请将objectName设置为对应的文件夹名称。如果文件夹非空,则需要将文件夹下的所有object删除后才能删除该文件夹。 + err = bucket.DeleteObject(key) + if err != nil { + global.MG_LOG.Error("function bucketManager.Delete() Filed", zap.Any("err", err.Error())) + return errors.New("function bucketManager.Delete() Filed, err:" + err.Error()) + } + + return nil +} + +func NewBucket() (*oss.Bucket, error) { + // 创建OSSClient实例。 + client, err := oss.New(global.MG_CONFIG.AliyunOSS.Endpoint, global.MG_CONFIG.AliyunOSS.AccessKeyId, global.MG_CONFIG.AliyunOSS.AccessKeySecret) + if err != nil { + return nil, err + } + + // 获取存储空间。 + bucket, err := client.Bucket(global.MG_CONFIG.AliyunOSS.BucketName) + if err != nil { + return nil, err + } + + return bucket, nil +} diff --git a/utils/upload/local.go b/utils/upload/local.go new file mode 100644 index 0000000..6e7a6b6 --- /dev/null +++ b/utils/upload/local.go @@ -0,0 +1,79 @@ +package upload + +import ( + "errors" + "io" + "mime/multipart" + "os" + "path" + "pure-admin/global" + "pure-admin/utils" + "strings" + "time" + + "go.uber.org/zap" +) + +type Local struct{} + +//@object: *Local +//@function: UploadFile +//@description: 上传文件 +//@param: file *multipart.FileHeader +//@return: string, string, error + +func (*Local) UploadFile(file *multipart.FileHeader) (string, string, error) { + // 读取文件后缀 + ext := path.Ext(file.Filename) + // 读取文件名并加密 + name := strings.TrimSuffix(file.Filename, ext) + name = utils.MD5V([]byte(name)) + // 拼接新文件名 + filename := name + "_" + time.Now().Format("20060102150405") + ext + // 尝试创建此路径 + mkdirErr := os.MkdirAll(global.MG_CONFIG.Local.Path, os.ModePerm) + if mkdirErr != nil { + global.MG_LOG.Error("function os.MkdirAll() Filed", zap.Any("err", mkdirErr.Error())) + return "", "", errors.New("function os.MkdirAll() Filed, err:" + mkdirErr.Error()) + } + // 拼接路径和文件名 + p := global.MG_CONFIG.Local.Path + "/" + filename + + f, openError := file.Open() // 读取文件 + if openError != nil { + global.MG_LOG.Error("function file.Open() Filed", zap.Any("err", openError.Error())) + return "", "", errors.New("function file.Open() Filed, err:" + openError.Error()) + } + defer f.Close() // 创建文件 defer 关闭 + + out, createErr := os.Create(p) + if createErr != nil { + global.MG_LOG.Error("function os.Create() Filed", zap.Any("err", createErr.Error())) + + return "", "", errors.New("function os.Create() Filed, err:" + createErr.Error()) + } + defer out.Close() // 创建文件 defer 关闭 + + _, copyErr := io.Copy(out, f) // 传输(拷贝)文件 + if copyErr != nil { + global.MG_LOG.Error("function io.Copy() Filed", zap.Any("err", copyErr.Error())) + return "", "", errors.New("function io.Copy() Filed, err:" + copyErr.Error()) + } + return p, filename, nil +} + +//@object: *Local +//@function: DeleteFile +//@description: 删除文件 +//@param: key string +//@return: error + +func (*Local) DeleteFile(key string) error { + p := global.MG_CONFIG.Local.Path + "/" + key + if strings.Contains(p, global.MG_CONFIG.Local.Path) { + if err := os.Remove(p); err != nil { + return errors.New("本地文件删除失败, err:" + err.Error()) + } + } + return nil +} diff --git a/utils/upload/minio.go b/utils/upload/minio.go new file mode 100644 index 0000000..830bfee --- /dev/null +++ b/utils/upload/minio.go @@ -0,0 +1,123 @@ +package upload + +import ( + "bytes" + "encoding/json" + "errors" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "strings" +) + +const ( + BaseUrl = "http://file-upload-test.mangguonews.com/upload" + ImgSuffix = "jpg,jpeg,png,gif,tif,tiff,bmp," + Type = "graph,video,doc," +) + +type Response struct { + Data struct { + File string `json:"file"` + Hash string `json:"hash"` + ScaleImage string `json:"scaleImage"` + UploadFileName string `json:"uploadFileName"` + BaseUrl string `json:"baseUrl"` //给前端返回另加的参数 + } `json:"data"` + Message struct { + Desc string `json:"desc"` + Error interface{} `json:"error"` + } `json:"message"` + Status bool `json:"status"` +} + +type ParamsUpload struct { + File *multipart.FileHeader `form:"file"` //文件 + Type string `form:"type"` //类型 img:图片 + ParamsGet +} + +type ParamsGet struct { + Width string `form:"width"` + Height string `form:"height"` + Scale string `form:"scale"` +} + +func createMgNewsUploadRequest(file multipart.File, params map[string]string, fileName string) (*http.Request, error) { + var ( + err error + body *bytes.Buffer + w *multipart.Writer + writer io.Writer + req *http.Request + contentType string + ) + body = &bytes.Buffer{} + w = multipart.NewWriter(body) + contentType = w.FormDataContentType() + for key, val := range params { + _ = w.WriteField(key, val) + } + if file != nil { + writer, err = w.CreateFormFile("file", fileName) + _, err = io.Copy(writer, file) + if err != nil { + return nil, err + } + } + w.Close() + req, err = http.NewRequest(http.MethodPost, BaseUrl, body) + req.Header.Set("Content-Type", contentType) + return req, err +} + +func MgNewsUpload(file multipart.File, pm map[string]string, fileName string) (respData Response, err error) { + var ( + client *http.Client + req *http.Request + resp *http.Response + resBody []byte + ) + client = &http.Client{} + req, err = createMgNewsUploadRequest(file, pm, fileName) + if err != nil { + return + } + resp, _ = client.Do(req) + defer resp.Body.Close() + resBody, err = ioutil.ReadAll(resp.Body) + if err != nil { + return + } + if resp.StatusCode != 200 { + err = errors.New("上传失败") + return + } + //fmt.Println(string(resBody)) + err = json.Unmarshal(resBody, &respData) + if err != nil { + return + } + return +} + +func CheckType(t string) bool { + if strings.Index(Type, strings.ToLower(t)+",") >= 0 { + return true + } + return false +} + +func CheckFileSuffix(fileName string, t string) bool { + var suffix string + suffix = fileName[(strings.LastIndex(fileName, "."))+1:] + if t == "graph" { + if strings.Index(ImgSuffix, strings.ToLower(suffix)+",") >= 0 { + return true + } + } else { + return false + } + return false +} diff --git a/utils/upload/qiniu.go b/utils/upload/qiniu.go new file mode 100644 index 0000000..7eaa5c5 --- /dev/null +++ b/utils/upload/qiniu.go @@ -0,0 +1,114 @@ +package upload + +import ( + "context" + "errors" + "fmt" + "mime/multipart" + "pure-admin/global" + "time" + + "github.com/qiniu/api.v7/v7/auth/qbox" + "github.com/qiniu/api.v7/v7/storage" + "go.uber.org/zap" +) + +type Qiniu struct{} + +//@object: *Qiniu +//@function: UploadFile +//@description: 上传文件 +//@param: file *multipart.FileHeader +//@return: string, string, error + +func (*Qiniu) UploadFile(file *multipart.FileHeader) (string, string, error) { + putPolicy := storage.PutPolicy{Scope: global.MG_CONFIG.Qiniu.Bucket} + mac := qbox.NewMac(global.MG_CONFIG.Qiniu.AccessKey, global.MG_CONFIG.Qiniu.SecretKey) + upToken := putPolicy.UploadToken(mac) + cfg := qiniuConfig() + formUploader := storage.NewFormUploader(cfg) + ret := storage.PutRet{} + putExtra := storage.PutExtra{Params: map[string]string{"x:name": "github logo"}} + + f, openError := file.Open() + if openError != nil { + global.MG_LOG.Error("function file.Open() Filed", zap.Any("err", openError.Error())) + + return "", "", errors.New("function file.Open() Filed, err:" + openError.Error()) + } + defer f.Close() // 创建文件 defer 关闭 + fileKey := fmt.Sprintf("%d%s", time.Now().Unix(), file.Filename) // 文件名格式 自己可以改 建议保证唯一性 + putErr := formUploader.Put(context.Background(), &ret, upToken, fileKey, f, file.Size, &putExtra) + if putErr != nil { + global.MG_LOG.Error("function formUploader.Put() Filed", zap.Any("err", putErr.Error())) + return "", "", errors.New("function formUploader.Put() Filed, err:" + putErr.Error()) + } + return global.MG_CONFIG.Qiniu.ImgPath + "/" + ret.Key, ret.Key, nil +} + +func (*Qiniu) UploadFile2(fileKey string, file *multipart.FileHeader) (string, string, error) { + putPolicy := storage.PutPolicy{Scope: global.MG_CONFIG.Qiniu.Bucket} + mac := qbox.NewMac(global.MG_CONFIG.Qiniu.AccessKey, global.MG_CONFIG.Qiniu.SecretKey) + upToken := putPolicy.UploadToken(mac) + cfg := qiniuConfig() + formUploader := storage.NewFormUploader(cfg) + ret := storage.PutRet{} + putExtra := storage.PutExtra{Params: map[string]string{"x:name": "github logo"}} + + f, openError := file.Open() + if openError != nil { + global.MG_LOG.Error("function file.Open() Filed", zap.Any("err", openError.Error())) + + return "", "", errors.New("function file.Open() Filed, err:" + openError.Error()) + } + defer f.Close() // 创建文件 defer 关闭 + //fileKey := fmt.Sprintf("%d%s", time.Now().Unix(), file.Filename) // 文件名格式 自己可以改 建议保证唯一性 + putErr := formUploader.Put(context.Background(), &ret, upToken, fileKey, f, file.Size, &putExtra) + if putErr != nil { + global.MG_LOG.Error("function formUploader.Put() Filed", zap.Any("err", putErr.Error())) + return "", "", errors.New("function formUploader.Put() Filed, err:" + putErr.Error()) + } + return global.MG_CONFIG.Qiniu.ImgPath + "/" + ret.Key, ret.Key, nil +} + +//@object: *Qiniu +//@function: DeleteFile +//@description: 删除文件 +//@param: key string +//@return: error + +func (*Qiniu) DeleteFile(key string) error { + mac := qbox.NewMac(global.MG_CONFIG.Qiniu.AccessKey, global.MG_CONFIG.Qiniu.SecretKey) + cfg := qiniuConfig() + bucketManager := storage.NewBucketManager(mac, cfg) + if err := bucketManager.Delete(global.MG_CONFIG.Qiniu.Bucket, key); err != nil { + global.MG_LOG.Error("function bucketManager.Delete() Filed", zap.Any("err", err.Error())) + return errors.New("function bucketManager.Delete() Filed, err:" + err.Error()) + } + return nil +} + +//@object: *Qiniu +//@function: qiniuConfig +//@description: 根据配置文件进行返回七牛云的配置 +//@return: *storage.Config + +func qiniuConfig() *storage.Config { + cfg := storage.Config{ + UseHTTPS: global.MG_CONFIG.Qiniu.UseHTTPS, + UseCdnDomains: global.MG_CONFIG.Qiniu.UseCdnDomains, + } + switch global.MG_CONFIG.Qiniu.Zone { // 根据配置文件进行初始化空间对应的机房 + case "ZoneHuadong": + cfg.Zone = &storage.ZoneHuadong + case "ZoneHuabei": + cfg.Zone = &storage.ZoneHuabei + case "ZoneHuanan": + cfg.Zone = &storage.ZoneHuanan + case "ZoneBeimei": + cfg.Zone = &storage.ZoneBeimei + case "ZoneXinjiapo": + cfg.Zone = &storage.ZoneXinjiapo + } + return &cfg +} diff --git a/utils/upload/tencent_cos.go b/utils/upload/tencent_cos.go new file mode 100644 index 0000000..dd4a3fb --- /dev/null +++ b/utils/upload/tencent_cos.go @@ -0,0 +1,60 @@ +package upload + +import ( + "context" + "errors" + "fmt" + "mime/multipart" + "net/http" + "net/url" + "pure-admin/global" + "time" + + "github.com/tencentyun/cos-go-sdk-v5" + "go.uber.org/zap" +) + +type TencentCOS struct{} + +// UploadFile upload file to COS +func (*TencentCOS) UploadFile(file *multipart.FileHeader) (string, string, error) { + client := NewClient() + f, openError := file.Open() + if openError != nil { + global.MG_LOG.Error("function file.Open() Filed", zap.Any("err", openError.Error())) + return "", "", errors.New("function file.Open() Filed, err:" + openError.Error()) + } + defer f.Close() // 创建文件 defer 关闭 + fileKey := fmt.Sprintf("%d%s", time.Now().Unix(), file.Filename) + + _, err := client.Object.Put(context.Background(), global.MG_CONFIG.TencentCOS.PathPrefix+"/"+fileKey, f, nil) + if err != nil { + panic(err) + } + return global.MG_CONFIG.TencentCOS.BaseURL + "/" + global.MG_CONFIG.TencentCOS.PathPrefix + "/" + fileKey, fileKey, nil +} + +// DeleteFile delete file form COS +func (*TencentCOS) DeleteFile(key string) error { + client := NewClient() + name := global.MG_CONFIG.TencentCOS.PathPrefix + "/" + key + _, err := client.Object.Delete(context.Background(), name) + if err != nil { + global.MG_LOG.Error("function bucketManager.Delete() Filed", zap.Any("err", err.Error())) + return errors.New("function bucketManager.Delete() Filed, err:" + err.Error()) + } + return nil +} + +// NewClient init COS client +func NewClient() *cos.Client { + urlStr, _ := url.Parse("https://" + global.MG_CONFIG.TencentCOS.Bucket + ".cos." + global.MG_CONFIG.TencentCOS.Region + ".myqcloud.com") + baseURL := &cos.BaseURL{BucketURL: urlStr} + client := cos.NewClient(baseURL, &http.Client{ + Transport: &cos.AuthorizationTransport{ + SecretID: global.MG_CONFIG.TencentCOS.SecretID, + SecretKey: global.MG_CONFIG.TencentCOS.SecretKey, + }, + }) + return client +} diff --git a/utils/upload/upload.go b/utils/upload/upload.go new file mode 100644 index 0000000..19ae55c --- /dev/null +++ b/utils/upload/upload.go @@ -0,0 +1,34 @@ +package upload + +import ( + "mime/multipart" + "pure-admin/global" +) + +//@interface_name: OSS +//@description: OSS接口 + +type OSS interface { + UploadFile(file *multipart.FileHeader) (string, string, error) + DeleteFile(key string) error +} + +//@function: NewOss +//@description: OSS接口 +//@description: OSS的实例化方法 +//@return: OSS + +func NewOss() OSS { + switch global.MG_CONFIG.System.OssType { + case "local": + return &Local{} + case "qiniu": + return &Qiniu{} + case "tencent-cos": + return &TencentCOS{} + case "aliyun-oss": + return &AliyunOSS{} + default: + return &Local{} + } +} diff --git a/utils/validator.go b/utils/validator.go new file mode 100644 index 0000000..26eabd9 --- /dev/null +++ b/utils/validator.go @@ -0,0 +1,368 @@ +package utils + +import ( + "bytes" + "errors" + "pure-admin/model/request" + "reflect" + "strconv" + "strings" +) + +type Rules map[string][]string + +type RulesMap map[string]Rules + +var CustomizeMap = make(map[string]Rules) + +//@function: RegisterRule +//@description: 注册自定义规则方案建议在路由初始化层即注册 +//@param: key string, rule Rules +//@return: err error + +func RegisterRule(key string, rule Rules) (err error) { + if CustomizeMap[key] != nil { + return errors.New(key + "已注册,无法重复注册") + } else { + CustomizeMap[key] = rule + return nil + } +} + +//@function: NotEmpty +//@description: 非空 不能为其对应类型的0值 +//@return: string + +func NotEmpty() string { + return "notEmpty" +} + +//@function: Lt +//@description: 小于入参(<) 如果为string array Slice则为长度比较 如果是 int uint float 则为数值比较 +//@param: mark string +//@return: string + +func Lt(mark string) string { + return "lt=" + mark +} + +//@function: Le +//@description: 小于等于入参(<=) 如果为string array Slice则为长度比较 如果是 int uint float 则为数值比较 +//@param: mark string +//@return: string + +func Le(mark string) string { + return "le=" + mark +} + +//@function: Eq +//@description: 等于入参(==) 如果为string array Slice则为长度比较 如果是 int uint float 则为数值比较 +//@param: mark string +//@return: string + +func Eq(mark string) string { + return "eq=" + mark +} + +//@function: Ne +//@description: 不等于入参(!=) 如果为string array Slice则为长度比较 如果是 int uint float 则为数值比较 +//@param: mark string +//@return: string + +func Ne(mark string) string { + return "ne=" + mark +} + +//@function: Ge +//@description: 大于等于入参(>=) 如果为string array Slice则为长度比较 如果是 int uint float 则为数值比较 +//@param: mark string +//@return: string + +func Ge(mark string) string { + return "ge=" + mark +} + +//@function: Gt +//@description: 大于入参(>) 如果为string array Slice则为长度比较 如果是 int uint float 则为数值比较 +//@param: mark string +//@return: string + +func Gt(mark string) string { + return "gt=" + mark +} + +func Ct(marks ...string) string { + var result bytes.Buffer + for _, value := range marks { + result.WriteString(value + ",") + } + return "ct=" + result.String() +} + +//@function: Verify +//@description: 校验方法 +//@param: st interface{}, roleMap Rules(入参实例,规则map) +//@return: err error + +func Verify(st interface{}, roleMap Rules) (err error) { + compareMap := map[string]bool{ + "lt": true, + "le": true, + "eq": true, + "ne": true, + "ge": true, + "gt": true, + } + + compareMap2 := map[string]bool{ + "ct": true, + } + + typ := reflect.TypeOf(st) + val := reflect.ValueOf(st) // 获取reflect.Type类型 + + kd := val.Kind() // 获取到st对应的类别 + if kd != reflect.Struct { + return errors.New("expect struct") + } + num := val.NumField() + // 遍历结构体的所有字段 + for i := 0; i < num; i++ { + tagVal := typ.Field(i) + val := val.Field(i) + if len(roleMap[tagVal.Name]) > 0 { + for _, v := range roleMap[tagVal.Name] { + switch { + case v == "notEmpty": + if isBlank(val) { + return errors.New(tagVal.Name + "值不能为空") + } + case compareMap[strings.Split(v, "=")[0]]: + if !compareVerify(val, v) { + return errors.New(tagVal.Name + "长度或值不在合法范围," + v) + } + case compareMap2[strings.Split(v, "=")[0]]: + if !compareVerify2(val, v) { + return errors.New(tagVal.Name + "取值不可用," + v) + } + } + } + } + } + return nil +} + +func Verify2(st request.StructParams, roleMap Rules) (err error) { + compareMap := map[string]bool{ + "lt": true, + "le": true, + "eq": true, + "ne": true, + "ge": true, + "gt": true, + } + compareMap2 := map[string]bool{ + "ct": true, + } + for stk, stv := range st { + val := reflect.ValueOf(stv) + if len(roleMap[stk]) > 0 { + for _, v := range roleMap[stk] { + switch { + case v == "notEmpty": + if isBlank(val) { + return errors.New(stk + "值不能为空") + } + case compareMap[strings.Split(v, "=")[0]]: + if !compareVerify(val, v) { + return errors.New(stk + "长度或值不在合法范围," + v) + } + case compareMap2[strings.Split(v, "=")[0]]: + if !compareVerify2(val, v) { + return errors.New(stk + "取值不可用," + v) + } + } + } + } + } + return nil +} + +//@function: compareVerify +//@description: 长度和数字的校验方法 根据类型自动校验 +//@param: value reflect.Value, VerifyStr string +//@return: bool + +func compareVerify(value reflect.Value, VerifyStr string) bool { + switch value.Kind() { + case reflect.String, reflect.Slice, reflect.Array: + return compare(value.Len(), VerifyStr) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return compare(value.Uint(), VerifyStr) + case reflect.Float32, reflect.Float64: + return compare(value.Float(), VerifyStr) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return compare(value.Int(), VerifyStr) + default: + return false + } +} + +func compareVerify2(value reflect.Value, VerifyStr string) bool { + if value.String() != "" { + v := value.String() + "," + if strings.Index(VerifyStr, v) > 0 { + return true + } + } + return false +} + +//@function: isBlank +//@description: 非空校验 +//@param: value reflect.Value +//@return: bool + +func isBlank(value reflect.Value) bool { + switch value.Kind() { + case reflect.String: + return value.Len() == 0 + case reflect.Bool: + return !value.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return value.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return value.Uint() == 0 + case reflect.Float32, reflect.Float64: + return value.Float() == 0 + case reflect.Interface, reflect.Ptr: + return value.IsNil() + } + return reflect.DeepEqual(value.Interface(), reflect.Zero(value.Type()).Interface()) +} + +//@function: compare +//@description: 比较函数 +//@param: value interface{}, VerifyStr string +//@return: bool + +func compare(value interface{}, VerifyStr string) bool { + VerifyStrArr := strings.Split(VerifyStr, "=") + val := reflect.ValueOf(value) + switch val.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + VInt, VErr := strconv.ParseInt(VerifyStrArr[1], 10, 64) + if VErr != nil { + return false + } + switch { + case VerifyStrArr[0] == "lt": + return val.Int() < VInt + case VerifyStrArr[0] == "le": + return val.Int() <= VInt + case VerifyStrArr[0] == "eq": + return val.Int() == VInt + case VerifyStrArr[0] == "ne": + return val.Int() != VInt + case VerifyStrArr[0] == "ge": + return val.Int() >= VInt + case VerifyStrArr[0] == "gt": + return val.Int() > VInt + default: + return false + } + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + VInt, VErr := strconv.Atoi(VerifyStrArr[1]) + if VErr != nil { + return false + } + switch { + case VerifyStrArr[0] == "lt": + return val.Uint() < uint64(VInt) + case VerifyStrArr[0] == "le": + return val.Uint() <= uint64(VInt) + case VerifyStrArr[0] == "eq": + return val.Uint() == uint64(VInt) + case VerifyStrArr[0] == "ne": + return val.Uint() != uint64(VInt) + case VerifyStrArr[0] == "ge": + return val.Uint() >= uint64(VInt) + case VerifyStrArr[0] == "gt": + return val.Uint() > uint64(VInt) + default: + return false + } + case reflect.Float32, reflect.Float64: + VFloat, VErr := strconv.ParseFloat(VerifyStrArr[1], 64) + if VErr != nil { + return false + } + switch { + case VerifyStrArr[0] == "lt": + return val.Float() < VFloat + case VerifyStrArr[0] == "le": + return val.Float() <= VFloat + case VerifyStrArr[0] == "eq": + return val.Float() == VFloat + case VerifyStrArr[0] == "ne": + return val.Float() != VFloat + case VerifyStrArr[0] == "ge": + return val.Float() >= VFloat + case VerifyStrArr[0] == "gt": + return val.Float() > VFloat + default: + return false + } + default: + return false + } +} + +func Transform(st request.StructParams, fields ...string) map[string]interface{} { + var ( + fm = make(map[string]string) + res = make(map[string]interface{}) + ) + for _, v := range fields { + fm[v] = v + } + for k, v := range st { + if field, ok := fm[snakeString(k)]; ok { + res[field] = v + } + } + return res +} + +func TransformRuin(st request.StructParams, fields ...string) map[string]interface{} { + var ( + fm = make(map[string]string) + res = make(map[string]interface{}) + ) + for _, v := range fields { + fm[v] = v + } + for k, v := range st { + if _, ok := fm[snakeString(k)]; !ok { + res[snakeString(k)] = v + } + } + return res +} + +func snakeString(s string) string { + data := make([]byte, 0, len(s)*2) + j := false + num := len(s) + for i := 0; i < num; i++ { + d := s[i] + if i > 0 && d >= 'A' && d <= 'Z' && j { + data = append(data, '_') + } + if d != '_' { + j = true + } + data = append(data, d) + } + return strings.ToLower(string(data[:])) +} diff --git a/utils/verify.go b/utils/verify.go new file mode 100644 index 0000000..6b9abe7 --- /dev/null +++ b/utils/verify.go @@ -0,0 +1,79 @@ +package utils + +var ( + IdVerify = Rules{"ID": {NotEmpty()}} + IdVerify2 = Rules{"id": {NotEmpty()}} + ApiVerify = Rules{"Path": {NotEmpty()}, "Description": {NotEmpty()}, "ApiGroup": {NotEmpty()}, "Method": {NotEmpty()}} + MenuVerify = Rules{"Path": {NotEmpty()}, "ParentId": {NotEmpty()}, "Name": {NotEmpty()}, "Component": {NotEmpty()}, "Sort": {Ge("0")}} + MenuMetaVerify = Rules{"Title": {NotEmpty()}} + LoginVerify = Rules{"CaptchaId": {NotEmpty()}, "Captcha": {NotEmpty()}, "Username": {NotEmpty()}, "Password": {NotEmpty()}} + RegisterVerify = Rules{"Username": {NotEmpty()}, "NickName": {NotEmpty()}, "Password": {NotEmpty()}, "AuthorityId": {NotEmpty()}} + PageInfoVerify = Rules{"Page": {NotEmpty()}, "PageSize": {NotEmpty()}} + CustomerVerify = Rules{"CustomerName": {NotEmpty()}, "CustomerPhoneData": {NotEmpty()}} + AutoCodeVerify = Rules{"Abbreviation": {NotEmpty()}, "StructName": {NotEmpty()}, "PackageName": {NotEmpty()}, "Fields": {NotEmpty()}} + AuthorityVerify = Rules{"AuthorityName": {NotEmpty()}} + AuthorityIdVerify = Rules{"AuthorityId": {NotEmpty()}} + OldAuthorityVerify = Rules{"OldAuthorityId": {NotEmpty()}} + ChangePasswordVerify = Rules{"Username": {NotEmpty()}, "Password": {NotEmpty()}, "NewPassword": {NotEmpty()}} + SetUserAuthorityVerify = Rules{"UUID": {NotEmpty()}, "AuthorityId": {NotEmpty()}} + BsChannelVerify = Rules{"Name": {NotEmpty()}, "JumpType": {NotEmpty()}, "Status": {NotEmpty()}} + BsBannerVerify = Rules{"ChannelId": {NotEmpty()}, "Title": {NotEmpty()}, "CoverUrl": {NotEmpty()}, "RelationType": {NotEmpty()}, "SourceType": {Ct("1", "2", "3")}} + BsNewsVerity = Rules{"Title": {NotEmpty()}, "TitleDesc": {NotEmpty()}, "DisplayMode": {NotEmpty()}, "LinkType": {NotEmpty()}, "AuthorId": {NotEmpty()}, "ShareTitle": {NotEmpty()}} + BsNews03Verity = Rules{"Title": {NotEmpty()}, "TitleDesc": {NotEmpty()}, "AuthorId": {NotEmpty()}, "ShareTitle": {NotEmpty()}, "Type": {NotEmpty()}} + AuthorVerity = Rules{"Name": {NotEmpty()}, "Avatar": {NotEmpty()}} + SearchNewsRecommendVerity = Rules{"NewsId": {NotEmpty()}} + UUIDVerity = Rules{"UUID": {NotEmpty()}} + NewsRecommendVerity = Rules{"NewsId": {NotEmpty()}, "RelationId": {NotEmpty()}} + BsTogetherVerity = Rules{"Type": {NotEmpty()}, "Title": {NotEmpty()}} + DisplayModeVerity = Rules{"DisplayMode": {NotEmpty()}} + SearchTogetherRelationVerity = Rules{"TogetherId": {NotEmpty()}} + ChannelIDVerity = Rules{"ChannelId": {NotEmpty()}} + SubjectIDVerity = Rules{"SubjectId": {NotEmpty()}} + GatherIDVerity = Rules{"GatherId": {NotEmpty()}} + LiveIDVerity = Rules{"LiveId": {NotEmpty()}} + TogetherRelationVerity = Rules{"TogetherId": {NotEmpty()}, "RelationId": {NotEmpty()}, "RelationType": {Ct("2", "3", "6")}} + BsSubjectVerity = Rules{"Type": {NotEmpty()}, "Title": {NotEmpty()}, "ListTitle": {NotEmpty()}, "ShareTitle": {NotEmpty()}, "Info": {NotEmpty()}, "CoverUrl": {NotEmpty()}, "ShareImage": {NotEmpty()}} + BsLeaderVerity = Rules{"Name": {NotEmpty()}, "Avatar": {NotEmpty()}, "Position": {NotEmpty()}, "Info": {NotEmpty()}, "ShareTitle": {NotEmpty()}} + BsSubjectGatherVerity = Rules{"SubjectId": {NotEmpty()}, "GatherTitle": {NotEmpty()}} + BsNewsGatherVerity = Rules{"GatherId": {NotEmpty()}, "RelationId": {NotEmpty()}} + LeaderIDVerity = Rules{"LeaderId": {NotEmpty()}} + BsLeaderRelationVerity = Rules{"LeaderId": {NotEmpty()}, "RelationId": {NotEmpty()}, "RelationType": {NotEmpty()}} + BsChannelPageVerity = Rules{"ChannelId": {NotEmpty()}, "RelationId": {NotEmpty()}, "RelationType": {NotEmpty()}} + UploadFileVerity = Rules{"File": {NotEmpty()}, "Type": {NotEmpty()}} + UploadFileVerity2 = Rules{"File": {NotEmpty()}} + SendPushVerity = Rules{"relationId": {NotEmpty()}, "relationType": {Ct("1", "3", "4", "6")}, "Body": {NotEmpty()}, "PushType": {NotEmpty()}} + VersionControlVerity = Rules{"Version": {NotEmpty()}, "Type": {NotEmpty()}, "Info": {NotEmpty()}, "Status": {NotEmpty()}} + BsLiveBannerVerity = Rules{"CoverUrl": {NotEmpty()}, "Status": {NotEmpty()}} + BsLiveNoticeVerity = Rules{"CoverUrl": {NotEmpty()}, "Title": {NotEmpty()}} + BsLiveBaseVerity = Rules{"Title": {NotEmpty()}, "CoverUrl": {NotEmpty()}, "VideoUrl": {NotEmpty()}, "Status": {NotEmpty()}, "Remark": {NotEmpty()}} + BsLiveVerity = Rules{"HlsUrl": {NotEmpty()}} + BsLivePlaybackVerity = Rules{"Title": {NotEmpty()}, "CoverUrl": {NotEmpty()}, "VideoUrl": {NotEmpty()}} + BsLiveImageTextVerity = Rules{"LiveId": {NotEmpty()}, "Content": {NotEmpty()}, "AuthorId": {NotEmpty()}} + SensitiveWordVerity = Rules{"Content": {NotEmpty()}} + HotWordVerity = Rules{"Title": {NotEmpty()}} + DictDataVerity = Rules{"TypeCode": {NotEmpty()}} + AppUserStatusVerity = Rules{"UUID": {NotEmpty()}, "Status": {Ct("1", "2")}} + AppUserVerity = Rules{"Nickname": {NotEmpty()}} + BsRedBoxVerity = Rules{"RelationId": {NotEmpty()}, "RelationType": {NotEmpty()}} + CategoryIDVerity = Rules{"CategoryID": {NotEmpty()}} + BsRankVerity = Rules{"CategoryID": {NotEmpty()}, "Ranks": {NotEmpty()}} + IdStatusVerity = Rules{"ID": {NotEmpty()}, "Status": {NotEmpty()}} + LevelVerity = Rules{"Level": {NotEmpty()}} + BsGovRelationVerity = Rules{"RelationId": {NotEmpty()}, "RelationType": {NotEmpty()}, "Level": {Ct("1", "2")}} + BsAdvertisementPoolVerity = Rules{"Cover": {NotEmpty()}, "Url": {NotEmpty()}, "Type": {NotEmpty()}, "Title": {NotEmpty()}, "LinkType": {NotEmpty()}} + GeneratePlaybackVerity = Rules{"ID": {NotEmpty()}, "Zone": {NotEmpty()}, "StreamName": {NotEmpty()}, "Start": {NotEmpty()}, "End": {NotEmpty()}} + TempVerity = Rules{"": {NotEmpty()}} + BsNewsDraftCheckVerity = Rules{"ID": {NotEmpty()}, "CheckStatus": {NotEmpty()}} + NaireVerity = Rules{"Data": {NotEmpty()}} + MBoardVerity = Rules{"Content": {NotEmpty()}} + VigourProgramVerity = Rules{"Name": {NotEmpty()}, "Mechanism": {NotEmpty()}, "Phone": {NotEmpty()}, "ProgramNum": {NotEmpty()}, "ProgramName": {NotEmpty()}, "ProgramType": {NotEmpty()}, "Belong": {NotEmpty()}} + VigourHostVerity = Rules{"Set": {NotEmpty()}, "Name": {NotEmpty()}, "Phone": {NotEmpty()}, "Email": {NotEmpty()}, "Belong": {NotEmpty()}, "Mechanism": {NotEmpty()}} + H5StructVerity = Rules{"Table": {NotEmpty()}} + BsCommentVerity = Rules{"RelationId": {NotEmpty()}, "RelationType": {Ct("1")}, "Content": {NotEmpty()}, "CreateBy": {NotEmpty()}} + + MissionIdVerity = Rules{"MissionId": {NotEmpty()}} + ValueVerity = Rules{"Value": {NotEmpty()}} + OrderIDVerify = Rules{"OrderID": {NotEmpty()}} + ChainVerify = Rules{"Hash": {NotEmpty()}} + BannerVerity = Rules{"Title": {NotEmpty()}, "CoverUrl": {NotEmpty()}, "LinkType": {NotEmpty()}} +) diff --git a/utils/zipfiles.go b/utils/zipfiles.go new file mode 100644 index 0000000..921c9b4 --- /dev/null +++ b/utils/zipfiles.go @@ -0,0 +1,71 @@ +package utils + +import ( + "archive/zip" + "io" + "os" + "strings" +) + +//@function: ZipFiles +//@description: 压缩文件 +//@param: filename string, files []string, oldForm, newForm string +//@return: error + +func ZipFiles(filename string, files []string, oldForm, newForm string) error { + + newZipFile, err := os.Create(filename) + if err != nil { + return err + } + defer func() { + _ = newZipFile.Close() + }() + + zipWriter := zip.NewWriter(newZipFile) + defer func() { + _ = zipWriter.Close() + }() + + // 把files添加到zip中 + for _, file := range files { + + err = func(file string) error { + zipFile, err := os.Open(file) + if err != nil { + return err + } + defer zipFile.Close() + // 获取file的基础信息 + info, err := zipFile.Stat() + if err != nil { + return err + } + + header, err := zip.FileInfoHeader(info) + if err != nil { + return err + } + + // 使用上面的FileInforHeader() 就可以把文件保存的路径替换成我们自己想要的了,如下面 + header.Name = strings.Replace(file, oldForm, newForm, -1) + + // 优化压缩 + // 更多参考see http://golang.org/pkg/archive/zip/#pkg-constants + header.Method = zip.Deflate + + writer, err := zipWriter.CreateHeader(header) + if err != nil { + return err + } + if _, err = io.Copy(writer, zipFile); err != nil { + return err + } + return nil + }(file) + if err != nil { + return err + } + } + return nil +}